| 1 | | In the Optimization Detective plugin from the WordPress Performance team there is a need to compute a precise locator for each tag in a document beyond just what `get_breadcrumbs()` provides. In particular, there is a need to disambiguate between two tags which may be siblings of each other in which case `array( 'html', 'body', 'img' )` will be ambiguous. Currently we're using XPaths for this purpose, for example if there are three `IMG` tags appearing as siblings at the beginning of the `BODY`, their XPaths are computed as: |
| | 1 | In the Optimization Detective plugin from the WordPress Core Performance Team there is a need to compute a precise locator for each tag in a document beyond just what `get_breadcrumbs()` provides. In particular, there is a need to disambiguate between two tags which may be siblings of each other in which case `array( 'html', 'body', 'img' )` will be ambiguous. Currently we're using XPaths for this purpose, for example if there are three `IMG` tags appearing as siblings at the beginning of the `BODY`, their XPaths are computed as: |