Check AX cache if labelled before fetching labels

HTML labelable elements can cause extreme slowness while loading in some
cases. We should only call html_element->labels() if the current element
is known to have labels (we can check our relationship cache).

Bug: 976849
Change-Id: Ia5e0e312b3a5e1d2d2d4cfdc5249f6a58b38147c
Commit-Queue: Aaron Leventhal <>
Reviewed-by: Nektarios Paisios <>
Cr-Commit-Position: refs/heads/master@{#672099}
6 files changed