mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
Generated
+78
-23
@@ -90,37 +90,62 @@
|
||||
<XML>
|
||||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
||||
</XML>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="feature">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="gsp">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="haml">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="html">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="jsp">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="rb">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="sass">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="sql">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="yml">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<codeStyleSettings language="CFML">
|
||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="ECMA Script Level 4">
|
||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<option name="IF_BRACE_FORCE" value="1" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
||||
<option name="FOR_BRACE_FORCE" value="1" />
|
||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="GSP">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="Groovy">
|
||||
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
|
||||
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
|
||||
@@ -201,6 +226,36 @@
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JSP">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JavaScript">
|
||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<option name="IF_BRACE_FORCE" value="1" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
||||
<option name="FOR_BRACE_FORCE" value="1" />
|
||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
|
||||
Generated
+5
-1
@@ -20,7 +20,11 @@
|
||||
<entry name="!*.class" />
|
||||
<entry name="!*.groovy" />
|
||||
</wildcardResourcePatterns>
|
||||
<annotationProcessing enabled="false" useClasspath="true" />
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="false">
|
||||
<processorPath useClasspath="true" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="EclipseCompilerSettings">
|
||||
<option name="GENERATE_NO_WARNINGS" value="true" />
|
||||
|
||||
+3
@@ -594,6 +594,9 @@
|
||||
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="UtilityClassWithoutPrivateConstructor" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoreClassesWithOnlyMain" value="false" />
|
||||
<option name="ignorableAnnotations">
|
||||
<value />
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="WaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="WaitNotInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
|
||||
@@ -799,6 +799,9 @@
|
||||
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="UtilityClassWithoutPrivateConstructor" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoreClassesWithOnlyMain" value="false" />
|
||||
<option name="ignorableAnnotations">
|
||||
<value />
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ValidExternallyBoundObject" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ValidatorConfigModelInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
|
||||
Generated
+1
@@ -123,6 +123,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/platform/xdebugger-impl/xdebugger-impl.iml" filepath="$PROJECT_DIR$/platform/xdebugger-impl/xdebugger-impl.iml" group="platform" />
|
||||
<module fileurl="file://$PROJECT_DIR$/xml/impl/xml.iml" filepath="$PROJECT_DIR$/xml/impl/xml.iml" group="xml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/xml/openapi/xml-openapi.iml" filepath="$PROJECT_DIR$/xml/openapi/xml-openapi.iml" group="xml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/xml/tests/xml-tests.iml" filepath="$PROJECT_DIR$/xml/tests/xml-tests.iml" group="xml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/xpath/xpath.iml" filepath="$PROJECT_DIR$/plugins/xpath/xpath.iml" group="plugins" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/xslt-debugger/xslt-debugger.iml" filepath="$PROJECT_DIR$/plugins/xslt-debugger/xslt-debugger.iml" group="plugins" />
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/xslt-debugger/engine/xslt-debugger-engine.iml" filepath="$PROJECT_DIR$/plugins/xslt-debugger/engine/xslt-debugger-engine.iml" group="plugins" />
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
<orderEntry type="module" module-name="relaxng" />
|
||||
<orderEntry type="module" module-name="gradle" />
|
||||
<orderEntry type="module" module-name="rearranger" />
|
||||
<orderEntry type="module" module-name="xml-tests" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
+7
-1
@@ -20,6 +20,7 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.testFramework.UsefulTestCase;
|
||||
import com.intellij.testFramework.builders.EmptyModuleFixtureBuilder;
|
||||
import com.intellij.testFramework.builders.ModuleFixtureBuilder;
|
||||
@@ -82,7 +83,12 @@ public abstract class CodeInsightFixtureTestCase<T extends ModuleFixtureBuilder>
|
||||
*/
|
||||
@NonNls
|
||||
protected final String getTestDataPath() {
|
||||
return PathManager.getHomePath().replace(File.separatorChar, '/') + getBasePath();
|
||||
String path = isCommunity() ? PlatformTestUtil.getCommunityPath() : PathManager.getHomePath();
|
||||
return path.replace(File.separatorChar, '/') + getBasePath();
|
||||
}
|
||||
|
||||
protected boolean isCommunity() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected Project getProject() {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.psi.XmlElementFactory;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.testFramework.LightIdeaTestCase;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
|
||||
/**
|
||||
* author: lesya
|
||||
*/
|
||||
public class SearchingInXmlTest extends LightIdeaTestCase {
|
||||
public void test() throws IncorrectOperationException {
|
||||
XmlTag xmlTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<root>" +
|
||||
"<tag1><name>name1</name><value>1</value></tag1>" +
|
||||
"<tag1><name>name2</name><value>2</value></tag1>" +
|
||||
"<tag1><name>name3</name><value>3</value></tag1>" +
|
||||
"<tag1><name>name4</name><value>4</value></tag1>" +
|
||||
"<tag1><name>name5</name><value>5</value></tag1>" +
|
||||
"<tag1><name>name6</name><value>6</value></tag1>" +
|
||||
"<tag1><name>name7</name><value>7</value></tag1>" +
|
||||
"</root>");
|
||||
XmlTag found = XmlUtil.find("name", "name4", "tag1", xmlTag);
|
||||
|
||||
assertEquals("4", found.findFirstSubTag("value").getValue().getText());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* @author max
|
||||
*/
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.psi.impl.source.parsing.xml.XmlBuilder;
|
||||
import com.intellij.psi.impl.source.parsing.xml.XmlBuilderDriver;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class XmlBuilderTest extends LightCodeInsightTestCase {
|
||||
private static class TestXmlBuilder implements XmlBuilder {
|
||||
private final StringBuilder builder = new StringBuilder();
|
||||
private final StringBuilder currentPhysicalText = new StringBuilder();
|
||||
private final StringBuilder currentDisplayText = new StringBuilder();
|
||||
private final ProcessingOrder myTagProcessingOrder;
|
||||
|
||||
public TestXmlBuilder(final ProcessingOrder tagsAndAttributes) {
|
||||
myTagProcessingOrder = tagsAndAttributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attribute(final CharSequence name, final CharSequence value, final int startoffset, final int endoffset) {
|
||||
flushText();
|
||||
builder.append("ATT: name='").append(name).append("' value='").append(value).append("'\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endTag(final CharSequence localName, final String namespace, final int startoffset, final int endoffset) {
|
||||
flushText();
|
||||
builder.append("ENDTAG: name='").append(localName).append("' namespace='").append(namespace).append("'\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doctype(@Nullable final CharSequence publicId, @Nullable final CharSequence systemId, final int startOffset, final int endOffset) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessingOrder startTag(final CharSequence localName, final String namespace, final int startoffset, final int endoffset,
|
||||
final int headerEndOffset) {
|
||||
flushText();
|
||||
builder.append("TAG: name='").append(localName).append("' namespace='").append(namespace).append("'\n");
|
||||
return myTagProcessingOrder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void textElement(final CharSequence display, final CharSequence physical, final int startoffset, final int endoffset) {
|
||||
currentPhysicalText.append(physical);
|
||||
currentDisplayText.append(display);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityRef(final CharSequence ref, final int startOffset, final int endOffset) {
|
||||
flushText();
|
||||
builder.append("REF: '").append(ref).append("'\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String message, int startOffset, int endOffset) {
|
||||
flushText();
|
||||
builder.append("ERROR: '").append(message).append("'\n");
|
||||
}
|
||||
|
||||
private void flushText() {
|
||||
if (currentPhysicalText.length() > 0) {
|
||||
builder.append("TEXT: '").append(currentPhysicalText).append("' DISPLAY: '").append(currentDisplayText).append("'\n");
|
||||
currentPhysicalText.setLength(0);
|
||||
currentDisplayText.setLength(0);
|
||||
}
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
flushText();
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public void testEmptyXml() throws Exception {
|
||||
doTest("<root/>", "TAG: name='root' namespace=''\n" +
|
||||
"ENDTAG: name='root' namespace=''\n", XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES);
|
||||
}
|
||||
|
||||
public void testRealJspx() throws Exception {
|
||||
doTest(
|
||||
/* Test: */
|
||||
"<jsp:root xmlns:jsp=\"http://java.sun.com/JSP/Page\" xmlns=\"http://www.w3.org/1999/xhtml\" version=\"2.0\"\n" +
|
||||
" xmlns:spring=\"http://www.springframework.org/tags\" xmlns:c=\"http://java.sun.com/jsp/jstl/core\">\n" +
|
||||
"<html>\n" +
|
||||
" <c:set var=\"foo\" value=\"${1}\"/>\n" +
|
||||
" <c:set var=\"foobar\" value=\"${2}\"/>\n" +
|
||||
" <spring:bind path=\"test.fieldName\">\n" +
|
||||
" <jsp:scriptlet></jsp:scriptlet>\n" +
|
||||
" </spring:bind>\n" +
|
||||
"</html>\n" +
|
||||
"</jsp:root>",
|
||||
|
||||
/* Expected result: */
|
||||
"TAG: name='root' namespace='http://java.sun.com/JSP/Page'\n" +
|
||||
"ATT: name='xmlns:jsp' value='http://java.sun.com/JSP/Page'\n" +
|
||||
"ATT: name='xmlns' value='http://www.w3.org/1999/xhtml'\n" +
|
||||
"ATT: name='version' value='2.0'\n" +
|
||||
"ATT: name='xmlns:spring' value='http://www.springframework.org/tags'\n" +
|
||||
"ATT: name='xmlns:c' value='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"TAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
|
||||
"TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"ATT: name='var' value='foo'\n" +
|
||||
"ATT: name='value' value='${1}'\n" +
|
||||
"ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"ATT: name='var' value='foobar'\n" +
|
||||
"ATT: name='value' value='${2}'\n" +
|
||||
"ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"TAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
|
||||
"ATT: name='path' value='test.fieldName'\n" +
|
||||
"TAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
|
||||
"ENDTAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
|
||||
"ENDTAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
|
||||
"ENDTAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
|
||||
"ENDTAG: name='root' namespace='http://java.sun.com/JSP/Page'\n",
|
||||
XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES);
|
||||
}
|
||||
|
||||
public void testRealJspxNoAttributes() throws Exception {
|
||||
doTest(
|
||||
/* Test: */
|
||||
"<jsp:root xmlns:jsp=\"http://java.sun.com/JSP/Page\" xmlns=\"http://www.w3.org/1999/xhtml\" version=\"2.0\"\n" +
|
||||
" xmlns:spring=\"http://www.springframework.org/tags\" xmlns:c=\"http://java.sun.com/jsp/jstl/core\">\n" +
|
||||
"<html>\n" +
|
||||
" <c:set var=\"foo\" value=\"${1}\"/>\n" +
|
||||
" <c:set var=\"foobar\" value=\"${2}\"/>\n" +
|
||||
" <spring:bind path=\"test.fieldName\">\n" +
|
||||
" <jsp:scriptlet></jsp:scriptlet>\n" +
|
||||
" </spring:bind>\n" +
|
||||
"</html>\n" +
|
||||
"</jsp:root>",
|
||||
|
||||
/* Expected result: */
|
||||
"TAG: name='root' namespace='http://java.sun.com/JSP/Page'\n" +
|
||||
"TAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
|
||||
"TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"TAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"ENDTAG: name='set' namespace='http://java.sun.com/jsp/jstl/core'\n" +
|
||||
"TAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
|
||||
"TAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
|
||||
"ENDTAG: name='scriptlet' namespace='http://java.sun.com/JSP/Page'\n" +
|
||||
"ENDTAG: name='bind' namespace='http://www.springframework.org/tags'\n" +
|
||||
"ENDTAG: name='html' namespace='http://www.w3.org/1999/xhtml'\n" +
|
||||
"ENDTAG: name='root' namespace='http://java.sun.com/JSP/Page'\n",
|
||||
XmlBuilder.ProcessingOrder.TAGS);
|
||||
}
|
||||
|
||||
|
||||
public void testNamespaceOverride() throws Exception {
|
||||
doTest(
|
||||
"<c:x xmlns:c=\"ns1\">\n" +
|
||||
" <c:y/>\n" +
|
||||
" <c:x xmlns:c=\"ns2\">\n" +
|
||||
" <c:y/>\n" +
|
||||
" </c:x>\n" +
|
||||
" <c:y/>\n" +
|
||||
"</c:x>\n",
|
||||
|
||||
"TAG: name='x' namespace='ns1'\n" +
|
||||
"ATT: name='xmlns:c' value='ns1'\n" +
|
||||
"TAG: name='y' namespace='ns1'\n" +
|
||||
"ENDTAG: name='y' namespace='ns1'\n" +
|
||||
"TAG: name='x' namespace='ns2'\n" +
|
||||
"ATT: name='xmlns:c' value='ns2'\n" +
|
||||
"TAG: name='y' namespace='ns2'\n" +
|
||||
"ENDTAG: name='y' namespace='ns2'\n" +
|
||||
"ENDTAG: name='x' namespace='ns2'\n" +
|
||||
"TAG: name='y' namespace='ns1'\n" +
|
||||
"ENDTAG: name='y' namespace='ns1'\n" +
|
||||
"ENDTAG: name='x' namespace='ns1'\n",
|
||||
XmlBuilder.ProcessingOrder.TAGS_AND_ATTRIBUTES);
|
||||
}
|
||||
|
||||
public void testSimpleEntityResolution() throws Exception {
|
||||
doTest(
|
||||
"<root><</root>",
|
||||
"TAG: name='root' namespace=''\n" +
|
||||
"TEXT: '<' DISPLAY: '<'\n" +
|
||||
"ENDTAG: name='root' namespace=''\n",
|
||||
XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS);
|
||||
}
|
||||
|
||||
public void testCDATA() throws Exception {
|
||||
doTest(
|
||||
"<root><![CDATA[<asis/>]]></root>",
|
||||
"TAG: name='root' namespace=''\n" +
|
||||
"TEXT: '<![CDATA[<asis/>]]>' DISPLAY: '<asis/>'\n" +
|
||||
"ENDTAG: name='root' namespace=''\n",
|
||||
XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS
|
||||
);
|
||||
}
|
||||
|
||||
public void testErrors() throws Exception {
|
||||
doTest(
|
||||
"<root>" +
|
||||
"<foo>" +
|
||||
"<bar" +
|
||||
"<" +
|
||||
"</root>",
|
||||
"TAG: name='root' namespace=''\n" +
|
||||
"TAG: name='foo' namespace=''\n" +
|
||||
"ERROR: 'Element foo is not closed'\n" +
|
||||
"ENDTAG: name='foo' namespace=''\n" +
|
||||
"TAG: name='bar' namespace=''\n" +
|
||||
"ERROR: 'Tag start is not closed'\n" +
|
||||
"ENDTAG: name='bar' namespace=''\n" +
|
||||
"TAG: name='' namespace=''\n" +
|
||||
"ERROR: 'Tag name expected'\n" +
|
||||
"ENDTAG: name='' namespace=''\n" +
|
||||
"ENDTAG: name='root' namespace=''\n",
|
||||
XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS
|
||||
);
|
||||
}
|
||||
|
||||
public void testComments() throws Exception {
|
||||
doTest(
|
||||
"<root>" +
|
||||
"<foo>" +
|
||||
"<!--aa-->" +
|
||||
"</foo>" +
|
||||
"<foo>" +
|
||||
"<!---->" +
|
||||
"</foo>" +
|
||||
"<foo>" +
|
||||
"aaa<!--aa-->aaa" +
|
||||
"</foo>" +
|
||||
"<foo>" +
|
||||
"\naaa\n<!--aa-->\naaa\n" +
|
||||
"</foo>" +
|
||||
"</root>",
|
||||
"TAG: name='root' namespace=''\n" +
|
||||
"TAG: name='foo' namespace=''\n" +
|
||||
"ENDTAG: name='foo' namespace=''\n" +
|
||||
"TAG: name='foo' namespace=''\n" +
|
||||
"ENDTAG: name='foo' namespace=''\n" +
|
||||
"TAG: name='foo' namespace=''\n" +
|
||||
"TEXT: 'aaaaaa' DISPLAY: 'aaaaaa'\n" +
|
||||
"ENDTAG: name='foo' namespace=''\n" +
|
||||
"TAG: name='foo' namespace=''\n" +
|
||||
"TEXT: '\naaa\n\naaa\n' DISPLAY: '\naaa\n\naaa\n'\n" +
|
||||
"ENDTAG: name='foo' namespace=''\n" +
|
||||
"ENDTAG: name='root' namespace=''\n",
|
||||
XmlBuilder.ProcessingOrder.TAGS_AND_TEXTS
|
||||
);
|
||||
}
|
||||
|
||||
private static void doTest(String xml, String expectedEventSequence, final XmlBuilder.ProcessingOrder tagsAndAttributes) throws Exception {
|
||||
final TestXmlBuilder builder = new TestXmlBuilder(tagsAndAttributes);
|
||||
new XmlBuilderDriver(xml).build(builder);
|
||||
assertEquals(expectedEventSequence, builder.getResult());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiFileFactory;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.testFramework.PsiTestCase;
|
||||
import com.intellij.xml.XmlAttributeDescriptor;
|
||||
import com.intellij.xml.XmlElementDescriptor;
|
||||
import com.intellij.xml.XmlNSDescriptor;
|
||||
import com.intellij.xml.impl.dtd.XmlElementDescriptorImpl;
|
||||
import com.intellij.xml.impl.dtd.XmlNSDescriptorImpl;
|
||||
|
||||
/**
|
||||
* @author Mike
|
||||
*/
|
||||
public class XmlDtdTest extends PsiTestCase {
|
||||
public void testDocumentDescriptor1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor("<!ELEMENT principals (#PCDATA)><!ELEMENT data-sources (#PCDATA)>");
|
||||
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag("principals"));
|
||||
assertNotNull(elementDescriptor);
|
||||
|
||||
elementDescriptor = NSDescriptor.getElementDescriptor(tag("data-sources"));
|
||||
assertNotNull(elementDescriptor);
|
||||
|
||||
elementDescriptor = NSDescriptor.getElementDescriptor(tag("xxx"));
|
||||
assertNull(elementDescriptor);
|
||||
}
|
||||
|
||||
public void testElementDescriptor1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor("<!ELEMENT principals (#PCDATA)><!ELEMENT data-sources (#PCDATA)>");
|
||||
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag("principals"));
|
||||
assertEquals("principals", elementDescriptor.getName());
|
||||
|
||||
elementDescriptor = NSDescriptor.getElementDescriptor(tag("data-sources"));
|
||||
assertEquals("data-sources", elementDescriptor.getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor2() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT principals (#PCDATA)><!ELEMENT data-sources ANY>" +
|
||||
"<!ELEMENT read-access (namespace-resource)><!ELEMENT group EMPTY>");
|
||||
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag("principals"));
|
||||
assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_MIXED);
|
||||
|
||||
elementDescriptor = NSDescriptor.getElementDescriptor(tag("data-sources"));
|
||||
assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_ANY);
|
||||
|
||||
elementDescriptor = NSDescriptor.getElementDescriptor(tag("read-access"));
|
||||
assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_CHILDREN);
|
||||
|
||||
elementDescriptor = NSDescriptor.getElementDescriptor(tag("group"));
|
||||
assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_EMPTY);
|
||||
}
|
||||
|
||||
public void testElementDescriptor3() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT principals ANY><!ATTLIST principals path CDATA #IMPLIED smtp-host CDATA #REQUIRED>" +
|
||||
"<!ATTLIST principals address CDATA #IMPLIED>");
|
||||
|
||||
final XmlTag tag = tag("principals");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("path", tag);
|
||||
assertNotNull(attributeDescriptor);
|
||||
|
||||
attributeDescriptor = elementDescriptor.getAttributeDescriptor("xxx", tag);
|
||||
assertNull(attributeDescriptor);
|
||||
|
||||
attributeDescriptor = elementDescriptor.getAttributeDescriptor("smtp-host", tag);
|
||||
assertNotNull(attributeDescriptor);
|
||||
|
||||
attributeDescriptor = elementDescriptor.getAttributeDescriptor("address", tag);
|
||||
assertNotNull(attributeDescriptor);
|
||||
|
||||
XmlAttributeDescriptor[] descriptors = elementDescriptor.getAttributesDescriptors(tag);
|
||||
assertEquals("path", descriptors[0].getName());
|
||||
assertEquals("smtp-host", descriptors[1].getName());
|
||||
assertEquals("address", descriptors[2].getName());
|
||||
assertEquals(3, descriptors.length);
|
||||
}
|
||||
|
||||
public void testElementDescriptor4() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT orion-application (ejb-module*, persistence?, namespace-access)>" +
|
||||
"<!ELEMENT ejb-module ANY>" +
|
||||
"<!ELEMENT persistence ANY>" +
|
||||
"<!ELEMENT namespace-access ANY>");
|
||||
|
||||
XmlTag documentTag = tag("orion-application");
|
||||
XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)NSDescriptor.getElementDescriptor(documentTag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(documentTag);
|
||||
|
||||
assertEquals(3, elements.length);
|
||||
assertEquals("ejb-module", elements[0].getName());
|
||||
assertEquals("persistence", elements[1].getName());
|
||||
assertEquals("namespace-access", elements[2].getName());
|
||||
|
||||
elements = elements[0].getElementsDescriptors(documentTag);
|
||||
assertEquals(4, elements.length);
|
||||
assertEquals("orion-application", elements[0].getName());
|
||||
assertEquals("ejb-module", elements[1].getName());
|
||||
assertEquals("persistence", elements[2].getName());
|
||||
assertEquals("namespace-access", elements[3].getName());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT principals ANY><!ATTLIST principals path CDATA #IMPLIED>");
|
||||
|
||||
final XmlTag tag = tag("principals");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("path", tag);
|
||||
assertEquals("path", attributeDescriptor.getName());
|
||||
assertTrue(!attributeDescriptor.isRequired());
|
||||
assertTrue(!attributeDescriptor.isFixed());
|
||||
assertTrue(!attributeDescriptor.isEnumerated());
|
||||
assertNull(attributeDescriptor.getDefaultValue());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor2() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT principals ANY><!ATTLIST principals path CDATA #IMPLIED>");
|
||||
|
||||
final XmlTag tag = tag("principals");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("path", tag);
|
||||
assertTrue(!attributeDescriptor.isRequired());
|
||||
assertTrue(!attributeDescriptor.isFixed());
|
||||
assertTrue(!attributeDescriptor.isEnumerated());
|
||||
assertNull(attributeDescriptor.getDefaultValue());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor3() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT toc ANY> <!ATTLIST toc version CDATA #FIXED \"1.0\">");
|
||||
|
||||
final XmlTag tag = tag("toc");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("version", tag);
|
||||
assertTrue(!attributeDescriptor.isRequired());
|
||||
assertTrue(attributeDescriptor.isFixed());
|
||||
assertTrue(!attributeDescriptor.isEnumerated());
|
||||
assertEquals("1.0", attributeDescriptor.getDefaultValue());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor4() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT toc ANY> <!ATTLIST toc remote (true|false) \"false\">");
|
||||
|
||||
final XmlTag tag = tag("toc");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
|
||||
assertTrue(!attributeDescriptor.isRequired());
|
||||
assertTrue(!attributeDescriptor.isFixed());
|
||||
assertTrue(attributeDescriptor.isEnumerated());
|
||||
assertEquals("false", attributeDescriptor.getDefaultValue());
|
||||
|
||||
String[] values = attributeDescriptor.getEnumeratedValues();
|
||||
assertEquals(2, values.length);
|
||||
assertEquals("true", values[0]);
|
||||
assertEquals("false", values[1]);
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor5() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ELEMENT toc ANY> <!ATTLIST toc remote (0|1|2) #REQUIRED>");
|
||||
|
||||
final XmlTag tag = tag("toc");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
|
||||
assertTrue(attributeDescriptor.isRequired());
|
||||
assertTrue(!attributeDescriptor.isFixed());
|
||||
assertTrue(attributeDescriptor.isEnumerated());
|
||||
assertNull(attributeDescriptor.getDefaultValue());
|
||||
|
||||
String[] values = attributeDescriptor.getEnumeratedValues();
|
||||
assertEquals(3, values.length);
|
||||
assertEquals("0", values[0]);
|
||||
assertEquals("1", values[1]);
|
||||
assertEquals("2", values[2]);
|
||||
}
|
||||
|
||||
public void testEntityDeclElement1() throws Exception {
|
||||
final XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ENTITY % types \"fileset | patternset \"> <!ELEMENT project (target | taskdef | %types; | property )*> " +
|
||||
"<!ELEMENT target><!ELEMENT taskdef><!ELEMENT fileset><!ELEMENT patternset><!ELEMENT property>");
|
||||
|
||||
XmlTag projectTag = tag("project");
|
||||
final XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(projectTag);
|
||||
|
||||
final XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(projectTag);
|
||||
|
||||
assertEquals(5, elements.length);
|
||||
}
|
||||
|
||||
public void testEntityDecl1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ENTITY % boolean \"(true|false|on|off|yes|no)\"> <!ELEMENT toc ANY> <!ATTLIST toc remote %boolean; \"false\"");
|
||||
|
||||
final XmlTag tag = tag("toc");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
|
||||
assertTrue(!attributeDescriptor.isRequired());
|
||||
assertTrue(!attributeDescriptor.isFixed());
|
||||
assertTrue(attributeDescriptor.isEnumerated());
|
||||
assertEquals("false", (attributeDescriptor.getDefaultValue()));
|
||||
|
||||
String[] values = attributeDescriptor.getEnumeratedValues();
|
||||
assertEquals(6, values.length);
|
||||
assertEquals("true", values[0]);
|
||||
assertEquals("false", values[1]);
|
||||
assertEquals("on", values[2]);
|
||||
assertEquals("off", values[3]);
|
||||
assertEquals("yes", values[4]);
|
||||
assertEquals("no", values[5]);
|
||||
}
|
||||
|
||||
public void testEntityDecl2() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ENTITY % coreattrs \"id D #IMPLIED\"> <!ELEMENT a ANY> <!ATTLIST a %coreattrs; version CDATA #FIXED \"1.0\"");
|
||||
|
||||
final XmlTag tag = tag("a");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
final XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
assertEquals(2, attributes.length);
|
||||
assertEquals("id", attributes[0].getName());
|
||||
assertEquals("version", attributes[1].getName());
|
||||
}
|
||||
|
||||
public void testEntityDecl3() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ENTITY % att1 \"id1 D #IMPLIED\"> <!ENTITY % att2 \"id2 D #IMPLIED\"> <!ELEMENT a ANY> <!ATTLIST a %att1; %att2; ");
|
||||
|
||||
final XmlTag tag = tag("a");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
final XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
assertEquals(2, attributes.length);
|
||||
assertEquals("id1", attributes[0].getName());
|
||||
assertEquals("id2", attributes[1].getName());
|
||||
}
|
||||
|
||||
public void testEntityDecl4() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ENTITY % boolean \'(true|false|on|off|yes|no)\'> <!ENTITY % bool \"%boolean;\"> <!ELEMENT toc ANY> <!ATTLIST toc remote %bool; \"false\"");
|
||||
|
||||
final XmlTag tag = tag("toc");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor("remote", tag);
|
||||
assertTrue(!attributeDescriptor.isRequired());
|
||||
assertTrue(!attributeDescriptor.isFixed());
|
||||
assertTrue(attributeDescriptor.isEnumerated());
|
||||
assertEquals("false", attributeDescriptor.getDefaultValue());
|
||||
|
||||
String[] values = attributeDescriptor.getEnumeratedValues();
|
||||
assertEquals(6, values.length);
|
||||
assertEquals("true", values[0]);
|
||||
assertEquals("false", values[1]);
|
||||
assertEquals("on", values[2]);
|
||||
assertEquals("off", values[3]);
|
||||
assertEquals("yes", values[4]);
|
||||
assertEquals("no", values[5]);
|
||||
}
|
||||
|
||||
public void testEntityDecl5() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ENTITY % boolean \"true | false\" > <!ELEMENT foo EMPTY> <!ATTLIST foo someBoolean (%boolean;) \"true\" someString CDATA #IMPLIED >");
|
||||
|
||||
final XmlTag tag = tag("foo");
|
||||
final XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
final XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
|
||||
assertEquals(2, attributes.length);
|
||||
assertEquals("someBoolean", attributes[0].getName());
|
||||
assertEquals("someString", attributes[1].getName());
|
||||
|
||||
assertTrue(attributes[0].isEnumerated());
|
||||
assertEquals(2, attributes[0].getEnumeratedValues().length);
|
||||
assertEquals("true", attributes[0].getEnumeratedValues()[0]);
|
||||
assertEquals("false", attributes[0].getEnumeratedValues()[1]);
|
||||
}
|
||||
|
||||
public void testEmbeddedDtd1() throws Exception {
|
||||
XmlFile xmlFile = (XmlFile)createDummyFile("test.xml",
|
||||
"<!DOCTYPE tv [ <!ELEMENT tv (date)*> <!ELEMENT date (#PCDATA)> ]> <tv></tv>");
|
||||
|
||||
final XmlTag tag = xmlFile.getDocument().getRootTag();
|
||||
assertNotNull(tag);
|
||||
final XmlElementDescriptor desc = xmlFile.getDocument().getRootTagNSDescriptor().getElementDescriptor(tag);
|
||||
assertNotNull(desc);
|
||||
|
||||
final XmlElementDescriptor[] elements = desc.getElementsDescriptors(tag);
|
||||
assertEquals(1, elements.length);
|
||||
assertEquals("date", elements[0].getName());
|
||||
}
|
||||
|
||||
private XmlNSDescriptor createDescriptor(String dtdText) throws Exception {
|
||||
PsiFile dtdFile = createDummyFile("test.dtd", dtdText);
|
||||
|
||||
return new XmlNSDescriptorImpl((XmlFile)dtdFile);
|
||||
}
|
||||
|
||||
private XmlTag tag(String tagName) throws Exception {
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(myPsiManager.getProject()).createFileFromText("tag.xml", "<" + tagName + "/>");
|
||||
return file.getDocument().getRootTag();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.PomManager;
|
||||
import com.intellij.pom.PomModel;
|
||||
import com.intellij.pom.PomModelAspect;
|
||||
import com.intellij.pom.event.PomChangeSet;
|
||||
import com.intellij.pom.event.PomModelEvent;
|
||||
import com.intellij.pom.event.PomModelListener;
|
||||
import com.intellij.pom.xml.XmlAspect;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.XmlElementFactory;
|
||||
import com.intellij.psi.impl.source.PsiFileImpl;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.psi.xml.XmlText;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
public class XmlEventsTest extends LightCodeInsightTestCase {
|
||||
public void test1() throws Exception{
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tagFromText.setAttribute("a", "b");
|
||||
}
|
||||
});
|
||||
|
||||
assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
|
||||
}
|
||||
|
||||
public void test2() throws Exception{
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>aaa</a>");
|
||||
final XmlTag otherTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>");
|
||||
final XmlText xmlText = tagFromText.getValue().getTextElements()[0];
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlText.insertAtOffset(otherTag, 2);
|
||||
}
|
||||
});
|
||||
|
||||
assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
|
||||
}
|
||||
|
||||
public void test3() throws Exception{
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>aaa</a>");
|
||||
final XmlText xmlText = tagFromText.getValue().getTextElements()[0];
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlText.insertText("bb", 2);
|
||||
}
|
||||
});
|
||||
|
||||
assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
|
||||
}
|
||||
|
||||
public void test4() throws Exception{
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>a </a>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tagFromText.addAfter(tagFromText.getValue().getTextElements()[0], tagFromText.getValue().getTextElements()[0]);
|
||||
}
|
||||
});
|
||||
|
||||
assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
|
||||
}
|
||||
|
||||
public void test5() throws Exception{
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>aaa</a>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tagFromText.delete();
|
||||
}
|
||||
});
|
||||
|
||||
assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
|
||||
}
|
||||
|
||||
public void testBulkUpdate() throws Exception{
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
final PsiFile file = createFile("a.xml", "<a/>");
|
||||
new WriteCommandAction(getProject()) {
|
||||
@Override
|
||||
protected void run(Result result) throws Throwable {
|
||||
final Document document = PsiDocumentManager.getInstance(getProject()).getDocument(file);
|
||||
((DocumentEx)document).setInBulkUpdate(true);
|
||||
document.insertString(0, " ");
|
||||
commitDocument(document);
|
||||
((DocumentEx)document).setInBulkUpdate(false);
|
||||
}
|
||||
}.execute();
|
||||
assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
|
||||
}
|
||||
|
||||
public void testDocumentChange1() throws Exception{
|
||||
final String rootTagText = "<a/>";
|
||||
final String stringToInsert = "b=\"c\"";
|
||||
final int positionToInsert = 2;
|
||||
|
||||
checkEventsByDocumentChange(rootTagText, positionToInsert, stringToInsert);
|
||||
}
|
||||
|
||||
public void testDocumentChange2() throws Exception{
|
||||
final String rootTagText = "<a />";
|
||||
final String stringToInsert = "b=\"c\"";
|
||||
final int positionToInsert = 3;
|
||||
|
||||
checkEventsByDocumentChange(rootTagText, positionToInsert, stringToInsert);
|
||||
}
|
||||
|
||||
|
||||
public void testDocumentChange3() throws Exception{
|
||||
final String rootTagText = "<b><a /></b>";
|
||||
final String stringToInsert = "b=\"c\"";
|
||||
final int positionToInsert = 6;
|
||||
|
||||
checkEventsByDocumentChange(rootTagText, positionToInsert, stringToInsert);
|
||||
}
|
||||
|
||||
public void testAttributeValueReplace() throws Exception {
|
||||
final String text = "<target name=\"old\"/>";
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText(text);
|
||||
final XmlAttribute attribute = tag.getAttribute("name", null);
|
||||
assert attribute != null;
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
attribute.setValue("new");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
assertEquals(attribute.getValue(), "new");
|
||||
assertEquals("(Attribute \"name\" for tag \"target\" set to \"\"new\"\")\n", listener.getEventString());
|
||||
}
|
||||
|
||||
private void checkEventsByDocumentChange(final String rootTagText, final int positionToInsert, final String stringToInsert)
|
||||
throws Exception {
|
||||
final PomModel model = PomManager.getModel(getProject());
|
||||
final Listener listener = new Listener(model.getModelAspect(XmlAspect.class));
|
||||
model.addModelListener(listener);
|
||||
final XmlTag tagFromText = ((XmlFile)createFile("file.xml", rootTagText)).getDocument().getRootTag();
|
||||
final PsiFileImpl containingFile = (PsiFileImpl)tagFromText.getContainingFile();
|
||||
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getProject());
|
||||
final Document document = documentManager.getDocument(containingFile);
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
document.insertString(positionToInsert, stringToInsert);
|
||||
documentManager.commitDocument(document);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, "", null);
|
||||
|
||||
assertFileTextEquals(getTestName(false) + ".txt", listener.getEventString());
|
||||
}
|
||||
|
||||
private static class Listener implements PomModelListener{
|
||||
private final XmlAspect myAspect;
|
||||
private final StringBuffer myBuffer = new StringBuffer();
|
||||
|
||||
public Listener(XmlAspect modelAspect) {
|
||||
myAspect = modelAspect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modelChanged(PomModelEvent event) {
|
||||
final PomChangeSet changeSet = event.getChangeSet(myAspect);
|
||||
if(changeSet == null) return;
|
||||
myBuffer.append(changeSet);
|
||||
myBuffer.append("\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAspectChangeInteresting(PomModelAspect aspect) {
|
||||
return aspect == myAspect;
|
||||
}
|
||||
|
||||
String getEventString(){
|
||||
return myBuffer.toString();
|
||||
}
|
||||
}
|
||||
|
||||
private static void assertFileTextEquals(String targetDataName, String treeText) throws Exception {
|
||||
String fullName = PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/')+ "/xml/tests/testData/psi/events" + File.separatorChar + targetDataName;
|
||||
try{
|
||||
String expectedText = loadFile(fullName);
|
||||
assertEquals(expectedText.trim(), treeText.trim());
|
||||
}
|
||||
catch(FileNotFoundException e){
|
||||
//FileUtil.writeToFile(new File(fullName), StringUtil.convertLineSeparators(treeText).getBytes("UTF-8"));
|
||||
fail("No output file found. Created file "+fullName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected static String loadFile(String fullName) throws Exception {
|
||||
String text = FileUtil.loadFile(new File(fullName)).trim();
|
||||
text = StringUtil.convertLineSeparators(text);
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.psi.PsiFileFactory;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.testFramework.PsiTestCase;
|
||||
import com.intellij.xml.XmlAttributeDescriptor;
|
||||
import com.intellij.xml.XmlElementDescriptor;
|
||||
import com.intellij.xml.XmlNSDescriptor;
|
||||
|
||||
/**
|
||||
* @author Mike
|
||||
*/
|
||||
public class XmlInsightTest extends PsiTestCase {
|
||||
public void testDocumentDescriptor1() throws Exception {
|
||||
XmlFile file = createFile("<root><a></a><b></b><a></a></root>");
|
||||
XmlNSDescriptor descriptor = createDescriptor(file);
|
||||
|
||||
XmlElementDescriptor element = descriptor.getElementDescriptor(file.getDocument().getRootTag());
|
||||
assertNotNull(element);
|
||||
assertEquals("root", element.getName());
|
||||
|
||||
element = descriptor.getElementDescriptor(file.getDocument().getRootTag().getSubTags()[0]);
|
||||
assertNotNull(element);
|
||||
assertEquals("a", element.getName());
|
||||
|
||||
element = descriptor.getElementDescriptor(file.getDocument().getRootTag().getSubTags()[1]);
|
||||
assertNotNull(element);
|
||||
assertEquals("b", element.getName());
|
||||
|
||||
element = descriptor.getElementDescriptor(file.getDocument().getRootTag().getSubTags()[2]);
|
||||
assertNotNull(element);
|
||||
assertEquals("a", element.getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor1() throws Exception {
|
||||
XmlFile file = createFile("<root><a></a><b></b><a></a></root>");
|
||||
XmlNSDescriptor descriptor = createDescriptor(file);
|
||||
|
||||
XmlTag rootTag = file.getDocument().getRootTag();
|
||||
XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
|
||||
|
||||
XmlElementDescriptor[] elements = element.getElementsDescriptors(rootTag);
|
||||
|
||||
assertEquals(2, elements.length);
|
||||
assertEquals("a", elements[0].getName());
|
||||
assertEquals("b", elements[1].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor2() throws Exception {
|
||||
XmlFile file = createFile("<root><a><b/></a><a><c/></a></root>");
|
||||
XmlNSDescriptor descriptor = createDescriptor(file);
|
||||
|
||||
XmlTag rootTag = file.getDocument().getRootTag();
|
||||
XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
|
||||
element = element.getElementsDescriptors(rootTag)[0];
|
||||
|
||||
XmlElementDescriptor[] elements = element.getElementsDescriptors(rootTag.getSubTags()[0]);
|
||||
|
||||
assertEquals(2, elements.length);
|
||||
assertEquals("b", elements[0].getName());
|
||||
assertEquals("c", elements[1].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor3() throws Exception {
|
||||
XmlFile file = createFile("<root><a><b/><c></c></a><a><c/></a></root>");
|
||||
XmlNSDescriptor descriptor = createDescriptor(file);
|
||||
|
||||
XmlTag rootTag = file.getDocument().getRootTag();
|
||||
XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
|
||||
element = element.getElementsDescriptors(rootTag)[0];
|
||||
|
||||
XmlElementDescriptor[] elements = element.getElementsDescriptors(rootTag.getSubTags()[0]);
|
||||
|
||||
assertEquals(2, elements.length);
|
||||
assertEquals("b", elements[0].getName());
|
||||
//assertTrue(elements[0].getContentType() == XmlElementDescriptor.CONTENT_TYPE_EMPTY);
|
||||
|
||||
assertEquals("c", elements[1].getName());
|
||||
//assertTrue(elements[1].getContentType() == XmlElementDescriptor.CONTENT_TYPE_CHILDREN);
|
||||
}
|
||||
|
||||
public void testElementDescriptor4() throws Exception {
|
||||
XmlFile file = createFile("<root><a attr2=''></a><a attr1=''></a></root>");
|
||||
XmlNSDescriptor descriptor = createDescriptor(file);
|
||||
|
||||
XmlTag rootTag = file.getDocument().getRootTag();
|
||||
XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
|
||||
element = element.getElementsDescriptors(rootTag)[0];
|
||||
|
||||
XmlAttributeDescriptor[] attributes = element.getAttributesDescriptors(rootTag);
|
||||
|
||||
assertEquals(2, attributes.length);
|
||||
assertEquals("attr1", attributes[0].getName());
|
||||
assertEquals("attr2", attributes[1].getName());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor1() throws Exception {
|
||||
XmlFile file = createFile("<root><a attr1=''></a><a attr2='' attr1=''></a></root>");
|
||||
XmlNSDescriptor descriptor = createDescriptor(file);
|
||||
|
||||
XmlTag rootTag = file.getDocument().getRootTag();
|
||||
XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
|
||||
element = element.getElementsDescriptors(rootTag)[0];
|
||||
|
||||
XmlAttributeDescriptor[] attributes = element.getAttributesDescriptors(rootTag);
|
||||
|
||||
assertEquals("attr1", attributes[0].getName());
|
||||
assertTrue(attributes[0].isRequired());
|
||||
|
||||
assertEquals("attr2", attributes[1].getName());
|
||||
assertTrue(!attributes[1].isRequired());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor2() throws Exception {
|
||||
XmlFile file = createFile("<root><a c='' a=''></a></root>");
|
||||
XmlNSDescriptor descriptor = createDescriptor(file);
|
||||
|
||||
XmlTag rootTag = file.getDocument().getRootTag();
|
||||
XmlElementDescriptor element = descriptor.getElementDescriptor(rootTag);
|
||||
element = element.getElementsDescriptors(rootTag)[0];
|
||||
|
||||
XmlAttributeDescriptor[] attributes = element.getAttributesDescriptors(rootTag);
|
||||
|
||||
assertEquals("c", attributes[0].getName());
|
||||
assertTrue(attributes[0].isRequired());
|
||||
|
||||
assertEquals("a", attributes[1].getName());
|
||||
assertTrue(attributes[1].isRequired());
|
||||
}
|
||||
|
||||
private XmlFile createFile(String text) throws Exception {
|
||||
return (XmlFile)createDummyFile("test.xml", text);
|
||||
}
|
||||
|
||||
private XmlNSDescriptor createDescriptor(XmlFile file) throws Exception{
|
||||
return file.getDocument().getRootTagNSDescriptor();
|
||||
}
|
||||
|
||||
private XmlTag tag(String tagName) throws Exception {
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(myPsiManager.getProject()).createFileFromText("tag.xml", "<" + tagName + "/>");
|
||||
return file.getDocument().getRootTag();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,649 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.lang.ASTFactory;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.LanguageASTFactory;
|
||||
import com.intellij.lang.LanguageParserDefinitions;
|
||||
import com.intellij.lang.dtd.DTDLanguage;
|
||||
import com.intellij.lang.dtd.DTDParserDefinition;
|
||||
import com.intellij.lang.xml.XMLLanguage;
|
||||
import com.intellij.lang.xml.XMLParserDefinition;
|
||||
import com.intellij.lang.xml.XmlASTFactory;
|
||||
import com.intellij.lexer.FilterLexer;
|
||||
import com.intellij.lexer.Lexer;
|
||||
import com.intellij.lexer.XmlLexer;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.DebugUtil;
|
||||
import com.intellij.psi.impl.source.CharTableImpl;
|
||||
import com.intellij.psi.impl.source.parsing.xml.OldXmlParser;
|
||||
import com.intellij.psi.impl.source.tree.CompositeElement;
|
||||
import com.intellij.psi.impl.source.tree.LeafElement;
|
||||
import com.intellij.psi.impl.source.tree.TreeUtil;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.testFramework.ParsingTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.util.ThrowableRunnable;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author Mike, ik
|
||||
*/
|
||||
public class XmlParsingTest extends ParsingTestCase {
|
||||
public XmlParsingTest() {
|
||||
super("psi", "???");
|
||||
myLanguage = XMLLanguage.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
addExplicitExtension(LanguageParserDefinitions.INSTANCE, XMLLanguage.INSTANCE, new XMLParserDefinition());
|
||||
addExplicitExtension(LanguageParserDefinitions.INSTANCE, DTDLanguage.INSTANCE, new DTDParserDefinition());
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, XMLLanguage.INSTANCE, new XmlASTFactory());
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, DTDLanguage.INSTANCE, new XmlASTFactory());
|
||||
registerExtensionPoint(new ExtensionPointName<XmlChildRole.StartTagEndTokenProvider>("com.intellij.xml.startTagEndToken"),
|
||||
XmlChildRole.StartTagEndTokenProvider.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
|
||||
}
|
||||
|
||||
private void doTestXml(@NonNls String text) throws Exception {
|
||||
myLanguage = XMLLanguage.INSTANCE;
|
||||
doTest(text, "test.xml");
|
||||
}
|
||||
private void doTestDtd(@NonNls String text) throws Exception {
|
||||
myLanguage = DTDLanguage.INSTANCE;
|
||||
doTest(text, "test.dtd");
|
||||
}
|
||||
private void doTest(@NonNls String text, @NonNls String fileName) throws Exception {
|
||||
PsiFile file = createFile(fileName, text);
|
||||
checkResult("test" +getTestName(false), file);
|
||||
}
|
||||
|
||||
public void testNewParsing1() throws Exception {
|
||||
doTestXml("<a></a>");
|
||||
}
|
||||
|
||||
public void testEmptyCommentParsing() throws Exception {
|
||||
doTestXml("<!---->");
|
||||
}
|
||||
|
||||
public void testNewParsing2() throws Exception {
|
||||
doTestXml("<a> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing3() throws Exception {
|
||||
doTestXml("<a </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing4() throws Exception {
|
||||
doTestXml("<a> <b> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing5() throws Exception {
|
||||
doTestXml("<a> <b/> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing6() throws Exception {
|
||||
doTestXml("<!DOCTYPE greeting SYSTEM \"hello.dtd\" [<!ELEMENT greeting EMPTY>]> <a> <b/> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing7() throws Exception {
|
||||
doTestXml("<a> <b> <c> <d> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing8() throws Exception {
|
||||
doTestXml("<a blah=\"blah\"/>");
|
||||
}
|
||||
|
||||
public void testNewParsing9() throws Exception {
|
||||
doTestXml("<a asd=\"asd\"></a>");
|
||||
}
|
||||
|
||||
public void testNewParsing10() throws Exception {
|
||||
doTestXml("<a asd=\"asd\"> <s> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing11() throws Exception {
|
||||
doTestXml("<!-- <!-- --> <a asd=\"asd\"> <s> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing12() throws Exception {
|
||||
doTestXml("<a><a ajsdg<a></a></a>");
|
||||
}
|
||||
|
||||
public void testNewParsing13() throws Exception {
|
||||
doTestXml("<a><b><c>\n" + "xxx \n" + "xxxx\n" + "<</b></a>");
|
||||
}
|
||||
|
||||
public void testNewParsing14() throws Exception {
|
||||
doTestXml("<a><a ajsdg = \"\"></a></a>");
|
||||
}
|
||||
|
||||
public void testNewParsing15() throws Exception {
|
||||
doTestXml("<!DOCTYPE a [<!ELEMENT a (a)>]> <a><a ajsdg = \"\"></a></a>");
|
||||
}
|
||||
|
||||
public void testNewParsing19() throws Exception {
|
||||
doTestXml("<!DOCTYPE aaa [" + "<!ELEMENT a #EMPTY>" + "<!ATTLIST a" + " xx CDATA #IMPLIED" + " yy #IMPLIED" + " zz CDATA #IMPLIED>]>\n" +
|
||||
"<a> <b> </b> </a>");
|
||||
}
|
||||
|
||||
public void testNewParsing20() throws Exception {
|
||||
doTestXml("<!DOCTYPE root [\n" + "<!\n" + "]>\n" + "<root>\n" + "\n" + "</root>");
|
||||
}
|
||||
|
||||
public void testEntityInAttr() throws Exception {
|
||||
doTestXml("<a href=\"&n\"/>");
|
||||
}
|
||||
|
||||
public void testEntityInContent() throws Exception {
|
||||
doTestXml("<a> &n </a>");
|
||||
}
|
||||
|
||||
public void testMultyRoots() throws Exception {
|
||||
doTestXml("<a href=\"\"/> <b/>");
|
||||
}
|
||||
|
||||
public void testMultyRootsWithErrorsBetween() throws Exception {
|
||||
doTestXml("<a href=\"\"/> </ss><b/>");
|
||||
}
|
||||
|
||||
public void testGtInTagContent() throws Exception {
|
||||
doTestXml("<a>></a>");
|
||||
}
|
||||
|
||||
public void testManyErrors() throws Exception {
|
||||
doTestXml(loadFile("manyErrors.xml"));
|
||||
}
|
||||
|
||||
public void _testLexerPerformance1() throws Exception{
|
||||
final String text = loadFile("pallada.xml");
|
||||
XmlLexer lexer = new XmlLexer();
|
||||
doLex(lexer, text);
|
||||
final FilterLexer filterLexer = new FilterLexer(new XmlLexer(),
|
||||
new FilterLexer.SetFilter(LanguageParserDefinitions.INSTANCE.forLanguage(XMLLanguage.INSTANCE).getWhitespaceTokens()));
|
||||
doLex(filterLexer, text);
|
||||
doLex(lexer, text);
|
||||
doLex(filterLexer, text);
|
||||
doLex(filterLexer, text);
|
||||
}
|
||||
|
||||
public void _testLexerPerformance2() throws Exception{
|
||||
final String text = loadFile("performance2.xml");
|
||||
XmlLexer lexer = new XmlLexer();
|
||||
doLex(lexer, text);
|
||||
final FilterLexer filterLexer = new FilterLexer(new XmlLexer(),
|
||||
new FilterLexer.SetFilter(LanguageParserDefinitions.INSTANCE.forLanguage(XMLLanguage.INSTANCE).getWhitespaceTokens()));
|
||||
doLex(filterLexer, text);
|
||||
doLex(lexer, text);
|
||||
for (int i = 0; i < 20; i++) {
|
||||
doLex(filterLexer, text);
|
||||
}
|
||||
}
|
||||
|
||||
private static void doLex(Lexer lexer, final String text) {
|
||||
lexer.start(text);
|
||||
long time = System.currentTimeMillis();
|
||||
int count = 0;
|
||||
while(lexer.getTokenType() != null){
|
||||
lexer.advance();
|
||||
count++;
|
||||
}
|
||||
System.out.println("Plain lexing took " + (System.currentTimeMillis() - time) + "ms lexems count:" + count);
|
||||
}
|
||||
|
||||
private void transformAllChildren(final ASTNode file) {
|
||||
for (ASTNode child = file.getFirstChildNode(); child != null; child = child.getTreeNext()) {
|
||||
transformAllChildren(child);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void _testPerformance1() throws Exception{
|
||||
final String text = loadFile("pallada.xml");
|
||||
long time = System.currentTimeMillis();
|
||||
final PsiFile file = createFile("test.xml", text);
|
||||
transformAllChildren(file.getNode());
|
||||
System.out.println("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
|
||||
int index = 0;
|
||||
while(index++ < 10){
|
||||
newParsing(text);
|
||||
}
|
||||
LeafElement firstLeaf = TreeUtil.findFirstLeaf(file.getNode());
|
||||
index = 0;
|
||||
do{
|
||||
index++;
|
||||
}
|
||||
while((firstLeaf = TreeUtil.nextLeaf(firstLeaf, null)) != null);
|
||||
System.out.println("For " + index + " lexems");
|
||||
}
|
||||
|
||||
public void _testReparsePerformance() throws Exception {
|
||||
final String text = loadFile("performance2.xml");
|
||||
final PsiFile file = createFile("test.xml", text);
|
||||
transformAllChildren(file.getNode());
|
||||
final Document doc = PsiDocumentManager.getInstance(getProject()).getDocument(file);
|
||||
|
||||
System.gc();
|
||||
System.gc();
|
||||
|
||||
new WriteCommandAction(getProject(), file) {
|
||||
@Override
|
||||
protected void run(final Result result) throws Throwable {
|
||||
PlatformTestUtil.startPerformanceTest("XML reparse using PsiBuilder", 2500, new ThrowableRunnable() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
final long tm = System.currentTimeMillis();
|
||||
doc.insertString(0, "<additional root=\"tag\"/>");
|
||||
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
|
||||
System.out.println("Reparsed for: " + (System.currentTimeMillis() - tm));
|
||||
}
|
||||
}
|
||||
}).cpuBound().assertTiming();
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
public void _testPerformance2() throws Exception{
|
||||
final String text = loadFile("performance2.xml");
|
||||
long time = System.currentTimeMillis();
|
||||
final PsiFile file = createFile("test.xml", text);
|
||||
transformAllChildren(file.getNode());
|
||||
System.out.println("Old parsing took " + (System.currentTimeMillis() - time) + "ms");
|
||||
int index = 0;
|
||||
while(index++ < 10){
|
||||
newParsing(text);
|
||||
}
|
||||
LeafElement firstLeaf = TreeUtil.findFirstLeaf(file.getNode());
|
||||
index = 0;
|
||||
do{
|
||||
index++;
|
||||
}
|
||||
while((firstLeaf = TreeUtil.nextLeaf(firstLeaf, null)) != null);
|
||||
System.out.println("For " + index + " lexems");
|
||||
}
|
||||
|
||||
private static void newParsing(final String text) {
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
ASTFactory.lazy(XmlElementType.XML_FILE, text).getFirstChildNode(); // ensure parsed
|
||||
|
||||
System.out.println("parsed for " + (System.currentTimeMillis() - time) + "ms");
|
||||
}
|
||||
|
||||
public void testXmlDecl() throws Exception {
|
||||
doTestXml("<?xml version=\"1.0\" encoding='cp1251' ?>");
|
||||
}
|
||||
|
||||
public void testXmlDecl2() throws Exception {
|
||||
doTestXml("<?xml version=\"1.0\" encoding='cp1251' ?> <foo></foo>");
|
||||
}
|
||||
|
||||
public void testXmlDecl3() throws Exception {
|
||||
doTestXml("<?xml version=\"1.0\" encoding='cp1251' > <foo></foo>");
|
||||
}
|
||||
|
||||
public void testDoctype1() throws Exception {
|
||||
doTestXml("<!DOCTYPE greeting SYSTEM \"hello.dtd\">");
|
||||
}
|
||||
|
||||
public void testDoctype2() throws Exception {
|
||||
doTestXml("<!DOCTYPE toc " + "PUBLIC \"-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN\" " +
|
||||
"\"http://java.sun.com/products/javahelp/toc_1_0.dtd\">");
|
||||
}
|
||||
|
||||
public void testDoctype3() throws Exception {
|
||||
doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT greeting (#PCDATA)>" + "]>");
|
||||
}
|
||||
|
||||
public void testDoctype4() throws Exception {
|
||||
doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT br EMPTY>" + "]>");
|
||||
}
|
||||
|
||||
public void testDoctype5() throws Exception {
|
||||
doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT p (#PCDATA|a|ul|b|i|em)*>" + "]>");
|
||||
}
|
||||
|
||||
public void testDoctype6() throws Exception {
|
||||
doTestXml("<!DOCTYPE greeting [" + "<!ELEMENT %name.para; %content.para; >" + "]>");
|
||||
}
|
||||
|
||||
public void testDoctype7() throws Exception {
|
||||
doTestXml("<?xml version='1.0' encoding='ISO-8859-1' ?>" + "<!DOCTYPE toc SYSTEM 'dtds/ejb-jar_2_0.dtd'>" + "<test>" + "</test>");
|
||||
}
|
||||
|
||||
public void testAttlist1() throws Exception {
|
||||
doTestDtd("<!ATTLIST termdef id ID #REQUIRED name CDATA #IMPLIED>");
|
||||
}
|
||||
|
||||
public void testAttlist2() throws Exception {
|
||||
doTestDtd("<!ATTLIST termdef type (bullets|ordered|glossary) \"ordered\">");
|
||||
}
|
||||
|
||||
public void testAttlist3() throws Exception {
|
||||
doTestDtd("<!ATTLIST termdef method CDATA #FIXED \"POST\">");
|
||||
}
|
||||
|
||||
public void testAttlist4() throws Exception {
|
||||
doTestDtd("<!ATTLIST termdef default-charset %CHARSET; \"iso-8859-1\">");
|
||||
}
|
||||
|
||||
public void testComment1() throws Exception {
|
||||
doTestXml("<!-- declarations for <head> & <body> -->");
|
||||
}
|
||||
|
||||
public void testComment2() throws Exception {
|
||||
doTestDtd("<!ELEMENT data-sources (#PCDATA)> <!-- abc --> <!ATTLIST data-sources path CDATA #IMPLIED");
|
||||
}
|
||||
|
||||
public void testComment3() throws Exception {
|
||||
doTestXml("<a><!--<b>--></a>");
|
||||
}
|
||||
|
||||
public void testElements1() throws Exception {
|
||||
doTestXml("<a></a>");
|
||||
}
|
||||
|
||||
public void testElements2() throws Exception {
|
||||
doTestXml("<a/>");
|
||||
}
|
||||
|
||||
public void testElements3() throws Exception {
|
||||
doTestXml("<a><b><c/><d/></b><e/><f><g/></f></a>");
|
||||
}
|
||||
|
||||
public void testElements4() throws Exception {
|
||||
doTestXml("<project name=\"IDEA_ZKM\">\n" + "<!-- set global properties for this build -->\n" + "<property value=\"off\" />\n" +
|
||||
"</project>\n");
|
||||
}
|
||||
|
||||
public void testElements5() throws Exception {
|
||||
doTestXml("<ns1:a><ns2:b/></ns1:a>");
|
||||
}
|
||||
|
||||
public void testElements6() throws Exception {
|
||||
doTestXml("<!DOCTYPE project [" + "<!ENTITY targets SYSTEM \"file:../myproject/targets.xml\">" + "]>" + "<project>" + "</project>");
|
||||
}
|
||||
|
||||
public void testAttributes1() throws Exception {
|
||||
doTestXml("<a att1='val1' att2=\"val2\"></a>");
|
||||
}
|
||||
|
||||
public void testAttributes2() throws Exception {
|
||||
doTestXml("<a><b c=\"\" > </b> </a>");
|
||||
}
|
||||
|
||||
public void testAttributes3() throws Exception {
|
||||
doTestXml("<a><b c=\"a, b, c\" > </b> </a>");
|
||||
}
|
||||
|
||||
public void testAttributes4() throws Exception {
|
||||
doTestXml("<a><b c=\"a b\" > </b> </a>");
|
||||
}
|
||||
|
||||
public void testAttributes5() throws Exception {
|
||||
doTestXml("<a><b c=\"a\"d=\"\" > </b> </a>");
|
||||
}
|
||||
|
||||
public void testManualEmptyAttributeParsing() throws Exception{
|
||||
String value = "<a><b c=\"\" > </b> </a>";
|
||||
final CompositeElement element = parseManually(value, XmlElementType.XML_ELEMENT_DECL, XmlEntityDecl.EntityContextType.GENERIC_XML);
|
||||
checkResult("testManualEmptyAttributeParsing.txt", DebugUtil.treeToString(element, false));
|
||||
}
|
||||
|
||||
private CompositeElement parseManually(final String value, final IElementType xmlElementDecl, XmlEntityDecl.EntityContextType parseType) {
|
||||
return (CompositeElement)new OldXmlParser(value, xmlElementDecl, parseType, new CharTableImpl(), getPsiManager()).parse();
|
||||
}
|
||||
|
||||
public void testCharacters1() throws Exception {
|
||||
doTestXml("<a>someChar\nData</a>");
|
||||
}
|
||||
|
||||
public void testEditing1() throws Exception {
|
||||
doTestXml("<<a></a>");
|
||||
}
|
||||
|
||||
public void testEditing2() throws Exception {
|
||||
doTestXml("<a><b/> < <c/></a>");
|
||||
}
|
||||
|
||||
public void testEditing3() throws Exception {
|
||||
doTestXml("<a><b <c/></a>");
|
||||
}
|
||||
|
||||
public void testEditing4() throws Exception {
|
||||
doTestXml("<a><b>< <c/></a>");
|
||||
}
|
||||
|
||||
public void testEditing5() throws Exception {
|
||||
doTestXml("<a><b></ <c/></a>");
|
||||
}
|
||||
|
||||
public void testEditing6() throws Exception {
|
||||
doTestXml("<one> <two ,b\"/></one>");
|
||||
}
|
||||
|
||||
public void testEditing7() throws Exception {
|
||||
doTestXml("<one> <two a,b\"/></one>");
|
||||
}
|
||||
|
||||
public void testEditing8() throws Exception {
|
||||
doTestXml("<one> <two a b=\"\"/></one>");
|
||||
}
|
||||
|
||||
public void testEditing9() throws Exception {
|
||||
doTestXml("<one> <two a b=\"\"> ashdgjkasgd <aksjhdk></two></one>");
|
||||
}
|
||||
|
||||
|
||||
public void testCdata1() throws Exception {
|
||||
doTestXml("<a><![CDATA[<greeting>Hello, world!</greeting>]]></a>");
|
||||
}
|
||||
|
||||
public void testCdata2() throws Exception {
|
||||
doTestXml("<a><![CDATA[someData <!--</greeting>--> more data]]></a>");
|
||||
}
|
||||
|
||||
public void testDtd1() throws Exception {
|
||||
doTestDtd("<!ELEMENT data-sources (#PCDATA)> <!ATTLIST data-sources path CDATA #IMPLIED>");
|
||||
}
|
||||
|
||||
public void testElementDecl1() throws Exception {
|
||||
doTestDtd("<!ELEMENT data-sources EMPTY>");
|
||||
}
|
||||
|
||||
public void testElementDecl2() throws Exception {
|
||||
doTestDtd("<!ELEMENT data-sources ANY>");
|
||||
}
|
||||
|
||||
public void testConditionalSection1() throws Exception {
|
||||
doTestDtd("<![ INCLUDE [ <!ELEMENT data-sources ANY> ]]>");
|
||||
}
|
||||
|
||||
public void testConditionalSection2() throws Exception {
|
||||
doTestDtd("<![%sgml.features;[\n" + "<![IGNORE[\n" +
|
||||
"<!ENTITY % dbgenent SYSTEM \"http://www.oasis-open.org/docbook/xml/configerror.txt\">\n" + "]]>\n" + "]]>");
|
||||
}
|
||||
|
||||
public void testConditionalSection3() throws Exception {
|
||||
doTestDtd("<!ENTITY % dbhier.module \"INCLUDE\">\n" + "<![ %dbhier.module; [\n" + "<!ENTITY % dbhier PUBLIC\n" +
|
||||
"\"-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN\"\n" + "\"dbhierx.mod\">\n" + "%dbhier;\n" + "]]>");
|
||||
}
|
||||
|
||||
public void testEntityRef1() throws Exception {
|
||||
doTestXml("<a>%types;</a>");
|
||||
}
|
||||
|
||||
public void testEntityRef3() throws Exception {
|
||||
doTestDtd("<!ELEMENT project (target | taskdef | %types; | property )*>");
|
||||
}
|
||||
|
||||
public void testEntityRef4() throws Exception {
|
||||
doTestXml("<a b=\"aa > bb\" />");
|
||||
}
|
||||
|
||||
public void testEntityRef5() throws Exception {
|
||||
doTestDtd("<!ATTLIST a %coreattrs; version CDATA #FIXED \"1.0\"");
|
||||
}
|
||||
|
||||
public void testEntityRef6() throws Exception {
|
||||
doTestDtd("&common;");
|
||||
}
|
||||
|
||||
public void testEntityRef7() throws Exception {
|
||||
doTestDtd("<!ATTLIST foo someBoolean (%boolean;) \"true\" someString CDATA #IMPLIED >");
|
||||
}
|
||||
|
||||
public void testEntityDecl1() throws Exception {
|
||||
doTestDtd("<!ENTITY % types \"fileset | patternset mapper\">");
|
||||
}
|
||||
|
||||
public void testEntityDecl2() throws Exception {
|
||||
doTestDtd("<!ENTITY types \"fileset | patternset mapper\">");
|
||||
}
|
||||
|
||||
public void testEntityDecl3() throws Exception {
|
||||
doTestDtd("<!ENTITY build-common SYSTEM \"common.xml\">");
|
||||
}
|
||||
|
||||
public void testEntityDecl4() throws Exception {
|
||||
doTestDtd(
|
||||
"<!ENTITY open-hatch PUBLIC \"-//Textuality//TEXT Standard open-hatch boilerplate//EN\" \"http://www.textuality.com/boilerplate/OpenHatch.xml\">");
|
||||
}
|
||||
|
||||
public void testUnbalanced1() throws Exception {
|
||||
doTestXml("<a><b></a>");
|
||||
}
|
||||
|
||||
public void testUnbalanced2() throws Exception {
|
||||
doTestXml("<a><b><c></a>");
|
||||
}
|
||||
|
||||
public void testUnbalanced3() throws Exception {
|
||||
doTestXml("<a><b></bb></a>");
|
||||
}
|
||||
|
||||
public void testUnbalanced4() throws Exception {
|
||||
doTestXml("<a><b><b/></c></a>");
|
||||
}
|
||||
|
||||
public void testDtdUrl1() throws Exception {
|
||||
XmlFile file = (XmlFile)createFile("test.xml", "<!DOCTYPE greeting SYSTEM \"hello.dtd\">");
|
||||
|
||||
XmlDocument document = file.getDocument();
|
||||
XmlProlog prolog = document.getProlog();
|
||||
XmlDoctype doctype = prolog.getDoctype();
|
||||
String url = doctype.getDtdUri();
|
||||
assertTrue("testDtdUrl1", "hello.dtd".equals(url));
|
||||
}
|
||||
|
||||
public void testContent1() throws Exception {
|
||||
XmlFile file = (XmlFile)createFile("test.xml", "<a> \nxxx \n</a>");
|
||||
checkResult("testContent1", file);
|
||||
assertTrue("xxx".equals(file.getDocument().getRootTag().getValue().getTrimmedText()));
|
||||
}
|
||||
|
||||
public void testUnopenedTag1() throws Exception {
|
||||
doTestXml("</foo>");
|
||||
}
|
||||
|
||||
public void testUnclosedTag() throws Exception {
|
||||
XmlFile file = (XmlFile)createFile("test.xml", "<a>xxx");
|
||||
checkResult("testUnclosedTag", file);
|
||||
assertTrue("xxx".equals(file.getDocument().getRootTag().getValue().getText()));
|
||||
}
|
||||
|
||||
public void testUnclosedTag2() throws Exception {
|
||||
doTestXml("<a");
|
||||
}
|
||||
|
||||
public void testProcessingInstruction1() throws Exception {
|
||||
doTestXml("<?This is=\"PI\"?>");
|
||||
}
|
||||
|
||||
public void testProcessingInstruction2() throws Exception {
|
||||
doTestXml("<a><?This is=\"PI\"?></a>");
|
||||
}
|
||||
|
||||
public void testProcessingInstruction3() throws Exception {
|
||||
doTestXml("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<?xml-stylesheet type=\"text/xsl\" href=\"document.xsl\"?>" +
|
||||
"<!-- @(#) $Id$ -->" + "<!DOCTYPE api SYSTEM \"document.dtd\">" + "<api>" + "</api>");
|
||||
}
|
||||
|
||||
public void testCharRef1() throws Exception {
|
||||
doTestXml("<a>{</a>");
|
||||
}
|
||||
|
||||
public void testCharRef2() throws Exception {
|
||||
doTestXml("<a>ģ</a>");
|
||||
}
|
||||
|
||||
public void testCharRef3() throws Exception {
|
||||
doTestXml("{");
|
||||
}
|
||||
|
||||
public void testCharRef4() throws Exception {
|
||||
doTestXml("�");
|
||||
}
|
||||
|
||||
public void testCharRef5() throws Exception {
|
||||
doTestXml("<a attr=\"abc{\"/>");
|
||||
}
|
||||
|
||||
public void testNotation1() throws Exception {
|
||||
doTestDtd("<!NOTATION data-sources SYSTEM \"x3\">");
|
||||
}
|
||||
|
||||
public void testPrologInDtd() throws Exception {
|
||||
doTestDtd("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + "<!ELEMENT idea-plugin>\n" + "<!ATTLIST idea-plugin\n" +
|
||||
" url CDATA #IMPLIED>");
|
||||
}
|
||||
|
||||
public void testEmptyElementsInDtd() throws Exception {
|
||||
doTestDtd("<!ELEMENT >\n<!ELEMENT name (,)\n<!ATTLIST > <!ELEMENT zzz (aa?, bb)+> <!ELEMENT xxx(aaa,)>" + "<!ATTLIST %aaa;>");
|
||||
}
|
||||
|
||||
public void testElementDeclaration() throws Exception {
|
||||
doTestDtd(
|
||||
"<!ELEMENT xxx EMPTY>\n<!ELEMENT xxx2 ANY>\n<!ELEMENT %name.para; %content.para; >\n<!ELEMENT xxx3 (#PCDATA | a) >\n<!ELEMENT xxx4 >");
|
||||
}
|
||||
|
||||
public void testEntityDeclaration() throws Exception {
|
||||
doTestDtd("<!ENTITY xxx > <!ENTITY >");
|
||||
}
|
||||
|
||||
public void testEntityDeclaration2() throws Exception {
|
||||
String s = "| %pre.qname; | %blockquote.qname; | %address.qname;";
|
||||
CompositeElement element = parseManually(s, XmlElementType.XML_ELEMENT_CONTENT_SPEC, XmlEntityDecl.EntityContextType.ELEMENT_CONTENT_SPEC);
|
||||
checkResult("testEntityDeclaration2.txt", DebugUtil.treeToString(element, false));
|
||||
}
|
||||
|
||||
public void testEntityInAttlistDeclaration() throws Exception {
|
||||
doTestDtd("<!ATTLIST %span.qname; %Common.attrib;>");
|
||||
}
|
||||
|
||||
public void testSGMLDtd() throws Exception {
|
||||
doTestDtd("<!ELEMENT name - - (%inline;)* +(A)> <!ATTLIST (A|B) >\n" +
|
||||
"<!ELEMENT (E|E2) - O (%flow;)* -- table header cell, table data cell-->\n" +
|
||||
"<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->");
|
||||
}
|
||||
|
||||
public void testNotation2() throws Exception {
|
||||
doTestXml("<!DOCTYPE x3 [<!NOTATION data-sources SYSTEM \"x3\">]>");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: Maxim.Mossienko
|
||||
* Date: Sep 8, 2006
|
||||
* Time: 3:40:30 PM
|
||||
*/
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixTestCase;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.util.ThrowableRunnable;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @by Maxim.Mossienko
|
||||
*/
|
||||
public class XmlPerformanceTest extends LightQuickFixTestCase {
|
||||
private final Set<String> ourTestsWithFolding = new HashSet<String>(Arrays.asList("IndentUnindent2"));
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "performance/";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
|
||||
}
|
||||
|
||||
public void testDummy() {
|
||||
@SuppressWarnings({"UnusedDeclaration"})
|
||||
Class clazz = IdeaTestUtil.class;
|
||||
}
|
||||
|
||||
public void testIndentUnindent() throws Exception {
|
||||
doIndentTest(2000);
|
||||
}
|
||||
|
||||
public void testIndentUnindent2() throws Exception {
|
||||
doIndentTest(2001);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean doFolding() {
|
||||
return ourTestsWithFolding.contains(getTestName(false));
|
||||
}
|
||||
|
||||
private void doIndentTest(int time) throws Exception {
|
||||
configureByFile(getBasePath() + getTestName(false)+".xml");
|
||||
doHighlighting();
|
||||
myEditor.getSelectionModel().setSelection(0,myEditor.getDocument().getTextLength());
|
||||
|
||||
PlatformTestUtil.startPerformanceTest("Fix long indent/unindent "+time, time, new ThrowableRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
EditorActionManager.getInstance().getActionHandler("EditorIndentSelection").execute(myEditor, new DataContext() {
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getData(String dataId) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
EditorActionManager.getInstance().getActionHandler("EditorUnindentSelection").execute(myEditor, new DataContext() {
|
||||
@Override
|
||||
@Nullable
|
||||
public Object getData(String dataId) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}).assertTiming();
|
||||
final int startOffset = myEditor.getCaretModel().getOffset();
|
||||
myEditor.getSelectionModel().setSelection(startOffset,startOffset);
|
||||
checkResultByFile(getBasePath() + getTestName(false)+".xml");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: mike
|
||||
* Date: Oct 4, 2002
|
||||
* Time: 2:14:24 PM
|
||||
* To change template for new class use
|
||||
* Code Style | Class Templates options (Tools | IDE Options).
|
||||
*/
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.psi.AbstractReparseTestCase;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.DebugUtil;
|
||||
import com.intellij.psi.impl.source.xml.XmlFileImpl;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.testFramework.ParsingTestCase;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@PlatformTestCase.WrapInCommand
|
||||
public class XmlReparseTest extends AbstractReparseTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
setFileType(StdFileTypes.XML);
|
||||
}
|
||||
|
||||
public void test1() throws Exception{
|
||||
String s1 = "<a>";
|
||||
String s2 = "</a>";
|
||||
|
||||
prepareFile(s1, s2);
|
||||
final String beforeReparse = DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true);
|
||||
insert("");
|
||||
assertEquals("Tree changed after empty reparse", beforeReparse, DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true));
|
||||
}
|
||||
|
||||
public void testTagData1() throws Exception {
|
||||
String s1 = "<a>";
|
||||
String s2 = "</a>";
|
||||
|
||||
prepareFile(s1, s2);
|
||||
insert("x");
|
||||
insert(" ");
|
||||
insert("xxxxx");
|
||||
insert("\n");
|
||||
insert("xxxxx");
|
||||
}
|
||||
|
||||
public void testTagData2() throws Exception {
|
||||
String s1 = "<a><b>\nSomeDataHere";
|
||||
String s2 = "\n</b></a>";
|
||||
|
||||
prepareFile(s1, s2);
|
||||
|
||||
PsiElement element1 = ((XmlFile)myDummyFile).getDocument().getRootTag();
|
||||
|
||||
insert("x");
|
||||
insert(" ");
|
||||
insert("xxxxx");
|
||||
insert("\n");
|
||||
insert("xxxxx");
|
||||
|
||||
assertSame(element1, ((XmlFile)myDummyFile).getDocument().getRootTag());
|
||||
}
|
||||
|
||||
public void testTagInTag1() throws Exception {
|
||||
String s1 = "<a><b>";
|
||||
String s2 = "</b></a>";
|
||||
|
||||
prepareFile(s1, s2);
|
||||
|
||||
insert("<");
|
||||
insert("c");
|
||||
insert("/");
|
||||
insert(">");
|
||||
}
|
||||
|
||||
public void testTagInTag2() throws Exception {
|
||||
String s1 = "<a><b>";
|
||||
String s2 = "</b></a>";
|
||||
|
||||
prepareFile(s1, s2);
|
||||
|
||||
insert("<");
|
||||
insert("c");
|
||||
insert(">");
|
||||
insert("\nxxx \nxxxx\n");
|
||||
insert("<");
|
||||
insert("/");
|
||||
insert("c");
|
||||
insert(">");
|
||||
}
|
||||
|
||||
public void testTagInTag3() throws Exception {
|
||||
String s1 = "<a><b>";
|
||||
String s2 = "</b></a>";
|
||||
|
||||
prepareFile(s1, s2);
|
||||
|
||||
insert("<");
|
||||
insert("/");
|
||||
insert("b");
|
||||
insert(">");
|
||||
}
|
||||
|
||||
public void testSCR5925() throws Exception {
|
||||
String s1 = "<one> <two ";
|
||||
String s2 = ",b\"/></one>";
|
||||
|
||||
prepareFile(s1, s2);
|
||||
insert("a");
|
||||
insert("t");
|
||||
insert("t");
|
||||
insert("r");
|
||||
insert("=");
|
||||
insert("\"");
|
||||
}
|
||||
|
||||
public void testXmlReparseProblem() throws IncorrectOperationException {
|
||||
prepareFile("<table>\n" +
|
||||
" <tr>\n" +
|
||||
"<td>\n" +
|
||||
"<table width"," </td>\n" +
|
||||
" </tr>\n" +
|
||||
"</table>");
|
||||
insert("=");
|
||||
}
|
||||
private static final String marker = "<marker>";
|
||||
public void testXmlDeclDtd() throws Exception {
|
||||
PsiFile file = createFile("x.xml", "<!DOCTYPE name [\n" +
|
||||
" <!ELEMENT name (" + marker+ "a b c d" + marker+ ")>\n" +
|
||||
" <!ELEMENT name2 (" + marker+ "%entity;" + marker+ ")>\n" +
|
||||
"]>\n" +
|
||||
"<name></name>");
|
||||
|
||||
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getProject());
|
||||
Document document = documentManager.getDocument(file);
|
||||
|
||||
removeGarbage(document);
|
||||
|
||||
documentManager.commitAllDocuments();
|
||||
String myFullDataPath = getTestDataPath() + "psi/";
|
||||
ParsingTestCase.doCheckResult(myFullDataPath, file, true, "testXmlDeclDtd", false, false);
|
||||
}
|
||||
|
||||
private static void removeGarbage(Document document) {
|
||||
int i = document.getText().indexOf(marker);
|
||||
if (i==-1) return;
|
||||
document.replaceString(i,i+marker.length(),"");
|
||||
removeGarbage(document);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,757 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.xml.XmlAttributeDescriptor;
|
||||
import com.intellij.xml.XmlElementDescriptor;
|
||||
import com.intellij.xml.XmlNSDescriptor;
|
||||
import com.intellij.xml.impl.schema.XmlElementDescriptorImpl;
|
||||
import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
* @author Mike
|
||||
*/
|
||||
public class XmlSchemaTest extends LightCodeInsightTestCase {
|
||||
private XmlTag SHIP_TO;
|
||||
private XmlTag UNKNOWN_TAG;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
SHIP_TO = XmlTestUtil.tag("shipTo", getProject());
|
||||
UNKNOWN_TAG = XmlTestUtil.tag("xxx", getProject());
|
||||
}
|
||||
|
||||
public void testDocumentDescriptor1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:element name=\"comment\" type=\"xsd:string\"/>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
assertNotNull(NSDescriptor);
|
||||
assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", getProject())));
|
||||
assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", getProject())));
|
||||
assertNull(NSDescriptor.getElementDescriptor(UNKNOWN_TAG));
|
||||
}
|
||||
|
||||
public void testElementDescriptor1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:element name=\"comment\" type=\"xsd:string\"/>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", getProject()));
|
||||
assertEquals("purchaseOrder", elementDescriptor.getName());
|
||||
|
||||
elementDescriptor = NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", getProject()));
|
||||
assertEquals("comment", elementDescriptor.getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor2() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"comment\" type=\"xsd:string\"/>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("comment", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(0, elements.length);
|
||||
|
||||
XmlAttributeDescriptor[] descriptors = elementDescriptor.getAttributesDescriptors(tag);
|
||||
assertEquals(0, descriptors.length);
|
||||
|
||||
assertEquals(elementDescriptor.getContentType(), XmlElementDescriptor.CONTENT_TYPE_MIXED);
|
||||
}
|
||||
|
||||
public void testElementDescriptor3() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"items\" type=\"Items\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(3, elements.length);
|
||||
assertEquals("shipTo", elements[0].getName());
|
||||
assertEquals("billTo", elements[1].getName());
|
||||
assertEquals("items", elements[2].getName());
|
||||
|
||||
assertEquals("shipTo", elementDescriptor.getElementDescriptor(SHIP_TO, null).getName());
|
||||
assertNull(elementDescriptor.getElementDescriptor(UNKNOWN_TAG, null));
|
||||
}
|
||||
|
||||
public void testElementDescriptor4() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
|
||||
" <xsd:attribute name=\"name\" type=\"xsd:string\"/>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
|
||||
assertEquals(2, attributes.length);
|
||||
assertEquals("orderDate", attributes[0].getName());
|
||||
assertEquals("name", attributes[1].getName());
|
||||
|
||||
assertEquals("name", elementDescriptor.getAttributeDescriptor("name", tag).getName());
|
||||
|
||||
assertNull(elementDescriptor.getAttributeDescriptor("xxx", tag));
|
||||
}
|
||||
|
||||
public void testElementDescriptor5() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"items\" type=\"Items\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:complexType name=\"USAddress\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"name\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"street\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"city\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"state\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"zip\" type=\"xsd:decimal\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
" <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag).getElementDescriptor(SHIP_TO, null);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(5, elements.length);
|
||||
assertEquals("name", elements[0].getName());
|
||||
assertEquals("street", elements[1].getName());
|
||||
assertEquals("city", elements[2].getName());
|
||||
assertEquals("state", elements[3].getName());
|
||||
assertEquals("zip", elements[4].getName());
|
||||
|
||||
final XmlTag context = tag.findFirstSubTag(elements[2].getName());
|
||||
assertEquals(0, elements[2].getElementsDescriptors(context).length);
|
||||
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(context);
|
||||
assertEquals(1, attributes.length);
|
||||
assertEquals("country", attributes[0].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor6() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"shipTo\">" +
|
||||
" <xsd:complexType name=\"USAddress\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"name\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"street\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"city\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"state\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"zip\" type=\"xsd:decimal\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
" <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>" +
|
||||
" </xsd:complexType>" +
|
||||
" </xsd:element>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag).getElementDescriptor(SHIP_TO, null);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(5, elements.length);
|
||||
assertEquals("name", elements[0].getName());
|
||||
assertEquals("street", elements[1].getName());
|
||||
assertEquals("city", elements[2].getName());
|
||||
assertEquals("state", elements[3].getName());
|
||||
assertEquals("zip", elements[4].getName());
|
||||
|
||||
final XmlTag context = tag.findFirstSubTag(elements[2].getName());
|
||||
assertEquals(0, elements[2].getElementsDescriptors(context).length);
|
||||
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(context);
|
||||
assertEquals(1, attributes.length);
|
||||
assertEquals("country", attributes[0].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor7() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\">" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"shipTo\">" +
|
||||
" <xsd:complexType name=\"USAddress\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"name\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"street\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"city\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"state\" type=\"xsd:string\"/>" +
|
||||
" <xsd:element name=\"zip\" type=\"xsd:decimal\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
" <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>" +
|
||||
" </xsd:complexType>" +
|
||||
" </xsd:element>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:element>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
assertEquals(0, attributes.length);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(1, elements.length);
|
||||
assertEquals("shipTo", elements[0].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor8() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element ref=\"items\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:element name=\"items\" type=\"xsd:string\"/>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(1, elements.length);
|
||||
assertEquals("items", elements[0].getName());
|
||||
|
||||
assertEquals("items", elementDescriptor.getElementDescriptor(XmlTestUtil.tag("items", getProject()), null).getName());
|
||||
assertNull(elementDescriptor.getElementDescriptor(UNKNOWN_TAG, null));
|
||||
}
|
||||
|
||||
public void testElementDescriptor9() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:group ref=\"ddd:mainBookElements\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:group name=\"mainBookElements\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"title\" type=\"nameType\"/>" +
|
||||
" <xsd:element name=\"author\" type=\"nameType\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:group>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(2, elements.length);
|
||||
assertEquals("title", elements[0].getName());
|
||||
assertEquals("author", elements[1].getName());
|
||||
|
||||
assertEquals("title", elementDescriptor.getElementDescriptor(XmlTestUtil.tag("title", getProject()), null).getName());
|
||||
assertNull(elementDescriptor.getElementDescriptor(UNKNOWN_TAG, null));
|
||||
}
|
||||
|
||||
public void testElementDescriptor10() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:attributeGroup ref=\"ddd:bookAttributes\"/>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:attributeGroup name=\"bookAttributes\">" +
|
||||
" <xsd:attribute name=\"isbn\" type=\"xs:string\" use=\"required\"/>" +
|
||||
" <xsd:attribute name=\"available\" type=\"xs:string\"/>" +
|
||||
"</xsd:attributeGroup>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
|
||||
assertEquals(2, attributes.length);
|
||||
assertEquals("isbn", attributes[0].getName());
|
||||
assertEquals("available", attributes[1].getName());
|
||||
|
||||
assertEquals("isbn", elementDescriptor.getAttributeDescriptor("isbn", tag).getName());
|
||||
|
||||
assertNull(elementDescriptor.getAttributeDescriptor("xxx", tag));
|
||||
}
|
||||
|
||||
public void testElementDescriptor11() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:complexContent>" +
|
||||
" <xsd:restriction base=\"PurchaseOrderType2\">" +
|
||||
" <xsd:element name=\"shipTo2\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"items\" type=\"Items\"/>" +
|
||||
" </xsd:restriction>" +
|
||||
" </xsd:complexContent>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType2\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"items\" type=\"Items\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
|
||||
assertEquals(4, elements.length);
|
||||
assertEquals("shipTo", elements[0].getName());
|
||||
assertEquals("billTo", elements[1].getName());
|
||||
assertEquals("shipTo2", elements[2].getName());
|
||||
assertEquals("items", elements[3].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor15() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:complexContent>" +
|
||||
" <xsd:extension base=\"PurchaseOrderType2\">" +
|
||||
" <xsd:element name=\"shipTo2\" type=\"USAddress\"/>" +
|
||||
" </xsd:extension>" +
|
||||
" </xsd:complexContent>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType2\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element name=\"shipTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"billTo\" type=\"USAddress\"/>" +
|
||||
" <xsd:element name=\"items\" type=\"Items\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
|
||||
assertEquals(4, elements.length);
|
||||
assertEquals("shipTo", elements[0].getName());
|
||||
assertEquals("billTo", elements[1].getName());
|
||||
assertEquals("items", elements[2].getName());
|
||||
assertEquals("shipTo2", elements[3].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor12() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:complexContent>" +
|
||||
" <xsd:restriction base=\"PurchaseOrderType2\">" +
|
||||
" <xsd:attribute name=\"orderDate2\" type=\"xsd:date\"/>" +
|
||||
" <xsd:attribute name=\"name\" type=\"xsd:date\"/>" +
|
||||
" </xsd:restriction>" +
|
||||
" </xsd:complexContent>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType2\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
|
||||
" <xsd:attribute name=\"name\" type=\"xsd:string\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
|
||||
assertEquals(3, attributes.length);
|
||||
assertEquals("orderDate", attributes[0].getName());
|
||||
assertEquals("orderDate2", attributes[1].getName());
|
||||
assertEquals("name", attributes[2].getName());
|
||||
}
|
||||
|
||||
public void testElementDescriptor13() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\">" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element ref=\"shipTo\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:element>" +
|
||||
"<xsd:element name=\"shipTo\" abstract=\"true\">" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
final XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(0, elements.length);
|
||||
}
|
||||
|
||||
public void testElementDescriptor14() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema targetNamespace=\"http://www.deansoft.com/AddressBook\" xmlns:ab=\"http://www.deansoft.com/AddressBook\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\">" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element ref=\"shipTo\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:element>" +
|
||||
"<xsd:element name=\"shipTo\" abstract=\"true\">" +
|
||||
" <xsd:complexType name=\"USAddress\">" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
|
||||
" <xsd:element name=\"items\" type=\"Items\"/>" +
|
||||
" </xsd:complexType>" +
|
||||
"</xsd:element>" +
|
||||
"<xsd:element name=\"name\" substitutionGroup=\"ab:shipTo\"/>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", "http://www.deansoft.com/AddressBook", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
final XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(1, elements.length);
|
||||
assertEquals("name", elements[0].getName());
|
||||
XmlAttributeDescriptor[] attrs = elements[0].getAttributesDescriptors(tag);
|
||||
assertEquals(1, attrs.length);
|
||||
assertEquals("orderDate", attrs[0].getName());
|
||||
XmlElementDescriptor[] element0Descriptors = elements[0].getElementsDescriptors(tag.findFirstSubTag(elements[0].getName()));
|
||||
assertEquals(1, element0Descriptors.length);
|
||||
assertEquals("items", element0Descriptors[0].getName());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
|
||||
|
||||
assertTrue(!attribute.isEnumerated());
|
||||
assertTrue(!attribute.isFixed());
|
||||
assertTrue(!attribute.isRequired());
|
||||
assertNull(attribute.getDefaultValue());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptorProhibited() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\" use=\"prohibited\" />" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
assertEquals(0, attributes.length);
|
||||
}
|
||||
|
||||
public void testAttributeDescriptorProhibited2() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:complexContent>" +
|
||||
" <xsd:restriction base=\"PurchaseOrderType2\">" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\" use=\"prohibited\"/>" +
|
||||
" </xsd:restriction>" +
|
||||
" </xsd:complexContent>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType2\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" +
|
||||
" <xsd:attribute name=\"name\" type=\"xsd:string\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlAttributeDescriptor[] attributes = elementDescriptor.getAttributesDescriptors(tag);
|
||||
|
||||
assertEquals(1, attributes.length);
|
||||
assertEquals("name", attributes[0].getName());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor2() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\" use=\"required\" default=\" 2002 \"/>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
|
||||
|
||||
assertTrue(!attribute.isEnumerated());
|
||||
assertTrue(!attribute.isFixed());
|
||||
assertTrue(attribute.isRequired());
|
||||
assertEquals(" 2002 ", attribute.getDefaultValue());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor3() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\" fixed=\"1 01 2001\"/>" +
|
||||
"</xsd:complexType>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
|
||||
|
||||
assertTrue(!attribute.isEnumerated());
|
||||
assertTrue(attribute.isFixed());
|
||||
assertTrue(!attribute.isRequired());
|
||||
assertEquals("1 01 2001", attribute.getDefaultValue());
|
||||
}
|
||||
|
||||
public void testAttributeDescriptor4() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:attribute ref=\"orderDate\" use=\"required\"/>" +
|
||||
"</xsd:complexType>" +
|
||||
" <xsd:attribute name=\"orderDate\" type=\"xsd:date\" fixed=\"1 01 2001\"/>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
final XmlTag tag = XmlTestUtil.tag("purchaseOrder", getProject());
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
XmlAttributeDescriptor attribute = elementDescriptor.getAttributeDescriptor("orderDate", tag);
|
||||
|
||||
assertNotNull(attribute);
|
||||
assertTrue(!attribute.isEnumerated());
|
||||
assertTrue(attribute.isFixed());
|
||||
assertTrue(attribute.isRequired());
|
||||
assertEquals("1 01 2001", attribute.getDefaultValue());
|
||||
}
|
||||
|
||||
public void testNamespace1() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xs:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xs:element name=\"comment\" type=\"xs:string\"/>" +
|
||||
"</xs:schema>");
|
||||
|
||||
assertNotNull(NSDescriptor);
|
||||
assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", getProject())));
|
||||
assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", getProject())));
|
||||
assertNull(NSDescriptor.getElementDescriptor(UNKNOWN_TAG));
|
||||
}
|
||||
|
||||
public void testNamespace2() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema targetNamespace=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
|
||||
"<xsd:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<xsd:complexType name=\"PurchaseOrderType\">" +
|
||||
" <xsd:sequence>" +
|
||||
" <xsd:element ref=\"xsd:items\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
"</xsd:complexType>" +
|
||||
"<xsd:element name=\"items\" type=\"xsd:string\"/>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlTag tag = XmlTestUtil.tag("purchaseOrder", "http://www.w3.org/2001/XMLSchema", getProject());
|
||||
XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl)NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag);
|
||||
assertEquals(1, elements.length);
|
||||
assertEquals("items", elements[0].getName());
|
||||
|
||||
assertEquals("items", elementDescriptor.getElementDescriptor("items").getName());
|
||||
assertNull(elementDescriptor.getElementDescriptor("xxx"));
|
||||
}
|
||||
|
||||
public void testNamespace3() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xs:schema xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
|
||||
"<xs:element name=\"purchaseOrder\" type=\"PurchaseOrderType\"/>" +
|
||||
"<element name=\"comment\" type=\"xs:string\"/>" +
|
||||
"</xs:schema>");
|
||||
|
||||
assertNotNull(NSDescriptor);
|
||||
assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("purchaseOrder", "http://www.w3.org/2001/XMLSchema", getProject())));
|
||||
assertNotNull(NSDescriptor.getElementDescriptor(XmlTestUtil.tag("comment", "http://www.w3.org/2001/XMLSchema", getProject())));
|
||||
assertNull(NSDescriptor.getElementDescriptor(UNKNOWN_TAG));
|
||||
}
|
||||
|
||||
//public void testAny1() throws Exception {
|
||||
// XmlDocumentDescriptor documentDescriptor = createDescriptorImpl(
|
||||
// "<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
|
||||
// " <xsd:element name=\"root\">" +
|
||||
// " <xsd:complexType>" +
|
||||
// " <xsd:sequence minOccurs=\"1\" maxOccurs=\"1\">" +
|
||||
// " <xsd:any namespace=\"##other\" minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"skip\"/>" +
|
||||
// " </xsd:sequence>" +
|
||||
// " </xsd:complexType>" +
|
||||
// " </xsd:element>" +
|
||||
// "</xsd:schema>"
|
||||
// );
|
||||
//
|
||||
// XmlFile xmlFile = (XmlFile)createFile("file.xml",
|
||||
// "<root xmlns=\"http://foo\">" +
|
||||
// " <a:a xmlns:a=\"http://bar\" />" +
|
||||
// "</root>"
|
||||
// );
|
||||
//
|
||||
// XmlElementDescriptor rootDescriptor = documentDescriptor.getElementDescriptor(xmlFile.saveToString().getRootTag());
|
||||
// assertNotNull(rootDescriptor);
|
||||
//
|
||||
// XmlTag aTag = xmlFile.saveToString().getRootTag().findSubTag("a:a");
|
||||
// assertNotNull(aTag);
|
||||
// XmlElementDescriptor aDescriptor = documentDescriptor.getElementDescriptor(aTag);
|
||||
// assertNotNull(aDescriptor);
|
||||
//}
|
||||
|
||||
public void testAny2() throws Exception {
|
||||
PsiFile dtdFile = createFile("test.xml", "<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
|
||||
" <xsd:element name=\"root\">" +
|
||||
" <xsd:complexType>" +
|
||||
" <xsd:sequence minOccurs=\"1\" maxOccurs=\"1\">" +
|
||||
" <xsd:any namespace=\"##other\" minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"skip\"/>" +
|
||||
" </xsd:sequence>" +
|
||||
" </xsd:complexType>" +
|
||||
" </xsd:element>" +
|
||||
"</xsd:schema>");
|
||||
|
||||
XmlNSDescriptor NSDescriptor = new XmlNSDescriptorImpl((XmlFile)dtdFile);
|
||||
|
||||
XmlFile xmlFile = (XmlFile)createFile("file.xml",
|
||||
"<foo:root xmlns:foo=\"http://foo\">" +
|
||||
" <foo:a xmlns:a=\"http://bar\" />" +
|
||||
"</foo:root>"
|
||||
);
|
||||
|
||||
XmlElementDescriptor rootDescriptor = NSDescriptor.getElementDescriptor(xmlFile.getDocument().getRootTag());
|
||||
assertNotNull(rootDescriptor);
|
||||
|
||||
XmlTag aTag = xmlFile.getDocument().getRootTag().findFirstSubTag("foo:a");
|
||||
assertNotNull(aTag);
|
||||
//XmlElementDescriptor aDescriptor = NSDescriptor.getElementDescriptor(aTag);
|
||||
//assertNull(aDescriptor);
|
||||
}
|
||||
|
||||
public void testAny3() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
|
||||
" <xsd:element name=\"root\">" +
|
||||
" <xsd:complexType>" +
|
||||
" <xsd:anyAttribute namespace=\"##other\" processContents=\"skip\"/>" +
|
||||
" </xsd:complexType>" +
|
||||
" </xsd:element>" +
|
||||
"</xsd:schema>"
|
||||
);
|
||||
|
||||
XmlFile xmlFile = (XmlFile)createFile("file.xml",
|
||||
"<root xmlns=\"http://foo\" y:a=\"1\">" +
|
||||
"</root>"
|
||||
);
|
||||
|
||||
final XmlTag rootTag = xmlFile.getDocument().getRootTag();
|
||||
XmlElementDescriptor rootDescriptor = NSDescriptor.getElementDescriptor(rootTag);
|
||||
assertNotNull(rootDescriptor);
|
||||
|
||||
XmlAttribute attribute = rootTag.getAttribute("y:a", XmlUtil.EMPTY_URI);
|
||||
assertNotNull(attribute);
|
||||
XmlAttributeDescriptor aDescriptor = rootDescriptor.getAttributeDescriptor("y:a", rootTag);
|
||||
assertNotNull(aDescriptor);
|
||||
}
|
||||
|
||||
public void testAny4() throws Exception {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<xsd:schema targetNamespace=\"http://foo\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" >" +
|
||||
" <xsd:element name=\"root\">" +
|
||||
" <xsd:complexType>" +
|
||||
" <xsd:anyAttribute namespace=\"##other\" processContents=\"skip\"/>" +
|
||||
" </xsd:complexType>" +
|
||||
" </xsd:element>" +
|
||||
"</xsd:schema>"
|
||||
);
|
||||
|
||||
XmlFile xmlFile = (XmlFile)createFile("file.xml",
|
||||
"<root xmlns=\"http://foo\" a=\"1\">" +
|
||||
"</root>"
|
||||
);
|
||||
|
||||
final XmlTag rootTag = xmlFile.getDocument().getRootTag();
|
||||
XmlElementDescriptor rootDescriptor = NSDescriptor.getElementDescriptor(rootTag);
|
||||
assertNotNull(rootDescriptor);
|
||||
|
||||
XmlAttribute attribute = rootTag.getAttribute("a", XmlUtil.EMPTY_URI);
|
||||
assertNotNull(attribute);
|
||||
XmlAttributeDescriptor aDescriptor = rootDescriptor.getAttributeDescriptor("a", rootTag);
|
||||
assertNull(aDescriptor);
|
||||
|
||||
attribute = rootTag.getAttribute("a", "http://foo");
|
||||
assertNull(attribute);
|
||||
attribute = rootTag.getAttribute("a", XmlUtil.ANT_URI);
|
||||
assertNull(attribute);
|
||||
}
|
||||
|
||||
private static XmlNSDescriptor createDescriptor(@NonNls String dtdText) throws Exception {
|
||||
PsiFile dtdFile = createFile("test.xml", dtdText);
|
||||
|
||||
return new XmlNSDescriptorImpl((XmlFile)dtdFile);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,960 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.command.UndoConfirmationPolicy;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.RangeMarker;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.CodeStyleManager;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.LocalTimeCounter;
|
||||
import com.intellij.xml.util.XmlTagUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
@SuppressWarnings({"ConstantConditions", "EmptyCatchBlock"})
|
||||
public class XmlTagTest extends LightCodeInsightTestCase {
|
||||
private static XmlTag createTag(String value) throws IncorrectOperationException {
|
||||
return XmlElementFactory.getInstance(getProject()).createTagFromText("<foo>" + value + "</foo>");
|
||||
}
|
||||
|
||||
public void testGetTextValue() throws Throwable {
|
||||
assertEquals("bar", createTag("bar").getValue().getText());
|
||||
}
|
||||
|
||||
public void testCharRefs() throws Throwable {
|
||||
String[] names = XmlTagUtil.getCharacterEntityNames();
|
||||
for (String name : names) {
|
||||
XmlTag tag = createTag("foo&" + name + ";bar");
|
||||
assertEquals("foo" + XmlTagUtil.getCharacterByEntityName(name) + "bar", tag.getValue().getTrimmedText());
|
||||
}
|
||||
}
|
||||
|
||||
public void testLocalNSDeclarations() throws Throwable {
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo xmlns='aaa' xmlns:a='bbbb'/>");
|
||||
final Object[] nsPrefixes = ArrayUtil.toObjectArray(tag.getLocalNamespaceDeclarations().keySet());
|
||||
Arrays.sort(nsPrefixes);
|
||||
assertEquals(2, nsPrefixes.length);
|
||||
assertEquals("a",nsPrefixes[1]);
|
||||
assertEquals("",nsPrefixes[0]);
|
||||
}
|
||||
|
||||
public void testCDATA() throws Throwable {
|
||||
XmlTag tag = createTag("foo<![CDATA[<>&'\"]]>bar");
|
||||
assertEquals("foo<>&'\"bar", tag.getValue().getTrimmedText());
|
||||
}
|
||||
|
||||
public void testWhitespacesInAttributes() throws Throwable {
|
||||
XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a c=d>b</a>");
|
||||
assertEquals("b", tag.getValue().getText());
|
||||
}
|
||||
|
||||
public void testCreateChildTag() throws Throwable {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a xmlns=\"aNamespace\"/>");
|
||||
final XmlTag childTag = rootTag.createChildTag("b", "bNamespace", null, true);
|
||||
assertEquals("bNamespace", childTag.getNamespace());
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
XmlTag beanTag = (XmlTag)rootTag.add(childTag);
|
||||
assertEquals("bNamespace", beanTag.getNamespace());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testDeleteTag() throws Throwable {
|
||||
XmlTag aTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a><b/> </a>");
|
||||
final XmlTag bTag = aTag.findFirstSubTag("b");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
bTag.delete();
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(0, aTag.getSubTags().length);
|
||||
}
|
||||
|
||||
public void testReplaceTag() throws Throwable {
|
||||
final XmlTag aTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a><b/></a>");
|
||||
final XmlTag bTag = aTag.findFirstSubTag("b");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
PsiElement cTag = bTag.replace(XmlElementFactory.getInstance(getProject()).createTagFromText("<c/>"));
|
||||
assertEquals(1, aTag.getSubTags().length);
|
||||
assertEquals(cTag, aTag.getSubTags()[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testAddText() throws Exception{
|
||||
final XmlElementFactory elementFactory = XmlElementFactory.getInstance(getProject());
|
||||
final XmlTag aTag = elementFactory.createTagFromText("<a>1</a>");
|
||||
final XmlText displayText = elementFactory.createDisplayText("2");
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
final PsiElement psiElement = aTag.addAfter(displayText, aTag.getValue().getChildren()[0]);
|
||||
assertEquals(psiElement.getContainingFile(), aTag.getContainingFile());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testWhitespaceInsideTag() throws Exception {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
XmlElementFactory.getInstance(getProject()).createTagFromText("<p/>").getValue().setText("\n");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testSetAttribute_ForXhtml() throws Exception {
|
||||
XmlFile xhtmlFile = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("dummy.xhtml", "<html/>");
|
||||
final XmlTag rootTag = xhtmlFile.getDocument().getRootTag();
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootTag.setAttribute("foo", "bar");
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(1, rootTag.getAttributes().length);
|
||||
assertEquals("bar", rootTag.getAttributeValue("foo"));
|
||||
assertEquals("foo", rootTag.getAttributes()[0].getName());
|
||||
}
|
||||
|
||||
public void testSetAttribute() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html/>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootTag.setAttribute("foo", "bar");
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(1, rootTag.getAttributes().length);
|
||||
assertEquals("bar", rootTag.getAttributeValue("foo"));
|
||||
assertEquals("foo", rootTag.getAttributes()[0].getName());
|
||||
assertEquals("<html foo=\"bar\"/>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testSetAttributeWithQuotes() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html/>");
|
||||
final String value = "a \"b\" c";
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootTag.setAttribute("foo", value);
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(1, rootTag.getAttributes().length);
|
||||
assertEquals(value, rootTag.getAttributeValue("foo"));
|
||||
assertEquals("foo", rootTag.getAttributes()[0].getName());
|
||||
assertEquals("<html foo='" + value + "'/>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testSetAttributeWithQuotes2() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html/>");
|
||||
final String value = "'a \"b\" c'";
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootTag.setAttribute("foo", value);
|
||||
}
|
||||
});
|
||||
|
||||
final String expected = value.replaceAll("\"", """);
|
||||
assertEquals(1, rootTag.getAttributes().length);
|
||||
assertEquals(expected, rootTag.getAttributeValue("foo"));
|
||||
assertEquals(value, rootTag.getAttribute("foo").getDisplayValue());
|
||||
assertEquals("foo", rootTag.getAttributes()[0].getName());
|
||||
assertEquals("<html foo=\"" + expected + "\"/>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testSetAttributeUpdateText() throws Exception {
|
||||
final String value = "a \"b\" c";
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html foo='" + value + "'/>");
|
||||
|
||||
assertEquals(1, rootTag.getAttributes().length);
|
||||
assertEquals(value, rootTag.getAttributeValue("foo"));
|
||||
|
||||
final XmlAttribute foo = rootTag.getAttribute("foo");
|
||||
final String text = foo.getValueElement().getText();
|
||||
assertEquals("'" + value + "'", text);
|
||||
|
||||
((PsiLanguageInjectionHost)foo.getValueElement()).updateText(text);
|
||||
assertEquals("<html foo='" + value + "'/>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testSetAttributeWithNamespaces() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<ns:tag xmlns:ns=\"xxx\"/>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootTag.setAttribute("foo", "", "bar");
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(2, rootTag.getAttributes().length);
|
||||
assertEquals("bar", rootTag.getAttributeValue("foo"));
|
||||
assertEquals("foo", rootTag.getAttributes()[1].getName());
|
||||
assertEquals("<ns:tag xmlns:ns=\"xxx\" foo=\"bar\"/>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testTextEdit1() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>aaa</html>");
|
||||
final XmlText xmlText = rootTag.getValue().getTextElements()[0];
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlText.removeText(0, 3);
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<html></html>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testTextEdit2() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>a<a</html>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootTag.getValue().getTextElements()[0].removeText(0, 3);
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<html></html>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testTextEdit3() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>a<a</html>");
|
||||
final XmlText xmlText = rootTag.getValue().getTextElements()[0];
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlText.removeText(1, 2);
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(1, xmlText.getChildren().length);
|
||||
assertEquals("<html>aa</html>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testTextEdit4() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>aaa</html>");
|
||||
final XmlText xmlText = rootTag.getValue().getTextElements()[0];
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlText.removeText(1, 2);
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(1, xmlText.getChildren().length);
|
||||
assertEquals("<html>aa</html>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testTextEdit5() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html><x>xxx</x>\n<y>yyy</y></html>");
|
||||
final XmlTag y = rootTag.findFirstSubTag("y");
|
||||
|
||||
final PsiFile file = y.getContainingFile();
|
||||
String text = y.getValue().getText();
|
||||
TextRange textRange = y.getValue().getTextRange();
|
||||
|
||||
assertEquals(text, textRange.substring(file.getText()));
|
||||
|
||||
new WriteCommandAction(getProject(), file) {
|
||||
@Override
|
||||
protected void run(final Result result) throws Throwable {
|
||||
CodeStyleManager.getInstance(getProject()).adjustLineIndent(file, y.getTextOffset());
|
||||
}
|
||||
}.execute();
|
||||
|
||||
text = y.getValue().getText();
|
||||
textRange = y.getValue().getTextRange();
|
||||
|
||||
assertEquals(text, textRange.substring(file.getText()));
|
||||
}
|
||||
|
||||
public void testTextEdit6() throws Exception {
|
||||
final XmlTag rootTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<html>a<b>1</b>c</html>");
|
||||
final XmlTag xmlTag = rootTag.findFirstSubTag("b");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlTag.delete();
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<html>ac</html>", rootTag.getText());
|
||||
}
|
||||
|
||||
public void testBrace() throws Exception {
|
||||
final XmlTag tagFromText = XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tagFromText.getValue().setText("<");
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<", tagFromText.getValue().getTextElements()[0].getValue());
|
||||
}
|
||||
|
||||
public void testEmptyTextRange() throws Exception {
|
||||
final String text = "<a></a>";
|
||||
final String name = "test.xhtml";
|
||||
XmlTag rootTag = createTag(name, text);
|
||||
TextRange textRange = rootTag.getValue().getTextRange();
|
||||
assertEquals(3, textRange.getStartOffset());
|
||||
assertEquals(3, textRange.getEndOffset());
|
||||
}
|
||||
|
||||
public void testDeleteTagBetweenText() throws Exception {
|
||||
final XmlTag tag = createTag("foo.xhtml", "<p>a<div/>b</p>");
|
||||
final XmlTag div = tag.getSubTags()[0];
|
||||
new WriteCommandAction(getProject(), tag.getContainingFile()) {
|
||||
@Override
|
||||
protected void run(final Result result) throws Throwable {
|
||||
div.delete();
|
||||
}
|
||||
}.execute();
|
||||
assertEquals("<p>ab</p>", tag.getText());
|
||||
}
|
||||
|
||||
private static XmlTag createTag(final String name, final String text) {
|
||||
final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject())
|
||||
.createFileFromText(name, StdFileTypes.XML, text, LocalTimeCounter.currentTime(), true);
|
||||
return file.getDocument().getRootTag();
|
||||
}
|
||||
|
||||
// tests whether rangemarker gets changed when texts are merged, passes
|
||||
public void testRangeMarker1() throws IOException, IncorrectOperationException {
|
||||
final XmlFile file = (XmlFile)createFile("file.xhtml", "<a>1234<b></b>567</a>");
|
||||
final XmlTag root = file.getDocument().getRootTag();
|
||||
final XmlTag tag = root.findFirstSubTag("b");
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final int offset = tag.getTextOffset();
|
||||
|
||||
Document document = PsiDocumentManager.getInstance(getProject()).getDocument(root.getContainingFile());
|
||||
RangeMarker marker = document.createRangeMarker(offset - 3, offset);
|
||||
tag.delete();
|
||||
|
||||
|
||||
assertEquals(4, marker.getStartOffset());
|
||||
assertEquals(7, marker.getEndOffset());
|
||||
}
|
||||
}, "", null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// this one fails, the difference is that we do some manipulations before: move "234" before the tag
|
||||
public void testRangeMarker2() throws IOException, IncorrectOperationException {
|
||||
final XmlTag root = createTag("file.xhtml", "<a>1<b>234</b>567</a>");
|
||||
final XmlTag tag = root.findFirstSubTag("b");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Document document = PsiDocumentManager.getInstance(getProject()).getDocument(root.getContainingFile());
|
||||
XmlTagChild child = tag.getValue().getChildren()[0];
|
||||
assertTrue(child instanceof XmlText && child.getText().equals("234"));
|
||||
|
||||
try {
|
||||
tag.getParent().addBefore(child, tag);
|
||||
|
||||
assertEquals(7, tag.getTextOffset());
|
||||
RangeMarker marker = document.createRangeMarker(4, 7);
|
||||
tag.delete();
|
||||
|
||||
assertEquals(4, marker.getStartOffset());
|
||||
assertEquals(7, marker.getEndOffset());
|
||||
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
}
|
||||
}
|
||||
}, "", null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// the previous test relveals one problem with text merge, "234" in fact is not merged with "1"
|
||||
public void test3() throws IOException, IncorrectOperationException {
|
||||
final XmlTag root = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>1<b>234</b>456</a>");
|
||||
final XmlTag tag = root.findFirstSubTag("b");
|
||||
|
||||
final XmlTagChild child = tag.getValue().getChildren()[0];
|
||||
assertTrue(child instanceof XmlText && child.getText().equals("234"));
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
assertNotNull(tag.getParent().addBefore(child, tag));
|
||||
tag.delete();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
assertEquals(1, root.getValue().getChildren().length);
|
||||
assertEquals("1234456", root.getValue().getChildren()[0].getText());
|
||||
}
|
||||
|
||||
public void test3XHTML() throws IOException, IncorrectOperationException {
|
||||
final XmlTag root = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>1<b>234</b>456</a>");
|
||||
final XmlTag tag = root.findFirstSubTag("b");
|
||||
|
||||
final XmlTagChild child = tag.getValue().getChildren()[0];
|
||||
assertTrue(child instanceof XmlText && child.getText().equals("234"));
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
assertNotNull(tag.getParent().addBefore(child, tag));
|
||||
tag.delete();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
assertEquals(1, root.getValue().getChildren().length);
|
||||
assertEquals("1234456", root.getValue().getChildren()[0].getText());
|
||||
}
|
||||
|
||||
public void testDisplayText() throws Throwable {
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText(" <foo/>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tag.add(XmlElementFactory.getInstance(getProject()).createDisplayText("aaa\nbbb"));
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("aaa\nbbb", tag.getValue().getTextElements()[0].getValue());
|
||||
}
|
||||
|
||||
public void testXHTMLAddBefore1() throws Exception {
|
||||
final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xhtml",
|
||||
"<a>a <b>123</b> c</a>");
|
||||
final XmlTag tagB = file.getDocument().getRootTag().findFirstSubTag("b");
|
||||
|
||||
final XmlTagChild[] tagElements = tagB.getValue().getChildren();
|
||||
final PsiElement parent = tagB.getParent();
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
PsiElement first = parent.addBefore(tagElements[0], tagB);
|
||||
assertNotNull(first);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testXHTMLSetAttribute1() throws Exception {
|
||||
new WriteCommandAction.Simple(getProject()) {
|
||||
@Override
|
||||
protected void run() throws Throwable {
|
||||
final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xhtml", "<a/>");
|
||||
final XmlTag tagB = file.getDocument().getRootTag();
|
||||
|
||||
tagB.setAttribute("a", "");
|
||||
assertEquals("<a a=\"\"/>", tagB.getText());
|
||||
|
||||
tagB.setAttribute("b", "");
|
||||
assertEquals("<a a=\"\" b=\"\"/>", tagB.getText());
|
||||
|
||||
tagB.setAttribute("c", "");
|
||||
assertEquals("<a a=\"\" b=\"\" c=\"\"/>", tagB.getText());
|
||||
|
||||
tagB.getAttributes()[1].delete();
|
||||
assertEquals("<a a=\"\" c=\"\"/>", tagB.getText());
|
||||
}
|
||||
}.execute().throwException();
|
||||
}
|
||||
|
||||
public void testXHTMLNbsp1() throws Exception {
|
||||
final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xhtml", "<a> </a>");
|
||||
final XmlTag tagB = file.getDocument().getRootTag();
|
||||
assertEquals(tagB.getValue().getTextElements().length, 1);
|
||||
assertEquals(tagB.getValue().getTextElements()[0].getValue(), "\u00a0");
|
||||
}
|
||||
|
||||
public void testDeleteTagWithMultilineWhitespace1() throws Exception {
|
||||
final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xml",
|
||||
"<a>\n <a/>\n</a>");
|
||||
final XmlTag tagB = file.getDocument().getRootTag();
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tagB.getSubTags()[0].delete();
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<a>\n </a>", tagB.getText());
|
||||
}
|
||||
|
||||
public void testDeleteTagWithMultilineWhitespace2() throws Exception {
|
||||
final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject())
|
||||
.createFileFromText("test.xml", "<a>\n <a>\n <b>\n hasgdgasjdgasdg asgdjhasgd</b>\n </a>\n</a>");
|
||||
final XmlTag tagB = file.getDocument().getRootTag();
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tagB.getSubTags()[0].getSubTags()[0].delete();
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<a>\n <a>\n </a>\n</a>", tagB.getText());
|
||||
}
|
||||
|
||||
public void testXHTMLRangeMarkers2() throws Exception {
|
||||
XmlTag tag = createTag("file.xhtml", "<a>xyz</a>");
|
||||
PsiFile psiFile = tag.getContainingFile();
|
||||
Document document = PsiDocumentManager.getInstance(psiFile.getProject()).getDocument(psiFile);
|
||||
RangeMarker rangeMarker = document.createRangeMarker(5, 5);
|
||||
final XmlText text = (XmlText) tag.getValue().getChildren()[0];
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
text.removeText(2, 3);
|
||||
}
|
||||
catch(IncorrectOperationException ioe){}
|
||||
}
|
||||
}, "", null, UndoConfirmationPolicy.DO_NOT_REQUEST_CONFIRMATION);
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals(5, rangeMarker.getStartOffset());
|
||||
assertEquals(5, rangeMarker.getEndOffset());
|
||||
}
|
||||
|
||||
public void testXHTMLTextInsert() throws Exception {
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>xyz</a>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tag.getValue().getTextElements()[0].insertText("<", 1);
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<a>x<yz</a>", tag.getText());
|
||||
}
|
||||
|
||||
public void testSimpleTextInsertion() throws Throwable {
|
||||
doTestSimpleInsertion("xyz", "a");
|
||||
doTestSimpleInsertion(" xyz", "a");
|
||||
doTestSimpleInsertion("x yz", "a");
|
||||
doTestSimpleInsertion("xy z", "a");
|
||||
doTestSimpleInsertion("xyz ", "a");
|
||||
doTestSimpleInsertion(" xyz ", "a");
|
||||
doTestSimpleInsertion(" x y z ", "a");
|
||||
}
|
||||
|
||||
public void testWhitespaceTextInsertion() throws Throwable {
|
||||
doTestSimpleInsertion("xyz", " ");
|
||||
}
|
||||
|
||||
public void testSimpleTextDeletion() throws Throwable {
|
||||
doTestSimpleDeletion("xyz");
|
||||
doTestSimpleDeletion(" xyz");
|
||||
doTestSimpleDeletion("x yz");
|
||||
doTestSimpleDeletion("xy z");
|
||||
doTestSimpleDeletion("xyz ");
|
||||
doTestSimpleDeletion(" xyz ");
|
||||
doTestSimpleDeletion(" x y z ");
|
||||
}
|
||||
|
||||
public void testWhitespaceDeletion() throws Throwable {
|
||||
doTestSimpleDeletion(" xyz");
|
||||
doTestSimpleDeletion("x yz");
|
||||
doTestSimpleDeletion("xy z");
|
||||
doTestSimpleDeletion("xyz ");
|
||||
doTestSimpleDeletion(" xyz ");
|
||||
doTestSimpleDeletion(" x y z ");
|
||||
}
|
||||
|
||||
private static void doTestSimpleDeletion(final String text) throws IncorrectOperationException {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
for (int j = i; j < text.length(); j++) {
|
||||
XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + text + "</a>");
|
||||
final PsiElement[] children = tag.getValue().getTextElements();
|
||||
assertEquals(1, children.length);
|
||||
final XmlText xmlText = (XmlText)children[0];
|
||||
assertEquals(text, xmlText.getText());
|
||||
xmlText.removeText(i, j);
|
||||
final StringBuffer expected = new StringBuffer(text);
|
||||
expected.delete(i, j);
|
||||
assertEquals(expected.toString(), xmlText.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void doTestSimpleInsertion(final String text, final String textToInsert) throws IncorrectOperationException {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
for (int i = 0; i <= text.length(); i++) {
|
||||
XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + text + "</a>");
|
||||
final PsiElement[] children = tag.getValue().getTextElements();
|
||||
assertEquals(1, children.length);
|
||||
final XmlText xmlText = (XmlText)children[0];
|
||||
assertEquals(text, xmlText.getValue());
|
||||
xmlText.insertText(textToInsert, i);
|
||||
final StringBuffer expected = new StringBuffer(text);
|
||||
expected.insert(i, textToInsert);
|
||||
assertEquals(expected.toString(), xmlText.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testEscapedInsertion() throws Throwable {
|
||||
doTestEscapedInsertion("xyz", "&");
|
||||
doTestEscapedInsertion("xyz", "&&");
|
||||
doTestEscapedInsertion("xyz", "&x&");
|
||||
doTestEscapedInsertion("&xyz", "a");
|
||||
doTestEscapedInsertion("&xyz", " ");
|
||||
doTestEscapedInsertion("x&yz", "a");
|
||||
doTestEscapedInsertion("x&yz", " ");
|
||||
doTestEscapedInsertion("xy&z", "a");
|
||||
doTestEscapedInsertion("xy&z", " ");
|
||||
doTestEscapedInsertion("xyz&", "a");
|
||||
doTestEscapedInsertion("xyz&", " ");
|
||||
doTestEscapedInsertion("&x&y&z&", "a");
|
||||
doTestEscapedInsertion(" x&y&z&", "a");
|
||||
doTestEscapedInsertion(" x y&z&", "a");
|
||||
doTestEscapedInsertion("&x y&z&", "a");
|
||||
doTestEscapedInsertion("&x y&z ", "a");
|
||||
doTestEscapedInsertion("&x&y&z&", "<");
|
||||
doTestEscapedInsertion("&x&y&z&", ">");
|
||||
doTestEscapedInsertion("_xyz", "a");
|
||||
doTestEscapedInsertion("x_yz", "a");
|
||||
doTestEscapedInsertion("xy_z", "a");
|
||||
doTestEscapedInsertion("xyz_", "a");
|
||||
doTestEscapedInsertion("_xyz_", "a");
|
||||
doTestEscapedInsertion("_x_y_z_", "a");
|
||||
}
|
||||
|
||||
public static void notestEscapedDeletion() throws Throwable {
|
||||
doTestEscapedDeletion("&");
|
||||
doTestEscapedDeletion("&&");
|
||||
doTestEscapedDeletion(" &&");
|
||||
doTestEscapedDeletion(" & &");
|
||||
doTestEscapedDeletion(" & & ");
|
||||
doTestEscapedDeletion(" && ");
|
||||
doTestEscapedDeletion("&& ");
|
||||
doTestEscapedDeletion("& ");
|
||||
doTestEscapedDeletion(" ");
|
||||
doTestEscapedDeletion("&abc");
|
||||
doTestEscapedDeletion("a&bc");
|
||||
doTestEscapedDeletion("ab&c");
|
||||
doTestEscapedDeletion("abc&");
|
||||
doTestEscapedDeletion(" &abc");
|
||||
doTestEscapedDeletion("a &bc");
|
||||
doTestEscapedDeletion("ab &c");
|
||||
doTestEscapedDeletion("abc &");
|
||||
doTestEscapedDeletion("& abc");
|
||||
doTestEscapedDeletion("a& bc");
|
||||
doTestEscapedDeletion("ab& c");
|
||||
doTestEscapedDeletion("abc& ");
|
||||
}
|
||||
|
||||
private static void doTestEscapedInsertion(final String text, final String textToInsert) throws IncorrectOperationException {
|
||||
String tagText = toEscapedText(text);
|
||||
for (int i = 0; i <= text.length(); i++) {
|
||||
XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + tagText + "</a>");
|
||||
final PsiElement[] children = tag.getValue().getTextElements();
|
||||
assertEquals(1, children.length);
|
||||
final XmlText xmlText = (XmlText)children[0];
|
||||
assertEquals(tagText, xmlText.getText());
|
||||
xmlText.insertText(textToInsert, i);
|
||||
final StringBuffer expectedDisplay = new StringBuffer(text.replace('_', '\u00a0'));
|
||||
expectedDisplay.insert(i, textToInsert);
|
||||
assertEquals(expectedDisplay.toString(), xmlText.getValue());
|
||||
|
||||
// final String expectedText = toEscapedText(expectedDisplay.toString());
|
||||
// assertEquals(expectedText, xmlText.getText());
|
||||
}
|
||||
}
|
||||
|
||||
private static void doTestEscapedDeletion(final String text) throws IncorrectOperationException {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
String tagText = toEscapedText(text);
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
for (int j = i; j < text.length(); j++) {
|
||||
XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>" + tagText + "</a>");
|
||||
final PsiElement[] children = tag.getValue().getTextElements();
|
||||
assertEquals(1, children.length);
|
||||
final XmlText xmlText = (XmlText)children[0];
|
||||
assertEquals(tagText, xmlText.getText());
|
||||
xmlText.removeText(i, j);
|
||||
final StringBuffer expectedDisplay = new StringBuffer(text.replace('_', ' '));
|
||||
expectedDisplay.delete(i, j);
|
||||
assertEquals(expectedDisplay.toString(), xmlText.getValue());
|
||||
|
||||
final String expectedText = toEscapedText(expectedDisplay.toString());
|
||||
assertEquals(expectedText, xmlText.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testWhitespacesInEmptyXHTMLTag() throws Exception{
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a> <b/> </a>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tag.findFirstSubTag("b").delete();
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("<a> </a>", tag.getText());
|
||||
}
|
||||
|
||||
public void test2() throws Exception {
|
||||
XmlFile file = (XmlFile)createFile("file.xml", "<a>x y</a>");
|
||||
XmlTag tag = file.getDocument().getRootTag();
|
||||
final XmlText xmlText = tag.getValue().getTextElements()[0];
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
xmlText.insertText("z", 1);
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}, "", null, UndoConfirmationPolicy.DO_NOT_REQUEST_CONFIRMATION);
|
||||
}
|
||||
});
|
||||
assertEquals("<a>xz y</a>", tag.getText());
|
||||
}
|
||||
|
||||
private static String toDisplay(String text) {
|
||||
text = text.replaceAll("<", "<");
|
||||
text = text.replaceAll(">", ">");
|
||||
text = text.replaceAll("&", "&");
|
||||
text = text.replaceAll("'", "'");
|
||||
text = text.replaceAll(""", "\"");
|
||||
text = text.replaceAll("<!\\[CDATA\\[", "");
|
||||
text = text.replaceAll("\\]\\]>", "");
|
||||
return text.replaceAll(" ", "_");
|
||||
}
|
||||
|
||||
private static String toEscapedText(String original) {
|
||||
String text = original.replaceAll("<", "<");
|
||||
text = text.replaceAll(">", ">");
|
||||
text = text.replaceAll("&", "&");
|
||||
text = text.replaceAll("'", "'");
|
||||
text = text.replaceAll("\"", """);
|
||||
text = text.replaceAll("_", " ");
|
||||
assertEquals(original, toDisplay(text));
|
||||
return text;
|
||||
}
|
||||
|
||||
public void testCoordinateMappingConsistent() throws Exception {
|
||||
doCoordinateMappingConsistentFromDisplayText("abc");
|
||||
doCoordinateMappingConsistentFromDisplayText(" abc");
|
||||
doCoordinateMappingConsistentFromDisplayText(" a bc");
|
||||
doCoordinateMappingConsistentFromDisplayText(" a b c");
|
||||
doCoordinateMappingConsistentFromDisplayText(" a b c ");
|
||||
doCoordinateMappingConsistentFromDisplayText(" ab c ");
|
||||
doCoordinateMappingConsistentFromDisplayText(" abc ");
|
||||
doCoordinateMappingConsistentFromDisplayText("abc ");
|
||||
|
||||
doCoordinateMappingConsistentFromDisplayText(" ");
|
||||
doCoordinateMappingConsistentFromDisplayText("&");
|
||||
|
||||
doCoordinateMappingConsistentFromDisplayText("&abc");
|
||||
doCoordinateMappingConsistentFromDisplayText(" &abc");
|
||||
doCoordinateMappingConsistentFromDisplayText(" a& bc");
|
||||
doCoordinateMappingConsistentFromDisplayText(" a &b c");
|
||||
doCoordinateMappingConsistentFromDisplayText(" a b& c ");
|
||||
doCoordinateMappingConsistentFromDisplayText(" ab c& ");
|
||||
doCoordinateMappingConsistentFromDisplayText(" ab&c ");
|
||||
doCoordinateMappingConsistentFromDisplayText("abc &");
|
||||
doCoordinateMappingConsistentFromDisplayText("abc&");
|
||||
doCoordinateMappingConsistentFromDisplayText("ab&c&");
|
||||
doCoordinateMappingConsistentFromDisplayText("ab&c");
|
||||
doCoordinateMappingConsistentFromDisplayText("a&b&c");
|
||||
|
||||
doCoordinateMappingConsistentFromEscapedText("<![CDATA[ ]]>");
|
||||
doCoordinateMappingConsistentFromEscapedText("<![CDATA[x]]>");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x]]>");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x]]>xxx");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx&<![CDATA[x]]>xxx");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx&<![CDATA[x]]>&xxx");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x]]>&xxx");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[xas]]>&xxx");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[xa>s]]>&xxx");
|
||||
doCoordinateMappingConsistentFromEscapedText("xxx<![CDATA[x<a>s]]>&xxx");
|
||||
}
|
||||
|
||||
public void testNBSP() throws Exception {
|
||||
final XmlTag tagA = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a>1<b> </b></a>");
|
||||
|
||||
final XmlTag tagB = tagA.findFirstSubTag("b");
|
||||
final XmlTagChild nbsp = tagB.getValue().getChildren()[0];
|
||||
assertEquals(" ", nbsp.getText());
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tagA.addBefore(nbsp.copy(), tagB);
|
||||
}
|
||||
});
|
||||
|
||||
XmlTagChild nbsp1 = tagA.getValue().getChildren()[0];
|
||||
assertEquals("1 ", nbsp1.getText());
|
||||
}
|
||||
|
||||
private static void doCoordinateMappingConsistentFromDisplayText(final String text) throws IncorrectOperationException {
|
||||
doCoordinateMappingConsistentFromEscapedText(toEscapedText(text));
|
||||
}
|
||||
|
||||
private static void doCoordinateMappingConsistentFromEscapedText(final String tagText) throws IncorrectOperationException {
|
||||
String text = toDisplay(tagText);
|
||||
XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<a>" + tagText + "</a>");
|
||||
final PsiElement[] children = tag.getValue().getTextElements();
|
||||
assertEquals(1, children.length);
|
||||
final XmlText xmlText = (XmlText)children[0];
|
||||
assertEquals(tagText, xmlText.getText());
|
||||
|
||||
for (int i = 0; i <= text.length(); i++) {
|
||||
final int physical = xmlText.displayToPhysical(i);
|
||||
final int display = xmlText.physicalToDisplay(physical);
|
||||
assertEquals("Coords mapping failed for: '" + tagText + "' - " + physical, display, i);
|
||||
}
|
||||
|
||||
assertEquals("Coords mapping failed for: '" + tagText + "'", 0, xmlText.physicalToDisplay(0));
|
||||
assertEquals(tagText.length(), xmlText.displayToPhysical(text.length()));
|
||||
assertEquals(text.length(), xmlText.physicalToDisplay(tagText.length()));
|
||||
}
|
||||
|
||||
public void testStrangeCharactesInText() throws Throwable {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
XmlElementFactory.getInstance(getProject()).createTagFromText("<a/>").getValue().setText("@#$%@$%$${${''}");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testPsiToDocumentSynchronizationFailed() throws Throwable {
|
||||
String text = "<wpd><methods> </methods></wpd>";
|
||||
final File tempFile = FileUtil.createTempFile("idea-test", ".xml");
|
||||
tempFile.createNewFile();
|
||||
final FileOutputStream fileOutputStream = new FileOutputStream(tempFile);
|
||||
fileOutputStream.write(text.getBytes());
|
||||
fileOutputStream.flush();
|
||||
fileOutputStream.close();
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
@SuppressWarnings({"ConstantConditions"})
|
||||
public void run() {
|
||||
VirtualFileManager.getInstance().refresh(false);
|
||||
XmlFile file ;//createTemporaryFile("wpd.xml", text));
|
||||
try {
|
||||
file = (XmlFile)getPsiManager().findFile(VfsUtil.findFileByURL(tempFile.toURL()));
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
final XmlTag methodTag = file.getDocument().getRootTag().findFirstSubTag("methods");
|
||||
try {
|
||||
methodTag.add(XmlElementFactory.getInstance(getProject()).createTagFromText("<method/>"));
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}, "", null, UndoConfirmationPolicy.DO_NOT_REQUEST_CONFIRMATION);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testXmlFormattingException() throws Throwable {
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo>bar</foo>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tag.add(XmlElementFactory.getInstance(getProject()).createTagFromText("<bar/>"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testSetNamespace() throws Exception {
|
||||
XmlFile xhtmlFile = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("dummy.xml",
|
||||
"<html><body/></html>");
|
||||
|
||||
final XmlTag rootTag = xhtmlFile.getDocument().getRootTag();
|
||||
|
||||
rootTag.getSubTags()[0].getNamespace(); // fill the cache
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootTag.setAttribute("xmlns", "http://www.ru");
|
||||
}
|
||||
});
|
||||
|
||||
assertEquals("http://www.ru", rootTag.getSubTags()[0].getNamespace());
|
||||
}
|
||||
|
||||
public void testInsert() throws Exception {
|
||||
String html = "<html><head /><body><hr /></body>\n</html>";
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("xxx.xhtml", html);
|
||||
XmlTag body = file.getDocument().getRootTag().findFirstSubTag("body");
|
||||
final XmlTag hr = body.getSubTags()[0];
|
||||
|
||||
final XmlText text = XmlElementFactory.getInstance(getProject()).createDisplayText("p");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
PsiElement element = hr.getParentTag().addAfter(text, hr);
|
||||
assertEquals(element.getParent(), hr.getParentTag());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void testCollapse() throws IncorrectOperationException {
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo></foo>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
tag.collapseIfEmpty();
|
||||
assertEquals("<foo/>", tag.getText());
|
||||
|
||||
final XmlTag tag1 = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo>abc</foo>");
|
||||
tag1.collapseIfEmpty();
|
||||
assertEquals("<foo/>", tag1.getText());
|
||||
|
||||
final XmlTag tag2 = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo><boo/></foo>");
|
||||
tag2.collapseIfEmpty();
|
||||
assertEquals("<foo><boo/></foo>", tag2.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.psi.XmlElementFactory;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.psi.xml.XmlText;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
|
||||
/**
|
||||
* @author lesya, dsl
|
||||
*/
|
||||
public class XmlTagWriteTest extends LightCodeInsightTestCase{
|
||||
public void test1() throws IncorrectOperationException {
|
||||
XmlElementFactory elementFactory = XmlElementFactory.getInstance(getProject());
|
||||
final XmlTag xmlTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<tag1/>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlTag.add(xmlTag.createChildTag("tag2", XmlUtil.EMPTY_URI, null, false));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
assertEquals("<tag1><tag2/></tag1>", xmlTag.getText());
|
||||
XmlTag createdFromText = elementFactory.createTagFromText(xmlTag.getText());
|
||||
assertEquals("tag1", createdFromText.getName());
|
||||
assertEquals(1, createdFromText.getSubTags().length);
|
||||
assertEquals("tag2", createdFromText.getSubTags()[0].getName());
|
||||
}
|
||||
|
||||
public void test2() throws IncorrectOperationException {
|
||||
final XmlTag xmlTag = XmlElementFactory.getInstance(getProject()).createTagFromText("<tag1></tag1>");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
xmlTag.add(xmlTag.createChildTag("tag2", XmlUtil.EMPTY_URI, null, false));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
assertEquals("<tag1><tag2/></tag1>", xmlTag.getText());
|
||||
XmlTag createdFromText = XmlElementFactory.getInstance(getProject()).createTagFromText(xmlTag.getText());
|
||||
assertEquals("tag1", createdFromText.getName());
|
||||
assertEquals(1, createdFromText.getSubTags().length);
|
||||
assertEquals("tag2", createdFromText.getSubTags()[0].getName());
|
||||
}
|
||||
|
||||
public void test3() throws Exception{
|
||||
final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<b>\n0123456</b>");
|
||||
final XmlText text = (XmlText) tag.getValue().getChildren()[0];
|
||||
String textS = text.getText();
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
text.insertText("lala", 2);
|
||||
}
|
||||
});
|
||||
|
||||
XmlText text2 = (XmlText)tag.getValue().getChildren()[0];
|
||||
assertEquals(textS.substring(0, 2) + "lala" + textS.substring(2), text2.getText());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFileFactory;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class XmlTestUtil {
|
||||
|
||||
public static XmlTag tag(@NonNls String tagName, Project project) throws Exception {
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(project).createFileFromText("tag.xml", "<" + tagName + "/>");
|
||||
return file.getDocument().getRootTag();
|
||||
}
|
||||
|
||||
public static XmlTag tag(@NonNls String tagName, @NonNls String namespace, Project project) throws Exception {
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(project)
|
||||
.createFileFromText("tag.xml", "<" + tagName + " xmlns=\"" + namespace + "\"/>");
|
||||
return file.getDocument().getRootTag();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.psi.PsiFileFactory;
|
||||
import com.intellij.psi.XmlElementFactory;
|
||||
import com.intellij.psi.impl.source.codeStyle.CodeEditUtil;
|
||||
import com.intellij.psi.xml.XmlElement;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.psi.xml.XmlText;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
|
||||
/**
|
||||
* @author mike
|
||||
*/
|
||||
public class XmlTextTest extends LightCodeInsightTestCase {
|
||||
public void testInsertAtOffset() throws Exception {
|
||||
new WriteCommandAction(getProject()) {
|
||||
|
||||
@Override
|
||||
protected void run(final Result result) throws Throwable {
|
||||
String xml = "<root>0123456789</root>";
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject())
|
||||
.createFileFromText("foo.xml", StdFileTypes.XML, xml, (long)1, true, false);
|
||||
//System.out.println(DebugUtil.psiToString(file, false));
|
||||
XmlTag root = file.getDocument().getRootTag();
|
||||
final XmlText text1 = root.getValue().getTextElements()[0];
|
||||
|
||||
assertFalse(CodeEditUtil.isNodeGenerated(root.getNode()));
|
||||
final XmlText text = text1;
|
||||
|
||||
final XmlElement element = text.insertAtOffset(XmlElementFactory.getInstance(getProject()).createTagFromText("<bar/>"), 5);
|
||||
assertNotNull(element);
|
||||
assertTrue(element instanceof XmlText);
|
||||
assertEquals("01234", element.getText());
|
||||
assertEquals("<root>01234<bar/>56789</root>", text.getContainingFile().getText());
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
public void testPhysicalToDisplayIfHasGaps2() throws Exception {
|
||||
String xml = "<div>&abc</div>";
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("foo.xml", xml);
|
||||
XmlTag root = file.getDocument().getRootTag();
|
||||
final XmlText text = root.getValue().getTextElements()[0];
|
||||
|
||||
assertEquals("&abc", text.getValue());
|
||||
assertEquals(0, text.physicalToDisplay(0));
|
||||
assertEquals(1, text.physicalToDisplay(5));
|
||||
assertEquals(2, text.physicalToDisplay(6));
|
||||
assertEquals(3, text.physicalToDisplay(7));
|
||||
assertEquals(4, text.physicalToDisplay(8));
|
||||
}
|
||||
|
||||
public void testDisplayToPhysical() throws Exception {
|
||||
String xml = "<div>&abc</div>";
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("foo.xml", xml);
|
||||
XmlTag root = file.getDocument().getRootTag();
|
||||
final XmlText text = root.getValue().getTextElements()[0];
|
||||
|
||||
assertEquals("&abc", text.getValue());
|
||||
assertEquals(0, text.displayToPhysical(0));
|
||||
assertEquals(5, text.displayToPhysical(1));
|
||||
assertEquals(6, text.displayToPhysical(2));
|
||||
assertEquals(7, text.displayToPhysical(3));
|
||||
assertEquals(8, text.displayToPhysical(4));
|
||||
}
|
||||
|
||||
public void testDisplayToPhysical2() throws Exception {
|
||||
String xml = "<div><![CDATA[ ]]></div>";
|
||||
XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("foo.xml", xml);
|
||||
XmlTag root = file.getDocument().getRootTag();
|
||||
final XmlText text = root.getValue().getTextElements()[0];
|
||||
|
||||
assertEquals(" ", text.getValue());
|
||||
assertEquals(9, text.displayToPhysical(0));
|
||||
assertEquals(13, text.displayToPhysical(1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
public class XmlWrongClosingTagNameInspectionTest extends LightQuickFixTestCase {
|
||||
public void test() throws Exception { doAllTests(); }
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/wrongClosingTagName";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/inspections";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.xml.XmlFile
|
||||
import com.intellij.psi.xml.XmlTag
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.openapi.application.WriteAction
|
||||
|
||||
/**
|
||||
* @author mike
|
||||
*/
|
||||
public class XmlXIncludeTest extends LightCodeInsightFixtureTestCase {
|
||||
private static final String BASE_PATH = "/psi/xi";
|
||||
|
||||
public void testBasicXi() throws Exception {
|
||||
configure();
|
||||
assertSubtagNames("before", "include1", "after");
|
||||
}
|
||||
|
||||
public void testXpointerXi1() throws Exception {
|
||||
configure();
|
||||
assertSubtagNames("before", "foo", "bar", "after");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/xml/tests/testData/" + BASE_PATH;
|
||||
}
|
||||
|
||||
private void assertSubtagNames(String... expectedNames) {
|
||||
final XmlTag tag = ((XmlFile)myFixture.file).document.rootTag
|
||||
final List<String> names = tag.getSubTags().collect { it.name }
|
||||
|
||||
assertEquals(
|
||||
"subtags are different",
|
||||
StringUtil.join(expectedNames, "\n"), StringUtil.join(names, "\n")
|
||||
);
|
||||
}
|
||||
|
||||
private void configure() throws Exception {
|
||||
myFixture.configureByFiles(getName() + ".xml", "/include1.xml");
|
||||
}
|
||||
|
||||
public void testModifyingIncludedFile() {
|
||||
myFixture.configureByText 'a.xml', '''
|
||||
<root xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<before/>
|
||||
<xi:include href="include1.xml" xpointer="xpointer(/include1/*)"/>
|
||||
<after/>
|
||||
</root>
|
||||
'''
|
||||
def inc1 = myFixture.copyFileToProject("include1.xml")
|
||||
assertSubtagNames("before", "foo", "bar", "after")
|
||||
|
||||
changeText inc1, '<include1><a/></include1>'
|
||||
|
||||
assertSubtagNames("before", "a", "after")
|
||||
}
|
||||
|
||||
public void testModifyingTransitivelyIncludedFile() {
|
||||
myFixture.configureByText 'a.xml', '''
|
||||
<root xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<before/>
|
||||
<xi:include href="include1.xml" xpointer="xpointer(/include1/*)"/>
|
||||
<after/>
|
||||
</root>
|
||||
'''
|
||||
myFixture.addFileToProject("include1.xml", """
|
||||
<include1 xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<foo attr1="val1"> <fooChild/> </foo>
|
||||
<bar/>
|
||||
<xi:include href="include2.xml""/>
|
||||
</include1>
|
||||
""")
|
||||
def inc2 = myFixture.addFileToProject("include2.xml", '<a/>')
|
||||
|
||||
assertSubtagNames("before", "foo", "bar", "a", "after")
|
||||
|
||||
changeText inc2.virtualFile, '<b/>'
|
||||
|
||||
assertSubtagNames("before", "foo", "bar", "b", "after")
|
||||
|
||||
}
|
||||
|
||||
private changeText(VirtualFile inc1, String s) {
|
||||
def token = WriteAction.start()
|
||||
try {
|
||||
FileDocumentManager.instance.getDocument(inc1).setText s
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
}
|
||||
finally {
|
||||
token.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupManagerImpl;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
@SuppressWarnings({"ALL"})
|
||||
public class XmlSmartEnterTest extends LightCodeInsightTestCase {
|
||||
private static final String BASE_PATH = "/smartEnter";
|
||||
private LookupElement[] myItems;
|
||||
|
||||
public void testSmartFinish1() throws Throwable {
|
||||
doCompletionPopupTest(getTestName(false));
|
||||
}
|
||||
|
||||
public void testSmartFinish2() throws Throwable {
|
||||
boolean old = CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION;
|
||||
CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = false;
|
||||
try {
|
||||
doCompletionPopupTest(getTestName(false));
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_CODE_COMPLETION = old;
|
||||
}
|
||||
}
|
||||
|
||||
public void testSmartFinish3() throws Exception {
|
||||
doSmartEnterTest("SmartFinish1");
|
||||
}
|
||||
|
||||
public void testSmartFinish4() throws Exception {
|
||||
doSmartEnterTest("SmartFinish2");
|
||||
}
|
||||
|
||||
public void testSmartFinish5() throws Exception {
|
||||
doSmartEnterTest("SmartFinish3");
|
||||
}
|
||||
|
||||
public void testSmartFinish_IDEADEV_29628() throws Exception {
|
||||
doSmartEnterTest("IDEADEV_29628");
|
||||
}
|
||||
|
||||
public void testSmartFinishWithWrongAttribute() throws Exception {
|
||||
doSmartEnterTest("WrongAttribute");
|
||||
}
|
||||
|
||||
public void testOpenAttribute() throws Exception {
|
||||
doSmartEnterTest("OpenAttribute");
|
||||
}
|
||||
|
||||
public void testComplete1() throws Exception {
|
||||
_doTest("Tag.xml", "Tag_after.xml");
|
||||
}
|
||||
|
||||
private void doCompletionPopupTest(String baseName) throws Exception {
|
||||
_doTestCompletion(baseName + ".xml", baseName + "_after.xml");
|
||||
}
|
||||
|
||||
private void _doTestCompletion(final String name, final String after_name) throws Exception {
|
||||
configureByFile(BASE_PATH + "/" + name);
|
||||
performCompletionAction();
|
||||
select(Lookup.COMPLETE_STATEMENT_SELECT_CHAR);
|
||||
checkResultByFile(BASE_PATH + "/" + after_name);
|
||||
}
|
||||
|
||||
private void doSmartEnterTest(String baseName) throws Exception {
|
||||
_doTest(baseName + ".xml", baseName + "_after.xml");
|
||||
}
|
||||
|
||||
private void _doTest(String filename, String filename_after) throws Exception {
|
||||
configureByFile(BASE_PATH + "/" + filename);
|
||||
|
||||
new WriteCommandAction(getProject()) {
|
||||
protected void run(final Result result) throws Throwable {
|
||||
new XmlSmartEnterProcessor().process(getProject(), getEditor(), getFile());
|
||||
}
|
||||
}.execute();
|
||||
|
||||
checkResultByFile("", BASE_PATH + "/" + filename_after, true);
|
||||
}
|
||||
|
||||
private void performCompletionAction() {
|
||||
new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(getProject(), getEditor());
|
||||
final LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(getEditor());
|
||||
myItems = lookup == null ? null : lookup.getItems().toArray(LookupElement.EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
private void select(final char c) {
|
||||
if (c != '\n' && c != '\t' && c != Lookup.COMPLETE_STATEMENT_SELECT_CHAR) {
|
||||
type(c);
|
||||
return;
|
||||
}
|
||||
|
||||
final LookupManagerImpl manager = (LookupManagerImpl) LookupManager.getInstance(getProject());
|
||||
final Lookup lookup = manager.getActiveLookup();
|
||||
if(lookup != null) {
|
||||
manager.forceSelection(c, lookup.getCurrentItem());
|
||||
}
|
||||
}
|
||||
|
||||
protected String getBasePath() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.intellij.codeInsight.editorActions.moveUpDown;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightTestCase;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
@SuppressWarnings({"ALL"})
|
||||
public class XmlMoverTest extends CodeInsightTestCase {
|
||||
|
||||
public void testTag() throws Exception { doTest("xml"); }
|
||||
public void testTag2() throws Exception { doTest("xml"); }
|
||||
public void testTag3() throws Exception { doTest("xml"); }
|
||||
public void testTag4() throws Exception { doTest("xml"); }
|
||||
public void testTag5() throws Exception { doTest("xml"); }
|
||||
public void testTag6() throws Exception { doTest("xml"); }
|
||||
public void testTag7() throws Exception { doTest("xml"); }
|
||||
public void testTag8() throws Exception { doTest("xml"); }
|
||||
public void testTag9() throws Exception { doTest("xml"); }
|
||||
public void testTag10() throws Exception { doTest("xml"); }
|
||||
public void testTag11() throws Exception { doTest("xml"); }
|
||||
|
||||
public void test1() throws Exception { doTest("html"); }
|
||||
|
||||
private void doTest(String ext) throws Exception {
|
||||
final String baseName = getBasePath() + '/' + getTestName(true);
|
||||
final String fileName = baseName + "."+ext;
|
||||
|
||||
try {
|
||||
@NonNls String afterFileName = baseName + "_afterUp." + ext;
|
||||
EditorActionHandler handler = new MoveStatementUpAction().getHandler();
|
||||
performAction(fileName, handler, afterFileName);
|
||||
|
||||
afterFileName = baseName + "_afterDown." + ext;
|
||||
handler = new MoveStatementDownAction().getHandler();
|
||||
performAction(fileName, handler, afterFileName);
|
||||
}
|
||||
finally {
|
||||
//CodeStyleSettingsManager.getInstance(myProject).dropTemporarySettings();
|
||||
}
|
||||
}
|
||||
|
||||
private void performAction(final String fileName, final EditorActionHandler handler, final String afterFileName) throws Exception {
|
||||
configureByFile(fileName);
|
||||
final boolean enabled = handler.isEnabled(myEditor, null);
|
||||
assertEquals(new File(getTestDataPath(), afterFileName).exists(), enabled);
|
||||
if (enabled) {
|
||||
handler.execute(myEditor, null);
|
||||
checkResultByFile(afterFileName);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/mover";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.intellij.psi.formatter;
|
||||
|
||||
import com.intellij.psi.impl.source.xml.XmlFileImpl;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public abstract class XmlFormatterTestBase extends XmlFormatterTestCase {
|
||||
protected void checkFormattingDoesNotProduceException(String name) throws Exception {
|
||||
|
||||
String text = loadFile(name + ".xml", null);
|
||||
final XmlFileImpl file = (XmlFileImpl)createFile(name + ".xml", text);
|
||||
myTextRange = new TextRange(10000, 10001);
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
performFormatting(file);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, "", "");
|
||||
|
||||
myTextRange = new TextRange(1000000, 1000001);
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
performFormatting(file);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, "", "");
|
||||
myTextRange = new TextRange(0, text.length());
|
||||
CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
performFormatting(file);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, "", "");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.intellij.psi.formatter;
|
||||
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.psi.formatter.xml.XmlCodeStyleSettings;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class XmlFormatterTestCase extends FormatterTestCase{
|
||||
|
||||
public void testDontKeepLineBreaksInText() throws Throwable {
|
||||
final CodeStyleSettings settings = getSettings();
|
||||
final XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
|
||||
settings.RIGHT_MARGIN = 15;
|
||||
|
||||
settings.HTML_KEEP_LINE_BREAKS_IN_TEXT = false;
|
||||
xmlSettings.XML_KEEP_LINE_BREAKS_IN_TEXT = false;
|
||||
doTextTest("<tag>aaa\nbbb\nccc\nddd\n</tag>", "<tag>aaa bbb\n ccc ddd\n</tag>");
|
||||
|
||||
settings.HTML_TEXT_WRAP = CodeStyleSettings.DO_NOT_WRAP;
|
||||
xmlSettings.XML_TEXT_WRAP = CodeStyleSettings.DO_NOT_WRAP;
|
||||
doTextTest("<tag>aaa\nbbb\nccc\nddd\n</tag>", "<tag>aaa bbb ccc ddd\n</tag>");
|
||||
}
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.intellij.psi.impl.source.html;
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
@SuppressWarnings({"ALL"})
|
||||
public class HtmlConditionalCommentInjectionTest extends CompletionTestCase {
|
||||
|
||||
public void testHtmlCompletion() throws Exception {
|
||||
configureByFile("complete.html");
|
||||
checkResultByFile("complete_after.html");
|
||||
}
|
||||
|
||||
public void testXhtmlCompletion() throws Exception {
|
||||
configureByFile("complete.xhtml");
|
||||
checkResultByFile("complete_after.xhtml");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/commentInjection/";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.intellij.xml;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
import com.intellij.xml.actions.ValidateXmlActionHandler;
|
||||
import org.apache.xerces.impl.Constants;
|
||||
import org.apache.xerces.impl.xs.XSComplexTypeDecl;
|
||||
import org.apache.xerces.impl.xs.XSElementDecl;
|
||||
import org.apache.xerces.impl.xs.models.CMBuilder;
|
||||
import org.apache.xerces.impl.xs.models.CMNodeFactory;
|
||||
import org.apache.xerces.impl.xs.models.XSCMValidator;
|
||||
import org.apache.xerces.xni.grammars.Grammar;
|
||||
import org.apache.xerces.xni.grammars.XMLGrammarDescription;
|
||||
import org.apache.xerces.xni.grammars.XMLGrammarPool;
|
||||
import org.apache.xerces.xni.grammars.XSGrammar;
|
||||
import org.apache.xerces.xs.XSComplexTypeDefinition;
|
||||
import org.apache.xerces.xs.XSElementDeclaration;
|
||||
import org.apache.xerces.xs.XSModel;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
@SuppressWarnings({"UseOfObsoleteCollectionType"})
|
||||
public class XmlConstraintsTest extends CodeInsightFixtureTestCase {
|
||||
|
||||
public void testXercesGrammar() throws Exception {
|
||||
XSModel xsModel = getXSModel("test.xml", "test.xsd");
|
||||
XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration("a", "");
|
||||
XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
|
||||
CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
|
||||
XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
|
||||
int[] ints = validator.startContentModel();
|
||||
Vector vector = validator.whatCanGoHere(ints);
|
||||
XSElementDecl o = (XSElementDecl)vector.get(0);
|
||||
assertEquals("b", o.getName());
|
||||
}
|
||||
|
||||
public void testXercesIncomplete() throws Exception {
|
||||
XSModel xsModel = getXSModel("testIncomplete.xml", "test.xsd");
|
||||
XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration("a", "");
|
||||
XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
|
||||
CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
|
||||
XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
|
||||
int[] ints = validator.startContentModel();
|
||||
Vector vector = validator.whatCanGoHere(ints);
|
||||
XSElementDecl o = (XSElementDecl)vector.get(0);
|
||||
assertEquals("b", o.getName());
|
||||
}
|
||||
|
||||
public void testXercesForCompletion() throws Exception {
|
||||
XSModel xsModel = getXSModel("testCompletion.xml", "test.xsd");
|
||||
PsiElement element = myFixture.getFile().findElementAt(getEditor().getCaretModel().getOffset());
|
||||
XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
|
||||
|
||||
assert tag != null;
|
||||
XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration(tag.getLocalName(), tag.getNamespace());
|
||||
XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
|
||||
CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
|
||||
XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
|
||||
int[] ints = validator.startContentModel();
|
||||
Vector vector = validator.whatCanGoHere(ints);
|
||||
XSElementDecl o = (XSElementDecl)vector.get(0);
|
||||
assertEquals("b", o.getName());
|
||||
}
|
||||
|
||||
private XSModel getXSModel(String... files) {
|
||||
myFixture.configureByFiles(files);
|
||||
|
||||
XmlFile file = (XmlFile)myFixture.getFile();
|
||||
ValidateXmlActionHandler handler = new ValidateXmlActionHandler(false) {
|
||||
@Override
|
||||
protected SAXParser createParser() throws SAXException, ParserConfigurationException {
|
||||
SAXParser parser = super.createParser();
|
||||
parser.getXMLReader().setFeature(Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE, true);
|
||||
return parser;
|
||||
}
|
||||
};
|
||||
handler.setErrorReporter(handler.new TestErrorReporter());
|
||||
handler.doValidate(file);
|
||||
XMLGrammarPool grammarPool = ValidateXmlActionHandler.getGrammarPool(file);
|
||||
assert grammarPool != null;
|
||||
Grammar[] grammars = grammarPool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA);
|
||||
XSGrammar grammar = (XSGrammar)grammars[0];
|
||||
return grammar.toXSModel();
|
||||
}
|
||||
|
||||
public void testXsdConstraints() throws Exception {
|
||||
Map<String, XmlElementDescriptor> map = configure("test.xml", "test.xsd");
|
||||
XmlElementDescriptor a = map.get("a");
|
||||
XmlElementsGroup topGroup = a.getTopGroup();
|
||||
}
|
||||
|
||||
public void testDtdConstraints() throws Exception {
|
||||
|
||||
Map<String, XmlElementDescriptor> map = configure("testDtd.xml");
|
||||
XmlElementDescriptor a = map.get("a");
|
||||
XmlElementDescriptor b = map.get("b");
|
||||
|
||||
XmlElementDescriptor c = map.get("c");
|
||||
|
||||
XmlElementDescriptor d = map.get("d");
|
||||
|
||||
XmlElementDescriptor e = map.get("e");
|
||||
}
|
||||
|
||||
private Map<String, XmlElementDescriptor> configure(String... files) {
|
||||
myFixture.configureByFiles(files);
|
||||
XmlTag tag = ((XmlFile)getFile()).getRootTag();
|
||||
assertNotNull(tag);
|
||||
XmlElementDescriptor descriptor = tag.getDescriptor();
|
||||
assertNotNull(descriptor);
|
||||
XmlElementDescriptor[] descriptors = descriptor.getElementsDescriptors(tag);
|
||||
Map<String, XmlElementDescriptor> map =
|
||||
ContainerUtil.assignKeys(Arrays.asList(descriptors).iterator(), new Convertor<XmlElementDescriptor, String>() {
|
||||
@Override
|
||||
public String convert(XmlElementDescriptor o) {
|
||||
return o.getName();
|
||||
}
|
||||
});
|
||||
map.put(tag.getName(), tag.getDescriptor());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/xml/tests/testData/constraints";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isCommunity() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
package com.intellij.xml;
|
||||
|
||||
import com.intellij.codeInsight.actions.OptimizeImportsProcessor;
|
||||
import com.intellij.codeInsight.daemon.impl.analysis.XmlUnusedNamespaceInspection;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInspection.htmlInspections.XmlInspectionToolProvider;
|
||||
import com.intellij.javaee.ExternalResourceManagerImpl;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.testFramework.IdeaTestCase;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
public class XmlNamespacesTest extends CodeInsightFixtureTestCase {
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public XmlNamespacesTest() {
|
||||
IdeaTestCase.initPlatformPrefix();
|
||||
}
|
||||
|
||||
public void testUnusedNamespaces() throws Exception {
|
||||
doUnusedDeclarationTest(
|
||||
"<all xmlns=\"http://www.w3.org/2001/XMLSchema\" <warning descr=\"Namespace declaration is never used\">xmlns:xsi=\"http://www.w3.org/2001/XMLSc<caret>hema-instance\"</warning>/>",
|
||||
"<all xmlns=\"http://www.w3.org/2001/XMLSchema\"/>", XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME);
|
||||
}
|
||||
|
||||
public void testUnusedDefaultNamespace() throws Exception {
|
||||
doUnusedDeclarationTest("<schema:schema \n" +
|
||||
" xmlns:schema=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" <warning descr=\"Namespace declaration is never used\">xmlns=\"http://www.w3.org/2001/X<caret>Include\"</warning>\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" <warning descr=\"Namespace location is never used\">xsi:noNamespaceSchemaLocation=\"http://www.w3.org/2001/XInclude\"</warning>>\n" +
|
||||
"</schema:schema>",
|
||||
|
||||
"<schema:schema\n" +
|
||||
" xmlns:schema=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" >\n" +
|
||||
"</schema:schema>", XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME, false);
|
||||
|
||||
doOptimizeImportsTest("<schema:schema \n" +
|
||||
" xmlns:schema=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" >\n" +
|
||||
"</schema:schema>");
|
||||
}
|
||||
|
||||
public void testDifferentPrefixes() throws Exception {
|
||||
doUnusedDeclarationTest(
|
||||
"<x:all <warning descr=\"Namespace declaration is never used\">xmlns=\"http://www.w3.org/2001/XMLS<caret>chema\"</warning>\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" <warning descr=\"Namespace declaration is never used\">xmlns:y=\"http://www.w3.org/2001/XMLSchema\"</warning>/>",
|
||||
|
||||
"<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:y=\"http://www.w3.org/2001/XMLSchema\"/>",
|
||||
XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME, false);
|
||||
|
||||
doOptimizeImportsTest("<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" />");
|
||||
}
|
||||
|
||||
public void testUnusedLocation() throws Exception {
|
||||
doUnusedDeclarationTest("<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" xsi:schemaLocation=\"<warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XML<caret>Sche</warning> " +
|
||||
"<warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XMLSchema.xsd</warning>\"/>",
|
||||
"<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" />",
|
||||
XmlUnusedNamespaceInspection.RemoveNamespaceLocationFix.NAME);
|
||||
}
|
||||
|
||||
public void testUnusedLocationOnly() throws Exception {
|
||||
doUnusedDeclarationTest("<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" <warning descr=\"Namespace declaration is never used\">xmlns:y=\"http://www.w3.org/2001/XInclude\"</warning>\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" xsi:schemaLocation=\"<warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XI<caret>nclude</warning> <warning descr=\"Namespace location is never used\">http://www.w3.org/2001/XInclude.xsd</warning>\n" +
|
||||
" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd\"/>",
|
||||
"<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" xsi:schemaLocation=\"http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd\"/>",
|
||||
XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME);
|
||||
}
|
||||
|
||||
public void testUnusedDefaultLocation() throws Exception {
|
||||
doUnusedDeclarationTest("<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" <warning descr=\"Namespace location is never used\">xsi:noNamespaceSc<caret>hemaLocation=\"<error descr=\"Cannot resolve file 'zzz'\">zzz</error>\"</warning> />",
|
||||
"<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" />",
|
||||
XmlUnusedNamespaceInspection.RemoveNamespaceLocationFix.NAME);
|
||||
}
|
||||
|
||||
public void testKeepFormatting() throws Exception {
|
||||
doUnusedDeclarationTest("<xs:schema attributeFormDefault=\"unqualified\"\n" +
|
||||
" <warning descr=\"Namespace declaration is never used\">xmlns:xsi=\"http://www.w3.org/20<caret>01/XMLSchema-instance\"</warning>\n" +
|
||||
" elementFormDefault=\"qualified\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
|
||||
"\n" +
|
||||
" <!-- keep formatting here-->\n" +
|
||||
" <xs:element name=\"a\" type=\"aType\"/>\n" +
|
||||
" <xs:complexType name=\"aType\">\n" +
|
||||
"\n" +
|
||||
" </xs:complexType>\n" +
|
||||
"</xs:schema>",
|
||||
"<xs:schema attributeFormDefault=\"unqualified\"\n" +
|
||||
" elementFormDefault=\"qualified\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
|
||||
"\n" +
|
||||
" <!-- keep formatting here-->\n" +
|
||||
" <xs:element name=\"a\" type=\"aType\"/>\n" +
|
||||
" <xs:complexType name=\"aType\">\n" +
|
||||
"\n" +
|
||||
" </xs:complexType>\n" +
|
||||
"</xs:schema>",
|
||||
XmlUnusedNamespaceInspection.RemoveNamespaceDeclarationFix.NAME);
|
||||
}
|
||||
|
||||
public void testImplicitPrefixUsage() throws Exception {
|
||||
myFixture.configureByText("a.xml", "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:x2=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" <warning descr=\"Namespace declaration is never used\">xmlns:x3=\"http://www.w3.org/2001/XMLSchema\"</warning> >\n" +
|
||||
" <xs:element name=\"a\" type=\"x2:string\"/>\n" +
|
||||
"</xs:schema>");
|
||||
myFixture.testHighlighting();
|
||||
}
|
||||
|
||||
public void testUnusedLocationDetection() throws Exception {
|
||||
myFixture.configureByFile("web-app_2_5.xsd");
|
||||
myFixture.configureByText("a.xml", "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" <warning descr=\"Namespace declaration is never used\">xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\"</warning>\n" +
|
||||
" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee\n" +
|
||||
" web-app_2_5.xsd\"\n" +
|
||||
" version=\"2.5\">\n" +
|
||||
"</web-app>");
|
||||
myFixture.testHighlighting();
|
||||
}
|
||||
|
||||
public void testWSDD() throws Exception {
|
||||
myFixture.configureByText("a.xml",
|
||||
"<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">\n" +
|
||||
"<typeMapping deserializer=\"org.apache.axis.encoding.ser.BeanDeserializerFactory\" encodingStyle=\"\" qname=\"ns38:AxisAnalysis\" serializer=\"org.apache.axis.encoding.ser.BeanSerializerFactory\" languageSpecificType=\"java:com.pls.xactservice.axis.bindings.AxisAnalysis\"/>\n" +
|
||||
"</deployment>");
|
||||
myFixture.testHighlighting();
|
||||
}
|
||||
|
||||
public void testPrefixesInTagValues() throws Exception {
|
||||
myFixture.configureByText("a.xml",
|
||||
"<<info descr=\"Namespace '' is not bound\">nodeTypes</info> xmlns:nt=\"<error descr=\"URI is not registered (Settings | Project Settings | Schemas and DTDs)\">http://www.jcp.org/jcr/nt/1.0</error>\" xmlns:customns=\"<error descr=\"URI is not registered (Settings | Project Settings | Schemas and DTDs)\">http://customurl</error>\">\n" +
|
||||
"<nodeType name=\"customns:item\" isMixin=\"false\" hasOrderableChildNodes=\"false\">\n" +
|
||||
" <supertypes>\n" +
|
||||
" <supertype>nt:folder</supertype>\n" +
|
||||
" </supertypes>\n" +
|
||||
"</nodeType>\n" +
|
||||
"</<info descr=\"Namespace '' is not bound\">nodeTypes</info>>");
|
||||
myFixture.testHighlighting();
|
||||
}
|
||||
|
||||
public void testLocallyUsedNamespace() throws Exception {
|
||||
myFixture.configureByText("a.xml", "<x:all\n" +
|
||||
" xmlns:x=\"http://www.w3.org/2001/XMLSchema\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" xsi:schemaLocation=\"http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd\n" +
|
||||
" http://www.w3.org/2001/XInclude http://www.w3.org/2001/XInclude.xsd\">\n" +
|
||||
"\n" +
|
||||
" <include xmlns=\"http://www.w3.org/2001/XInclude\" href=\"<error descr=\"Cannot resolve file 'a.xml'\">a.xml</error>\"/>\n" +
|
||||
"</x:all>");
|
||||
myFixture.testHighlighting();
|
||||
}
|
||||
|
||||
public void testSubDirectory() throws Exception {
|
||||
myFixture.testHighlighting("moved.xml", "trg/move-def.xsd");
|
||||
}
|
||||
|
||||
public void testSuppressedOptimize() throws Exception {
|
||||
myFixture.configureByFile("web-app_2_5.xsd");
|
||||
String text = "<!--suppress XmlUnusedNamespaceDeclaration -->\n" +
|
||||
"<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\"\n" +
|
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
|
||||
" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee\n" +
|
||||
" web-app_2_5.xsd\"\n" +
|
||||
" version=\"2.5\">\n" +
|
||||
"</web-app>";
|
||||
myFixture.configureByText("a.xml", text);
|
||||
|
||||
doOptimizeImportsTest(text);
|
||||
}
|
||||
|
||||
private void doUnusedDeclarationTest(String text, String after, String name) throws Exception {
|
||||
doUnusedDeclarationTest(text, after, name, true);
|
||||
}
|
||||
|
||||
private void doUnusedDeclarationTest(String text, String after, String name, boolean testOptimizeImports) throws Exception {
|
||||
myFixture.configureByText("a.xml", text);
|
||||
myFixture.testHighlighting();
|
||||
IntentionAction action = myFixture.getAvailableIntention(name);
|
||||
assertNotNull(name + " not found", action);
|
||||
myFixture.launchAction(action);
|
||||
myFixture.checkResult(after);
|
||||
|
||||
myFixture.configureByText("a.xml", text);
|
||||
if (testOptimizeImports) {
|
||||
doOptimizeImportsTest(after);
|
||||
}
|
||||
}
|
||||
|
||||
private void doOptimizeImportsTest(String after) {
|
||||
myFixture.testHighlighting();
|
||||
new WriteCommandAction(getProject(), getFile()) {
|
||||
@Override
|
||||
protected void run(Result result) throws Throwable {
|
||||
new OptimizeImportsProcessor(getProject(), getFile()).runWithoutProgress();
|
||||
}
|
||||
}.execute();
|
||||
myFixture.checkResult(after);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
myFixture.enableInspections(new XmlInspectionToolProvider());
|
||||
ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd",
|
||||
getTestDataPath() + "/web-app_2_5.xsd", getTestRootDisposable());
|
||||
ExternalResourceManagerImpl.registerResourceTemporarily("http://xml.apache.org/axis/wsdd/",
|
||||
getTestDataPath() + "/wsdd.dtd", getTestRootDisposable());
|
||||
ExternalResourceManagerImpl.registerResourceTemporarily("http://xml.apache.org/axis/wsdd/providers/java",
|
||||
getTestDataPath() + "/wsdd_provider_java.xsd", getTestRootDisposable());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/xml/tests/testData/unusedNs";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isCommunity() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.intellij.xml;
|
||||
|
||||
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightTestUtil;
|
||||
import com.intellij.xml.refactoring.SchemaPrefixRenameHandler;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class XmlSchemaPrefixTest extends CodeInsightFixtureTestCase {
|
||||
|
||||
public void testPrefixUsages() throws Exception {
|
||||
doFindUsages("usages.xml", 16);
|
||||
doFindUsages("usages1.xml", 16);
|
||||
}
|
||||
|
||||
public void testRename() throws Exception {doRename();}
|
||||
public void testRename1() throws Exception {doRename();}
|
||||
|
||||
public void testRename2() throws Exception {doRename();}
|
||||
public void testRenameFromClosingTag() throws Exception {doRename();}
|
||||
|
||||
private void doRename() throws Exception {
|
||||
doRename("xsd");
|
||||
}
|
||||
|
||||
private void doRename(String newValue) throws Exception {
|
||||
final String name = getTestName(true);
|
||||
CodeInsightTestUtil.doInlineRenameTest(new SchemaPrefixRenameHandler(), name, "xml", newValue, myFixture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/xml/tests/testData/schemaPrefix";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isCommunity() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void doFindUsages(String filename, int usages) {
|
||||
final int size = myFixture.testFindUsages(filename).size();
|
||||
assert size == usages : "Threre should be " + usages + " usages, but found " + size + ". File: " + filename;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.intellij.xml;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.codeInsight.completion.CompletionType;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.javaee.ExternalResourceManagerImpl;
|
||||
import com.intellij.testFramework.IdeaTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
public class XmlSmartCompletionTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public XmlSmartCompletionTest() {
|
||||
IdeaTestCase.initPlatformPrefix();
|
||||
}
|
||||
|
||||
public void testCompletion() throws Exception {
|
||||
doTest(new String[]{"testCompletion.xml", "test.xsd"}, "b");
|
||||
}
|
||||
|
||||
public void testCompletionNext() throws Exception {
|
||||
doTest(new String[]{"testCompletionNext.xml", "test.xsd"}, "c");
|
||||
}
|
||||
|
||||
public void testCompletion3() throws Exception {
|
||||
doTest(new String[]{"testCompletion3.xml", "test.xsd"}, "c", "d");
|
||||
}
|
||||
|
||||
public void testServlet() throws Exception {
|
||||
doTest(new String[]{"Servlet.xml"}, "icon", "servlet-name");
|
||||
}
|
||||
|
||||
public void testServletName() throws Exception {
|
||||
|
||||
doForText("<!DOCTYPE web-app\n" +
|
||||
" PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\n" +
|
||||
" \"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd\">\n" +
|
||||
"<web-app>\n" +
|
||||
"\n" +
|
||||
" <servlet>\n" +
|
||||
" <s<caret>\n" +
|
||||
" </servlet>\n" +
|
||||
"</web-app>",
|
||||
"<!DOCTYPE web-app\n" +
|
||||
" PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\n" +
|
||||
" \"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd\">\n" +
|
||||
"<web-app>\n" +
|
||||
"\n" +
|
||||
" <servlet>\n" +
|
||||
" <servlet-name\n" +
|
||||
" </servlet>\n" +
|
||||
"</web-app>");
|
||||
}
|
||||
|
||||
public void testPrefix() throws Exception {
|
||||
doForText("<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
|
||||
" <ann<caret>\n" +
|
||||
"</xs:schema>",
|
||||
"<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" +
|
||||
" <xs:annotation\n" +
|
||||
"</xs:schema>");
|
||||
}
|
||||
|
||||
private void doForText(String before, String after) {
|
||||
myFixture.configureByText("a.xml", before);
|
||||
myFixture.complete(CompletionType.SMART);
|
||||
myFixture.checkResult(after);
|
||||
}
|
||||
|
||||
private void doTest(String[] files, String... items) {
|
||||
myFixture.configureByFiles(files);
|
||||
LookupElement[] elements;
|
||||
try {
|
||||
CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = false;
|
||||
elements = myFixture.complete(CompletionType.SMART);
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = true;
|
||||
}
|
||||
assert elements != null;
|
||||
List<String> strings = ContainerUtil.map(elements, new Function<LookupElement, String>() {
|
||||
@Override
|
||||
public String fun(LookupElement lookupElement) {
|
||||
return lookupElement.getLookupString();
|
||||
}
|
||||
});
|
||||
assertEquals(Arrays.asList(items), strings);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/j2ee/dtds/web-app_2_3.dtd",
|
||||
getTestDataPath() + "/web-app_2_3.dtd", getTestRootDisposable());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/xml/tests/testData/smartCompletion";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + getBasePath();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.intellij.xml.actions;
|
||||
|
||||
import com.intellij.javaee.ExternalResourceManagerImpl;
|
||||
import com.intellij.testFramework.IdeaTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightTestUtil;
|
||||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
public class GenerateXmlTagTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
|
||||
public GenerateXmlTagTest() {
|
||||
IdeaTestCase.initPlatformPrefix();
|
||||
}
|
||||
|
||||
public void testGenerate() throws Exception {
|
||||
myFixture.configureByFile("web-app_2_5.xsd");
|
||||
doTest("generate.xml", "security-constraint");
|
||||
}
|
||||
|
||||
public void testGenerateEmpty() throws Exception {
|
||||
myFixture.configureByFile("javaee_5.xsd");
|
||||
myFixture.configureByFile("web-app_2_5.xsd");
|
||||
doTest("generateEmpty.xml", "distributable");
|
||||
}
|
||||
|
||||
public void testGenerateDTD() throws Exception {
|
||||
doTest("generateDTD.xml", "b");
|
||||
}
|
||||
|
||||
public void testGenerateDTDComplex() throws Exception {
|
||||
doTest("generateDTDComplex.xml", "b");
|
||||
}
|
||||
|
||||
public void testSpring() throws Exception {
|
||||
myFixture.configureByFile("spring-beans_3.0.xsd");
|
||||
doTest("spring.xml", "bean");
|
||||
}
|
||||
|
||||
public void testSpringAtCaret() throws Exception {
|
||||
myFixture.configureByFile("spring-beans_3.0.xsd");
|
||||
doTest("springAtCaret.xml", "bean");
|
||||
}
|
||||
|
||||
public void testSpringAfterBean() throws Exception {
|
||||
myFixture.configureByFile("spring-beans_3.0.xsd");
|
||||
doTest("springAfterBean.xml", "bean");
|
||||
}
|
||||
|
||||
public void testSpringAlias() throws Exception {
|
||||
myFixture.configureByFile("spring-beans_3.0.xsd");
|
||||
doTest("springAlias.xml", "alias");
|
||||
}
|
||||
|
||||
public void testInitParam() throws Exception {
|
||||
doTest("initParam.xml", "context-param");
|
||||
}
|
||||
|
||||
private void doTest(String file, String tagName) {
|
||||
GenerateXmlTagAction.TEST_THREAD_LOCAL.set(tagName);
|
||||
CodeInsightTestUtil.doActionTest(new GenerateXmlTagAction(), file, myFixture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
ExternalResourceManagerImpl.registerResourceTemporarily("http://java.sun.com/j2ee/dtds/web-app_2_3.dtd",
|
||||
getTestDataPath() + "/web-app_2_3.dtd", getTestRootDisposable());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/xml/tests/testData/generateTag";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + getBasePath();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.intellij.xml.actions;
|
||||
|
||||
import com.intellij.codeInsight.daemon.LightIntentionActionTestCase;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
@SuppressWarnings({"ALL"})
|
||||
public class SplitTagActionTest extends LightIntentionActionTestCase {
|
||||
public void test() throws Exception { doAllTests(); }
|
||||
|
||||
@Override
|
||||
protected boolean shouldBeAvailableAfterExecution() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "";
|
||||
}
|
||||
|
||||
protected String getTestDataPath() {
|
||||
return PlatformTestUtil.getCommunityPath() + "/xml/tests/testData/intentions/splitTag";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.intellij.xml.index;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.IdeaTestCase;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
public class XmlSchemaIndexTest extends CodeInsightFixtureTestCase {
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public XmlSchemaIndexTest() {
|
||||
IdeaTestCase.initPlatformPrefix();
|
||||
}
|
||||
|
||||
public void testBuilder() throws IOException {
|
||||
|
||||
VirtualFile file = myFixture.copyFileToProject("spring-beans-2.0.xsd");
|
||||
assert file != null;
|
||||
final Collection<String> tags = XsdTagNameBuilder.computeTagNames(file.getInputStream());
|
||||
assert tags != null;
|
||||
assertEquals(22, tags.size());
|
||||
|
||||
final String ns = XsdNamespaceBuilder.computeNamespace(file.getInputStream());
|
||||
assertEquals("http://www.springframework.org/schema/beans", ns);
|
||||
|
||||
final VirtualFile xsd = myFixture.copyFileToProject("XMLSchema.xsd");
|
||||
assert xsd != null;
|
||||
final String xsns = XsdNamespaceBuilder.computeNamespace(xsd.getInputStream());
|
||||
assertEquals("http://www.w3.org/2001/XMLSchema", xsns);
|
||||
|
||||
final Collection<String> xstags = XsdTagNameBuilder.computeTagNames(xsd.getInputStream());
|
||||
assert xstags != null;
|
||||
assertEquals(69, xstags.size());
|
||||
assertTrue(xstags.contains("schema"));
|
||||
}
|
||||
|
||||
public void testTagNameIndex() {
|
||||
|
||||
myFixture.copyDirectoryToProject("", "");
|
||||
|
||||
final Project project = getProject();
|
||||
final Collection<String> tags = XmlTagNamesIndex.getAllTagNames(project);
|
||||
assertTrue(tags.size() > 26);
|
||||
final Collection<VirtualFile> files = XmlTagNamesIndex.getFilesByTagName("bean", project);
|
||||
assertEquals(1, files.size());
|
||||
|
||||
final Collection<VirtualFile> files1 = XmlTagNamesIndex.getFilesByTagName("schema", project);
|
||||
assertEquals(files1.toString(), 2, files1.size());
|
||||
|
||||
Collection<String> names = ContainerUtil.map(files1, new Function<VirtualFile, String>() {
|
||||
@Override
|
||||
public String fun(VirtualFile virtualFile) {
|
||||
return virtualFile.getName();
|
||||
}
|
||||
});
|
||||
List<String> expected = Arrays.asList("XMLSchema.xsd", "XMLSchema.xsd");
|
||||
names.removeAll(expected);
|
||||
assertTrue(files1.toString(), names.isEmpty());
|
||||
}
|
||||
|
||||
public void testNamespaceIndex() {
|
||||
|
||||
myFixture.copyDirectoryToProject("", "");
|
||||
|
||||
final List<IndexedRelevantResource<String, String>> files =
|
||||
XmlNamespaceIndex.getResourcesByNamespace("http://www.springframework.org/schema/beans",
|
||||
getProject(),
|
||||
myModule);
|
||||
assertEquals(1, files.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/xml/tests/testData/index";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isCommunity() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]
|
||||
<link rel="stylesheet" type="text/css" should not be highlighted href="1.css"/>
|
||||
should not be highlighted
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
should not be highlighted
|
||||
<![endif-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="sty<caret>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="sty<caret>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet<caret>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet<caret>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" <warning>ref</warning>="1.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<warning>xxx.css</warning>"/>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" <error descr="Attribute typ is not allowed here">typ</error><error descr="'=' expected"> </error><error descr="Attribute e is not allowed here">e</error>="text/css" href="<warning descr="Cannot resolve file '1.css'"><error descr="Cannot resolve file '1.css'">1.css</error></warning>"/>
|
||||
<link rel="stylesheet" type="text/css" href="<warning descr="Cannot resolve file '2.css'"><error descr="Cannot resolve file '2.css'">2.css</error></warning>"/>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<style type="text/css">
|
||||
.regular {
|
||||
color: <error>INVALID</error>;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--[if ie]>
|
||||
<div class="ccc">something</div>
|
||||
<style type="text/css">
|
||||
.injected {
|
||||
color: <error>INVALID</error>;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title><!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]--><!--[if lt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if lte IE 5.5]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if gt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]--></head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>title</title><!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]--><!--[if lt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if lte IE 5.5]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if gt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]--></head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title>
|
||||
<!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title><!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]--><!--[if lt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if lte IE 5.5]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if gt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]--></head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>title</title><!--[if IE]>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="1.css"/>
|
||||
<![endif]--><!--[if lt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if lte IE 5.5]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if gt IE 6]>
|
||||
<style type="text/css">
|
||||
.test {
|
||||
color: aqua;
|
||||
}
|
||||
</style>
|
||||
<![endif]--></head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,3 @@
|
||||
<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
|
||||
|
||||
</a>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema attributeFormDefault="unqualified"
|
||||
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="a" type="aType"/>
|
||||
<xs:complexType name="aType">
|
||||
<xs:sequence>
|
||||
<xs:element type="xs:string" name="b"/>
|
||||
<xs:element type="xs:string" name="c" minOccurs="1" maxOccurs="5"/>
|
||||
<xs:element type="xs:string" name="d" minOccurs="z" maxOccurs="x"/>
|
||||
<xs:element type="xs:string" name="e" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,4 @@
|
||||
<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
|
||||
<b></b>
|
||||
<<caret>
|
||||
</a>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE a [
|
||||
<!ELEMENT a (b, c?, d+, e*)>
|
||||
<!ELEMENT b (#PCDATA)>
|
||||
<!ELEMENT c (#PCDATA)>
|
||||
<!ELEMENT d (#PCDATA)>
|
||||
<!ELEMENT e (#PCDATA)>
|
||||
]>
|
||||
<a >
|
||||
|
||||
</a>
|
||||
@@ -0,0 +1,3 @@
|
||||
<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
|
||||
<
|
||||
</a>
|
||||
@@ -0,0 +1,8 @@
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
web-app_2_5.xsd"
|
||||
version="2.5">
|
||||
|
||||
<caret>
|
||||
</web-app>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE a [
|
||||
|
||||
<!ELEMENT a (b)* >
|
||||
|
||||
<!ELEMENT b (c, d)>
|
||||
<!ELEMENT c (#PCDATA)>
|
||||
<!ATTLIST b
|
||||
x CDATA #REQUIRED
|
||||
y CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT d (#PCDATA)>
|
||||
]>
|
||||
|
||||
<a>
|
||||
<caret>
|
||||
</a>
|
||||
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE a [
|
||||
|
||||
<!ELEMENT a (b)* >
|
||||
|
||||
<!ELEMENT b (c, d)>
|
||||
<!ELEMENT c (#PCDATA)>
|
||||
<!ATTLIST b
|
||||
x CDATA #REQUIRED
|
||||
y CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT d EMPTY>
|
||||
<!ATTLIST d
|
||||
z CDATA #REQUIRED
|
||||
>
|
||||
]>
|
||||
<a>
|
||||
<caret>
|
||||
</a>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE a [
|
||||
|
||||
<!ELEMENT a (b)* >
|
||||
|
||||
<!ELEMENT b (c, d)>
|
||||
<!ELEMENT c (#PCDATA)>
|
||||
<!ATTLIST b
|
||||
x CDATA #REQUIRED
|
||||
y CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT d EMPTY>
|
||||
<!ATTLIST d
|
||||
z CDATA #REQUIRED
|
||||
>
|
||||
]>
|
||||
<a>
|
||||
<b x="">
|
||||
<c></c>
|
||||
<d z=""/>
|
||||
</b>
|
||||
</a>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE a [
|
||||
|
||||
<!ELEMENT a (b)* >
|
||||
|
||||
<!ELEMENT b (c, d)>
|
||||
<!ELEMENT c (#PCDATA)>
|
||||
<!ATTLIST b
|
||||
x CDATA #REQUIRED
|
||||
y CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT d (#PCDATA)>
|
||||
]>
|
||||
|
||||
<a>
|
||||
<b x="">
|
||||
<c></c>
|
||||
<d></d>
|
||||
</b>
|
||||
</a>
|
||||
@@ -0,0 +1,8 @@
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
web-app_2_5.xsd"
|
||||
version="2.5">
|
||||
|
||||
<caret>
|
||||
</web-app>
|
||||
@@ -0,0 +1,8 @@
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
web-app_2_5.xsd"
|
||||
version="2.5">
|
||||
|
||||
<distributable/>
|
||||
</web-app>
|
||||
@@ -0,0 +1,13 @@
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
web-app_2_5.xsd"
|
||||
version="2.5">
|
||||
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name></web-resource-name>
|
||||
<url-pattern></url-pattern>
|
||||
</web-resource-collection>
|
||||
</security-constraint>
|
||||
</web-app>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE web-app
|
||||
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
|
||||
<web-app>
|
||||
|
||||
<caret>
|
||||
|
||||
</web-app>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE web-app
|
||||
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
|
||||
<web-app>
|
||||
|
||||
<context-param>
|
||||
<param-name></param-name>
|
||||
<param-value></param-value>
|
||||
</context-param>
|
||||
|
||||
</web-app>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<caret>
|
||||
</beans>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<bean id="old"/>
|
||||
|
||||
<caret>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<bean id="old"/>
|
||||
|
||||
<bean
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<caret>
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<alias name="" alias=""/>
|
||||
</beans>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<caret>
|
||||
<bean id="old"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<bean
|
||||
<bean id="old"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
spring-beans_3.0.xsd">
|
||||
|
||||
<bean
|
||||
</beans>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>.</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td><caret></td>
|
||||
<td>4</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="14">1</td>
|
||||
<td>2</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11">1</td>
|
||||
<td>2</td>
|
||||
<td></td>
|
||||
<td>3</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>.</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td colspan="12">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="13">1</td>
|
||||
<td>2</td>
|
||||
<td colspan="12">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td colspan="12">1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table border="1">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td colspan="6">1</td>
|
||||
<td rowspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td><caret></td>
|
||||
<td>5</td>
|
||||
<td>2'</td>
|
||||
<td>3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" colspan="1">1</td>
|
||||
<td>2</td>
|
||||
<td></td>
|
||||
<td>3</td>
|
||||
<td rowspan="2" colspan="2">3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td></td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="5">2</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" rowspan="3">1</td>
|
||||
<td colspan="1" rowspan="2">2</td>
|
||||
<td colspan="2" rowspan="4">3</td>
|
||||
</tr>
|
||||
<tr/>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td></td>
|
||||
<td>2</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td></td>
|
||||
<td>7</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table border="1">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td colspan="6">1</td>
|
||||
<td rowspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>5</td>
|
||||
<td><caret></td>
|
||||
<td>2'</td>
|
||||
<td>3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" colspan="1">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td></td>
|
||||
<td rowspan="2" colspan="2">3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>4</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="5">2</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" rowspan="3">1</td>
|
||||
<td colspan="1" rowspan="2">2</td>
|
||||
<td colspan="2" rowspan="4">3</td>
|
||||
</tr>
|
||||
<tr/>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>2</td>
|
||||
<td></td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>7</td>
|
||||
<td></td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
<!-- "Add a new column to the table before the current one" "true" -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table border="1">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td><caret></td>
|
||||
<td colspan="5">1</td>
|
||||
<td rowspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>5</td>
|
||||
<td>2'</td>
|
||||
<td>3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td rowspan="2" colspan="1">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td rowspan="2" colspan="2">3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>1</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="3" rowspan="3">1</td>
|
||||
<td colspan="1" rowspan="2">2</td>
|
||||
<td colspan="2" rowspan="4">3</td>
|
||||
</tr>
|
||||
<tr/>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>2</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>7</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<table border="1">
|
||||
<thead> <tr> <th>1 <th>2
|
||||
<th></th>
|
||||
<tr> <th>1 <th> 2
|
||||
<th></th>
|
||||
</tr> </thead>
|
||||
<tr><td>1</td> <td> 2</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,966 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<table border=1>
|
||||
<thead><tr align=center><th>Name<th>Values<th>Initial value<th>Applies to<br>(Default: all)<th>Inherited?<th>Percentages<br>(Default: N/A)
|
||||
<th></th>
|
||||
<th>Media groups</thead>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-azimuth"><span class="propinst-azimuth xref">'azimuth'</span></a>
|
||||
<td><a href="aural.html#value-def-angle" class="noxref"><span class="value-inst-angle"><angle></span></a> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>center
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-attachment"><span class="propinst-background-attachment xref">'background-attachment'</span></a>
|
||||
<td>scroll | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>scroll
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-color"><span class="propinst-background-color xref">'background-color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | transparent | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>transparent
|
||||
<td>
|
||||
<td>no
|
||||
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-image"><span class="propinst-background-image xref">'background-image'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-position"><span class="propinst-background-position xref">'background-position'</span></a>
|
||||
<td>[ [ <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | left | center | right ] [ <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0% 0%
|
||||
<td>
|
||||
<td>no
|
||||
<td>refer to the size of the box itself
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-repeat"><span class="propinst-background-repeat xref">'background-repeat'</span></a>
|
||||
<td>repeat | repeat-x | repeat-y | no-repeat | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>repeat
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background"><span class="propinst-background xref">'background'</span></a>
|
||||
<td>[<a href="colors.html#propdef-background-color" class="noxref"><span class="propinst-background-color">'background-color'</span></a> || <a href="colors.html#propdef-background-image" class="noxref"><span class="propinst-background-image">'background-image'</span></a> || <a href="colors.html#propdef-background-repeat" class="noxref"><span class="propinst-background-repeat">'background-repeat'</span></a> || <a href="colors.html#propdef-background-attachment" class="noxref"><span class="propinst-background-attachment">'background-attachment'</span></a> || <a href="colors.html#propdef-background-position" class="noxref"><span class="propinst-background-position">'background-position'</span></a>] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>allowed on 'background-position'
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-border-collapse"><span class="propinst-border-collapse xref">'border-collapse'</span></a>
|
||||
<td>collapse | separate | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>separate
|
||||
<td>'table' and 'inline-table' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-color"><span class="propinst-border-color xref">'border-color'</span></a>
|
||||
<td>[ <a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | transparent ]{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-border-spacing"><span class="propinst-border-spacing xref">'border-spacing'</span></a>
|
||||
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a>? | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>'table' and 'inline-table' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-style"><span class="propinst-border-style xref">'border-style'</span></a>
|
||||
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top"><span class="propinst-border-top xref">'border-top'</span></a>
|
||||
<a href="box.html#propdef-border-right"><span class="propinst-border-right xref">'border-right'</span></a>
|
||||
<a href="box.html#propdef-border-bottom"><span class="propinst-border-bottom xref">'border-bottom'</span></a>
|
||||
<a href="box.html#propdef-border-left"><span class="propinst-border-left xref">'border-left'</span></a>
|
||||
<td>[ <a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> || <a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> || <a href="box.html#propdef-border-top-color" class="noxref"><span class="propinst-border-top-color">'border-top-color'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top-color"><span class="propinst-border-top-color xref">'border-top-color'</span></a>
|
||||
<a href="box.html#propdef-border-right-color"><span class="propinst-border-right-color xref">'border-right-color'</span></a>
|
||||
<a href="box.html#propdef-border-bottom-color"><span class="propinst-border-bottom-color xref">'border-bottom-color'</span></a>
|
||||
<a href="box.html#propdef-border-left-color"><span class="propinst-border-left-color xref">'border-left-color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | transparent | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>the value of the 'color' property
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top-style"><span class="propinst-border-top-style xref">'border-top-style'</span></a>
|
||||
<a href="box.html#propdef-border-right-style"><span class="propinst-border-right-style xref">'border-right-style'</span></a>
|
||||
<a href="box.html#propdef-border-bottom-style"><span class="propinst-border-bottom-style xref">'border-bottom-style'</span></a>
|
||||
<a href="box.html#propdef-border-left-style"><span class="propinst-border-left-style xref">'border-left-style'</span></a>
|
||||
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top-width"><span class="propinst-border-top-width xref">'border-top-width'</span></a>
|
||||
<a href="box.html#propdef-border-right-width"><span class="propinst-border-right-width xref">'border-right-width'</span></a>
|
||||
<a href="box.html#propdef-border-bottom-width"><span class="propinst-border-bottom-width xref">'border-bottom-width'</span></a>
|
||||
<a href="box.html#propdef-border-left-width"><span class="propinst-border-left-width xref">'border-left-width'</span></a>
|
||||
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-width"><span class="propinst-border-width xref">'border-width'</span></a>
|
||||
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border"><span class="propinst-border xref">'border'</span></a>
|
||||
<td>[ <a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> || <a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> || <a href="box.html#propdef-border-top-color" class="noxref"><span class="propinst-border-top-color">'border-top-color'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-bottom"><span class="propinst-bottom xref">'bottom'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>refer to height of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-caption-side"><span class="propinst-caption-side xref">'caption-side'</span></a>
|
||||
<td>top | bottom | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>top
|
||||
<td>'table-caption' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-clear"><span class="propinst-clear xref">'clear'</span></a>
|
||||
<td>none | left | right | both | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>block-level elements
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visufx.html#propdef-clip"><span class="propinst-clip xref">'clip'</span></a>
|
||||
<td><a href="visufx.html#value-def-shape" class="noxref"><span class="value-inst-shape"><shape></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>absolutely positioned elements
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-color"><span class="propinst-color xref">'color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-content"><span class="propinst-content xref">'content'</span></a>
|
||||
<td>normal | none | [ <a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string"><string></span></a> | <a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | <a href="syndata.html#value-def-counter" class="noxref"><span class="value-inst-counter"><counter></span></a> | attr(<a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier"><identifier></span></a>) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>normal
|
||||
<td>:before and :after pseudo-elements
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-counter-increment"><span class="propinst-counter-increment xref">'counter-increment'</span></a>
|
||||
<td>[ <a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier"><identifier></span></a> <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a>? ]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-counter-reset"><span class="propinst-counter-reset xref">'counter-reset'</span></a>
|
||||
<td>[ <a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier"><identifier></span></a> <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a>? ]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-cue-after"><span class="propinst-cue-after xref">'cue-after'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-cue-before"><span class="propinst-cue-before xref">'cue-before'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-cue"><span class="propinst-cue xref">'cue'</span></a>
|
||||
|
||||
<td>[ <a href="aural.html#propdef-cue-before" class="noxref"><span class="propinst-cue-before">'cue-before'</span></a> || <a href="aural.html#propdef-cue-after" class="noxref"><span class="propinst-cue-after">'cue-after'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-cursor"><span class="propinst-cursor xref">'cursor'</span></a>
|
||||
|
||||
<td>[ [<a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-direction"><span class="propinst-direction xref">'direction'</span></a>
|
||||
|
||||
<td>ltr | rtl | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>ltr
|
||||
<td>all elements, but see prose
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-display"><span class="propinst-display xref">'display'</span></a>
|
||||
<td>inline | block | list-item | run-in | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>inline
|
||||
<td>
|
||||
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-elevation"><span class="propinst-elevation xref">'elevation'</span></a>
|
||||
<td><a href="aural.html#value-def-angle" class="noxref"><span class="value-inst-angle"><angle></span></a> | below | level | above | higher | lower | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>level
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-empty-cells"><span class="propinst-empty-cells xref">'empty-cells'</span></a>
|
||||
<td>show | hide | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>show
|
||||
<td>'table-cell' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-float"><span class="propinst-float xref">'float'</span></a>
|
||||
<td>left | right | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>none
|
||||
<td>all, but see <a href="visuren.html#dis-pos-flo">9.7</a>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-family"><span class="propinst-font-family xref">'font-family'</span></a>
|
||||
<td>[[ <a href="fonts.html#value-def-family-name" class="noxref"><span class="value-inst-family-name"><family-name></span></a> | <a href="fonts.html#value-def-generic-family" class="noxref"><span class="value-inst-generic-family"><generic-family></span></a> ] [, <a href="fonts.html#value-def-family-name" class="noxref"><span class="value-inst-family-name"><family-name></span></a>| <a href="fonts.html#value-def-generic-family" class="noxref"><span class="value-inst-generic-family"><generic-family></span></a>]* ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-size"><span class="propinst-font-size xref">'font-size'</span></a>
|
||||
<td><a href="fonts.html#value-def-absolute-size" class="noxref"><span class="value-inst-absolute-size"><absolute-size></span></a> | <a href="fonts.html#value-def-relative-size" class="noxref"><span class="value-inst-relative-size"><relative-size></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>refer to parent element's font size
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-style"><span class="propinst-font-style xref">'font-style'</span></a>
|
||||
<td>normal | italic | oblique | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-variant"><span class="propinst-font-variant xref">'font-variant'</span></a>
|
||||
<td>normal | small-caps | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-weight"><span class="propinst-font-weight xref">'font-weight'</span></a>
|
||||
<td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font"><span class="propinst-font xref">'font'</span></a>
|
||||
<td>[ [ <a href="fonts.html#propdef-font-style" class="noxref"><span class="propinst-font-style">'font-style'</span></a> || <a href="fonts.html#propdef-font-variant" class="noxref"><span class="propinst-font-variant">'font-variant'</span></a> || <a href="fonts.html#propdef-font-weight" class="noxref"><span class="propinst-font-weight">'font-weight'</span></a> ]? <a href="fonts.html#propdef-font-size" class="noxref"><span class="propinst-font-size">'font-size'</span></a> [ / <a href="visudet.html#propdef-line-height" class="noxref"><span class="propinst-line-height">'line-height'</span></a> ]? <a href="fonts.html#propdef-font-family" class="noxref"><span class="propinst-font-family">'font-family'</span></a> ] | caption | icon | menu | message-box | small-caption | status-bar | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>yes
|
||||
<td>see individual properties
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-height"><span class="propinst-height xref">'height'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>all elements but non-replaced inline elements, table columns, and column groups
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-left"><span class="propinst-left xref">'left'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-letter-spacing"><span class="propinst-letter-spacing xref">'letter-spacing'</span></a>
|
||||
<td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-line-height"><span class="propinst-line-height xref">'line-height'</span></a>
|
||||
<td>normal | <a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>refer to the font size of the element itself
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style-image"><span class="propinst-list-style-image xref">'list-style-image'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style-position"><span class="propinst-list-style-position xref">'list-style-position'</span></a>
|
||||
<td>inside | outside | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>outside
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style-type"><span class="propinst-list-style-type xref">'list-style-type'</span></a>
|
||||
|
||||
<td>disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>disc
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style"><span class="propinst-list-style xref">'list-style'</span></a>
|
||||
<td>[ <a href="generate.html#propdef-list-style-type" class="noxref"><span class="propinst-list-style-type">'list-style-type'</span></a> || <a href="generate.html#propdef-list-style-position" class="noxref"><span class="propinst-list-style-position">'list-style-position'</span></a> || <a href="generate.html#propdef-list-style-image" class="noxref"><span class="propinst-list-style-image">'list-style-image'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-margin-right"><span class="propinst-margin-right xref">'margin-right'</span></a>
|
||||
<a href="box.html#propdef-margin-left"><span class="propinst-margin-left xref">'margin-left'</span></a>
|
||||
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width"><margin-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
|
||||
<td>all elements except elements with table display types other than table-caption, table and inline-table
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-margin-top"><span class="propinst-margin-top xref">'margin-top'</span></a>
|
||||
<a href="box.html#propdef-margin-bottom"><span class="propinst-margin-bottom xref">'margin-bottom'</span></a>
|
||||
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width"><margin-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>all elements except elements with table display types other than table-caption, table and inline-table
|
||||
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-margin"><span class="propinst-margin xref">'margin'</span></a>
|
||||
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width"><margin-width></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>all elements except elements with table display types other than table-caption, table and inline-table
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-max-height"><span class="propinst-max-height xref">'max-height'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>all elements but non-replaced inline elements, table columns, and column groups
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-max-width"><span class="propinst-max-width xref">'max-width'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>all elements but non-replaced inline elements, table rows, and row groups
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-min-height"><span class="propinst-min-height xref">'min-height'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>all elements but non-replaced inline elements, table columns, and column groups
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-min-width"><span class="propinst-min-width xref">'min-width'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>all elements but non-replaced inline elements, table rows, and row groups
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-orphans"><span class="propinst-orphans xref">'orphans'</span></a>
|
||||
<td><a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>2
|
||||
<td>block-level elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline-color"><span class="propinst-outline-color xref">'outline-color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | invert | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>invert
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline-style"><span class="propinst-outline-style xref">'outline-style'</span></a>
|
||||
|
||||
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline-width"><span class="propinst-outline-width xref">'outline-width'</span></a>
|
||||
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline"><span class="propinst-outline xref">'outline'</span></a>
|
||||
<td>[ <a href="ui.html#propdef-outline-color" class="noxref"><span class="propinst-outline-color">'outline-color'</span></a> || <a href="ui.html#propdef-outline-style" class="noxref"><span class="propinst-outline-style">'outline-style'</span></a> || <a href="ui.html#propdef-outline-width" class="noxref"><span class="propinst-outline-width">'outline-width'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="visufx.html#propdef-overflow"><span class="propinst-overflow xref">'overflow'</span></a>
|
||||
<td>visible | hidden | scroll | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>visible
|
||||
<td>non-replaced block-level elements, table cells, and inline-block elements
|
||||
<td>no
|
||||
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-padding-top"><span class="propinst-padding-top xref">'padding-top'</span></a>
|
||||
<a href="box.html#propdef-padding-right"><span class="propinst-padding-right xref">'padding-right'</span></a>
|
||||
<a href="box.html#propdef-padding-bottom"><span class="propinst-padding-bottom xref">'padding-bottom'</span></a>
|
||||
<a href="box.html#propdef-padding-left"><span class="propinst-padding-left xref">'padding-left'</span></a>
|
||||
<td><a href="box.html#value-def-padding-width" class="noxref"><span class="value-inst-padding-width"><padding-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-padding"><span class="propinst-padding xref">'padding'</span></a>
|
||||
<td><a href="box.html#value-def-padding-width" class="noxref"><span class="value-inst-padding-width"><padding-width></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-page-break-after"><span class="propinst-page-break-after xref">'page-break-after'</span></a>
|
||||
<td>auto | always | avoid | left | right | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>block-level elements
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-page-break-before"><span class="propinst-page-break-before xref">'page-break-before'</span></a>
|
||||
<td>auto | always | avoid | left | right | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>block-level elements
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-page-break-inside"><span class="propinst-page-break-inside xref">'page-break-inside'</span></a>
|
||||
<td>avoid | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>block-level elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pause-after"><span class="propinst-pause-after xref">'pause-after'</span></a>
|
||||
<td><a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time"><time></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pause-before"><span class="propinst-pause-before xref">'pause-before'</span></a>
|
||||
<td><a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time"><time></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pause"><span class="propinst-pause xref">'pause'</span></a>
|
||||
<td>[ [<a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time"><time></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a>]{1,2} ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>see descriptions of 'pause-before' and 'pause-after'
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pitch-range"><span class="propinst-pitch-range xref">'pitch-range'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>50
|
||||
<td>
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pitch"><span class="propinst-pitch xref">'pitch'</span></a>
|
||||
<td><a href="aural.html#value-def-frequency" class="noxref"><span class="value-inst-frequency"><frequency></span></a> | x-low | low | medium | high | x-high | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-play-during"><span class="propinst-play-during xref">'play-during'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> [ mix || repeat ]? | auto | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-position"><span class="propinst-position xref">'position'</span></a>
|
||||
|
||||
<td>static | relative | absolute | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>static
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-quotes"><span class="propinst-quotes xref">'quotes'</span></a>
|
||||
<td>[<a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string"><string></span></a> <a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string"><string></span></a>]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-richness"><span class="propinst-richness xref">'richness'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>50
|
||||
<td>
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-right"><span class="propinst-right xref">'right'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak-header"><span class="propinst-speak-header xref">'speak-header'</span></a>
|
||||
<td>once | always | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>once
|
||||
<td>elements that have table header information
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak-numeral"><span class="propinst-speak-numeral xref">'speak-numeral'</span></a>
|
||||
|
||||
<td>digits | continuous | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>continuous
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak-punctuation"><span class="propinst-speak-punctuation xref">'speak-punctuation'</span></a>
|
||||
<td>code | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak"><span class="propinst-speak xref">'speak'</span></a>
|
||||
<td>normal | none | spell-out | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speech-rate"><span class="propinst-speech-rate xref">'speech-rate'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | x-slow | slow | medium | fast | x-fast | faster | slower | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-stress"><span class="propinst-stress xref">'stress'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>50
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-table-layout"><span class="propinst-table-layout xref">'table-layout'</span></a>
|
||||
<td>auto | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>'table' and 'inline-table' elements
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-align"><span class="propinst-text-align xref">'text-align'</span></a>
|
||||
<td>left | right | center | justify | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl'
|
||||
<td>block-level elements, table cells and inline blocks
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-decoration"><span class="propinst-text-decoration xref">'text-decoration'</span></a>
|
||||
<td>none | [ underline || overline || line-through || blink ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>none
|
||||
<td>
|
||||
<td>no (see prose)
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-indent"><span class="propinst-text-indent xref">'text-indent'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>block-level elements, table cells and inline blocks
|
||||
<td>yes
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-transform"><span class="propinst-text-transform xref">'text-transform'</span></a>
|
||||
<td>capitalize | uppercase | lowercase | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-top"><span class="propinst-top xref">'top'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>refer to height of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-unicode-bidi"><span class="propinst-unicode-bidi xref">'unicode-bidi'</span></a>
|
||||
<td>normal | embed | bidi-override | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>all elements, but see prose
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-vertical-align"><span class="propinst-vertical-align xref">'vertical-align'</span></a>
|
||||
<td>baseline | sub | super | top | text-top | middle | bottom | text-bottom | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>baseline
|
||||
<td>inline-level and 'table-cell' elements
|
||||
<td>no
|
||||
<td>refer to the 'line-height' of the element itself
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visufx.html#propdef-visibility"><span class="propinst-visibility xref">'visibility'</span></a>
|
||||
<td>visible | hidden | collapse | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>visible
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-voice-family"><span class="propinst-voice-family xref">'voice-family'</span></a>
|
||||
<td>[[<a href="aural.html#value-def-specific-voice" class="noxref"><span class="value-inst-specific-voice"><specific-voice></span></a> | <a href="aural.html#value-def-generic-voice" class="noxref"><span class="value-inst-generic-voice"><generic-voice></span></a> ],]* [<a href="aural.html#value-def-specific-voice" class="noxref"><span class="value-inst-specific-voice"><specific-voice></span></a> | <a href="aural.html#value-def-generic-voice" class="noxref"><span class="value-inst-generic-voice"><generic-voice></span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-volume"><span class="propinst-volume xref">'volume'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | silent | x-soft | soft | medium | loud | x-loud | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>refer to inherited value
|
||||
<td></td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-white-space"><span class="propinst-white-space xref">'white-space'</span></a>
|
||||
<td>normal | pre | nowrap | pre-wrap | pre-line | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-widows"><span class="propinst-widows xref">'widows'</span></a>
|
||||
<td><a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>2
|
||||
<td>block-level elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-width"><span class="propinst-width xref">'width'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>all elements but non-replaced inline elements, table rows, and row groups
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-word-spacing"><span class="propinst-word-spacing xref">'word-spacing'</span></a>
|
||||
<td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-z-index"><span class="propinst-z-index xref">'z-index'</span></a>
|
||||
|
||||
<td>auto | <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>
|
||||
<td></td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>.</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<t<caret>d>3</td>
|
||||
<td>4</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="13">1</td>
|
||||
<td>2</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>.</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<t<caret>d>3</td>
|
||||
<td>4</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="13">1</td>
|
||||
<td>2</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>.</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="13">1</td>
|
||||
<td>2</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<t<caret>d colspan="11">1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table border="1">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td colspan="5">1</td>
|
||||
<td rowspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>5</td>
|
||||
<td>2'</td>
|
||||
<td>3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" colspan="1">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td rowspan="2" colspan="2">3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><caret>1</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" rowspan="3">1</td>
|
||||
<td colspan="1" rowspan="2">2</td>
|
||||
<td colspan="2" rowspan="4">3</td>
|
||||
</tr>
|
||||
<tr/>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>2</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>7</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table border="1">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td colspan="5">1</td>
|
||||
<td rowspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>5</td>
|
||||
<td>2'</td>
|
||||
<td>3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" colspan="1">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td rowspan="2" colspan="2">3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<t<caret>d colspan="3" rowspan="3">1</td>
|
||||
<td colspan="1" rowspan="2">2</td>
|
||||
<td colspan="2" rowspan="4">3</td>
|
||||
</tr>
|
||||
<tr/>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>2</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>7</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
<!-- "Add a new column to the table before the current one" "true" -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table border="1">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td colspan="5">1</td>
|
||||
<td rowspan="5">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>5</td>
|
||||
<td>2'</td>
|
||||
<td>3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" colspan="1">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td rowspan="2" colspan="2">3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td colspan="4">2</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" rowspan="3">1</td>
|
||||
<td colspan="1" rowspan="2">2</td>
|
||||
<td colspan="2" rowspan="4">3</td>
|
||||
</tr>
|
||||
<tr/>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>2</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<t<caret>d>1</td>
|
||||
<td>2</td>
|
||||
<td>7</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<table border="1">
|
||||
<thead> <tr> <th>1 <t<caret>h>2
|
||||
<tr> <th>1 <th> 2 </tr> </thead>
|
||||
<tr><td>1</td> <td> 2</td></tr>
|
||||
</table>
|
||||
@@ -0,0 +1,866 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<table border=1>
|
||||
<thead><tr align=center><th>Name<th>Values<th>Initial value<th>Applies to<br>(Default: all)<th>Inherited?<th>Percentages<br>(Default: N/A)<th>Media groups</thead>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-azimuth"><span class="propinst-azimuth xref">'azimuth'</span></a>
|
||||
<td><a href="aural.html#value-def-angle" class="noxref"><span class="value-inst-angle"><angle></span></a> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>center
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-attachment"><span class="propinst-background-attachment xref">'background-attachment'</span></a>
|
||||
<td>scroll | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>scroll
|
||||
<td>
|
||||
<td>no
|
||||
<t<caret>d>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-color"><span class="propinst-background-color xref">'background-color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | transparent | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>transparent
|
||||
<td>
|
||||
<td>no
|
||||
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-image"><span class="propinst-background-image xref">'background-image'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-position"><span class="propinst-background-position xref">'background-position'</span></a>
|
||||
<td>[ [ <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | left | center | right ] [ <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0% 0%
|
||||
<td>
|
||||
<td>no
|
||||
<td>refer to the size of the box itself
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background-repeat"><span class="propinst-background-repeat xref">'background-repeat'</span></a>
|
||||
<td>repeat | repeat-x | repeat-y | no-repeat | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>repeat
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-background"><span class="propinst-background xref">'background'</span></a>
|
||||
<td>[<a href="colors.html#propdef-background-color" class="noxref"><span class="propinst-background-color">'background-color'</span></a> || <a href="colors.html#propdef-background-image" class="noxref"><span class="propinst-background-image">'background-image'</span></a> || <a href="colors.html#propdef-background-repeat" class="noxref"><span class="propinst-background-repeat">'background-repeat'</span></a> || <a href="colors.html#propdef-background-attachment" class="noxref"><span class="propinst-background-attachment">'background-attachment'</span></a> || <a href="colors.html#propdef-background-position" class="noxref"><span class="propinst-background-position">'background-position'</span></a>] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>allowed on 'background-position'
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-border-collapse"><span class="propinst-border-collapse xref">'border-collapse'</span></a>
|
||||
<td>collapse | separate | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>separate
|
||||
<td>'table' and 'inline-table' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-color"><span class="propinst-border-color xref">'border-color'</span></a>
|
||||
<td>[ <a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | transparent ]{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-border-spacing"><span class="propinst-border-spacing xref">'border-spacing'</span></a>
|
||||
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a>? | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>'table' and 'inline-table' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-style"><span class="propinst-border-style xref">'border-style'</span></a>
|
||||
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top"><span class="propinst-border-top xref">'border-top'</span></a>
|
||||
<a href="box.html#propdef-border-right"><span class="propinst-border-right xref">'border-right'</span></a>
|
||||
<a href="box.html#propdef-border-bottom"><span class="propinst-border-bottom xref">'border-bottom'</span></a>
|
||||
<a href="box.html#propdef-border-left"><span class="propinst-border-left xref">'border-left'</span></a>
|
||||
<td>[ <a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> || <a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> || <a href="box.html#propdef-border-top-color" class="noxref"><span class="propinst-border-top-color">'border-top-color'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top-color"><span class="propinst-border-top-color xref">'border-top-color'</span></a>
|
||||
<a href="box.html#propdef-border-right-color"><span class="propinst-border-right-color xref">'border-right-color'</span></a>
|
||||
<a href="box.html#propdef-border-bottom-color"><span class="propinst-border-bottom-color xref">'border-bottom-color'</span></a>
|
||||
<a href="box.html#propdef-border-left-color"><span class="propinst-border-left-color xref">'border-left-color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | transparent | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>the value of the 'color' property
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top-style"><span class="propinst-border-top-style xref">'border-top-style'</span></a>
|
||||
<a href="box.html#propdef-border-right-style"><span class="propinst-border-right-style xref">'border-right-style'</span></a>
|
||||
<a href="box.html#propdef-border-bottom-style"><span class="propinst-border-bottom-style xref">'border-bottom-style'</span></a>
|
||||
<a href="box.html#propdef-border-left-style"><span class="propinst-border-left-style xref">'border-left-style'</span></a>
|
||||
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-top-width"><span class="propinst-border-top-width xref">'border-top-width'</span></a>
|
||||
<a href="box.html#propdef-border-right-width"><span class="propinst-border-right-width xref">'border-right-width'</span></a>
|
||||
<a href="box.html#propdef-border-bottom-width"><span class="propinst-border-bottom-width xref">'border-bottom-width'</span></a>
|
||||
<a href="box.html#propdef-border-left-width"><span class="propinst-border-left-width xref">'border-left-width'</span></a>
|
||||
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border-width"><span class="propinst-border-width xref">'border-width'</span></a>
|
||||
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-border"><span class="propinst-border xref">'border'</span></a>
|
||||
<td>[ <a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> || <a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> || <a href="box.html#propdef-border-top-color" class="noxref"><span class="propinst-border-top-color">'border-top-color'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-bottom"><span class="propinst-bottom xref">'bottom'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>refer to height of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-caption-side"><span class="propinst-caption-side xref">'caption-side'</span></a>
|
||||
<td>top | bottom | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>top
|
||||
<td>'table-caption' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-clear"><span class="propinst-clear xref">'clear'</span></a>
|
||||
<td>none | left | right | both | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>block-level elements
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visufx.html#propdef-clip"><span class="propinst-clip xref">'clip'</span></a>
|
||||
<td><a href="visufx.html#value-def-shape" class="noxref"><span class="value-inst-shape"><shape></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>absolutely positioned elements
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="colors.html#propdef-color"><span class="propinst-color xref">'color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-content"><span class="propinst-content xref">'content'</span></a>
|
||||
<td>normal | none | [ <a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string"><string></span></a> | <a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | <a href="syndata.html#value-def-counter" class="noxref"><span class="value-inst-counter"><counter></span></a> | attr(<a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier"><identifier></span></a>) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>normal
|
||||
<td>:before and :after pseudo-elements
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-counter-increment"><span class="propinst-counter-increment xref">'counter-increment'</span></a>
|
||||
<td>[ <a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier"><identifier></span></a> <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a>? ]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-counter-reset"><span class="propinst-counter-reset xref">'counter-reset'</span></a>
|
||||
<td>[ <a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier"><identifier></span></a> <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a>? ]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-cue-after"><span class="propinst-cue-after xref">'cue-after'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-cue-before"><span class="propinst-cue-before xref">'cue-before'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-cue"><span class="propinst-cue xref">'cue'</span></a>
|
||||
|
||||
<td>[ <a href="aural.html#propdef-cue-before" class="noxref"><span class="propinst-cue-before">'cue-before'</span></a> || <a href="aural.html#propdef-cue-after" class="noxref"><span class="propinst-cue-after">'cue-after'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-cursor"><span class="propinst-cursor xref">'cursor'</span></a>
|
||||
|
||||
<td>[ [<a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-direction"><span class="propinst-direction xref">'direction'</span></a>
|
||||
|
||||
<td>ltr | rtl | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>ltr
|
||||
<td>all elements, but see prose
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-display"><span class="propinst-display xref">'display'</span></a>
|
||||
<td>inline | block | list-item | run-in | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>inline
|
||||
<td>
|
||||
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#all-media-group">all</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-elevation"><span class="propinst-elevation xref">'elevation'</span></a>
|
||||
<td><a href="aural.html#value-def-angle" class="noxref"><span class="value-inst-angle"><angle></span></a> | below | level | above | higher | lower | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>level
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-empty-cells"><span class="propinst-empty-cells xref">'empty-cells'</span></a>
|
||||
<td>show | hide | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>show
|
||||
<td>'table-cell' elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-float"><span class="propinst-float xref">'float'</span></a>
|
||||
<td>left | right | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>none
|
||||
<td>all, but see <a href="visuren.html#dis-pos-flo">9.7</a>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-family"><span class="propinst-font-family xref">'font-family'</span></a>
|
||||
<td>[[ <a href="fonts.html#value-def-family-name" class="noxref"><span class="value-inst-family-name"><family-name></span></a> | <a href="fonts.html#value-def-generic-family" class="noxref"><span class="value-inst-generic-family"><generic-family></span></a> ] [, <a href="fonts.html#value-def-family-name" class="noxref"><span class="value-inst-family-name"><family-name></span></a>| <a href="fonts.html#value-def-generic-family" class="noxref"><span class="value-inst-generic-family"><generic-family></span></a>]* ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-size"><span class="propinst-font-size xref">'font-size'</span></a>
|
||||
<td><a href="fonts.html#value-def-absolute-size" class="noxref"><span class="value-inst-absolute-size"><absolute-size></span></a> | <a href="fonts.html#value-def-relative-size" class="noxref"><span class="value-inst-relative-size"><relative-size></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>refer to parent element's font size
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-style"><span class="propinst-font-style xref">'font-style'</span></a>
|
||||
<td>normal | italic | oblique | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-variant"><span class="propinst-font-variant xref">'font-variant'</span></a>
|
||||
<td>normal | small-caps | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font-weight"><span class="propinst-font-weight xref">'font-weight'</span></a>
|
||||
<td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="fonts.html#propdef-font"><span class="propinst-font xref">'font'</span></a>
|
||||
<td>[ [ <a href="fonts.html#propdef-font-style" class="noxref"><span class="propinst-font-style">'font-style'</span></a> || <a href="fonts.html#propdef-font-variant" class="noxref"><span class="propinst-font-variant">'font-variant'</span></a> || <a href="fonts.html#propdef-font-weight" class="noxref"><span class="propinst-font-weight">'font-weight'</span></a> ]? <a href="fonts.html#propdef-font-size" class="noxref"><span class="propinst-font-size">'font-size'</span></a> [ / <a href="visudet.html#propdef-line-height" class="noxref"><span class="propinst-line-height">'line-height'</span></a> ]? <a href="fonts.html#propdef-font-family" class="noxref"><span class="propinst-font-family">'font-family'</span></a> ] | caption | icon | menu | message-box | small-caption | status-bar | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>yes
|
||||
<td>see individual properties
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-height"><span class="propinst-height xref">'height'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>all elements but non-replaced inline elements, table columns, and column groups
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-left"><span class="propinst-left xref">'left'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-letter-spacing"><span class="propinst-letter-spacing xref">'letter-spacing'</span></a>
|
||||
<td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-line-height"><span class="propinst-line-height xref">'line-height'</span></a>
|
||||
<td>normal | <a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>refer to the font size of the element itself
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style-image"><span class="propinst-list-style-image xref">'list-style-image'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style-position"><span class="propinst-list-style-position xref">'list-style-position'</span></a>
|
||||
<td>inside | outside | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>outside
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style-type"><span class="propinst-list-style-type xref">'list-style-type'</span></a>
|
||||
|
||||
<td>disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>disc
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-list-style"><span class="propinst-list-style xref">'list-style'</span></a>
|
||||
<td>[ <a href="generate.html#propdef-list-style-type" class="noxref"><span class="propinst-list-style-type">'list-style-type'</span></a> || <a href="generate.html#propdef-list-style-position" class="noxref"><span class="propinst-list-style-position">'list-style-position'</span></a> || <a href="generate.html#propdef-list-style-image" class="noxref"><span class="propinst-list-style-image">'list-style-image'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>elements with 'display: list-item'
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-margin-right"><span class="propinst-margin-right xref">'margin-right'</span></a>
|
||||
<a href="box.html#propdef-margin-left"><span class="propinst-margin-left xref">'margin-left'</span></a>
|
||||
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width"><margin-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
|
||||
<td>all elements except elements with table display types other than table-caption, table and inline-table
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-margin-top"><span class="propinst-margin-top xref">'margin-top'</span></a>
|
||||
<a href="box.html#propdef-margin-bottom"><span class="propinst-margin-bottom xref">'margin-bottom'</span></a>
|
||||
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width"><margin-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>all elements except elements with table display types other than table-caption, table and inline-table
|
||||
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-margin"><span class="propinst-margin xref">'margin'</span></a>
|
||||
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width"><margin-width></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>all elements except elements with table display types other than table-caption, table and inline-table
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-max-height"><span class="propinst-max-height xref">'max-height'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>all elements but non-replaced inline elements, table columns, and column groups
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-max-width"><span class="propinst-max-width xref">'max-width'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>all elements but non-replaced inline elements, table rows, and row groups
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-min-height"><span class="propinst-min-height xref">'min-height'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>all elements but non-replaced inline elements, table columns, and column groups
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-min-width"><span class="propinst-min-width xref">'min-width'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>0
|
||||
<td>all elements but non-replaced inline elements, table rows, and row groups
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-orphans"><span class="propinst-orphans xref">'orphans'</span></a>
|
||||
<td><a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>2
|
||||
<td>block-level elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline-color"><span class="propinst-outline-color xref">'outline-color'</span></a>
|
||||
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color"><color></span></a> | invert | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>invert
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline-style"><span class="propinst-outline-style xref">'outline-style'</span></a>
|
||||
|
||||
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style"><border-style></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline-width"><span class="propinst-outline-width xref">'outline-width'</span></a>
|
||||
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width"><border-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="ui.html#propdef-outline"><span class="propinst-outline xref">'outline'</span></a>
|
||||
<td>[ <a href="ui.html#propdef-outline-color" class="noxref"><span class="propinst-outline-color">'outline-color'</span></a> || <a href="ui.html#propdef-outline-style" class="noxref"><span class="propinst-outline-style">'outline-style'</span></a> || <a href="ui.html#propdef-outline-width" class="noxref"><span class="propinst-outline-width">'outline-width'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
|
||||
|
||||
<tr><td><a href="visufx.html#propdef-overflow"><span class="propinst-overflow xref">'overflow'</span></a>
|
||||
<td>visible | hidden | scroll | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>visible
|
||||
<td>non-replaced block-level elements, table cells, and inline-block elements
|
||||
<td>no
|
||||
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-padding-top"><span class="propinst-padding-top xref">'padding-top'</span></a>
|
||||
<a href="box.html#propdef-padding-right"><span class="propinst-padding-right xref">'padding-right'</span></a>
|
||||
<a href="box.html#propdef-padding-bottom"><span class="propinst-padding-bottom xref">'padding-bottom'</span></a>
|
||||
<a href="box.html#propdef-padding-left"><span class="propinst-padding-left xref">'padding-left'</span></a>
|
||||
<td><a href="box.html#value-def-padding-width" class="noxref"><span class="value-inst-padding-width"><padding-width></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="box.html#propdef-padding"><span class="propinst-padding xref">'padding'</span></a>
|
||||
<td><a href="box.html#value-def-padding-width" class="noxref"><span class="value-inst-padding-width"><padding-width></span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>see individual properties
|
||||
<td>all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-page-break-after"><span class="propinst-page-break-after xref">'page-break-after'</span></a>
|
||||
<td>auto | always | avoid | left | right | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>block-level elements
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-page-break-before"><span class="propinst-page-break-before xref">'page-break-before'</span></a>
|
||||
<td>auto | always | avoid | left | right | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>block-level elements
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-page-break-inside"><span class="propinst-page-break-inside xref">'page-break-inside'</span></a>
|
||||
<td>avoid | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>auto
|
||||
<td>block-level elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pause-after"><span class="propinst-pause-after xref">'pause-after'</span></a>
|
||||
<td><a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time"><time></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pause-before"><span class="propinst-pause-before xref">'pause-before'</span></a>
|
||||
<td><a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time"><time></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>
|
||||
<td>no
|
||||
<td>see prose
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pause"><span class="propinst-pause xref">'pause'</span></a>
|
||||
<td>[ [<a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time"><time></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a>]{1,2} ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>see individual properties
|
||||
<td>
|
||||
<td>no
|
||||
<td>see descriptions of 'pause-before' and 'pause-after'
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pitch-range"><span class="propinst-pitch-range xref">'pitch-range'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>50
|
||||
<td>
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-pitch"><span class="propinst-pitch xref">'pitch'</span></a>
|
||||
<td><a href="aural.html#value-def-frequency" class="noxref"><span class="value-inst-frequency"><frequency></span></a> | x-low | low | medium | high | x-high | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-play-during"><span class="propinst-play-during xref">'play-during'</span></a>
|
||||
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri"><uri></span></a> [ mix || repeat ]? | auto | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-position"><span class="propinst-position xref">'position'</span></a>
|
||||
|
||||
<td>static | relative | absolute | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>static
|
||||
<td>
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="generate.html#propdef-quotes"><span class="propinst-quotes xref">'quotes'</span></a>
|
||||
<td>[<a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string"><string></span></a> <a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string"><string></span></a>]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-richness"><span class="propinst-richness xref">'richness'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>50
|
||||
<td>
|
||||
<td>yes
|
||||
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-right"><span class="propinst-right xref">'right'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak-header"><span class="propinst-speak-header xref">'speak-header'</span></a>
|
||||
<td>once | always | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>once
|
||||
<td>elements that have table header information
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak-numeral"><span class="propinst-speak-numeral xref">'speak-numeral'</span></a>
|
||||
|
||||
<td>digits | continuous | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>continuous
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak-punctuation"><span class="propinst-speak-punctuation xref">'speak-punctuation'</span></a>
|
||||
<td>code | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speak"><span class="propinst-speak xref">'speak'</span></a>
|
||||
<td>normal | none | spell-out | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-speech-rate"><span class="propinst-speech-rate xref">'speech-rate'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | x-slow | slow | medium | fast | x-fast | faster | slower | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-stress"><span class="propinst-stress xref">'stress'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>50
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="tables.html#propdef-table-layout"><span class="propinst-table-layout xref">'table-layout'</span></a>
|
||||
<td>auto | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>'table' and 'inline-table' elements
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-align"><span class="propinst-text-align xref">'text-align'</span></a>
|
||||
<td>left | right | center | justify | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl'
|
||||
<td>block-level elements, table cells and inline blocks
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-decoration"><span class="propinst-text-decoration xref">'text-decoration'</span></a>
|
||||
<td>none | [ underline || overline || line-through || blink ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>none
|
||||
<td>
|
||||
<td>no (see prose)
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-indent"><span class="propinst-text-indent xref">'text-indent'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>0
|
||||
<td>block-level elements, table cells and inline blocks
|
||||
<td>yes
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-text-transform"><span class="propinst-text-transform xref">'text-transform'</span></a>
|
||||
<td>capitalize | uppercase | lowercase | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>none
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-top"><span class="propinst-top xref">'top'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>refer to height of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-unicode-bidi"><span class="propinst-unicode-bidi xref">'unicode-bidi'</span></a>
|
||||
<td>normal | embed | bidi-override | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>all elements, but see prose
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-vertical-align"><span class="propinst-vertical-align xref">'vertical-align'</span></a>
|
||||
<td>baseline | sub | super | top | text-top | middle | bottom | text-bottom | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>baseline
|
||||
<td>inline-level and 'table-cell' elements
|
||||
<td>no
|
||||
<td>refer to the 'line-height' of the element itself
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visufx.html#propdef-visibility"><span class="propinst-visibility xref">'visibility'</span></a>
|
||||
<td>visible | hidden | collapse | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>visible
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-voice-family"><span class="propinst-voice-family xref">'voice-family'</span></a>
|
||||
<td>[[<a href="aural.html#value-def-specific-voice" class="noxref"><span class="value-inst-specific-voice"><specific-voice></span></a> | <a href="aural.html#value-def-generic-voice" class="noxref"><span class="value-inst-generic-voice"><generic-voice></span></a> ],]* [<a href="aural.html#value-def-specific-voice" class="noxref"><span class="value-inst-specific-voice"><specific-voice></span></a> | <a href="aural.html#value-def-generic-voice" class="noxref"><span class="value-inst-generic-voice"><generic-voice></span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>depends on user agent
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="aural.html#propdef-volume"><span class="propinst-volume xref">'volume'</span></a>
|
||||
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number"><number></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | silent | x-soft | soft | medium | loud | x-loud | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
|
||||
<td>medium
|
||||
<td>
|
||||
<td>yes
|
||||
<td>refer to inherited value
|
||||
<td><a href="aural.html#aural-media-group">aural</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-white-space"><span class="propinst-white-space xref">'white-space'</span></a>
|
||||
<td>normal | pre | nowrap | pre-wrap | pre-line | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="page.html#propdef-widows"><span class="propinst-widows xref">'widows'</span></a>
|
||||
<td><a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>2
|
||||
<td>block-level elements
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
|
||||
|
||||
<tr><td><a href="visudet.html#propdef-width"><span class="propinst-width xref">'width'</span></a>
|
||||
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage"><percentage></span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>all elements but non-replaced inline elements, table rows, and row groups
|
||||
<td>no
|
||||
<td>refer to width of containing block
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="text.html#propdef-word-spacing"><span class="propinst-word-spacing xref">'word-spacing'</span></a>
|
||||
<td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length"><length></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>normal
|
||||
<td>
|
||||
<td>yes
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
<tr><td><a href="visuren.html#propdef-z-index"><span class="propinst-z-index xref">'z-index'</span></a>
|
||||
|
||||
<td>auto | <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer"><integer></span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
|
||||
<td>auto
|
||||
<td>positioned elements
|
||||
<td>no
|
||||
<td>
|
||||
<td><a href="media.html#visual-media-group">visual</a>
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!-- "Add a new column to the table after the current one" "true" -->
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="a.css"/>
|
||||
<title>fdgsd</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>dsfgsdgfdg</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>.</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<td>3</td>
|
||||
<t<caret>d>3</td>
|
||||
<td>4</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="13">1</td>
|
||||
<td>2</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11">1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td colspan="11">1</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/tool"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://www.springframework.org/schema/tool"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Defines the tool support annotations for Spring's configuration namespaces.
|
||||
Used in other namespace XSD files; not intended for direct use in config files.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:element name="annotation">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence minOccurs="0">
|
||||
<xsd:element name="expected-type" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element name="assignable-to" type="typedParameterType" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element name="exports" type="exportsType" minOccurs="0" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="kind" default="direct">
|
||||
<xsd:simpleType>
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="ref"/>
|
||||
<xsd:enumeration value="direct"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:complexType name="typedParameterType">
|
||||
<xsd:attribute name="type" type="xsd:string" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="exportsType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Indicates that an annotated type exports an application visible component.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:attribute name="type" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The type of the exported component. May be null if the type is not known until runtime.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="identifier" type="xsd:string" default="@id">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Defines an XPath query that can be executed against the node annotated with this
|
||||
type to determine the identifier of any exported component.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema>
|
||||
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<men<caret>u></menu>
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user