containingUrl property

  1. @protected
  2. @nonVirtual
Uri? get containingUrl

The canonical URL of the stylesheet that caused the current canonicalize invocation.

This is only set when the containing stylesheet has a canonical URL, and when the URL being canonicalized is either relative or has a scheme for which isNonCanonicalScheme returns true. This restriction ensures that canonical URLs are always interpreted the same way regardless of their context.

Subclasses should only access this from within calls to canonicalize. Outside of that context, its value is undefined and subject to change.

Implementation

@protected
@nonVirtual
Uri? get containingUrl => utils.canonicalizeContext.containingUrl;