mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #26450 - PeterZhizhin:add_referrerpolicy_to_list_of_relevant_mutations, r=jdm
Add referrerpolicy to list of relevant mutations <!-- Please describe your changes on the following line: --> `img.referrerPolicy` change now mutates the image. Not all `referrerPolicy` attribute changes result in an image update event. Only valid changes are reflected. All referrerpolicy tests inside `relevant-mutations.html` WPT test now pass. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26388 <!-- Either: --> - [x] These have tests: ``` ./mach test-wpt tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html ```
This commit is contained in:
commit
6aec2c8594
6 changed files with 58 additions and 54 deletions
|
@ -126,6 +126,22 @@ pub enum ReferrerPolicy {
|
|||
StrictOriginWhenCrossOrigin,
|
||||
}
|
||||
|
||||
impl ToString for ReferrerPolicy {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
ReferrerPolicy::NoReferrer => "no-referrer",
|
||||
ReferrerPolicy::NoReferrerWhenDowngrade => "no-referrer-when-downgrade",
|
||||
ReferrerPolicy::Origin => "origin",
|
||||
ReferrerPolicy::SameOrigin => "same-origin",
|
||||
ReferrerPolicy::OriginWhenCrossOrigin => "origin-when-cross-origin",
|
||||
ReferrerPolicy::UnsafeUrl => "unsafe-url",
|
||||
ReferrerPolicy::StrictOrigin => "strict-origin",
|
||||
ReferrerPolicy::StrictOriginWhenCrossOrigin => "strict-origin-when-cross-origin",
|
||||
}
|
||||
.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ReferrerPolicyHeader> for ReferrerPolicy {
|
||||
fn from(policy: ReferrerPolicyHeader) -> Self {
|
||||
match policy {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue