/**
* Returns the URL of the stylesheet.
* @return the URL of the stylesheet
*/
public String jsxGet_href() {
final BrowserVersion version = getBrowserVersion();
if (ownerNode_ != null) {
final DomNode node = ownerNode_.getDomNodeOrDie();
if (node instanceof HtmlLink) {
// <link rel="stylesheet" type="text/css" href="..." />
final HtmlLink link = (HtmlLink) node;
final HtmlPage page = (HtmlPage) link.getPage();
final String href = link.getHrefAttribute();
if (!version.hasFeature(BrowserVersionFeatures.STYLESHEET_HREF_EXPANDURL)) {
// Don't expand relative URLs.
return href;
}
// Expand relative URLs.
try {
final URL url = page.getFullyQualifiedUrl(href);
return url.toExternalForm();
}
catch (final MalformedURLException e) {
// Log the error and fall through to the return values below.
LOG.warn(e.getMessage(), e);
}
}
}
// <style type="text/css"> ... </style>
if (version.hasFeature(BrowserVersionFeatures.STYLESHEET_HREF_STYLE_EMPTY)) {
return "";
}
else if (version.hasFeature(BrowserVersionFeatures.STYLESHEET_HREF_STYLE_NULL)) {
return null;
}
else {
final DomNode node = ownerNode_.getDomNodeOrDie();
final HtmlPage page = (HtmlPage) node.getPage();