mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Allow :link and :any-link to match SVG <a> elements
This commit is contained in:
parent
92d9907f8f
commit
eeba30f988
Notes:
github-actions[bot]
2024-11-06 20:43:50 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/eeba30f988a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2204
2 changed files with 4 additions and 4 deletions
|
@ -6,8 +6,7 @@ Rerun
|
||||||
|
|
||||||
Found 2 tests
|
Found 2 tests
|
||||||
|
|
||||||
1 Pass
|
2 Pass
|
||||||
1 Fail
|
|
||||||
Details
|
Details
|
||||||
Result Test Name MessagePass :any-link & :link pseudo-class invalidation with an HTML link
|
Result Test Name MessagePass :any-link & :link pseudo-class invalidation with an HTML link
|
||||||
Fail :any-link & :link pseudo-class invalidation with an SVG link
|
Pass :any-link & :link pseudo-class invalidation with an SVG link
|
|
@ -31,6 +31,7 @@
|
||||||
#include <LibWeb/HTML/HTMLTextAreaElement.h>
|
#include <LibWeb/HTML/HTMLTextAreaElement.h>
|
||||||
#include <LibWeb/Infra/Strings.h>
|
#include <LibWeb/Infra/Strings.h>
|
||||||
#include <LibWeb/Namespace.h>
|
#include <LibWeb/Namespace.h>
|
||||||
|
#include <LibWeb/SVG/SVGAElement.h>
|
||||||
|
|
||||||
namespace Web::SelectorEngine {
|
namespace Web::SelectorEngine {
|
||||||
|
|
||||||
|
@ -151,7 +152,7 @@ static inline bool matches_has_pseudo_class(CSS::Selector const& selector, Optio
|
||||||
static inline bool matches_link_pseudo_class(DOM::Element const& element)
|
static inline bool matches_link_pseudo_class(DOM::Element const& element)
|
||||||
{
|
{
|
||||||
// All a elements that have an href attribute, and all area elements that have an href attribute, must match one of :link and :visited.
|
// All a elements that have an href attribute, and all area elements that have an href attribute, must match one of :link and :visited.
|
||||||
if (!is<HTML::HTMLAnchorElement>(element) && !is<HTML::HTMLAreaElement>(element))
|
if (!is<HTML::HTMLAnchorElement>(element) && !is<HTML::HTMLAreaElement>(element) && !is<SVG::SVGAElement>(element))
|
||||||
return false;
|
return false;
|
||||||
return element.has_attribute(HTML::AttributeNames::href);
|
return element.has_attribute(HTML::AttributeNames::href);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue