* This function allows us to workaround a breaking change introduced by #71095 * src attributes/bindings used to be sanitized which was responsible for: * - converting undefined/null to '' * - supporting bypassed values (via bypassSecurityTrustResourceUrl) * * This workaround is intended to be
( propName: string, element: RElement, value: unknown, isAttribute = false, )
| 337 | * This workaround is intended to be dropped in v23 when the breaking change window opens. |
| 338 | */ |
| 339 | function unwrapImgVideoSrcValue( |
| 340 | propName: string, |
| 341 | element: RElement, |
| 342 | value: unknown, |
| 343 | isAttribute = false, |
| 344 | ): any { |
| 345 | if ( |
| 346 | propName === 'src' && |
| 347 | ((element as RElement).tagName === 'IMG' || (element as RElement).tagName === 'VIDEO') |
| 348 | ) { |
| 349 | if (value == null) { |
| 350 | return isAttribute ? value : ''; |
| 351 | } |
| 352 | |
| 353 | return unwrapSafeValue(value); |
| 354 | } |
| 355 | return value; |
| 356 | } |
| 357 | |
| 358 | /** If node is an OnPush component, marks its LView dirty. */ |
| 359 | export function markDirtyIfOnPush(lView: LView, viewIndex: number): void { |
no test coverage detected