Gets the `left` position of an element.
(element: DebugElement)
| 524 | |
| 525 | /** Gets the `left` position of an element. */ |
| 526 | function getComputedLeft(element: DebugElement): number { |
| 527 | // While the other properties in this test use `getComputedStyle`, we use `getBoundingClientRect` |
| 528 | // for left because iOS Safari doesn't support using `getComputedStyle` to get the calculated |
| 529 | // `left` value when using CSS `calc`. We subtract the `left` of the document body because |
| 530 | // browsers, by default, add a margin to the body (typically 8px). |
| 531 | const elementRect = element.nativeElement.getBoundingClientRect(); |
| 532 | const bodyRect = document.body.getBoundingClientRect(); |
| 533 | |
| 534 | return elementRect.left - bodyRect.left; |
| 535 | } |
| 536 | |
| 537 | @Component({ |
| 538 | template: '<mat-grid-list></mat-grid-list>', |
no test coverage detected
searching dependent graphs…