@@ -14911,7 +14911,7 @@ describe("$compile", () => {
1491114911 expect($$sanitizeUri).toHaveBeenCalledWith($rootScope.testUrl, false);
1491214912 });
1491314913
14914- it("should use $$sanitizeUri when working with svg and xlink- href", async () => {
14914+ it("should use $$sanitizeUri when working with svg href bindings ", async () => {
1491514915 const $$sanitizeUri = jasmine
1491614916 .createSpy("$$sanitizeUri")
1491714917 .and.returnValue("https://clean.example.org");
@@ -14924,10 +14924,10 @@ describe("$compile", () => {
1492414924 $rootScope.testUrl = "https://bad.example.org";
1492514925
1492614926 const elementA = $compile(
14927- "<svg><a xlink- href=\"{{ testUrl + 'aTag' }}\"></a></svg>",
14927+ "<svg><a href=\"{{ testUrl + 'aTag' }}\"></a></svg>",
1492814928 )($rootScope);
1492914929 await wait();
14930- expect(elementA.querySelector("a").getAttribute("xlink- href")).toBe(
14930+ expect(elementA.querySelector("a").getAttribute("href")).toBe(
1493114931 "https://clean.example.org",
1493214932 );
1493314933 expect($$sanitizeUri).toHaveBeenCalledWith(
@@ -14936,12 +14936,12 @@ describe("$compile", () => {
1493614936 );
1493714937
1493814938 const elementImage = $compile(
14939- "<svg><image xlink- href=\"{{ testUrl + 'imageTag' }}\"></image></svg>",
14939+ "<svg><image href=\"{{ testUrl + 'imageTag' }}\"></image></svg>",
1494014940 )($rootScope);
1494114941 await wait();
14942- expect(
14943- elementImage.querySelector("image").getAttribute("xlink-href") ,
14944- ).toBe("https://clean.example.org") ;
14942+ expect(elementImage.querySelector("image").getAttribute("href")).toBe(
14943+ "https://clean.example.org" ,
14944+ );
1494514945 expect($$sanitizeUri).toHaveBeenCalledWith(
1494614946 `${$rootScope.testUrl}imageTag`,
1494714947 true,
@@ -14992,7 +14992,7 @@ describe("$compile", () => {
1499214992 $$sanitizeUri.calls.reset();
1499314993
1499414994 const ngHref = $compile(
14995- '<svg><image ng-href="{{ testUrl }}" xlink:href="" ></image></svg>',
14995+ '<svg><image ng-href="{{ testUrl }}"></image></svg>',
1499614996 )($rootScope);
1499714997 await wait();
1499814998 expect(ngHref.querySelector("image").getAttribute("href")).toBe(
@@ -15032,7 +15032,7 @@ describe("$compile", () => {
1503215032 );
1503315033
1503415034 const ngHrefInterpolated = $compile(
15035- '<svg><image ng-href="{{ testUrl }}" xlink:href="" ></image></svg>',
15035+ '<svg><image ng-href="{{ testUrl }}"></image></svg>',
1503615036 )($rootScope);
1503715037 $rootScope.testUrl = disallowedDataUrl;
1503815038 await wait();
@@ -15049,7 +15049,7 @@ describe("$compile", () => {
1504915049 );
1505015050 });
1505115051
15052- it("should require a RESOURCE_URL context for href by if not on an anchor or image ", async () => {
15052+ it("should not specially handle legacy xlink- href on unsupported svg elements ", async () => {
1505315053 let error = [];
1505415054 module.decorator("$exceptionHandler", () => {
1505515055 return (exception, cause) => {
@@ -15062,7 +15062,7 @@ describe("$compile", () => {
1506215062 )($rootScope);
1506315063 $rootScope.testUrl = "https://bad.example.org";
1506415064 await wait();
15065- expect(error[0]).toMatch(/insecurl/ );
15065+ expect(error.length).toBe(0 );
1506615066 });
1506715067 });
1506815068
0 commit comments