Populate the distilled content slightly earlier
Before this CL, the distilled content is injected on DidFinishLoad(), or when the distillation finishes if it's later than DidFinishLoad(). When the DidFinishLoad() event propagates to TalkBack, the distilled content is usually not there yet, so TalkBack would announce the content of the place-holding page. This CL populates the distilled content in DocumentLoadedInFrame() instead of DidFinishLoad(). DocumentLoadedInFrame() is late enough to execute JavaScript, and is early enough so that it's more likely that the title and content can be picked up by TalkBack instead of the placeholder. If distillation is finished by DocumentLoadedInFrame(), onload() event would also be delayed, so that the accessibility focus is more likely to be on the web content. Otherwise, the focus is usually on the close button of the CustomTab (CCT), or nowhere. Note that this CL doesn't guarantee the distilled title is announced by TalkBack. If distillation finishes later than DocumentLoadedInFrame(), or if for some reason the accessibility focus is on the close button of the CCT, the title would go unannounced like before. Bug: 811417, 803474 Change-Id: Iaf2ff988b427ca9af582622597b505e7a8aca8e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1791048Reviewed-by:Dominic Mazzoni <dmazzoni@chromium.org> Reviewed-by:
Matthew Jones <mdjones@chromium.org> Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org> Cr-Commit-Position: refs/heads/master@{#697074}
Showing
Please register or sign in to comment