script: servoparser line number pass to CSP (#40597)

takes over the initial work from @zazabap in PR #38675 (Thanks
@zazabap!)

Testing: 
`./mach test-wpt
content-security-policy/securitypolicyviolation/blockeduri-inline.html`
`./mach test-wpt
/css/CSS2/abspos/abspos-containing-block-initial-001.xht`
Fixes #38167  
Closes #38675

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
Co-authored-by: zazabap <sweynan@icloud.com>
This commit is contained in:
WaterWhisperer
2025-11-13 17:48:17 +08:00
committed by GitHub
parent b235a35a7c
commit d57d422924
10 changed files with 42 additions and 1 deletions

View File

@@ -2500,6 +2500,12 @@ impl Document {
self.current_parser.get()
}
pub(crate) fn get_current_parser_line(&self) -> u32 {
self.get_current_parser()
.map(|parser| parser.get_current_line())
.unwrap_or(0)
}
/// A reference to the [`IFrameCollection`] of this [`Document`], holding information about
/// `<iframe>`s found within it.
pub(crate) fn iframes(&self) -> Ref<'_, IFrameCollection> {