mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Implement nonce
attribute to pass more CSP checks (#35876)
* Add doc comments to RequestBuilder fields/methods Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement Request::cryptographic_nonce_metadata Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement HTMLOrSVGElement::nonce Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set request cryptographic nonce metadata for link elements Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set request's cryptographic nonce when fetching scripts Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Forward request nonce to rust-content-security-policy Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
ce4ba30992
commit
1b6b21cb85
18 changed files with 111 additions and 289 deletions
|
@ -5,6 +5,7 @@
|
|||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix, local_name, namespace_url, ns};
|
||||
use js::rust::HandleObject;
|
||||
use script_bindings::str::DOMString;
|
||||
use style_dom::ElementState;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::SVGElementBinding::SVGElementMethods;
|
||||
|
@ -81,6 +82,14 @@ impl SVGElementMethods<crate::DomTypeHolder> for SVGElement {
|
|||
})
|
||||
}
|
||||
|
||||
// FIXME: The nonce should be stored in an internal slot instead of an
|
||||
// attribute (https://html.spec.whatwg.org/multipage/#cryptographicnonce)
|
||||
// https://html.spec.whatwg.org/multipage/#dom-noncedelement-nonce
|
||||
make_getter!(Nonce, "nonce");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-noncedelement-nonce
|
||||
make_setter!(SetNonce, "nonce");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-fe-autofocus
|
||||
fn Autofocus(&self) -> bool {
|
||||
self.element.has_attribute(&local_name!("autofocus"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue