mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibWeb: Do includes_properties_from_invalidation_set() for :link & co
Fixes #3511.
This commit is contained in:
parent
c4bc0842c1
commit
5f10f8c54c
Notes:
github-actions[bot]
2025-02-09 14:21:51 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/5f10f8c54ce Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3516
2 changed files with 25 additions and 0 deletions
|
@ -41,6 +41,8 @@
|
|||
#include <LibWeb/HTML/CustomElements/CustomElementReactionNames.h>
|
||||
#include <LibWeb/HTML/CustomElements/CustomElementRegistry.h>
|
||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||
#include <LibWeb/HTML/HTMLAnchorElement.h>
|
||||
#include <LibWeb/HTML/HTMLAreaElement.h>
|
||||
#include <LibWeb/HTML/HTMLBodyElement.h>
|
||||
#include <LibWeb/HTML/HTMLButtonElement.h>
|
||||
#include <LibWeb/HTML/HTMLFieldSetElement.h>
|
||||
|
@ -72,6 +74,7 @@
|
|||
#include <LibWeb/Page/Page.h>
|
||||
#include <LibWeb/Painting/PaintableBox.h>
|
||||
#include <LibWeb/Painting/ViewportPaintable.h>
|
||||
#include <LibWeb/SVG/SVGAElement.h>
|
||||
#include <LibWeb/Selection/Selection.h>
|
||||
#include <LibWeb/WebIDL/AbstractOperations.h>
|
||||
#include <LibWeb/WebIDL/DOMException.h>
|
||||
|
@ -1198,6 +1201,15 @@ bool Element::includes_properties_from_invalidation_set(CSS::InvalidationSet con
|
|||
// - FIXME: textarea elements that have a placeholder attribute whose value is currently being presented to the user.
|
||||
return false;
|
||||
}
|
||||
case CSS::PseudoClass::AnyLink:
|
||||
case CSS::PseudoClass::Link:
|
||||
case CSS::PseudoClass::LocalLink: {
|
||||
if (!is<HTML::HTMLAnchorElement>(*this) && !is<HTML::HTMLAreaElement>(*this) && !is<SVG::SVGAElement>(*this))
|
||||
return false;
|
||||
if (!has_attribute(HTML::AttributeNames::href))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
13
Tests/LibWeb/Crash/CSS/link-pseudo-class-invalidation.html
Normal file
13
Tests/LibWeb/Crash/CSS/link-pseudo-class-invalidation.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<style>
|
||||
ul#mylist a:link { }
|
||||
ul#mylist a:any-link { }
|
||||
ul#mylist a:local-link { }
|
||||
</style>
|
||||
<script>
|
||||
let o = document.createElement("div");
|
||||
o.offsetWidth;
|
||||
</script>
|
||||
<body>
|
||||
<ul id="mylist"></ul>
|
||||
</body>
|
Loading…
Add table
Reference in a new issue