[−][src]Struct lol_html::errors::ParsingAmbiguityError
An error that occurs when HTML parser runs into an ambigious state in the strict
mode.
Since the rewriter operates on a token stream and doesn't have access to a full DOM-tree, there are certain rare cases of non-conforming HTML markup which can't be guaranteed to be parsed correctly without an ability to backtrace the tree.
Therefore, due to security considerations, sometimes it's preferable to abort the rewriting process in case of such uncertainty.
One of the simplest examples of such markup is the following:
...
<select><xmp><script>"use strict";</script></select>
...
The <xmp>
element is not allowed inside the <select>
element, so in a browser the start
tag for <xmp>
will be ignored and following <script>
element will be parsed and executed.
On the other hand, the <select>
element itself can be also ignored depending on the
context in which it was parsed. In this case, the <xmp>
element will not be ignored
and the <script>
element along with its content will be parsed as a simple text inside
it.
So, in this case the parser needs an ability to backtrace the DOM-tree to figure out the correct parsing context.
Trait Implementations
impl Debug for ParsingAmbiguityError
[src]
impl Display for ParsingAmbiguityError
[src]
impl Error for ParsingAmbiguityError
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl PartialEq<ParsingAmbiguityError> for ParsingAmbiguityError
[src]
fn eq(&self, other: &ParsingAmbiguityError) -> bool
[src]
fn ne(&self, other: &ParsingAmbiguityError) -> bool
[src]
impl StructuralPartialEq for ParsingAmbiguityError
[src]
Auto Trait Implementations
impl RefUnwindSafe for ParsingAmbiguityError
impl Send for ParsingAmbiguityError
impl Sync for ParsingAmbiguityError
impl Unpin for ParsingAmbiguityError
impl UnwindSafe for ParsingAmbiguityError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,