Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ivy): DebugElement.query when there is a node outside Angular context #32361

Closed
wants to merge 1 commit into from

Conversation

@atscott
Copy link
Contributor

commented Aug 28, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Ivy throws an error when using DebugElement.query on node where a child was added with document.appendChild

Issue Number: N/A

What is the new behavior?

No error is thrown

Does this PR introduce a breaking change?

  • Yes
  • No

@atscott atscott requested a review from angular/fw-core as a code owner Aug 28, 2019

@googlebot googlebot added the cla: yes label Aug 28, 2019

@atscott atscott force-pushed the atscott:debugnode branch from c2fabfb to 2eae5e7 Aug 28, 2019

@ngbot ngbot bot modified the milestone: needsTriage Aug 28, 2019

@atscott

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

packages/core/test/debug/debug_node_spec.ts Outdated Show resolved Hide resolved
packages/core/src/debug/debug_node.ts Show resolved Hide resolved
packages/core/test/debug/debug_node_spec.ts Outdated Show resolved Hide resolved

@atscott atscott force-pushed the atscott:debugnode branch 2 times, most recently from ddcd5fe to 9aa78cb Aug 28, 2019

@atscott atscott requested a review from matsko Aug 28, 2019

@matsko
matsko approved these changes Aug 28, 2019
Copy link
Member

left a comment

Excellent :)

@kara
Copy link
Contributor

left a comment

Some minor nits

packages/core/src/debug/debug_node.ts Outdated Show resolved Hide resolved
packages/core/test/debug/debug_node_spec.ts Outdated Show resolved Hide resolved

@atscott atscott requested a review from kara Aug 29, 2019

@kara
kara approved these changes Aug 29, 2019
Copy link
Contributor

left a comment

LGTM

@atscott

This comment has been minimized.

Copy link
Contributor Author

commented Aug 29, 2019

@ngbot

This comment has been minimized.

Copy link

commented Aug 29, 2019

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "ci/circleci: setup" is failing
    failure status "google3" is failing
    pending missing required status "ci/circleci: build"
    pending missing required status "ci/circleci: lint"
    pending missing required status "ci/circleci: publish_snapshot"
    pending missing required status "ci/angular: size"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@atscott atscott force-pushed the atscott:debugnode branch from 40f824b to edfa21a Aug 30, 2019

fix(ivy): Prevent errors when querying for elements outside Angular c…
…ontext

DebugElement.query also searches elements that may have been created
outside of Angular (ex: with `document.appendChild`). The current
behavior attempts to get the LContext of these nodes but throws an error
because the LContext does not exist.

@atscott atscott force-pushed the atscott:debugnode branch from edfa21a to 67e0d89 Aug 30, 2019

@mhevery mhevery closed this in 260217a Aug 30, 2019

sabeersulaiman added a commit to sabeersulaiman/angular that referenced this pull request Sep 6, 2019
fix(ivy): Prevent errors when querying for elements outside Angular c…
…ontext (angular#32361)

DebugElement.query also searches elements that may have been created
outside of Angular (ex: with `document.appendChild`). The current
behavior attempts to get the LContext of these nodes but throws an error
because the LContext does not exist.

PR Close angular#32361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.