Repository navigation
layout: Pass poster_url for LargestContentfulPaint Entry - #43376
Conversation
| self.downcast::<HTMLVideoElement>() | ||
| .expect("not a video!") | ||
| .poster_url() | ||
| } |
There was a problem hiding this comment.
Instead of this method, we can add the poster URL to HTMLMediaData.
There was a problem hiding this comment.
Aye Aye! Added to HTMLMediaData
| Some(( | ||
| VideoInfo { | ||
| image_key: data.current_frame.map(|frame| frame.image_key), | ||
| poster_url: self.poster_url(), |
There was a problem hiding this comment.
This can be data.poster_url instead.
| }, | ||
| }; | ||
|
|
||
| *self.poster_url.borrow_mut() = Some(poster_url.url()); |
There was a problem hiding this comment.
We need to clear this value at the start of this method in case we take an early return. Clearing the poster URL attribute should also clear this cached value.
There was a problem hiding this comment.
I modified few more things to follow spec keywords. Please let me know what do you think of it.
Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
| { | ||
| Ok(url) => url, | ||
| Err(_) => { | ||
| let poster_url = { |
There was a problem hiding this comment.
Good progress! My final suggestion here looks like this:
*self.poster_url.safe_borrow_mut(cx.no_gc()) = None;
let Some(url) = ... else { .. };
let Ok(poster_url) = match self.owner_document().encoding_parse...() else {
self.htmlmediaelement.set_poster_frame(..);
return;
};
*self.poster_url.safe_borrow_mut(cx.no_gc()) = Some(poster_url.clone());There was a problem hiding this comment.
Integrated your suggestion, Please take a look
Signed-off-by: Shubham Gupta <shubhamg13.work@gmail.com>
jdm
left a comment
There was a problem hiding this comment.
Looks good! Thanks for taking the time to clean it up!
|
Whaaaaat! I think it TIMEDOUT. Re-try Please |
…3376) Fetches the `poster_url` from `HTMLVideoElement` and pass it for `LargestContentfulPaint` Testing: More WPT Passed Fixes: Part of servo#42000 --------- Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org> Signed-off-by: Shubham Gupta <shubhamg13.work@gmail.com>
Fetches the
poster_urlfromHTMLVideoElementand pass it forLargestContentfulPaintTesting: More WPT Passed
Fixes: Part of #42000