Skip to content

Commit

Permalink
[url_launcher] Fix Link test breakage from shadow DOM changes
Browse files Browse the repository at this point in the history
Replace the per-platform-view shadow dom query with a top-level shadow dom query.

Fixes breakage from flutter/engine#25747
  • Loading branch information
stuartmorgan authored and fotiDim committed Sep 13, 2021
1 parent 55b3ef0 commit f759644
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,13 @@ html.Element _findSingleAnchor() {
}
}

// Search inside platform views with shadow roots as well.
for (final html.Element platformView
in html.document.querySelectorAll('flt-platform-view')) {
final html.ShadowRoot shadowRoot = platformView.shadowRoot!;
if (shadowRoot != null) {
for (final html.Element anchor in shadowRoot.querySelectorAll('a')) {
if (hasProperty(anchor, linkViewIdProperty)) {
foundAnchors.add(anchor);
}
// Search inside the shadow DOM as well.
final html.ShadowRoot? shadowRoot =
html.document.querySelector('flt-glass-pane')?.shadowRoot;
if (shadowRoot != null) {
for (final html.Element anchor in shadowRoot.querySelectorAll('a')) {
if (hasProperty(anchor, linkViewIdProperty)) {
foundAnchors.add(anchor);
}
}
}
Expand Down

0 comments on commit f759644

Please sign in to comment.