Search in sources :

Example 1 with DocumentCSS

use of org.w3c.dom.css.DocumentCSS in project webtools.sourceediting by eclipse.

the class GetOverrideStyleTest method testModel.

public void testModel() {
    IDOMModel model = FileUtil.createHTMLModel();
    try {
        model.getStructuredDocument().setText(null, "<style>p {	border-color: blue; margin: 0; } </style> <p style=\"border-color: red; margin: 1;\">");
        Document document = model.getDocument();
        DocumentCSS ddd = (DocumentCSS) document;
        NodeList n = document.getElementsByTagName("p");
        ddd.getOverrideStyle((Element) n.item(0), "");
    } finally {
        if (model != null) {
            model.releaseFromEdit();
        }
    }
}
Also used : DocumentCSS(org.w3c.dom.css.DocumentCSS) IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) NodeList(org.w3c.dom.NodeList) Document(org.w3c.dom.Document)

Aggregations

IDOMModel (org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel)1 Document (org.w3c.dom.Document)1 NodeList (org.w3c.dom.NodeList)1 DocumentCSS (org.w3c.dom.css.DocumentCSS)1