(node: DOMElement, yogaNode: LayoutNode)
| 1307 | // rounding can give h=0 while still advancing the next sibling's top |
| 1308 | // (HelpV2's third shortcuts column), so h=0 alone isn't sufficient. |
| 1309 | function siblingSharesY(node: DOMElement, yogaNode: LayoutNode): boolean { |
| 1310 | const parent = node.parentNode |
| 1311 | if (!parent) return false |
| 1312 | const myTop = yogaNode.getComputedTop() |
| 1313 | const siblings = parent.childNodes |
| 1314 | const idx = siblings.indexOf(node) |
| 1315 | for (let i = idx + 1; i < siblings.length; i++) { |
| 1316 | const sib = (siblings[i] as DOMElement).yogaNode |
| 1317 | if (!sib) continue |
| 1318 | return sib.getComputedTop() === myTop |
| 1319 | } |
| 1320 | // No next sibling with a yoga node — check previous. A run of h=0 boxes |
| 1321 | // at the tail would all share y with each other. |
| 1322 | for (let i = idx - 1; i >= 0; i--) { |
| 1323 | const sib = (siblings[i] as DOMElement).yogaNode |
| 1324 | if (!sib) continue |
| 1325 | return sib.getComputedTop() === myTop |
| 1326 | } |
| 1327 | return false |
| 1328 | } |
| 1329 | |
| 1330 | // When a node blits, its absolute-positioned descendants that paint outside |
| 1331 | // the node's layout bounds are NOT covered by the blit (which only copies |
no test coverage detected