Author: dmaliarevich
Date: 2011-12-16 09:06:22 -0500 (Fri, 16 Dec 2011)
New Revision: 37395
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/Style.css
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/s2.css
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/Style.css
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/s2.css
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html.xml
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/.options
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/TestDomUtil.java
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java
Log:
https://issues.jboss.org/browse/JBIDE-5861 - component content test util methods for css
style checking were added, "Dump CSS Style" debug option was added, draft
version of @import test was added.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/.options
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/.options 2011-12-16 13:40:38 UTC (rev 37394)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/.options 2011-12-16 14:06:22 UTC (rev 37395)
@@ -11,6 +11,7 @@
org.jboss.tools.vpe/debug/visual/add_pseudo_element=
org.jboss.tools.vpe/debug/visual/contextmenu/dump_source=
org.jboss.tools.vpe/debug/visual/contextmenu/dump_selected_element=
+org.jboss.tools.vpe/debug/visual/contextmenu/dump_style=
org.jboss.tools.vpe/debug/visual/contextmenu/dump_mapping=
org.jboss.tools.vpe/debug/visual/dump_print_hash=
#This may be a list, e.g.:style,class,width
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2011-12-16
13:40:38 UTC (rev 37394)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpeDebug.java 2011-12-16
14:06:22 UTC (rev 37395)
@@ -33,6 +33,7 @@
public static final boolean VISUAL_CONTEXTMENU_DUMP_SOURCE;
public static final boolean VISUAL_CONTEXTMENU_DUMP_SELECTED_ELEMENT;
+ public static final boolean VISUAL_CONTEXTMENU_DUMP_CSS_STYLE;
public static final boolean VISUAL_CONTEXTMENU_DUMP_MAPPING;
public static final boolean VISUAL_DUMP_PRINT_HASH;
@@ -61,17 +62,15 @@
VISUAL_CONTEXTMENU_DUMP_SOURCE =
"true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID +
"/debug/visual/contextmenu/dump_source")); //$NON-NLS-1$ //$NON-NLS-2$
VISUAL_CONTEXTMENU_DUMP_SELECTED_ELEMENT =
"true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID +
"/debug/visual/contextmenu/dump_selected_element")); //$NON-NLS-1$
//$NON-NLS-2$
+ VISUAL_CONTEXTMENU_DUMP_CSS_STYLE =
"true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID +
"/debug/visual/contextmenu/dump_style")); //$NON-NLS-1$ //$NON-NLS-2$
VISUAL_CONTEXTMENU_DUMP_MAPPING =
"true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID +
"/debug/visual/contextmenu/dump_mapping")); //$NON-NLS-1$ //$NON-NLS-2$
VISUAL_DUMP_PRINT_HASH =
"true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID +
"/debug/visual/dump_print_hash")); //$NON-NLS-1$ //$NON-NLS-2$
- VISUAL_DUMP_IGNORED_ATTRIBUTES = Platform
- .getDebugOption(VpePlugin.PLUGIN_ID
+ VISUAL_DUMP_IGNORED_ATTRIBUTES = Platform.getDebugOption(VpePlugin.PLUGIN_ID
+ "/debug/visual/ignored_attributes") != null ? Arrays //$NON-NLS-1$
- .asList(Platform.getDebugOption(
- VpePlugin.PLUGIN_ID
+ .asList(Platform.getDebugOption(VpePlugin.PLUGIN_ID
+ "/debug/visual/ignored_attributes").split( //$NON-NLS-1$
Constants.COMMA)) : null;
VISUAL_CONTEXTMENU_TEST =
"true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID +
"/debug/visual/contextmenu/show_test")); //$NON-NLS-1$ //$NON-NLS-2$
-
USE_PRINT_STACK_TRACE =
"true".equals(Platform.getDebugOption(VpePlugin.PLUGIN_ID +
"/debug/use_PrintStackTrace")); //$NON-NLS-1$ //$NON-NLS-2$
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2011-12-16
13:40:38 UTC (rev 37394)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2011-12-16
14:06:22 UTC (rev 37395)
@@ -339,6 +339,19 @@
}
});
}
+ if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_CSS_STYLE) {
+ manager.add(new Action("Dump CSS Style") { //$NON-NLS-1$
+ public void run() {
+ VpeNodeMapping nodeMapping = SelectionUtil
+ .getNodeMappingBySourceSelection(sourceEditor, domMapping);
+ if (nodeMapping != null) {
+ DOMTreeDumper dumper = new DOMTreeDumper(VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
+ dumper.dumpStyle(nodeMapping.getVisualNode());
+ }
+ }
+ });
+ }
if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_MAPPING) {
manager.add(new Action("Dump Mapping") { //$NON-NLS-1$
public void run() {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java 2011-12-16
13:40:38 UTC (rev 37394)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java 2011-12-16
14:06:22 UTC (rev 37395)
@@ -132,6 +132,7 @@
if (topLevelMenu) {
addIfEnabled(new DumpSourceAction());
addIfEnabled(new DumpSelectedElementAction());
+ addIfEnabled(new DumpStyleAction());
addIfEnabled(new DumpMappingAction());
addIfEnabled(new TestAction());
}
@@ -307,6 +308,36 @@
return VpeDebug.VISUAL_CONTEXTMENU_DUMP_SELECTED_ELEMENT;
}
}
+
+ /**
+ * Action to dump computed css style
+ * of the selected VPE element.
+ * For debugging purposes only.
+ */
+ public class DumpStyleAction extends Action {
+ public DumpStyleAction() {
+ setText("Dump CSS Style"); //$NON-NLS-1$
+ }
+
+ @Override
+ public void run() {
+ final StructuredTextEditor sourceEditor = vpeMenuUtil.getSourceEditor();
+ final VpeDomMapping domMapping = vpeMenuUtil.getDomMapping();
+ final VpeNodeMapping nodeMapping = SelectionUtil
+ .getNodeMappingBySourceSelection(sourceEditor, domMapping);
+ if (nodeMapping != null) {
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
+ dumper.dumpStyle(nodeMapping.getVisualNode());
+ }
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return VpeDebug.VISUAL_CONTEXTMENU_DUMP_CSS_STYLE;
+ }
+ }
/**
* Action to print the {@link #domMapping}. For debugging purposes only.
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/ComponentContentTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/ComponentContentTest.java 2011-12-16
13:40:38 UTC (rev 37394)
+++
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/ComponentContentTest.java 2011-12-16
14:06:22 UTC (rev 37395)
@@ -99,7 +99,33 @@
throw getException();
}
}
+ protected void compareStyles(VpeController controller, File xmlTestFile)
+ throws FileNotFoundException {
+ Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
+ assertNotNull("Can't get test file, possibly file not exists " +
xmlTestFile,xmlTestDocument); //$NON-NLS-1$
+ List<String> ids = TestDomUtil.getTestIds(xmlTestDocument);
+ for (String id : ids) {
+ try{
+ compareStylesJob(controller, xmlTestDocument, id, id);
+ } catch (DOMComparisonException e) {
+ String xPathToNode = SourceDomUtil.getXPath(e.getNode());
+ String testFileName = xmlTestFile.getPath();
+ String message = e.getMessage();
+ fail(String.format("%s[%s]:\n%s", testFileName, xPathToNode, message));
//$NON-NLS-1$
+ }
+ }
+ }
+ private void compareStylesJob(VpeController controller, Document xmlTestDocument,
+ String elementId, String xmlTestId) throws DOMComparisonException {
+ nsIDOMElement vpeElement = findElementById(controller, elementId);
+ assertNotNull("Cannot find element with id = "+elementId, vpeElement);
//$NON-NLS-1$
+ Element xmlModelElement = TestDomUtil.getFirstChildElement(
+ TestDomUtil.getElemenById(xmlTestDocument, xmlTestId));
+ assertNotNull(xmlModelElement);
+ TestDomUtil.compareComputedStyle(vpeElement, xmlModelElement);
+ }
+
protected void compareContent(VpeController controller, File xmlTestFile)
throws FileNotFoundException {
Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
@@ -315,6 +341,36 @@
+ tagName + "</span>"; //$NON-NLS-1$
}
+ protected void performStyleTest(String elementPagePath) throws Throwable {
+ String fullelementPagePath = TestUtil.COMPONENTS_PATH + elementPagePath;
+ IFile elementPageFile = (IFile) TestUtil.getComponentFileByFullPath(
+ fullelementPagePath, getTestProjectName());
+ /*
+ * Test that test file was found and exists
+ */
+ assertNotNull("Could not find component file
'"+fullelementPagePath+"'", elementPageFile); //$NON-NLS-1$
//$NON-NLS-2$
+
+ IEditorPart editor = WorkbenchUtils.openEditor(elementPageFile,getEditorID());
+ assertNotNull("Editor should be opened.", editor); //$NON-NLS-1$
+ VpeController controller = TestUtil.getVpeController((JSPMultiPageEditor) editor);
+ /*
+ * Get xml test file
+ */
+ IResource xmlFile =TestUtil.getComponentFileByFullPath(fullelementPagePath +
XML_FILE_EXTENSION, getTestProjectName());
+ /*
+ * Test that XML test file was found and exists
+ */
+ assertNotNull("Could not find XML component file '"+fullelementPagePath +
XML_FILE_EXTENSION+"'", xmlFile); //$NON-NLS-1$ //$NON-NLS-2$
+ File xmlTestFile = xmlFile.getLocation().toFile();
+ /*
+ * Compare styles
+ */
+ compareStyles(controller, xmlTestFile);
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
/**
* find visual element by "id" entered in source part of vpe
*
@@ -338,6 +394,7 @@
}
return result;
}
+
/**
* find visual element by "id" entered in source part of vpe
*
@@ -346,20 +403,12 @@
* @return
*/
protected nsIDOMNode findNode(VpeController controller, Node node) {
-
- VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
- node);
-
- if (nodeMapping == null)
+ VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(node);
+ if (nodeMapping == null) {
return null;
-
+ }
return nodeMapping.getVisualNode();
}
- /**
- *
- * @return
- */
abstract protected String getTestProjectName();
-
-}
+}
\ No newline at end of file
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/TestDomUtil.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/TestDomUtil.java 2011-12-16
13:40:38 UTC (rev 37394)
+++
trunk/vpe/tests/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/TestDomUtil.java 2011-12-16
14:06:22 UTC (rev 37395)
@@ -37,10 +37,12 @@
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
+import org.mozilla.interfaces.nsIDOMDocumentView;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMViewCSS;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -73,7 +75,9 @@
final public static String START_REGEX = "/"; //$NON-NLS-1$
final public static String END_REGEX = "/"; //$NON-NLS-1$
-
+
+ public static final Pattern CSS_PROPERTY_PATTERN =
Pattern.compile("([^\\p{Space}]*)[\\p{Space}]*:[\\p{Space}]*(.*)[\\p{Space}]*;");
//$NON-NLS-1$
+
public static Document getDocument(File file) throws FileNotFoundException {
// create reader
FileReader reader = new FileReader(file);
@@ -145,6 +149,65 @@
}
+ public static void compareComputedStyle(nsIDOMNode vpeNode, Node modelNode)
+ throws DOMComparisonException {
+ /*
+ * Check node names
+ */
+ if (!modelNode.getNodeName().equalsIgnoreCase(vpeNode.getNodeName())) {
+ throw new DOMComparisonException("name of tag is \"" //$NON-NLS-1$
+ + vpeNode.getNodeName() + "\"but must be \"" //$NON-NLS-1$
+ + modelNode.getNodeName() + "\"", modelNode); //$NON-NLS-1$
+ }
+ /*
+ * Check node values
+ */
+ if ((modelNode.getNodeValue() != null)
+ && (!modelNode.getNodeValue().trim().equalsIgnoreCase(
+ vpeNode.getNodeValue().trim()))) {
+ throw new DOMComparisonException("value of " + vpeNode.getNodeName()
//$NON-NLS-1$
+ + " is \"" + vpeNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\" but must be \"" + modelNode.getNodeValue().trim()
//$NON-NLS-1$
+ + "\"", modelNode); //$NON-NLS-1$
+ }
+ /*
+ * Check node attributes
+ */
+ if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
+ compareAttributes(modelNode.getAttributes(), vpeNode.getAttributes());
+ }
+ /*
+ * Check node styles
+ */
+ compareComputedStyleJob(vpeNode, modelNode);
+ }
+
+ private static void compareComputedStyleJob(nsIDOMNode vpeNode, Node modelNode)
+ throws DOMComparisonException {
+ final nsIDOMDocumentView view = queryInterface(vpeNode.getOwnerDocument(),
nsIDOMDocumentView.class);
+ final nsIDOMViewCSS viewCss = queryInterface(view.getDefaultView(),
nsIDOMViewCSS.class);
+ final nsIDOMElement vpeElement = queryInterface(vpeNode, nsIDOMElement.class);
+ final nsIDOMCSSStyleDeclaration computedStyle = viewCss.getComputedStyle(vpeElement,
null);
+ String modelText = modelNode.getTextContent();
+ Matcher m = CSS_PROPERTY_PATTERN.matcher(modelText);
+ String vpeValue = null;
+ String xmlName = null;
+ String xmlValue = null;
+ while (m.find()) {
+ vpeValue = computedStyle.getPropertyValue(m.group(1));
+ xmlName = m.group(1);
+ xmlValue = m.group(2);
+ if (vpeValue == null) {
+ throw new DOMComparisonException("CSS property [" //$NON-NLS-1$
+ + xmlName + "] is missing in VPE visual node", modelNode); //$NON-NLS-1$
+ } else if (!vpeValue.equalsIgnoreCase(xmlValue)) {
+ throw new DOMComparisonException("CSS property [" //$NON-NLS-1$
+ + xmlName + "] is [" + vpeValue + "]" //$NON-NLS-1$
//$NON-NLS-2$
+ + ", but should be [" + xmlValue + "]", modelNode);
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+
/**
*
* @param vpeNode
@@ -154,7 +217,6 @@
*/
public static void compareNodes(nsIDOMNode vpeNode, Node modelNode)
throws DOMComparisonException {
-
if (!modelNode.getNodeName().equalsIgnoreCase(vpeNode.getNodeName())) {
throw new DOMComparisonException("name of tag is \"" //$NON-NLS-1$
+ vpeNode.getNodeName() + "\"but must be \"" //$NON-NLS-1$
@@ -171,19 +233,15 @@
// compare node's attributes
if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
- compareAttributes(modelNode.getAttributes(), vpeNode
- .getAttributes());
+ compareAttributes(modelNode.getAttributes(), vpeNode.getAttributes());
}
-
// compare children
nsIDOMNodeList vpeChildren = vpeNode.getChildNodes();
NodeList schemeChildren = modelNode.getChildNodes();
int realCount = 0;
int length = schemeChildren.getLength();
for (int i = 0; i < length; i++) {
-
Node schemeChild = schemeChildren.item(i);
-
// leave out empty text nodes in test dom model
String nodeValue = schemeChild.getNodeValue();
if ((schemeChild.getNodeType() != Node.TEXT_NODE)
@@ -214,7 +272,6 @@
compareNodes(vpeChild, schemeChild);
}
}
-
}
/**
@@ -353,7 +410,7 @@
private static List<String> splitAndSort(String property) {
List<String> propertyParts = new ArrayList<String>();
- for (String propertyPart : property.split("[\\s]+")) {
+ for (String propertyPart : property.split("[\\s]+")) { //$NON-NLS-1$
if (!propertyPart.isEmpty()) {
propertyParts.add(propertyPart);
}
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/Style.css
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/Style.css
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/Style.css 2011-12-16
14:06:22 UTC (rev 37395)
@@ -0,0 +1,10 @@
+.label {
+ font-weight: bold;
+ background: transparent
url("file:///D:/Projects/jbds/jsf/WebContent/css(2)/print_share_sprite.png")
no-repeat;
+}
+.label2 {
+ font-weight: bold;
+ background: transparent
url(file:///D:/Projects/jbds/jsf/WebContent/css/print_share_sprite.png) no-repeat;
+}
+table {width: 100%; border-spacing: 0; }
+tr { background: #f6d654 url(images/orangebg.png) repeat-y; }
\ No newline at end of file
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/s2.css
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/s2.css
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css/s2.css 2011-12-16
14:06:22 UTC (rev 37395)
@@ -0,0 +1,8 @@
+.label {
+ font-weight: bold;
+ background-color: red;
+}
+.label2 {
+ font-weight: bold;
+ background-color: green;
+}
\ No newline at end of file
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/Style.css
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/Style.css
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/Style.css 2011-12-16
14:06:22 UTC (rev 37395)
@@ -0,0 +1,10 @@
+.label {
+ font-weight: bold;
+ background: transparent
url("file:///D:/Projects/jbds/jsf/WebContent/css(2)/print_share_sprite.png")
no-repeat;
+}
+.label2 {
+ font-weight: bold;
+ background: transparent
url(file:///D:/Projects/jbds/jsf/WebContent/css/print_share_sprite.png) no-repeat;
+}
+table {width: 100%; border-spacing: 0; }
+tr { background: #f6d654 url(images/orangebg.png) repeat-y; }
\ No newline at end of file
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/s2.css
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/s2.css
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/css(2)/s2.css 2011-12-16
14:06:22 UTC (rev 37395)
@@ -0,0 +1,8 @@
+.label {
+ font-weight: bold;
+ background-color: red;
+}
+.label2 {
+ font-weight: bold;
+ background-color: green;
+}
\ No newline at end of file
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html (rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html 2011-12-16 14:06:22 UTC (rev 37395)
@@ -0,0 +1,39 @@
+<html>
+<head>
+<style type="text/css" title="currentStyle"
media="screen">
+@import "./css/Style.css";
+@import "../../css(2)/Style.css";
+@import "../../css/s2.css";
+</style>
+
+<style>
+ @import "/style/main.css" screen;
+ @import "/style/palm.css" handheld, print;
+ </style>
+
+ <style type="text/css">
+ @import url("/style/header.css");
+ H1 { font-size: 120%; font-family: Arial, Helvetica, sans-serif; color: green;
+ }
+ </style>
+ <style type="text/css">
+ @import url('/style/headerSingleQuotes.css');
+ @import url(/style(2)/header111.css);
+ H1 { font-size: 120%; font-family: Arial, Helvetica, sans-serif; color: green;
+ }
+ </style>
+</head>
+<body>
+<table>
+ <tr>
+ <td>1</td><td>2</td><td>3</td>
+ </tr>
+ </table>
+<div class="label" id="id1">
+TEXT 111
+</div>
+<div class="label2">
+TEXT 222
+</div>
+</body>
+</html>
\ No newline at end of file
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html.xml
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html.xml (rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975(
1 )/CSSImportConstruction.html.xml 2011-12-16 14:06:22 UTC (rev 37395)
@@ -0,0 +1,170 @@
+<tests>
+ <test id="id1">
+ <DIV>
+ background-attachment: scroll;
+ background-color: rgb(255, 0, 0);
+ background-image:
+ url("file:///D:/Projects/jbds/jsf/WebContent/css(2)/print_share_sprite.png");
+ background-position: 0% 0%;
+ background-repeat: no-repeat;
+ border-bottom-color: rgb(0, 0, 0);
+ border-bottom-style: none;
+ border-bottom-width: 0px;
+ border-collapse: separate;
+ border-left-color: rgb(0, 0, 0);
+ border-left-style: none;
+ border-left-width: 0px;
+ border-right-color: rgb(0, 0, 0);
+ border-right-style: none;
+ border-right-width: 0px;
+ border-spacing: 0px 0px;
+ border-top-color: rgb(0, 0, 0);
+ border-top-style: none;
+ border-top-width: 0px;
+ bottom: auto;
+ caption-side: top;
+ clear: none;
+ clip: auto;
+ color: rgb(0, 0, 0);
+ content: none;
+ counter-increment: none;
+ counter-reset: none;
+ cursor: auto;
+ direction: ltr;
+ display: block;
+ empty-cells: -moz-show-background;
+ float: none;
+ font-family: serif;
+ font-size: 16px;
+ font-size-adjust: none;
+ font-stretch: normal;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: bold;
+ height: 20px;
+ left: auto;
+ letter-spacing: normal;
+ line-height: 20px;
+ list-style-image: none;
+ list-style-position: outside;
+ list-style-type: disc;
+ margin-bottom: 0px;
+ margin-left: 0px;
+ margin-right: 0px;
+ margin-top: 0px;
+ marker-offset: auto;
+ max-height: none;
+ max-width: none;
+ min-height: 0px;
+ min-width: 0px;
+ ime-mode: auto;
+ opacity: 1;
+ outline-color: rgb(0, 0, 0);
+ outline-style: none;
+ outline-width: 0px;
+ outline-offset: 0px;
+ overflow: visible;
+ overflow-x: visible;
+ overflow-y: visible;
+ padding-bottom: 0px;
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ page-break-after: auto;
+ page-break-before: auto;
+ pointer-events: auto;
+ position: static;
+ quotes: "“" "”" "‘" "’";
+ right: auto;
+ table-layout: auto;
+ text-align: start;
+ text-decoration: none;
+ text-indent: 0px;
+ text-shadow: none;
+ text-transform: none;
+ top: auto;
+ unicode-bidi: embed;
+ vertical-align: baseline;
+ visibility: visible;
+ white-space: normal;
+ width: 1051px;
+ word-spacing: 0px;
+ z-index: auto;
+ -moz-appearance: none;
+ -moz-background-clip: border;
+ -moz-background-inline-policy: continuous;
+ -moz-background-origin: padding;
+ -moz-background-size: auto auto;
+ -moz-binding: none;
+ -moz-border-bottom-colors: none;
+ -moz-border-image: none;
+ -moz-border-left-colors: none;
+ -moz-border-right-colors: none;
+ -moz-border-top-colors: none;
+ -moz-border-radius-bottomleft: 0px;
+ -moz-border-radius-bottomright: 0px;
+ -moz-border-radius-topleft: 0px;
+ -moz-border-radius-topright: 0px;
+ -moz-box-align: stretch;
+ -moz-box-direction: normal;
+ -moz-box-flex: 0;
+ -moz-box-ordinal-group: 1;
+ -moz-box-orient: horizontal;
+ -moz-box-pack: start;
+ -moz-box-shadow: none;
+ -moz-box-sizing: content-box;
+ -moz-column-count: auto;
+ -moz-column-width: auto;
+ -moz-column-gap: 16px;
+ -moz-column-rule-color: rgb(0, 0, 0);
+ -moz-column-rule-width: 0px;
+ -moz-column-rule-style: none;
+ -moz-float-edge: content-box;
+ -moz-force-broken-image-icon: 0;
+ -moz-image-region: auto;
+ -moz-outline-radius-bottomleft: 0px;
+ -moz-outline-radius-bottomright: 0px;
+ -moz-outline-radius-topleft: 0px;
+ -moz-outline-radius-topright: 0px;
+ -moz-stack-sizing: stretch-to-fit;
+ -moz-transform: none;
+ -moz-transform-origin: 50% 50%;
+ -moz-user-focus: none;
+ -moz-user-input: enabled;
+ -moz-user-modify: read-write;
+ -moz-user-select: auto;
+ -moz-window-shadow: default;
+ word-wrap: normal;
+ clip-path: none;
+ clip-rule: nonzero;
+ color-interpolation: srgb;
+ color-interpolation-filters: linearrgb;
+ dominant-baseline: auto;
+ fill: rgb(0, 0, 0);
+ fill-opacity: 1;
+ fill-rule: nonzero;
+ filter: none;
+ flood-color: rgb(0, 0, 0);
+ flood-opacity: 1;
+ lighting-color: rgb(255, 255, 255);
+ image-rendering: auto;
+ mask: none;
+ marker-end: none;
+ marker-mid: none;
+ marker-start: none;
+ shape-rendering: auto;
+ stop-color: rgb(0, 0, 0);
+ stop-opacity: 1;
+ stroke: none;
+ stroke-dasharray: none;
+ stroke-dashoffset: 0px;
+ stroke-linecap: butt;
+ stroke-linejoin: miter;
+ stroke-miterlimit: 4;
+ stroke-opacity: 1;
+ stroke-width: 1px;
+ text-anchor: start;
+ text-rendering: auto;
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java 2011-12-16
13:40:38 UTC (rev 37394)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlComponentContentTest.java 2011-12-16
14:06:22 UTC (rev 37395)
@@ -485,6 +485,10 @@
performContentTest("jbide9975( 1 )/CSSUrlQuotes.html"); //$NON-NLS-1$
}
+ public void testCssImport() throws Throwable {
+ performStyleTest("jbide9975( 1 )/CSSImportConstruction.html"); //$NON-NLS-1$
+ }
+
protected String getTestProjectName() {
return HtmlAllTests.IMPORT_PROJECT_NAME;
}