Enhance PDF handling by introducing DISPOSITION_FORCE_INLINE and updating content disposition logic

This commit is contained in:
ownedbywuigi 2026-03-31 11:46:59 +01:00
commit 257ddfa48d
6 changed files with 63 additions and 7 deletions

View file

@ -293,10 +293,14 @@ interface nsIChannel : nsIRequest
* if available and if applicable. This allows determining inline versus
* attachment.
*
* Setting contentDisposition provides a hint to the channel about the
* disposition. If a normal Content-Disposition header is present its
* value will always be used. If it is missing the hinted value will
* be used if set.
* Setting contentDisposition provides a hint to the channel about the
* disposition. If the hint is DISPOSITION_ATTACHMENT and a normal
* Content-Disposition header is present, the hinted value will always be
* used. If the hint is DISPOSITION_FORCE_INLINE then the disposition is
* inline and the header is not used. The value from Content-Disposition
* header is only used when the hinted value is not DISPOSITION_INLINE or
* DISPOSITION_FORCE_INLINE.
* If the header is missing the hinted value will be used if set.
*
* Implementations should throw NS_ERROR_NOT_AVAILABLE if the header either
* doesn't exist for this type of channel or is empty, and return
@ -305,6 +309,7 @@ interface nsIChannel : nsIRequest
attribute unsigned long contentDisposition;
const unsigned long DISPOSITION_INLINE = 0;
const unsigned long DISPOSITION_ATTACHMENT = 1;
const unsigned long DISPOSITION_FORCE_INLINE = 2;
/**
* Access to the filename portion of the Content-Disposition header if