/*
         * (non-Javadoc)
         *
         * @see org.w3c.css.sac.DocumentHandler#importStyle(java.lang.String,
         *      org.w3c.css.sac.SACMediaList, java.lang.String)
         */

        public virtual void importStyle(string uri, SACMediaList media, string defaultNamespaceURI)
        {
            if (!Boolean.Parse(policy.getDirective("embedStyleSheets")))
            {
                //results.addErrorMessage("Importing of stylesheets has not been enabled");
            }
            //else if (!policy.getRegularExpression("offsiteURL").Pattern.matcher(uri).matches() && !policy.getRegularExpression("onsiteURL").Pattern.matcher(uri).matches())
            //{
            //    results.addErrorMessage("The url for stylesheet import could not be accepted for security reasons. The url was " + HTMLEntityEncoder.htmlEntityEncode(uri));
            //}
            //else
            //{

            //    try
            //    {
            //        URI importedStyleSheet = new URI(uri);

            //        // canonicalize the URI
            //        importedStyleSheet.normalize();

            //        if (!importedStyleSheet.isAbsolute())
            //        {
            //            // we have no concept of relative reference for free form
            //            // text as an end user can't know where the corresponding
            //            // free form will end up
            //            results.addErrorMessage("Cascading stylesheet located at <b>" + HTMLEntityEncoder.htmlEntityEncode(uri) + "</b> could not be embedded as relative URIs are not supported");
            //            return;
            //        }

            //        importedStyleSheets.Add(new InputSource(new InputStreamReader(importedStyleSheet.toURL().openStream())));
            //    }
            //    catch (URISyntaxException use)
            //    {
            //        results.addErrorMessage("Encountered invalid @import uri");
            //    }
            //    catch (System.IO.IOException ioe)
            //    {
            //        results.addErrorMessage("IO error importing stylesheet: " + uri);
            //    }
            //}
        }
Beispiel #2
0
 /*
 * (non-Javadoc)
 *
 * @see org.w3c.css.sac.DocumentHandler#startMedia(org.w3c.css.sac.SACMediaList)
 */
 public virtual void startMedia(SACMediaList media)
 {
     // CSS2 Media declaration - ignore this for now
 }
Beispiel #3
0
        /*
        * (non-Javadoc)
        *
        * @see org.w3c.css.sac.DocumentHandler#importStyle(java.lang.String,
        *      org.w3c.css.sac.SACMediaList, java.lang.String)
        */
        public virtual void importStyle(string uri, SACMediaList media, string defaultNamespaceURI)
        {
            if (!Boolean.Parse(policy.getDirective("embedStyleSheets")))
            {
                //results.addErrorMessage("Importing of stylesheets has not been enabled");
            }
            //else if (!policy.getRegularExpression("offsiteURL").Pattern.matcher(uri).matches() && !policy.getRegularExpression("onsiteURL").Pattern.matcher(uri).matches())
            //{
            //    results.addErrorMessage("The url for stylesheet import could not be accepted for security reasons. The url was " + HTMLEntityEncoder.htmlEntityEncode(uri));
            //}
            //else
            //{

            //    try
            //    {
            //        URI importedStyleSheet = new URI(uri);

            //        // canonicalize the URI
            //        importedStyleSheet.normalize();

            //        if (!importedStyleSheet.isAbsolute())
            //        {
            //            // we have no concept of relative reference for free form
            //            // text as an end user can't know where the corresponding
            //            // free form will end up
            //            results.addErrorMessage("Cascading stylesheet located at <b>" + HTMLEntityEncoder.htmlEntityEncode(uri) + "</b> could not be embedded as relative URIs are not supported");
            //            return;
            //        }

            //        importedStyleSheets.Add(new InputSource(new InputStreamReader(importedStyleSheet.toURL().openStream())));
            //    }
            //    catch (URISyntaxException use)
            //    {
            //        results.addErrorMessage("Encountered invalid @import uri");
            //    }
            //    catch (System.IO.IOException ioe)
            //    {
            //        results.addErrorMessage("IO error importing stylesheet: " + uri);
            //    }
            //}
        }
 /*
  * (non-Javadoc)
  *
  * @see org.w3c.css.sac.DocumentHandler#endMedia(org.w3c.css.sac.SACMediaList)
  */
 public virtual void endMedia(SACMediaList media)
 {
     // CSS2 Media declaration - ignore this for now
 }