Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: capricorn86/happy-dom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2a8030f7a990cf258d703bdcc895c36213f375ba
Choose a base ref
...
head repository: capricorn86/happy-dom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9095b2ddc7b013eedb83c670d29fc97b27ae0ddf
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Apr 12, 2024

  1. fix: [#1349] Return forms as html collection

    jean-leonco committed Apr 12, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    44ee19d View commit details

Commits on May 6, 2024

  1. Merge branch 'master' into return-forms-as-html-collection

    capricorn86 authored May 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb3d861 View commit details
  2. Merge pull request #1404 from jean-leonco/return-forms-as-html-collec…

    …tion
    
    fix: [#1349] Return forms as html collection
    capricorn86 authored May 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9095b2d View commit details
Showing with 3 additions and 2 deletions.
  1. +2 −2 packages/happy-dom/src/nodes/document/Document.ts
  2. +1 −0 packages/happy-dom/test/nodes/document/Document.test.ts
4 changes: 2 additions & 2 deletions packages/happy-dom/src/nodes/document/Document.ts
Original file line number Diff line number Diff line change
@@ -318,8 +318,8 @@ export default class Document extends Node {
/**
* Returns a collection of all form elements in a document.
*/
public get forms(): NodeList<HTMLFormElement> {
return this.querySelectorAll('form');
public get forms(): HTMLCollection<HTMLFormElement> {
return this.getElementsByTagName('form');
}

/**
1 change: 1 addition & 0 deletions packages/happy-dom/test/nodes/document/Document.test.ts
Original file line number Diff line number Diff line change
@@ -124,6 +124,7 @@ describe('Document', () => {

const forms = document.forms;

expect(forms).toBeInstanceOf(HTMLCollection);
expect(forms.length).toBe(2);
expect(forms[0]).toBe(form1);
expect(forms[1]).toBe(form2);