Skip to content

Commit

Permalink
LibWeb/HTML: Consider <a> all-named elements instead of <link>
Browse files Browse the repository at this point in the history
Leaving only the unimplemented legacy [[Call]] override funkiness
of HTMLAllCollection left not passing in the WPT tests.
  • Loading branch information
shannonbooth authored and gmta committed Dec 23, 2024
1 parent c704316 commit 910ff8b
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/LibWeb/HTML/HTMLAllCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <LibWeb/DOM/ParentNode.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/HTMLAllCollection.h>
#include <LibWeb/HTML/HTMLAnchorElement.h>
#include <LibWeb/HTML/HTMLButtonElement.h>
#include <LibWeb/HTML/HTMLEmbedElement.h>
#include <LibWeb/HTML/HTMLFormElement.h>
Expand All @@ -20,7 +21,6 @@
#include <LibWeb/HTML/HTMLIFrameElement.h>
#include <LibWeb/HTML/HTMLImageElement.h>
#include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/HTML/HTMLLinkElement.h>
#include <LibWeb/HTML/HTMLMapElement.h>
#include <LibWeb/HTML/HTMLMetaElement.h>
#include <LibWeb/HTML/HTMLObjectElement.h>
Expand Down Expand Up @@ -68,7 +68,7 @@ void HTMLAllCollection::visit_edges(Cell::Visitor& visitor)
static bool is_all_named_element(DOM::Element const& element)
{
// The following elements are "all"-named elements: a, button, embed, form, frame, frameset, iframe, img, input, map, meta, object, select, and textarea
return is<HTML::HTMLLinkElement>(element)
return is<HTML::HTMLAnchorElement>(element)
|| is<HTML::HTMLButtonElement>(element)
|| is<HTML::HTMLEmbedElement>(element)
|| is<HTML::HTMLFormElement>(element)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Harness status: OK

Found 41 tests

30 Pass
11 Fail
Pass document.all is an HTMLAllCollection
Pass length attribute
Pass indexed property getter
Pass indexed property getter out of range
Pass named property getter
Pass named property getter with dot syntax
Pass named property getter with invalid name
Pass named property getter returning collection
Pass named property getter with "array index property name"
Pass named property getter with invalid "array index property name"
Pass named property getter with undefined
Pass named property getter with null
Pass namedItem method
Pass namedItem method with invalid name
Pass namedItem method returning collection
Pass namedItem method with "array index property name"
Pass namedItem method with invalid "array index property name"
Pass namedItem method with undefined
Pass namedItem method with null
Pass namedItem method with no argument
Fail legacy caller
Fail legacy caller with invalid name
Fail legacy caller returning collection
Fail legacy caller with "array index property name"
Fail legacy caller with "array index property name" as number
Fail legacy caller with invalid "array index property name"
Fail legacy caller with undefined
Fail legacy caller with null
Fail legacy caller with no argument
Pass legacy caller is not a constructor
Fail legacy caller with arbitrary this value
Pass item method
Pass item method with invalid name
Pass item method returning collection
Pass item method with "array index property name"
Pass item method with "array index property name" as number
Pass item method with invalid "array index property name"
Pass item method with undefined
Pass item method with null
Pass item method with no argument
Fail collections are new live HTMLCollection instances
Loading

0 comments on commit 910ff8b

Please sign in to comment.