diff options
996 files changed, 13420 insertions, 2747 deletions
diff --git a/.classpath b/.classpath index c6230a2c55..130d4c0c49 100644 --- a/.classpath +++ b/.classpath @@ -2,6 +2,7 @@ <classpath> <classpathentry kind="src" path="server/tests/src"/> <classpathentry kind="src" path="client/tests/src"/> + <classpathentry kind="src" path="shared/tests/src"/> <classpathentry kind="src" path="theme-compiler/tests/src"/> <classpathentry kind="src" path="theme-compiler/src"/> <classpathentry kind="src" path="theme-compiler/tests/resources"/> diff --git a/WebContent/VAADIN/themes/base/customcomponent/customcomponent.scss b/WebContent/VAADIN/themes/base/customcomponent/customcomponent.scss index 461e1b1246..d672254a86 100644 --- a/WebContent/VAADIN/themes/base/customcomponent/customcomponent.scss +++ b/WebContent/VAADIN/themes/base/customcomponent/customcomponent.scss @@ -1,7 +1,6 @@ @mixin base-customcomponent($primaryStyleName : v-customcomponent) { .#{$primaryStyleName} { - overflow: hidden; } }
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/base/tabsheet/tabsheet.scss b/WebContent/VAADIN/themes/base/tabsheet/tabsheet.scss index 1a799814c1..14def56ab5 100644 --- a/WebContent/VAADIN/themes/base/tabsheet/tabsheet.scss +++ b/WebContent/VAADIN/themes/base/tabsheet/tabsheet.scss @@ -106,6 +106,12 @@ .#{$primaryStyleName}-tabitem-selected .v-caption { cursor: default; } +.#{$primaryStyleName}-tabitem-focus .v-captiontext { + text-decoration: underline; +} +.#{$primaryStyleName}-tabitem-selected.#{$primaryStyleName}-tabitem-focus .v-captiontext { + text-decoration: inherit; +} .#{$primaryStyleName}-content { border: 1px solid #aaa; /* Vertical borders are not supported, use v-tabsheet-tabcontainer and v-tabsheet-deco to present these borders */ diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index b2995dd0bd..bab759b812 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -120,6 +120,8 @@ url += '&theme=' + encodeURIComponent(theme); } + url += "&v-appId=" + appId; + var extraParams = getConfig('extraParams') if (extraParams !== undefined) { url += extraParams; diff --git a/WebContent/statictestfiles/vaadinsessions.jsp b/WebContent/statictestfiles/vaadinsessions.jsp new file mode 100644 index 0000000000..b22787a203 --- /dev/null +++ b/WebContent/statictestfiles/vaadinsessions.jsp @@ -0,0 +1,54 @@ +<!DOCTYPE> +<%@page import="com.vaadin.ui.UI"%> +<%@page import="com.vaadin.server.VaadinSession"%> +<HTML> +<HEAD> +<TITLE>JSP integration</TITLE> +<style> +table { + background: #fff; +} + +td { + border: 1px solid black; + padding: .5em; +} +</style> +</HEAD> +<BODY> + <table> + <tr> + <th align="left" colspan=4>Available UIs:</th> + </tr> + <tr> + <th>Service Name</th> + <th>CSRF token</th> + <th>UI id</th> + <th>UI type</th> + <th>Main content</th> + </tr> + <% + HttpSession httpSession = request.getSession(false); + for (VaadinSession vs : VaadinSession.getAllSessions(httpSession)) { + try { + vs.lock(); + for (UI ui : vs.getUIs()) { + out.append("<tr class='uirow'>"); + out.append("<td>" + vs.getService().getServiceName() + + "</td>"); + out.append("<td>" + vs.getCsrfToken() + "</td>"); + out.append("<td>" + ui.getUIId() + "</td>"); + out.append("<td>" + ui.getClass().getName() + "</td>"); + out.append("<td>" + ui.getContent().getClass().getName() + "</td>"); + out.append("</tr>"); + + } + } finally { + vs.unlock(); + } + + } + %> + </table> +</BODY> +</HTML>
\ No newline at end of file diff --git a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java index 5c3810099a..fb7b672b21 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java @@ -37,7 +37,6 @@ public class FetchReleaseNotesTickets { URLConnection connection = url.openConnection(); InputStream urlStream = connection.getInputStream(); - @SuppressWarnings("unchecked") List<String> tickets = IOUtils.readLines(urlStream); for (String ticket : tickets) { diff --git a/client-compiler/ivy.xml b/client-compiler/ivy.xml index f66a2e0255..f0fa5a49b0 100644 --- a/client-compiler/ivy.xml +++ b/client-compiler/ivy.xml @@ -31,33 +31,56 @@ <dependency org="commons-collections" name="commons-collections" rev="3.1" conf="build,ide -> default" /> <dependency org="commons-logging" name="commons-logging" - rev="1.1.1" conf="build,ide -> default" /> + rev="1.1.3" conf="build,ide -> default" /> <dependency org="ant" name="ant" rev="1.6.5" conf="build,ide -> default" /> <dependency org="net.sourceforge.cssparser" name="cssparser" - rev="0.9.5" conf="build,ide -> default" /> + rev="0.9.11" conf="build,ide -> default" /> <dependency org="ant" name="ant" rev="1.6.5" conf="build,ide -> default" /> <dependency org="ant" name="ant-launcher" rev="1.6.5" conf="build,ide -> default" /> - <dependency org="org.mortbay.jetty" name="jetty" rev="6.1.11" - conf="build,ide -> default" /> - <dependency org="org.mortbay.jetty" name="jetty-util" - rev="6.1.11" conf="build,ide -> default" /> + + <dependency org="org.eclipse.jetty" name="jetty-server" + rev="8.1.12.v20130726" conf="build,ide -> default"> + <exclude org="org.eclipse.jetty.orbit"></exclude> + </dependency> + <dependency org="org.eclipse.jetty" name="jetty-util" + rev="8.1.12.v20130726" conf="build,ide -> default" /> + <dependency org="org.jdesktop" name="swing-worker" rev="1.1" conf="build,ide -> default" /> <dependency org="commons-codec" name="commons-codec" - rev="1.3" conf="build,ide -> default" /> - <dependency org="commons-io" name="commons-io" rev="2.2" + rev="1.8" conf="build,ide -> default" /> + <dependency org="commons-io" name="commons-io" rev="2.4" conf="build,ide -> default" /> - <dependency org="commons-lang" name="commons-lang" - rev="2.6" conf="build,ide -> default" /> + <dependency org="org.apache.commons" name="commons-lang3" + rev="3.1" conf="build,ide -> default" /> <dependency org="org.apache.james" name="apache-mime4j" rev="0.6" conf="build,ide -> default" /> + <dependency org="org.apache.httpcomponents" name="httpclient" + rev="4.3.1" conf="build,ide -> default" /> + <dependency org="org.apache.httpcomponents" name="httpcore" + rev="4.3" conf="build,ide -> default" /> + <dependency org="org.apache.httpcomponents" name="httpmime" + rev="4.3.1" conf="build,ide -> default" /> + + <dependency org="net.sourceforge.nekohtml" name="nekohtml" + rev="1.9.19" conf="build,ide -> default" /> + <dependency org="xalan" name="serializer" rev="2.7.1" + conf="build,ide -> default" /> + <dependency org="xerces" name="xercesImpl" rev="2.11.0" + conf="build,ide -> default" /> + <dependency org="xml-apis" name="xml-apis" rev="1.4.01" + conf="build,ide -> default" /> + + <dependency org="com.ibm.icu" name="icu4j" rev="50.1.1" + conf="build,ide -> default" /> + <dependency org="com.vaadin" name="vaadin-client-compiler-deps" - rev="1.0.2" conf="build,ide -> default" /> + rev="1.1.0" conf="build,ide -> default" /> </dependencies> diff --git a/client/src/com/vaadin/Vaadin.gwt.xml b/client/src/com/vaadin/Vaadin.gwt.xml index a1dca07a1c..50600c5cbb 100644 --- a/client/src/com/vaadin/Vaadin.gwt.xml +++ b/client/src/com/vaadin/Vaadin.gwt.xml @@ -61,6 +61,6 @@ <add-linker name="xsiframe" /> <!-- Remove IE6/IE7 permutation as they are not supported --> - <set-property name="user.agent" value="ie8,ie9,ie10,gecko1_8,safari,opera" /> + <set-property name="user.agent" value="ie8,ie9,ie10,gecko1_8,safari" /> </module> diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java index a87fa3e342..8fddaf020c 100644 --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@ -50,6 +50,7 @@ import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.google.gwt.http.client.URL; import com.google.gwt.json.client.JSONArray; +import com.google.gwt.json.client.JSONNumber; import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONString; import com.google.gwt.regexp.shared.MatchResult; @@ -67,6 +68,7 @@ import com.vaadin.client.ApplicationConfiguration.ErrorMessage; import com.vaadin.client.ResourceLoader.ResourceLoadEvent; import com.vaadin.client.ResourceLoader.ResourceLoadListener; import com.vaadin.client.communication.HasJavaScriptConnectorHelper; +import com.vaadin.client.communication.Heartbeat; import com.vaadin.client.communication.JavaScriptMethodInvocation; import com.vaadin.client.communication.JsonDecoder; import com.vaadin.client.communication.JsonEncoder; @@ -91,6 +93,7 @@ import com.vaadin.client.ui.ui.UIConnector; import com.vaadin.client.ui.window.WindowConnector; import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.ApplicationConstants; +import com.vaadin.shared.JsonConstants; import com.vaadin.shared.Version; import com.vaadin.shared.communication.LegacyChangeVariablesInvocation; import com.vaadin.shared.communication.MethodInvocation; @@ -137,10 +140,6 @@ public class ApplicationConnection { public static final String ERROR_CLASSNAME_EXT = "-error"; - public static final char VAR_BURST_SEPARATOR = '\u001d'; - - public static final char VAR_ESCAPE_CHARACTER = '\u001b'; - /** * A string that, if found in a non-JSON response to a UIDL request, will * cause the browser to refresh the page. If followed by a colon, optional @@ -271,8 +270,6 @@ public class ApplicationConnection { /** Event bus for communication events */ private EventBus eventBus = GWT.create(SimpleEventBus.class); - private int lastResponseId = -1; - /** * The communication handler methods are called at certain points during * communication with the server. This allows for making add-ons that keep @@ -366,7 +363,7 @@ public class ApplicationConnection { * * To listen for the event add a {@link ApplicationStoppedHandler} by * invoking - * {@link ApplicationConnection#addHandler(ApplicationStoppedEvent.Type, ApplicationStoppedHandler)} + * {@link ApplicationConnection#addHandler(ApplicationConnection.ApplicationStoppedEvent.Type, ApplicationStoppedHandler)} * to the {@link ApplicationConnection} * * @since 7.1.8 @@ -431,6 +428,8 @@ public class ApplicationConnection { private VLoadingIndicator loadingIndicator; + private Heartbeat heartbeat = GWT.create(Heartbeat.class); + public static class MultiStepDuration extends Duration { private int previousStep = elapsedMillis(); @@ -493,7 +492,7 @@ public class ApplicationConnection { getLoadingIndicator().show(); - scheduleHeartbeat(); + heartbeat.init(this); Window.addWindowClosingHandler(new ClosingHandler() { @Override @@ -540,6 +539,10 @@ public class ApplicationConnection { // initial UIDL provided in DOM, continue as if returned by request handleJSONText(jsonText, -1); + + // Tooltip can't be created earlier because the necessary fields are + // not setup to add it in the correct place in the DOM + getVTooltip().showAssistive(new TooltipInfo(" ")); } } @@ -721,7 +724,7 @@ public class ApplicationConnection { }-*/; protected void repaintAll() { - makeUidlRequest("", getRepaintAllParameters()); + makeUidlRequest(new JSONArray(), getRepaintAllParameters()); } /** @@ -752,20 +755,25 @@ public class ApplicationConnection { /** * Makes an UIDL request to the server. * - * @param requestData - * Data that is passed to the server. + * @param reqInvocations + * Data containing RPC invocations and all related information. * @param extraParams * Parameters that are added as GET parameters to the url. * Contains key=value pairs joined by & characters or is empty if * no parameters should be added. Should not start with any * special character. */ - protected void makeUidlRequest(final String requestData, + protected void makeUidlRequest(final JSONArray reqInvocations, final String extraParams) { startRequest(); - // Security: double cookie submission pattern - final String payload = getCsrfToken() + VAR_BURST_SEPARATOR - + requestData; + + JSONObject payload = new JSONObject(); + payload.put(ApplicationConstants.CSRF_TOKEN, new JSONString( + getCsrfToken())); + payload.put(ApplicationConstants.RPC_INVOCATIONS, reqInvocations); + payload.put(ApplicationConstants.SERVER_SYNC_ID, new JSONNumber( + lastSeenServerSyncId)); + VConsole.log("Making UIDL Request with params: " + payload); String uri = translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX + ApplicationConstants.UIDL_PATH + '/'); @@ -789,7 +797,7 @@ public class ApplicationConnection { * @param payload * The contents of the request to send */ - protected void doUidlRequest(final String uri, final String payload) { + protected void doUidlRequest(final String uri, final JSONObject payload) { RequestCallback requestCallback = new RequestCallback() { @Override public void onError(Request request, Throwable exception) { @@ -956,14 +964,14 @@ public class ApplicationConnection { * @throws RequestException * if the request could not be sent */ - protected void doAjaxRequest(String uri, String payload, + protected void doAjaxRequest(String uri, JSONObject payload, RequestCallback requestCallback) throws RequestException { RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, uri); // TODO enable timeout // rb.setTimeoutMillis(timeoutMillis); // TODO this should be configurable - rb.setHeader("Content-Type", "text/plain;charset=utf-8"); - rb.setRequestData(payload); + rb.setHeader("Content-Type", JsonConstants.JSON_CONTENT_TYPE); + rb.setRequestData(payload.toString()); rb.setCallback(requestCallback); final Request request = rb.send(); @@ -1028,6 +1036,29 @@ public class ApplicationConnection { */ private ValueMap serverTimingInfo; + /** + * Holds the last seen response id given by the server. + * <p> + * The server generates a strictly increasing id for each response to each + * request from the client. This ID is then replayed back to the server on + * each request. This helps the server in knowing in what state the client + * is, and compare it to its own state. In short, it helps with concurrent + * changes between the client and server. + * <p> + * Initial value, i.e. no responses received from the server, is + * {@link #UNDEFINED_SYNC_ID} ({@value #UNDEFINED_SYNC_ID}). This happens + * between the bootstrap HTML being loaded and the first UI being rendered; + */ + private int lastSeenServerSyncId = UNDEFINED_SYNC_ID; + + /** + * The value of an undefined sync id. + * <p> + * This must be <code>-1</code>, because of the contract in + * {@link #getLastResponseId()} + */ + private static final int UNDEFINED_SYNC_ID = -1; + static final int MAX_CSS_WAITS = 100; protected void handleWhenCSSLoaded(final String jsonText, @@ -1308,7 +1339,13 @@ public class ApplicationConnection { * @return and id identifying the response */ public int getLastResponseId() { - return lastResponseId; + /* + * The discrepancy between field name and getter name is simply historic + * - API can't be changed, but the field was repurposed in a more + * general, yet compatible, use. "Response id" was deemed unsuitable a + * name, so it was called "server sync id" instead. + */ + return lastSeenServerSyncId; } protected void handleUIDLMessage(final Date start, final String jsonText, @@ -1335,6 +1372,17 @@ public class ApplicationConnection { VConsole.log("Handling message from server"); eventBus.fireEvent(new ResponseHandlingStartedEvent(this)); + if (json.containsKey(ApplicationConstants.SERVER_SYNC_ID)) { + int syncId = json.getInt(ApplicationConstants.SERVER_SYNC_ID); + + assert (lastSeenServerSyncId == UNDEFINED_SYNC_ID || syncId == lastSeenServerSyncId + 1) : "Newly retrieved server sync id was not exactly one larger than the previous one (new: " + + syncId + ", last seen: " + lastSeenServerSyncId + ")"; + + lastSeenServerSyncId = syncId; + } else { + VConsole.error("Server response didn't contain an id."); + } + // Handle redirect if (json.containsKey("redirect")) { String url = json.getValueMap("redirect").getString("url"); @@ -1343,8 +1391,6 @@ public class ApplicationConnection { return; } - lastResponseId++; - final MultiStepDuration handleUIDLDuration = new MultiStepDuration(); // Get security key @@ -2532,15 +2578,13 @@ public class ApplicationConnection { */ private void buildAndSendVariableBurst( LinkedHashMap<String, MethodInvocation> pendingInvocations) { - final StringBuffer req = new StringBuffer(); - while (!pendingInvocations.isEmpty()) { + JSONArray reqJson = new JSONArray(); + if (!pendingInvocations.isEmpty()) { if (ApplicationConfiguration.isDebugMode()) { Util.logVariableBurst(this, pendingInvocations.values()); } - JSONArray reqJson = new JSONArray(); - for (MethodInvocation invocation : pendingInvocations.values()) { JSONArray invocationJson = new JSONArray(); invocationJson.set(0, @@ -2579,9 +2623,6 @@ public class ApplicationConnection { reqJson.set(reqJson.size(), invocationJson); } - // escape burst separators (if any) - req.append(escapeBurstContents(reqJson.toString())); - pendingInvocations.clear(); // Keep tag string short lastInvocationTag = 0; @@ -2605,7 +2646,7 @@ public class ApplicationConnection { getConfiguration().setWidgetsetVersionSent(); } - makeUidlRequest(req.toString(), extraParams); + makeUidlRequest(reqJson, extraParams); } private boolean isJavascriptRpc(MethodInvocation invocation) { @@ -2849,35 +2890,6 @@ public class ApplicationConnection { } /** - * Encode burst separator characters in a String for transport over the - * network. This protects from separator injection attacks. - * - * @param value - * to encode - * @return encoded value - */ - protected String escapeBurstContents(String value) { - final StringBuilder result = new StringBuilder(); - for (int i = 0; i < value.length(); ++i) { - char character = value.charAt(i); - switch (character) { - case VAR_ESCAPE_CHARACTER: - // fall-through - escape character is duplicated - case VAR_BURST_SEPARATOR: - result.append(VAR_ESCAPE_CHARACTER); - // encode as letters for easier reading - result.append(((char) (character + 0x30))); - break; - default: - // the char is not a special one - add it to the result as is - result.append(character); - break; - } - } - return result.toString(); - } - - /** * Does absolutely nothing. Replaced by {@link LayoutManager}. * * @param container @@ -3304,20 +3316,11 @@ public class ApplicationConnection { * interval elapses if the interval is a positive number. Otherwise, does * nothing. * - * @see #sendHeartbeat() - * @see ApplicationConfiguration#getHeartbeatInterval() + * @deprecated as of 7.2, use {@link Heartbeat#schedule()} instead */ + @Deprecated protected void scheduleHeartbeat() { - final int interval = getConfiguration().getHeartbeatInterval(); - if (interval > 0) { - VConsole.log("Scheduling heartbeat in " + interval + " seconds"); - new Timer() { - @Override - public void run() { - sendHeartbeat(); - } - }.schedule(interval * 1000); - } + heartbeat.schedule(); } /** @@ -3326,51 +3329,12 @@ public class ApplicationConnection { * Heartbeat requests are used to inform the server that the client-side is * still alive. If the client page is closed or the connection lost, the * server will eventually close the inactive UI. - * <p> - * <b>TODO</b>: Improved error handling, like in doUidlRequest(). * - * @see #scheduleHeartbeat() + * @deprecated as of 7.2, use {@link Heartbeat#send()} instead */ + @Deprecated protected void sendHeartbeat() { - final String uri = addGetParameters( - translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX - + ApplicationConstants.HEARTBEAT_PATH + '/'), - UIConstants.UI_ID_PARAMETER + "=" - + getConfiguration().getUIId()); - - final RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, uri); - - final RequestCallback callback = new RequestCallback() { - - @Override - public void onResponseReceived(Request request, Response response) { - int status = response.getStatusCode(); - if (status == Response.SC_OK) { - // TODO Permit retry in some error situations - VConsole.log("Heartbeat response OK"); - scheduleHeartbeat(); - } else if (status == Response.SC_GONE) { - showSessionExpiredError(null); - } else { - VConsole.error("Failed sending heartbeat to server. Error code: " - + status); - } - } - - @Override - public void onError(Request request, Throwable exception) { - VConsole.error("Exception sending heartbeat: " + exception); - } - }; - - rb.setCallback(callback); - - try { - VConsole.log("Sending heartbeat request..."); - rb.send(); - } catch (RequestException re) { - callback.onError(null, re); - } + heartbeat.send(); } /** diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index 1ced003146..4fb656b16d 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -1029,6 +1029,98 @@ public class LayoutManager { } /** + * Gets the top border of the given element, provided that it has been + * measured. These elements are guaranteed to be measured: + * <ul> + * <li>ManagedLayotus and their child Connectors + * <li>Elements for which there is at least one ElementResizeListener + * <li>Elements for which at least one ManagedLayout has registered a + * dependency + * </ul> + * + * A negative number is returned if the element has not been measured. If 0 + * is returned, it might indicate that the element is not attached to the + * DOM. + * + * @param element + * the element to get the measured size for + * @return the measured top border of the element in pixels. + */ + public int getBorderTop(Element element) { + assert needsMeasure(element) : "Getting measurement for element that is not measured"; + return getMeasuredSize(element, nullSize).getBorderTop(); + } + + /** + * Gets the left border of the given element, provided that it has been + * measured. These elements are guaranteed to be measured: + * <ul> + * <li>ManagedLayotus and their child Connectors + * <li>Elements for which there is at least one ElementResizeListener + * <li>Elements for which at least one ManagedLayout has registered a + * dependency + * </ul> + * + * A negative number is returned if the element has not been measured. If 0 + * is returned, it might indicate that the element is not attached to the + * DOM. + * + * @param element + * the element to get the measured size for + * @return the measured left border of the element in pixels. + */ + public int getBorderLeft(Element element) { + assert needsMeasure(element) : "Getting measurement for element that is not measured"; + return getMeasuredSize(element, nullSize).getBorderLeft(); + } + + /** + * Gets the bottom border of the given element, provided that it has been + * measured. These elements are guaranteed to be measured: + * <ul> + * <li>ManagedLayotus and their child Connectors + * <li>Elements for which there is at least one ElementResizeListener + * <li>Elements for which at least one ManagedLayout has registered a + * dependency + * </ul> + * + * A negative number is returned if the element has not been measured. If 0 + * is returned, it might indicate that the element is not attached to the + * DOM. + * + * @param element + * the element to get the measured size for + * @return the measured bottom border of the element in pixels. + */ + public int getBorderBottom(Element element) { + assert needsMeasure(element) : "Getting measurement for element that is not measured"; + return getMeasuredSize(element, nullSize).getBorderBottom(); + } + + /** + * Gets the right border of the given element, provided that it has been + * measured. These elements are guaranteed to be measured: + * <ul> + * <li>ManagedLayotus and their child Connectors + * <li>Elements for which there is at least one ElementResizeListener + * <li>Elements for which at least one ManagedLayout has registered a + * dependency + * </ul> + * + * A negative number is returned if the element has not been measured. If 0 + * is returned, it might indicate that the element is not attached to the + * DOM. + * + * @param element + * the element to get the measured size for + * @return the measured right border of the element in pixels. + */ + public int getBorderRight(Element element) { + assert needsMeasure(element) : "Getting measurement for element that is not measured"; + return getMeasuredSize(element, nullSize).getBorderRight(); + } + + /** * Gets the padding width (left padding + right padding) of the given * element, provided that it has been measured. These elements are * guaranteed to be measured: @@ -1449,10 +1541,15 @@ public class LayoutManager { /** * Informs this LayoutManager that the size of a component might have - * changed. If there is no upcoming layout phase, a new layout phase is - * scheduled. This method should be used whenever a size might have changed - * from outside of Vaadin's normal update phase, e.g. when an icon has been - * loaded or when the user resizes some part of the UI using the mouse. + * changed. This method should be used whenever the size of an individual + * component might have changed from outside of Vaadin's normal update + * phase, e.g. when an icon has been loaded or when the user resizes some + * part of the UI using the mouse. + * <p> + * To set an entire component hierarchy to be measured, use + * {@link #setNeedsMeasureRecursively(ComponentConnector)} instead. + * <p> + * If there is no upcoming layout phase, a new layout phase is scheduled. * * @param component * the component whose size might have changed. @@ -1466,6 +1563,33 @@ public class LayoutManager { } } + /** + * Informs this LayoutManager that some sizes in a component hierarchy might + * have changed. This method should be used whenever the size of any child + * component might have changed from outside of Vaadin's normal update + * phase, e.g. when a CSS class name related to sizing has been changed. + * <p> + * To set a single component to be measured, use + * {@link #setNeedsMeasure(ComponentConnector)} instead. + * <p> + * If there is no upcoming layout phase, a new layout phase is scheduled. + * + * @since 7.2 + * @param component + * the component at the root of the component hierarchy to + * measure + */ + public void setNeedsMeasureRecursively(ComponentConnector component) { + setNeedsMeasure(component); + + if (component instanceof HasComponentsConnector) { + HasComponentsConnector hasComponents = (HasComponentsConnector) component; + for (ComponentConnector child : hasComponents.getChildComponents()) { + setNeedsMeasureRecursively(child); + } + } + } + public void setEverythingNeedsMeasure() { everythingNeedsMeasure = true; } diff --git a/client/src/com/vaadin/client/Profiler.java b/client/src/com/vaadin/client/Profiler.java index 083f2559b1..cfce59b08b 100644 --- a/client/src/com/vaadin/client/Profiler.java +++ b/client/src/com/vaadin/client/Profiler.java @@ -297,10 +297,6 @@ public class Profiler { if (isEnabled()) { double now = Duration.currentTimeMillis(); - StringBuilder stringBuilder = new StringBuilder( - "Time since window.performance.timing events"); - SimpleTree tree = new SimpleTree(stringBuilder.toString()); - String[] keys = new String[] { "navigationStart", "unloadEventStart", "unloadEventEnd", "redirectStart", "redirectEnd", "fetchStart", "domainLookupStart", diff --git a/client/src/com/vaadin/client/VCaption.java b/client/src/com/vaadin/client/VCaption.java index d0338de4a1..d96e6ed653 100644 --- a/client/src/com/vaadin/client/VCaption.java +++ b/client/src/com/vaadin/client/VCaption.java @@ -42,6 +42,8 @@ public class VCaption extends HTML { private Icon icon; + private String iconAltText = ""; + private Element captionText; private final ApplicationConnection client; @@ -112,6 +114,8 @@ public class VCaption extends HTML { if (null != owner) { AriaHelper.bindCaption(owner.getWidget(), null); + AriaHelper.handleInputInvalid(owner.getWidget(), false); + AriaHelper.handleInputRequired(owner.getWidget(), false); } } @@ -300,6 +304,14 @@ public class VCaption extends HTML { @Deprecated public boolean updateCaptionWithoutOwner(String caption, boolean disabled, boolean hasDescription, boolean hasError, String iconURL) { + return updateCaptionWithoutOwner(caption, disabled, hasDescription, + hasError, iconURL, ""); + } + + @Deprecated + public boolean updateCaptionWithoutOwner(String caption, boolean disabled, + boolean hasDescription, boolean hasError, String iconURL, + String iconAltText) { boolean wasPlacedAfterComponent = placedAfterComponent; // Caption is placed after component unless there is some part which @@ -332,7 +344,7 @@ public class VCaption extends HTML { // Icon forces the caption to be above the component placedAfterComponent = false; - icon.setUri(iconURL); + icon.setUri(iconURL, iconAltText); } else if (icon != null) { // Remove existing diff --git a/client/src/com/vaadin/client/VErrorMessage.java b/client/src/com/vaadin/client/VErrorMessage.java index 2e42b98a05..a384b451dd 100644 --- a/client/src/com/vaadin/client/VErrorMessage.java +++ b/client/src/com/vaadin/client/VErrorMessage.java @@ -31,9 +31,6 @@ public class VErrorMessage extends FlowPanel { public VErrorMessage() { super(); setStyleName(CLASSNAME); - - // Needed for binding with WAI-ARIA attributes - getElement().setId(DOM.createUniqueId()); } /** diff --git a/client/src/com/vaadin/client/VTooltip.java b/client/src/com/vaadin/client/VTooltip.java index 6191821988..e5c2ba117a 100644 --- a/client/src/com/vaadin/client/VTooltip.java +++ b/client/src/com/vaadin/client/VTooltip.java @@ -15,7 +15,8 @@ */ package com.vaadin.client; -import com.google.gwt.aria.client.Id; +import com.google.gwt.aria.client.LiveValue; +import com.google.gwt.aria.client.RelevantValue; import com.google.gwt.aria.client.Roles; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; @@ -36,12 +37,12 @@ import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; -import com.vaadin.client.ui.VOverlay; +import com.vaadin.client.ui.VWindowOverlay; /** * TODO open for extension */ -public class VTooltip extends VOverlay { +public class VTooltip extends VWindowOverlay { private static final String CLASSNAME = "v-tooltip"; private static final int MARGIN = 4; public static final int TOOLTIP_EVENTS = Event.ONKEYDOWN @@ -57,7 +58,6 @@ public class VTooltip extends VOverlay { private boolean justClosed = false; private String uniqueId = DOM.createUniqueId(); - private Element layoutElement; private int maxWidth; // Delays for the tooltip, configurable on the server side @@ -80,17 +80,28 @@ public class VTooltip extends VOverlay { setWidget(layout); layout.add(em); DOM.setElementProperty(description, "className", CLASSNAME + "-text"); - - layoutElement = layout.getElement(); - DOM.appendChild(layoutElement, description); + DOM.appendChild(layout.getElement(), description); setSinkShadowEvents(true); - // Used to bind the tooltip to the owner for assistive devices - layoutElement.setId(uniqueId); + // When a tooltip is shown, the content of the tooltip changes. With a + // tooltip being a live-area, this change is notified to a assistive + // device. + Roles.getTooltipRole().set(getElement()); + Roles.getTooltipRole().setAriaLiveProperty(getElement(), + LiveValue.ASSERTIVE); + Roles.getTooltipRole().setAriaRelevantProperty(getElement(), + RelevantValue.ADDITIONS); + } - description.setId(DOM.createUniqueId()); - Roles.getTooltipRole().set(layoutElement); - Roles.getTooltipRole().setAriaHiddenState(layoutElement, true); + /** + * Show the tooltip with the provided info for assistive devices. + * + * @param info + * with the content of the tooltip + */ + public void showAssistive(TooltipInfo info) { + updatePosition(null, true); + show(info); } /** @@ -229,10 +240,11 @@ public class VTooltip extends VOverlay { @Override public void hide() { - super.hide(); - Roles.getTooltipRole().setAriaHiddenState(layoutElement, true); - Roles.getTooltipRole().removeAriaDescribedbyProperty( - tooltipEventHandler.currentElement); + em.updateMessage(""); + description.setInnerHTML(""); + + updatePosition(null, true); + setPopupPosition(tooltipEventMouseX, tooltipEventMouseY); } private int tooltipEventMouseX; @@ -287,9 +299,9 @@ public class VTooltip extends VOverlay { private com.google.gwt.dom.client.Element currentElement = null; /** - * Current element focused + * Marker for handling of tooltip through focus */ - private boolean currentIsFocused; + private boolean handledByFocus; /** * Current tooltip active @@ -392,6 +404,7 @@ public class VTooltip extends VOverlay { */ @Override public void onBlur(BlurEvent be) { + handledByFocus = false; handleHideEvent(); } @@ -401,7 +414,7 @@ public class VTooltip extends VOverlay { .getEventTarget()); // We can ignore move event if it's handled by move or over already - if (currentElement == element && currentIsFocused == isFocused) { + if (currentElement == element && handledByFocus == true) { return; } @@ -409,27 +422,20 @@ public class VTooltip extends VOverlay { if (!connectorAndTooltipFound) { if (isShowing()) { handleHideEvent(); - Roles.getButtonRole() - .removeAriaDescribedbyProperty(element); } else { currentTooltipInfo = null; } } else { updatePosition(event, isFocused); - if (isShowing()) { + if (isShowing() && !isFocused) { replaceCurrentTooltip(); - Roles.getTooltipRole().removeAriaDescribedbyProperty( - currentElement); } else { showTooltip(); } - - Roles.getTooltipRole().setAriaDescribedbyProperty(element, - Id.of(uniqueId)); } - currentIsFocused = isFocused; + handledByFocus = isFocused; currentElement = element; } } @@ -464,9 +470,11 @@ public class VTooltip extends VOverlay { @Override public void setPopupPositionAndShow(PositionCallback callback) { - super.setPopupPositionAndShow(callback); - - Roles.getTooltipRole().setAriaHiddenState(layoutElement, false); + if (isAttached()) { + callback.setPosition(getOffsetWidth(), getOffsetHeight()); + } else { + super.setPopupPositionAndShow(callback); + } } /** diff --git a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java index 95584412cd..9eb2b881bb 100644 --- a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.Scheduler; +import com.google.gwt.json.client.JSONObject; import com.google.gwt.user.client.Command; import com.vaadin.client.ApplicationConfiguration; import com.vaadin.client.ApplicationConnection; @@ -110,7 +111,7 @@ public class AtmospherePushConnection implements PushConnection { private JavaScriptObject socket; - private ArrayList<String> messageQueue = new ArrayList<String>(); + private ArrayList<JSONObject> messageQueue = new ArrayList<JSONObject>(); private State state = State.CONNECT_PENDING; @@ -191,14 +192,8 @@ public class AtmospherePushConnection implements PushConnection { } } - /* - * (non-Javadoc) - * - * @see - * com.vaadin.client.communication.PushConenction#push(java.lang.String) - */ @Override - public void push(String message) { + public void push(JSONObject message) { switch (state) { case CONNECT_PENDING: assert isActive(); @@ -210,12 +205,13 @@ public class AtmospherePushConnection implements PushConnection { VConsole.log("Sending push message: " + message); if (transport.equals("websocket")) { - FragmentedMessage fragmented = new FragmentedMessage(message); + FragmentedMessage fragmented = new FragmentedMessage( + message.toString()); while (fragmented.hasNextFragment()) { doPush(socket, fragmented.getNextFragment()); } } else { - doPush(socket, message); + doPush(socket, message.toString()); } break; case DISCONNECT_PENDING: @@ -254,7 +250,7 @@ public class AtmospherePushConnection implements PushConnection { switch (state) { case CONNECT_PENDING: state = State.CONNECTED; - for (String message : messageQueue) { + for (JSONObject message : messageQueue) { push(message); } messageQueue.clear(); diff --git a/client/src/com/vaadin/client/communication/Date_Serializer.java b/client/src/com/vaadin/client/communication/Date_Serializer.java new file mode 100644 index 0000000000..c6eb7af188 --- /dev/null +++ b/client/src/com/vaadin/client/communication/Date_Serializer.java @@ -0,0 +1,44 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.client.communication; + +import java.util.Date; + +import com.google.gwt.json.client.JSONNumber; +import com.google.gwt.json.client.JSONValue; +import com.vaadin.client.ApplicationConnection; +import com.vaadin.client.metadata.Type; + +/** + * Client side serializer/deserializer for java.util.Date + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class Date_Serializer implements JSONSerializer<Date> { + + @Override + public Date deserialize(Type type, JSONValue jsonValue, + ApplicationConnection connection) { + return new Date((long) ((JSONNumber) jsonValue).doubleValue()); + } + + @Override + public JSONValue serialize(Date value, ApplicationConnection connection) { + return new JSONNumber(value.getTime()); + } + +} diff --git a/client/src/com/vaadin/client/communication/Heartbeat.java b/client/src/com/vaadin/client/communication/Heartbeat.java new file mode 100644 index 0000000000..4b80827127 --- /dev/null +++ b/client/src/com/vaadin/client/communication/Heartbeat.java @@ -0,0 +1,171 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.client.communication; + +import java.util.logging.Logger; + +import com.google.gwt.http.client.Request; +import com.google.gwt.http.client.RequestBuilder; +import com.google.gwt.http.client.RequestCallback; +import com.google.gwt.http.client.RequestException; +import com.google.gwt.http.client.Response; +import com.google.gwt.user.client.Timer; +import com.vaadin.client.ApplicationConnection; +import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent; +import com.vaadin.shared.ApplicationConstants; +import com.vaadin.shared.ui.ui.UIConstants; + +/** + * Handles sending of heartbeats to the server and reacting to the response + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class Heartbeat { + + private int interval = -1; + private Timer timer = new Timer() { + @Override + public void run() { + send(); + } + }; + + private ApplicationConnection connection; + + private static Logger getLogger() { + return Logger.getLogger(Heartbeat.class.getName()); + } + + /** + * Initializes the heartbeat for the given application connection + * + * @param connection + * the connection + */ + public void init(ApplicationConnection connection) { + this.connection = connection; + interval = connection.getConfiguration().getHeartbeatInterval(); + setInterval(interval); + schedule(); + + connection.addHandler( + ApplicationConnection.ApplicationStoppedEvent.TYPE, + new ApplicationConnection.ApplicationStoppedHandler() { + + @Override + public void onApplicationStopped( + ApplicationStoppedEvent event) { + setInterval(-1); + schedule(); + } + }); + + } + + /** + * Sends a heartbeat to the server + */ + public void send() { + final String uri = ApplicationConnection.addGetParameters( + getConnection().translateVaadinUri( + ApplicationConstants.APP_PROTOCOL_PREFIX + + ApplicationConstants.HEARTBEAT_PATH + '/'), + UIConstants.UI_ID_PARAMETER + "=" + + getConnection().getConfiguration().getUIId()); + + final RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, uri); + + final RequestCallback callback = new RequestCallback() { + + @Override + public void onResponseReceived(Request request, Response response) { + int status = response.getStatusCode(); + if (status == Response.SC_OK) { + // TODO Permit retry in some error situations + getLogger().fine("Heartbeat response OK"); + schedule(); + } else if (status == Response.SC_GONE) { + // FIXME This should really do something else like send an + // event + getConnection().showSessionExpiredError(null); + } else { + getLogger().warning( + "Failed sending heartbeat to server. Error code: " + + status); + } + } + + @Override + public void onError(Request request, Throwable exception) { + getLogger().severe("Exception sending heartbeat: " + exception); + } + }; + + rb.setCallback(callback); + + try { + getLogger().fine("Sending heartbeat request..."); + rb.send(); + } catch (RequestException re) { + callback.onError(null, re); + } + + } + + /** + * @return the interval at which heartbeat requests are sent + */ + public int getInterval() { + return interval; + } + + /** + * sets the interval at which heartbeat requests are sent + * + * @param interval + * the new interval + */ + public void setInterval(int interval) { + this.interval = interval; + } + + /** + * Updates the schedule of the heartbeat to match the set interval. A + * negative interval disables the heartbeat. + */ + public void schedule() { + if (getInterval() > 0) { + getLogger() + .fine("Scheduling heartbeat in " + interval + " seconds"); + timer.schedule(interval * 1000); + } else { + if (timer != null) { + getLogger().fine("Disabling heartbeat"); + timer.cancel(); + } + } + + } + + /** + * @return the application connection + */ + protected ApplicationConnection getConnection() { + return connection; + } + +} diff --git a/client/src/com/vaadin/client/communication/JSONSerializer.java b/client/src/com/vaadin/client/communication/JSONSerializer.java index e5829ece24..a4e78e503c 100644 --- a/client/src/com/vaadin/client/communication/JSONSerializer.java +++ b/client/src/com/vaadin/client/communication/JSONSerializer.java @@ -23,14 +23,17 @@ import com.vaadin.client.metadata.Type; /** * Implementors of this interface knows how to serialize an Object of a given * type to JSON and how to deserialize the JSON back into an object. - * + * <p> * The {@link #serialize(Object, ApplicationConnection)} and * {@link #deserialize(Type, JSONValue, ApplicationConnection)} methods must be * symmetric so they can be chained and produce the original result (or an equal * result). - * + * <p> * Each {@link JSONSerializer} implementation can handle an object of a single * type - see {@link Type#findSerializer()}. + * <p> + * This is the client side interface, see + * com.vaadin.server.communication.JSONSerializer for the server side interface. * * @since 7.0 */ diff --git a/client/src/com/vaadin/client/communication/PushConnection.java b/client/src/com/vaadin/client/communication/PushConnection.java index a7eba224be..ba79af9d2c 100644 --- a/client/src/com/vaadin/client/communication/PushConnection.java +++ b/client/src/com/vaadin/client/communication/PushConnection.java @@ -16,6 +16,7 @@ package com.vaadin.client.communication; +import com.google.gwt.json.client.JSONObject; import com.google.gwt.user.client.Command; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.ApplicationConnection.CommunicationErrorHandler; @@ -53,14 +54,14 @@ public interface PushConnection { * replay those messages in the original order when the connection has been * established. * - * @param message - * the message to push + * @param payload + * the payload to push * @throws IllegalStateException * if this connection is not active * * @see #isActive() */ - public void push(String message); + public void push(JSONObject payload); /** * Checks whether this push connection is in a state where it can push diff --git a/client/src/com/vaadin/client/ui/Icon.java b/client/src/com/vaadin/client/ui/Icon.java index 9d5829c079..4a0e858798 100644 --- a/client/src/com/vaadin/client/ui/Icon.java +++ b/client/src/com/vaadin/client/ui/Icon.java @@ -34,11 +34,19 @@ public class Icon extends UIObject { } public Icon(ApplicationConnection client, String uidlUri) { + this(client, uidlUri, ""); + } + + public Icon(ApplicationConnection client, String uidlUri, String iconAltText) { this(client); - setUri(uidlUri); + setUri(uidlUri, iconAltText); } public void setUri(String uidlUri) { + setUri(uidlUri, ""); + } + + public void setUri(String uidlUri, String uidlAlt) { if (!uidlUri.equals(myUri)) { /* * Start sinking onload events, widgets responsibility to react. We @@ -51,6 +59,8 @@ public class Icon extends UIObject { DOM.setElementProperty(getElement(), "src", uri); myUri = uidlUri; } + + setAlternateText(uidlAlt); } /** @@ -63,5 +73,4 @@ public class Icon extends UIObject { getElement().setAttribute("alt", alternateText == null ? "" : alternateText); } - } diff --git a/client/src/com/vaadin/client/ui/VAccordion.java b/client/src/com/vaadin/client/ui/VAccordion.java index f87186fe37..ddfe9dbc2c 100644 --- a/client/src/com/vaadin/client/ui/VAccordion.java +++ b/client/src/com/vaadin/client/ui/VAccordion.java @@ -463,7 +463,6 @@ public class VAccordion extends VTabsheetBase { } @Override - @SuppressWarnings("unchecked") public Iterator<Widget> getWidgetIterator() { return widgets.iterator(); } diff --git a/client/src/com/vaadin/client/ui/VCalendarPanel.java b/client/src/com/vaadin/client/ui/VCalendarPanel.java index 96678fd133..b043cd0ab7 100644 --- a/client/src/com/vaadin/client/ui/VCalendarPanel.java +++ b/client/src/com/vaadin/client/ui/VCalendarPanel.java @@ -170,8 +170,6 @@ public class VCalendarPanel extends FocusableFlexTable implements private Resolution resolution = Resolution.YEAR; - private int focusedRow; - private Timer mouseTimer; private Date value; @@ -256,7 +254,6 @@ public class VCalendarPanel extends FocusableFlexTable implements if (curday.getDate().equals(date)) { curday.addStyleDependentName(CN_FOCUSED); focusedDay = curday; - focusedRow = i; return; } } @@ -741,7 +738,6 @@ public class VCalendarPanel extends FocusableFlexTable implements } if (curr.equals(focusedDate)) { focusedDay = day; - focusedRow = weekOfMonth; if (hasFocus) { day.addStyleDependentName(CN_FOCUSED); } @@ -1795,10 +1791,8 @@ public class VCalendarPanel extends FocusableFlexTable implements * Updates the valus to correspond to the values in value */ public void updateTimes() { - boolean selected = true; if (value == null) { value = new Date(); - selected = false; } if (getDateTimeService().isTwelveHourClock()) { int h = value.getHours(); @@ -1833,10 +1827,6 @@ public class VCalendarPanel extends FocusableFlexTable implements } - private int getMilliseconds() { - return DateTimeService.getMilliseconds(value); - } - private DateTimeService getDateTimeService() { if (dateTimeService == null) { dateTimeService = new DateTimeService(); @@ -2034,7 +2024,6 @@ public class VCalendarPanel extends FocusableFlexTable implements private static final String SUBPART_HOUR_SELECT = "h"; private static final String SUBPART_MINUTE_SELECT = "m"; private static final String SUBPART_SECS_SELECT = "s"; - private static final String SUBPART_MSECS_SELECT = "ms"; private static final String SUBPART_AMPM_SELECT = "ampm"; private static final String SUBPART_DAY = "day"; private static final String SUBPART_MONTH_YEAR_HEADER = "header"; diff --git a/client/src/com/vaadin/client/ui/VFilterSelect.java b/client/src/com/vaadin/client/ui/VFilterSelect.java index 63c8d3dbf9..9bace9141c 100644 --- a/client/src/com/vaadin/client/ui/VFilterSelect.java +++ b/client/src/com/vaadin/client/ui/VFilterSelect.java @@ -1786,6 +1786,11 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, if (client.hasEventListeners(this, EventId.FOCUS)) { client.updateVariable(paintableId, EventId.FOCUS, "", true); } + + ComponentConnector connector = ConnectorMap.get(client).getConnector( + this); + client.getVTooltip().showAssistive( + connector.getTooltipInfo(getElement())); } /** diff --git a/client/src/com/vaadin/client/ui/VLabel.java b/client/src/com/vaadin/client/ui/VLabel.java index 8acd653778..35f47d540a 100644 --- a/client/src/com/vaadin/client/ui/VLabel.java +++ b/client/src/com/vaadin/client/ui/VLabel.java @@ -18,7 +18,6 @@ package com.vaadin.client.ui; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.HTML; -import com.vaadin.client.ApplicationConnection; import com.vaadin.client.BrowserInfo; import com.vaadin.client.Util; import com.vaadin.client.VTooltip; @@ -28,8 +27,6 @@ public class VLabel extends HTML { public static final String CLASSNAME = "v-label"; private static final String CLASSNAME_UNDEFINED_WIDTH = "v-label-undef-w"; - private ApplicationConnection connection; - public VLabel() { super(); setStyleName(CLASSNAME); @@ -71,9 +68,4 @@ public class VLabel extends HTML { super.setText(text); } } - - /** For internal use only. May be removed or replaced in the future. */ - public void setConnection(ApplicationConnection client) { - connection = client; - } } diff --git a/client/src/com/vaadin/client/ui/VLink.java b/client/src/com/vaadin/client/ui/VLink.java index fa4ee36bcf..064a012873 100644 --- a/client/src/com/vaadin/client/ui/VLink.java +++ b/client/src/com/vaadin/client/ui/VLink.java @@ -23,7 +23,6 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.HTML; -import com.vaadin.client.ApplicationConnection; import com.vaadin.client.Util; import com.vaadin.shared.ui.BorderStyle; @@ -70,9 +69,6 @@ public class VLink extends HTML implements ClickHandler { /** For internal use only. May be removed or replaced in the future. */ public Icon icon; - /** For internal use only. May be removed or replaced in the future. */ - public ApplicationConnection client; - public VLink() { super(); getElement().appendChild(anchor); diff --git a/client/src/com/vaadin/client/ui/VNativeButton.java b/client/src/com/vaadin/client/ui/VNativeButton.java index 67fa6f2ee3..d38e4c3374 100644 --- a/client/src/com/vaadin/client/ui/VNativeButton.java +++ b/client/src/com/vaadin/client/ui/VNativeButton.java @@ -33,8 +33,6 @@ public class VNativeButton extends Button implements ClickHandler { public static final String CLASSNAME = "v-nativebutton"; - protected String width = null; - /** For internal use only. May be removed or replaced in the future. */ public String paintableId; @@ -123,12 +121,6 @@ public class VNativeButton extends Button implements ClickHandler { } } - @Override - public void setWidth(String width) { - this.width = width; - super.setWidth(width); - } - /* * (non-Javadoc) * diff --git a/client/src/com/vaadin/client/ui/VNotification.java b/client/src/com/vaadin/client/ui/VNotification.java index 7019394e3b..128de0a285 100644 --- a/client/src/com/vaadin/client/ui/VNotification.java +++ b/client/src/com/vaadin/client/ui/VNotification.java @@ -21,19 +21,25 @@ import java.util.Date; import java.util.EventObject; import java.util.Iterator; +import com.google.gwt.aria.client.Roles; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Timer; +import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.BrowserInfo; import com.vaadin.client.UIDL; import com.vaadin.client.Util; +import com.vaadin.client.ui.aria.AriaHelper; import com.vaadin.shared.Position; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; import com.vaadin.shared.ui.ui.UIConstants; public class VNotification extends VOverlay { @@ -46,6 +52,12 @@ public class VNotification extends VOverlay { public static final Position BOTTOM_LEFT = Position.BOTTOM_LEFT; public static final Position BOTTOM_RIGHT = Position.BOTTOM_RIGHT; + /** + * Position that is only accessible for assistive devices, invisible for + * visual users. + */ + public static final Position ASSISTIVE = Position.ASSISTIVE; + public static final int DELAY_FOREVER = -1; public static final int DELAY_NONE = 0; @@ -149,15 +161,67 @@ public class VNotification extends VOverlay { } public void show(Widget widget, Position position, String style) { - setWidget(widget); + NotificationConfigurationBean styleSetup = getUiState(style); + setWaiAriaRole(styleSetup); + + FlowPanel panel = new FlowPanel(); + if (styleSetup.hasAssistivePrefix()) { + panel.add(new Label(styleSetup.getAssistivePrefix())); + AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(), + true); + } + + panel.add(widget); + + if (styleSetup.hasAssistivePostfix()) { + panel.add(new Label(styleSetup.getAssistivePostfix())); + AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(), + true); + } + setWidget(panel); show(position, style); } public void show(String html, Position position, String style) { - setWidget(new HTML(html)); + NotificationConfigurationBean styleSetup = getUiState(style); + String assistiveDeviceOnlyStyle = AriaHelper.ASSISTIVE_DEVICE_ONLY_STYLE; + + setWaiAriaRole(styleSetup); + + String type = ""; + String usage = ""; + + if (styleSetup != null && styleSetup.hasAssistivePrefix()) { + type = "<span class='" + assistiveDeviceOnlyStyle + "'>" + + styleSetup.getAssistivePrefix() + "</span>"; + } + + if (styleSetup != null && styleSetup.hasAssistivePostfix()) { + usage = "<span class='" + assistiveDeviceOnlyStyle + "'>" + + styleSetup.getAssistivePostfix() + "</span>"; + } + + setWidget(new HTML(type + html + usage)); show(position, style); } + private NotificationConfigurationBean getUiState(String style) { + NotificationConfigurationBean styleSetup = getApplicationConnection() + .getUIConnector().getState().notificationConfiguration.setup + .get(style); + return styleSetup; + } + + private void setWaiAriaRole(NotificationConfigurationBean styleSetup) { + Roles.getAlertRole().set(getElement()); + + if (styleSetup != null && styleSetup.getAssistiveRole() != null) { + if (Role.STATUS == styleSetup.getAssistiveRole()) { + Roles.getStatusRole().set(getElement()); + } + } + } + public void show(Position position, String style) { setOpacity(getElement(), startOpacity); if (style != null) { @@ -257,6 +321,10 @@ public class VNotification extends VOverlay { DOM.setStyleAttribute(el, "top", ""); DOM.setStyleAttribute(el, "bottom", "0px"); break; + case ASSISTIVE: + DOM.setStyleAttribute(el, "top", "-2000px"); + DOM.setStyleAttribute(el, "left", "-2000px"); + break; default: case MIDDLE_CENTER: center(); @@ -377,7 +445,8 @@ public class VNotification extends VOverlay { final String parsedUri = client .translateVaadinUri(notification .getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_ICON)); - html += "<img src=\"" + Util.escapeAttribute(parsedUri) + "\" />"; + html += "<img src=\"" + Util.escapeAttribute(parsedUri) + + "\" alt=\"\" />"; } if (notification .hasAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION)) { @@ -417,6 +486,8 @@ public class VNotification extends VOverlay { public static VNotification createNotification(int delayMsec, Widget owner) { final VNotification notification = GWT.create(VNotification.class); + notification.setWaiAriaRole(null); + notification.delayMsec = delayMsec; if (BrowserInfo.get().isTouchDevice()) { new Timer() { diff --git a/client/src/com/vaadin/client/ui/VOverlay.java b/client/src/com/vaadin/client/ui/VOverlay.java index e2c9001fed..545af2ce83 100644 --- a/client/src/com/vaadin/client/ui/VOverlay.java +++ b/client/src/com/vaadin/client/ui/VOverlay.java @@ -172,7 +172,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { * * See default theme 'shadow.css' for implementation example. */ - private static final String SHADOW_HTML = "<div class=\"top-left\"></div><div class=\"top\"></div><div class=\"top-right\"></div><div class=\"left\"></div><div class=\"center\"></div><div class=\"right\"></div><div class=\"bottom-left\"></div><div class=\"bottom\"></div><div class=\"bottom-right\"></div>"; + private static final String SHADOW_HTML = "<div aria-hidden=\"true\" class=\"top-left\"></div><div class=\"top\"></div><div class=\"top-right\"></div><div class=\"left\"></div><div class=\"center\"></div><div class=\"right\"></div><div class=\"bottom-left\"></div><div class=\"bottom\"></div><div class=\"bottom-right\"></div>"; /** * Matches {@link PopupPanel}.ANIMATION_DURATION diff --git a/client/src/com/vaadin/client/ui/VPanel.java b/client/src/com/vaadin/client/ui/VPanel.java index 6b02f079d1..ffeacade46 100644 --- a/client/src/com/vaadin/client/ui/VPanel.java +++ b/client/src/com/vaadin/client/ui/VPanel.java @@ -170,7 +170,6 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, public void onBrowserEvent(Event event) { super.onBrowserEvent(event); - final Element target = DOM.eventGetTarget(event); final int type = DOM.eventGetType(event); if (type == Event.ONKEYDOWN && shortcutHandler != null) { shortcutHandler.handleKeyboardEvent(event); diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index e800e7fe79..f4bd582a85 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -71,7 +71,6 @@ import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.PopupPanel; -import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.UIObject; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ApplicationConnection; @@ -80,6 +79,7 @@ import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorMap; import com.vaadin.client.Focusable; import com.vaadin.client.MouseEventDetailsBuilder; +import com.vaadin.client.StyleConstants; import com.vaadin.client.TooltipInfo; import com.vaadin.client.UIDL; import com.vaadin.client.Util; @@ -2314,7 +2314,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private int reqFirstRow = 0; private int reqRows = 0; - private boolean isRunning = false; + private boolean isRequestHandlerRunning = false; public void triggerRowFetch(int first, int rows) { setReqFirstRow(first); @@ -2332,12 +2332,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, deferRowFetch(250); } - public boolean isRunning() { - return isRunning; + public boolean isRequestHandlerRunning() { + return isRequestHandlerRunning; } public void deferRowFetch(int msec) { - isRunning = true; + isRequestHandlerRunning = true; if (reqRows > 0 && reqFirstRow < totalRows) { schedule(msec); @@ -2479,7 +2479,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, unSyncedselectionsBeforeRowFetch = new HashSet<Object>( selectedRowKeys); } - isRunning = false; + isRequestHandlerRunning = false; } } @@ -2487,7 +2487,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Sends request to refresh content at this position. */ public void refreshContent() { - isRunning = true; + isRequestHandlerRunning = true; int first = (int) (firstRowInViewPort - pageLength * cache_rate); int reqRows = (int) (2 * pageLength * cache_rate + pageLength); if (first < 0) { @@ -2811,13 +2811,27 @@ public class VScrollTable extends FlowPanel implements HasWidgets, DOM.setInnerHTML(floatingCopyOfHeaderCell, DOM.getInnerHTML(td)); floatingCopyOfHeaderCell = DOM .getChild(floatingCopyOfHeaderCell, 2); - DOM.setElementProperty(floatingCopyOfHeaderCell, "className", - VScrollTable.this.getStylePrimaryName() + "-header-drag"); + // #12714 the shown "ghost element" should be inside + // v-overlay-container, and it should contain the same styles as the + // table to enable theming (except v-table & v-widget). + String stylePrimaryName = VScrollTable.this.getStylePrimaryName(); + StringBuilder sb = new StringBuilder(); + for (String s : VScrollTable.this.getStyleName().split(" ")) { + if (!s.equals(StyleConstants.UI_WIDGET)) { + sb.append(s); + if (s.equals(stylePrimaryName)) { + sb.append("-header-drag "); + } else { + sb.append(" "); + } + } + } + floatingCopyOfHeaderCell.setClassName(sb.toString().trim()); // otherwise might wrap or be cut if narrow column DOM.setStyleAttribute(floatingCopyOfHeaderCell, "width", "auto"); updateFloatingCopysPosition(DOM.getAbsoluteLeft(td), DOM.getAbsoluteTop(td)); - DOM.appendChild(RootPanel.get().getElement(), + DOM.appendChild(VOverlay.getOverlayContainer(client), floatingCopyOfHeaderCell); } @@ -2832,8 +2846,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } private void hideFloatingCopy() { - DOM.removeChild(RootPanel.get().getElement(), - floatingCopyOfHeaderCell); + floatingCopyOfHeaderCell.removeFromParent(); floatingCopyOfHeaderCell = null; } @@ -6064,7 +6077,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private Element getEventTargetTdOrTr(Event event) { final Element eventTarget = event.getEventTarget().cast(); Widget widget = Util.findWidget(eventTarget, null); - final Element thisTrElement = getElement(); if (widget != this) { /* @@ -7140,7 +7152,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private void deEmphasis() { UIObject.setStyleName(getElement(), - VScrollTable.this.getStylePrimaryName() + "-drag", false); + getStylePrimaryName() + "-drag", false); if (lastEmphasized == null) { return; } @@ -7166,7 +7178,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private void emphasis(TableDDDetails details) { deEmphasis(); UIObject.setStyleName(getElement(), - VScrollTable.this.getStylePrimaryName() + "-drag", true); + getStylePrimaryName() + "-drag", true); // iterate old and new emphasized row for (Widget w : scrollBody.renderedRows) { VScrollTableRow row = (VScrollTableRow) w; diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index a3d96983e8..82eb9e7694 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -19,6 +19,10 @@ package com.vaadin.client.ui; import java.util.Iterator; import java.util.List; +import com.google.gwt.aria.client.Id; +import com.google.gwt.aria.client.LiveValue; +import com.google.gwt.aria.client.Roles; +import com.google.gwt.aria.client.SelectedValue; import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.DivElement; import com.google.gwt.dom.client.Style; @@ -55,6 +59,7 @@ import com.vaadin.client.TooltipInfo; import com.vaadin.client.UIDL; import com.vaadin.client.Util; import com.vaadin.client.VCaption; +import com.vaadin.client.ui.aria.AriaHelper; import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.EventId; import com.vaadin.shared.ui.ComponentStateUtil; @@ -94,12 +99,18 @@ public class VTabsheet extends VTabsheetBase implements Focusable, + "-selected"; private static final String TD_SELECTED_FIRST_CLASSNAME = TD_SELECTED_CLASSNAME + "-first"; + private static final String TD_FOCUS_CLASSNAME = TD_CLASSNAME + + "-focus"; + private static final String TD_FOCUS_FIRST_CLASSNAME = TD_FOCUS_CLASSNAME + + "-first"; private static final String TD_DISABLED_CLASSNAME = TD_CLASSNAME + "-disabled"; private static final String DIV_CLASSNAME = CLASSNAME + "-tabitem"; private static final String DIV_SELECTED_CLASSNAME = DIV_CLASSNAME + "-selected"; + private static final String DIV_FOCUS_CLASSNAME = DIV_CLASSNAME + + "-focus"; private TabCaption tabCaption; Element td = getElement(); @@ -112,11 +123,17 @@ public class VTabsheet extends VTabsheetBase implements Focusable, private String styleName; + private String id; + private Tab(TabBar tabBar) { super(DOM.createTD()); this.tabBar = tabBar; setStyleName(td, TD_CLASSNAME); + Roles.getTabRole().set(getElement()); + Roles.getTabRole().setAriaSelectedState(getElement(), + SelectedValue.FALSE); + div = DOM.createDiv(); setTabulatorIndex(-1); setStyleName(div, DIV_CLASSNAME); @@ -127,6 +144,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable, .getApplicationConnection()); add(tabCaption); + Roles.getTabRole().setAriaLabelledbyProperty(getElement(), + Id.of(tabCaption.getElement())); + addFocusHandler(getTabsheet()); addBlurHandler(getTabsheet()); addKeyDownHandler(getTabsheet()); @@ -138,6 +158,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, public void setHiddenOnServer(boolean hiddenOnServer) { this.hiddenOnServer = hiddenOnServer; + Roles.getTabRole().setAriaHiddenState(getElement(), hiddenOnServer); } @Override @@ -152,6 +173,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, public void setEnabledOnServer(boolean enabled) { enabledOnServer = enabled; + Roles.getTabRole().setAriaDisabledState(getElement(), !enabled); + setStyleName(td, TD_DISABLED_CLASSNAME, !enabled); if (!enabled) { focusImpl.setTabIndex(td, -1); @@ -175,10 +198,18 @@ public class VTabsheet extends VTabsheetBase implements Focusable, * true if the Tab is the first visible Tab */ public void setStyleNames(boolean selected, boolean first) { + setStyleNames(selected, first, false); + } + + public void setStyleNames(boolean selected, boolean first, + boolean keyboardFocus) { setStyleName(td, TD_FIRST_CLASSNAME, first); setStyleName(td, TD_SELECTED_CLASSNAME, selected); setStyleName(td, TD_SELECTED_FIRST_CLASSNAME, selected && first); setStyleName(div, DIV_SELECTED_CLASSNAME, selected); + setStyleName(td, TD_FOCUS_CLASSNAME, keyboardFocus); + setStyleName(td, TD_FOCUS_FIRST_CLASSNAME, keyboardFocus && first); + setStyleName(div, DIV_FOCUS_CLASSNAME, keyboardFocus); } public void setTabulatorIndex(int tabIndex) { @@ -204,10 +235,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, String newStyleName = tabUidl .getStringAttribute(TabsheetConstants.TAB_STYLE_NAME); // Find the nth td element - if (newStyleName != null && newStyleName.length() != 0) { + if (newStyleName != null && !newStyleName.isEmpty()) { if (!newStyleName.equals(styleName)) { // If we have a new style name - if (styleName != null && styleName.length() != 0) { + if (styleName != null && !styleName.isEmpty()) { // Remove old style name if present td.removeClassName(TD_CLASSNAME + "-" + styleName); } @@ -221,6 +252,15 @@ public class VTabsheet extends VTabsheetBase implements Focusable, td.removeClassName(TD_CLASSNAME + "-" + styleName); styleName = null; } + + String newId = tabUidl.getStringAttribute("id"); + if (newId != null && !newId.isEmpty()) { + td.setId(newId); + id = newId; + } else if (id != null) { + td.removeAttribute("id"); + id = null; + } } public void recalculateCaptionWidth() { @@ -250,15 +290,21 @@ public class VTabsheet extends VTabsheetBase implements Focusable, focusImpl.blur(td); } - public boolean isSelectable() { - VTabsheet ts = getTabsheet(); - if (ts.client == null || ts.disabled || ts.waitingForResponse) { - return false; - } - if (!isEnabledOnServer() || isHiddenOnServer()) { - return false; - } - return true; + public boolean hasTooltip() { + return tabCaption.getTooltipInfo() != null; + } + + public TooltipInfo getTooltipInfo() { + return tabCaption.getTooltipInfo(); + } + + public void setAssistiveDescription(String descriptionId) { + Roles.getTablistRole().setAriaDescribedbyProperty(getElement(), + Id.of(descriptionId)); + } + + public void removeAssistiveDescription() { + Roles.getTablistRole().removeAriaDescribedbyProperty(getElement()); } } @@ -267,12 +313,12 @@ public class VTabsheet extends VTabsheetBase implements Focusable, private boolean closable = false; private Element closeButton; private Tab tab; - private ApplicationConnection client; TabCaption(Tab tab, ApplicationConnection client) { super(client); - this.client = client; this.tab = tab; + + AriaHelper.ensureHasId(getElement()); } public boolean updateCaption(UIDL uidl) { @@ -292,7 +338,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, uidl.hasAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_DISABLED), uidl.hasAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_DESCRIPTION), uidl.hasAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_ERROR_MESSAGE), - uidl.getStringAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_ICON)); + uidl.getStringAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_ICON), + uidl.getStringAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_ICON_ALT)); setClosable(uidl.hasAttribute("closable")); @@ -330,6 +377,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, closeButton.setInnerHTML("×"); closeButton .setClassName(VTabsheet.CLASSNAME + "-caption-close"); + + Roles.getTabRole().setAriaHiddenState(closeButton, true); + Roles.getTabRole().setAriaDisabledState(closeButton, true); + getElement().appendChild(closeButton); } else if (!closable && closeButton != null) { getElement().removeChild(closeButton); @@ -376,6 +427,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, this.tabsheet = tabsheet; Element el = DOM.createTable(); + Roles.getPresentationRole().set(el); + Element tbody = DOM.createTBody(); DOM.appendChild(el, tbody); DOM.appendChild(tbody, tr); @@ -432,7 +485,12 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } int index = getWidgetIndex(caption.getParent()); - getTabsheet().onTabSelected(index); + + navigateTab(getTabsheet().focusedTabIndex, index); + getTabsheet().focusedTabIndex = index; + getTabsheet().focusedTab = getTab(index); + getTabsheet().focus(); + getTabsheet().loadTabSheet(index); } public VTabsheet getTabsheet() { @@ -450,13 +508,18 @@ public class VTabsheet extends VTabsheetBase implements Focusable, final Tab newSelected = getTab(index); final Tab oldSelected = selected; - newSelected.setStyleNames(true, isFirstVisibleTab(index)); + newSelected.setStyleNames(true, isFirstVisibleTab(index), true); newSelected.setTabulatorIndex(getTabsheet().tabulatorIndex); + Roles.getTabRole().setAriaSelectedState(newSelected.getElement(), + SelectedValue.TRUE); if (oldSelected != null && oldSelected != newSelected) { oldSelected.setStyleNames(false, isFirstVisibleTab(getWidgetIndex(oldSelected))); oldSelected.setTabulatorIndex(-1); + + Roles.getTabRole().setAriaSelectedState( + oldSelected.getElement(), SelectedValue.FALSE); } // Update the field holding the currently selected tab @@ -467,6 +530,23 @@ public class VTabsheet extends VTabsheetBase implements Focusable, getTab(tabsheet.activeTabIndex).recalculateCaptionWidth(); } + public void navigateTab(int fromIndex, int toIndex) { + Tab newNavigated = getTab(toIndex); + if (newNavigated == null) { + throw new IllegalArgumentException( + "Tab at provided index toIndex was not found"); + } + + Tab oldNavigated = getTab(fromIndex); + newNavigated.setStyleNames(newNavigated.equals(selected), + isFirstVisibleTab(toIndex), true); + + if (oldNavigated != null && fromIndex != toIndex) { + oldNavigated.setStyleNames(oldNavigated.equals(selected), + isFirstVisibleTab(fromIndex), false); + } + } + public void removeTab(int i) { Tab tab = getTab(i); if (tab == null) { @@ -596,15 +676,34 @@ public class VTabsheet extends VTabsheetBase implements Focusable, private String currentStyle; - private void onTabSelected(final int tabIndex) { - if (activeTabIndex != tabIndex) { + /** + * @return Whether the tab could be selected or not. + */ + private boolean canSelectTab(final int tabIndex) { + Tab tab = tb.getTab(tabIndex); + if (client == null || disabled || waitingForResponse) { + return false; + } + if (!tab.isEnabledOnServer() || tab.isHiddenOnServer()) { + return false; + } + + // Note that we return true when tabIndex == activeTabIndex; the active + // tab could be selected, it's just a no-op. + return true; + } + + /** + * Load the content of a tab of the provided index. + * + * @param index + * of the tab to load + */ + public void loadTabSheet(int tabIndex) { + if (activeTabIndex != tabIndex && canSelectTab(tabIndex)) { tb.selectTab(tabIndex); - // If this TabSheet already has focus, set the new selected tab - // as focused. - if (focusedTab != null) { - focusedTab = tb.getTab(tabIndex); - } + activeTabIndex = tabIndex; addStyleDependentName("loading"); // Hide the current contents so a loading indicator can be shown @@ -660,22 +759,30 @@ public class VTabsheet extends VTabsheetBase implements Focusable, DOM.setStyleAttribute(getElement(), "overflow", "hidden"); tabs = DOM.createDiv(); DOM.setElementProperty(tabs, "className", TABS_CLASSNAME); + Roles.getTablistRole().set(tabs); + Roles.getTablistRole().setAriaLiveProperty(tabs, LiveValue.OFF); scroller = DOM.createDiv(); + Roles.getTablistRole().setAriaHiddenState(scroller, true); DOM.setElementProperty(scroller, "className", SCROLLER_CLASSNAME); scrollerPrev = DOM.createButton(); + scrollerPrev.setTabIndex(-1); DOM.setElementProperty(scrollerPrev, "className", SCROLLER_CLASSNAME + "Prev"); + Roles.getTablistRole().setAriaHiddenState(scrollerPrev, true); DOM.sinkEvents(scrollerPrev, Event.ONCLICK); scrollerNext = DOM.createButton(); + scrollerNext.setTabIndex(-1); DOM.setElementProperty(scrollerNext, "className", SCROLLER_CLASSNAME + "Next"); + Roles.getTablistRole().setAriaHiddenState(scrollerNext, true); DOM.sinkEvents(scrollerNext, Event.ONCLICK); DOM.appendChild(getElement(), tabs); // Tabs tp.setStyleName(CLASSNAME + "-tabsheetpanel"); contentNode = DOM.createDiv(); + Roles.getTabpanelRole().set(contentNode); deco = DOM.createDiv(); @@ -1081,7 +1188,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, @Override public void onBlur(BlurEvent event) { + getApplicationConnection().getVTooltip().hideTooltip(); + if (focusedTab != null && focusedTab == event.getSource()) { + focusedTab.removeAssistiveDescription(); focusedTab = null; if (client.hasEventListeners(this, EventId.BLUR)) { client.updateVariable(id, EventId.BLUR, "", true); @@ -1096,6 +1206,13 @@ public class VTabsheet extends VTabsheetBase implements Focusable, if (client.hasEventListeners(this, EventId.FOCUS)) { client.updateVariable(id, EventId.FOCUS, "", true); } + + if (focusedTab.hasTooltip()) { + focusedTab.setAssistiveDescription(getApplicationConnection() + .getVTooltip().getUniqueId()); + getApplicationConnection().getVTooltip().showAssistive( + focusedTab.getTooltipInfo()); + } } } @@ -1116,13 +1233,17 @@ public class VTabsheet extends VTabsheetBase implements Focusable, if (!event.isAnyModifierKeyDown()) { if (keycode == getPreviousTabKey()) { selectPreviousTab(); + event.stopPropagation(); } else if (keycode == getNextTabKey()) { selectNextTab(); + event.stopPropagation(); } else if (keycode == getCloseTabKey()) { Tab tab = tb.getTab(activeTabIndex); if (tab.isClosable()) { tab.onClose(); } + } else if (keycode == getSelectTabKey()) { + loadTabSheet(focusedTabIndex); } } } @@ -1136,6 +1257,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, return KeyCodes.KEY_LEFT; } + protected int getSelectTabKey() { + return 32; // Space key + } + /** * @return The key code of the keyboard shortcut that selects the next tab * in a focused tabsheet. @@ -1153,48 +1278,62 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } private void selectPreviousTab() { - int newTabIndex = activeTabIndex; - Tab newTab; + int newTabIndex = focusedTabIndex; // Find the previous visible and enabled tab if any. do { newTabIndex--; - newTab = tb.getTab(newTabIndex); - } while (newTabIndex >= 0 && !newTab.isSelectable()); + } while (newTabIndex >= 0 && !canSelectTab(newTabIndex)); if (newTabIndex >= 0) { + tb.navigateTab(focusedTabIndex, newTabIndex); + focusedTabIndex = newTabIndex; + + // If this TabSheet already has focus, set the new selected tab + // as focused. + if (focusedTab != null) { + focusedTab = tb.getTab(focusedTabIndex); + focusedTab.focus(); + } + if (isScrolledTabs()) { - // Scroll until the new active tab is visible - while (!newTab.isVisible()) { + // Scroll until the new focused tab is visible + while (!tb.getTab(focusedTabIndex).isVisible()) { scrollerIndex = tb.scrollLeft(scrollerIndex); } updateTabScroller(); } - onTabSelected(newTabIndex); - activeTabIndex = newTabIndex; } } private void selectNextTab() { - int newTabIndex = activeTabIndex; - Tab newTab; + int newTabIndex = focusedTabIndex; // Find the next visible and enabled tab if any. do { newTabIndex++; - newTab = tb.getTab(newTabIndex); - } while (newTabIndex < getTabCount() && !newTab.isSelectable()); + } while (newTabIndex < getTabCount() && !canSelectTab(newTabIndex)); if (newTabIndex < getTabCount()) { + + tb.navigateTab(focusedTabIndex, newTabIndex); + focusedTabIndex = newTabIndex; + + // If this TabSheet already has focus, set the new selected tab + // as focused. + if (focusedTab != null) { + focusedTab = tb.getTab(focusedTabIndex); + focusedTab.focus(); + } + if (isClippedTabs()) { // Scroll until the new active tab is completely visible int newScrollerIndex = scrollerIndex; - while (isClipped(newTab) && newScrollerIndex != -1) { + while (isClipped(tb.getTab(focusedTabIndex)) + && newScrollerIndex != -1) { newScrollerIndex = tb.scrollRight(newScrollerIndex); } scrollerIndex = newScrollerIndex; updateTabScroller(); } - onTabSelected(newTabIndex); - activeTabIndex = newTabIndex; } } } diff --git a/client/src/com/vaadin/client/ui/VTabsheetBase.java b/client/src/com/vaadin/client/ui/VTabsheetBase.java index 0923248115..bcd8811c7d 100644 --- a/client/src/com/vaadin/client/ui/VTabsheetBase.java +++ b/client/src/com/vaadin/client/ui/VTabsheetBase.java @@ -42,6 +42,8 @@ public abstract class VTabsheetBase extends ComplexPanel { /** For internal use only. May be removed or replaced in the future. */ public int activeTabIndex = 0; /** For internal use only. May be removed or replaced in the future. */ + public int focusedTabIndex = 0; + /** For internal use only. May be removed or replaced in the future. */ public boolean disabled; /** For internal use only. May be removed or replaced in the future. */ public boolean readonly; diff --git a/client/src/com/vaadin/client/ui/VTree.java b/client/src/com/vaadin/client/ui/VTree.java index 51c00ca310..1acd4bd05f 100644 --- a/client/src/com/vaadin/client/ui/VTree.java +++ b/client/src/com/vaadin/client/ui/VTree.java @@ -70,6 +70,7 @@ import com.vaadin.client.ui.dd.VDragEvent; import com.vaadin.client.ui.dd.VDropHandler; import com.vaadin.client.ui.dd.VHasDropHandler; import com.vaadin.client.ui.dd.VTransferable; +import com.vaadin.client.ui.tree.TreeConnector; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.MouseEventDetails.MouseButton; import com.vaadin.shared.ui.MultiSelectMode; @@ -162,6 +163,9 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, /** For internal use only. May be removed or replaced in the future. */ public String[] bodyActionKeys; + /** For internal use only. May be removed or replaced in the future. */ + public TreeConnector connector; + public VLazyExecutor iconLoaded = new VLazyExecutor(50, new ScheduledCommand() { @@ -1729,6 +1733,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } } } + showTooltipForKeyboardNavigation(node); return true; } @@ -1754,6 +1759,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } } } + showTooltipForKeyboardNavigation(node); return true; } @@ -1774,6 +1780,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, focusAndSelectNode(focusedNode.getParentNode()); } } + showTooltipForKeyboardNavigation(focusedNode); return true; } @@ -1792,6 +1799,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, focusAndSelectNode(focusedNode.getChildren().get(0)); } } + showTooltipForKeyboardNavigation(focusedNode); return true; } @@ -1820,6 +1828,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, selectNode(node, true); } sendSelectionToServer(); + showTooltipForKeyboardNavigation(node); return true; } @@ -1836,12 +1845,20 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, selectNode(node, true); } sendSelectionToServer(); + showTooltipForKeyboardNavigation(node); return true; } return false; } + private void showTooltipForKeyboardNavigation(TreeNode node) { + if (connector != null) { + getClient().getVTooltip().showAssistive( + connector.getTooltipInfo(node.nodeCaptionSpan)); + } + } + private void focusAndSelectNode(TreeNode node) { /* * Keyboard navigation doesn't work reliably if the tree is in diff --git a/client/src/com/vaadin/client/ui/VUI.java b/client/src/com/vaadin/client/ui/VUI.java index ba3495743d..590263a5ed 100644 --- a/client/src/com/vaadin/client/ui/VUI.java +++ b/client/src/com/vaadin/client/ui/VUI.java @@ -18,6 +18,7 @@ package com.vaadin.client.ui; import java.util.ArrayList; +import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Element; import com.google.gwt.event.dom.client.HasScrollHandlers; @@ -43,6 +44,7 @@ import com.vaadin.client.ConnectorMap; import com.vaadin.client.Focusable; import com.vaadin.client.LayoutManager; import com.vaadin.client.Profiler; +import com.vaadin.client.Util; import com.vaadin.client.VConsole; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler; @@ -162,6 +164,8 @@ public class VUI extends SimplePanel implements ResizeHandler, }); + private Element storedFocus; + public VUI() { super(); // Allow focusing the view by using the focus() method, the view @@ -494,4 +498,36 @@ public class VUI extends SimplePanel implements ResizeHandler, FocusUtil.setTabIndex(this, index); } + /** + * Allows to store the currently focused Element. + * + * Current use case is to store the focus when a Window is opened. Does + * currently handle only a single value. Needs to be extended for #12158 + * + * @param focusedElement + */ + public void storeFocus() { + storedFocus = Util.getFocusedElement(); + } + + /** + * Restores the previously stored focus Element. + * + * Current use case is to restore the focus when a Window is closed. Does + * currently handle only a single value. Needs to be extended for #12158 + * + * @return the lastFocusElementBeforeDialogOpened + */ + public void focusStoredElement() { + if (storedFocus != null) { + storedFocus.focus(); + + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override + public void execute() { + storedFocus.focus(); + } + }); + } + } } diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index ad9d0eac7e..705787d6c8 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -18,11 +18,17 @@ package com.vaadin.client.ui; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Comparator; +import java.util.List; +import com.google.gwt.aria.client.Id; +import com.google.gwt.aria.client.RelevantValue; +import com.google.gwt.aria.client.Roles; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Position; import com.google.gwt.dom.client.Style.Unit; @@ -30,8 +36,11 @@ import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.FocusEvent; import com.google.gwt.event.dom.client.FocusHandler; +import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyDownEvent; import com.google.gwt.event.dom.client.KeyDownHandler; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.event.dom.client.ScrollEvent; import com.google.gwt.event.dom.client.ScrollHandler; import com.google.gwt.event.shared.HandlerRegistration; @@ -39,28 +48,35 @@ import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; +import com.google.gwt.user.client.Event.NativePreviewEvent; +import com.google.gwt.user.client.Event.NativePreviewHandler; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.BrowserInfo; +import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorMap; import com.vaadin.client.Focusable; import com.vaadin.client.LayoutManager; import com.vaadin.client.Util; import com.vaadin.client.debug.internal.VDebugWindow; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; +import com.vaadin.client.ui.aria.AriaHelper; import com.vaadin.client.ui.window.WindowMoveEvent; import com.vaadin.client.ui.window.WindowMoveHandler; +import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.ui.window.WindowMode; +import com.vaadin.shared.ui.window.WindowState.WindowRole; /** * "Sub window" component. * * @author Vaadin Ltd */ -public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, - ScrollHandler, KeyDownHandler, FocusHandler, BlurHandler, Focusable { +public class VWindow extends VWindowOverlay implements + ShortcutActionHandlerOwner, ScrollHandler, KeyDownHandler, + KeyUpHandler, FocusHandler, BlurHandler, Focusable { private static ArrayList<VWindow> windowOrder = new ArrayList<VWindow>(); @@ -144,6 +160,22 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, private boolean closable = true; + private Connector[] assistiveConnectors = new Connector[0]; + private String assistivePrefix; + private String assistivePostfix; + + private Element topTabStop; + private Element bottomTabStop; + + private NativePreviewHandler topEventBlocker; + private NativePreviewHandler bottomEventBlocker; + + private HandlerRegistration topBlockerRegistration; + private HandlerRegistration bottomBlockerRegistration; + + // Prevents leaving the window with the Tab key when true + private boolean doTabStop; + /** * If centered (via UIDL), the window should stay in the centered -mode * until a position is received from the server, or the user moves or @@ -178,13 +210,74 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, // Different style of shadow for windows setShadowStyle("window"); + Roles.getDialogRole().set(getElement()); + Roles.getDialogRole().setAriaRelevantProperty(getElement(), + RelevantValue.ADDITIONS); + constructDOM(); contentPanel.addScrollHandler(this); contentPanel.addKeyDownHandler(this); + contentPanel.addKeyUpHandler(this); contentPanel.addFocusHandler(this); contentPanel.addBlurHandler(this); } + @Override + protected void onAttach() { + super.onAttach(); + + /* + * Stores the element that has focus in the application UI when the + * window is opened, so it can be restored when the window closes. + * + * This is currently implemented for the case when one non-modal window + * can be open at the same time, and the focus is not changed while the + * window is open. + */ + getApplicationConnection().getUIConnector().getWidget().storeFocus(); + + /* + * When this window gets reattached, set the tabstop to the previous + * state. + */ + setTabStopEnabled(doTabStop); + } + + @Override + protected void onDetach() { + super.onDetach(); + + /* + * Restores the previously stored focused element. + * + * When the focus was changed outside the window while the window was + * open, the originally stored element is restored. + */ + getApplicationConnection().getUIConnector().getWidget() + .focusStoredElement(); + + removeTabBlockHandlers(); + } + + private void addTabBlockHandlers() { + if (topBlockerRegistration == null) { + topBlockerRegistration = Event + .addNativePreviewHandler(topEventBlocker); + bottomBlockerRegistration = Event + .addNativePreviewHandler(bottomEventBlocker); + } + } + + private void removeTabBlockHandlers() { + if (topBlockerRegistration != null) { + topBlockerRegistration.removeHandler(); + topBlockerRegistration = null; + + bottomBlockerRegistration.removeHandler(); + bottomBlockerRegistration = null; + } + } + public void bringToFront() { int curIndex = windowOrder.indexOf(this); if (curIndex + 1 < windowOrder.size()) { @@ -248,6 +341,9 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, protected void constructDOM() { setStyleName(CLASSNAME); + topTabStop = DOM.createDiv(); + DOM.setElementAttribute(topTabStop, "tabindex", "0"); + header = DOM.createDiv(); DOM.setElementProperty(header, "className", CLASSNAME + "-outerheader"); headerText = DOM.createDiv(); @@ -262,18 +358,25 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, maximizeRestoreBox = DOM.createDiv(); DOM.setElementProperty(maximizeRestoreBox, "className", CLASSNAME + "-maximizebox"); + DOM.setElementAttribute(maximizeRestoreBox, "tabindex", "0"); DOM.setElementProperty(closeBox, "className", CLASSNAME + "-closebox"); + DOM.setElementAttribute(closeBox, "tabindex", "0"); DOM.appendChild(footer, resizeBox); + bottomTabStop = DOM.createDiv(); + DOM.setElementAttribute(bottomTabStop, "tabindex", "0"); + wrapper = DOM.createDiv(); DOM.setElementProperty(wrapper, "className", CLASSNAME + "-wrap"); + DOM.appendChild(wrapper, topTabStop); DOM.appendChild(wrapper, header); DOM.appendChild(wrapper, maximizeRestoreBox); DOM.appendChild(wrapper, closeBox); DOM.appendChild(header, headerText); DOM.appendChild(wrapper, contents); DOM.appendChild(wrapper, footer); + DOM.appendChild(wrapper, bottomTabStop); DOM.appendChild(super.getContainerElement(), wrapper); sinkEvents(Event.ONDBLCLICK | Event.MOUSEEVENTS | Event.TOUCHEVENTS @@ -281,6 +384,96 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, setWidget(contentPanel); + // Make the closebox accessible for assistive devices + Roles.getButtonRole().set(closeBox); + Roles.getButtonRole().setAriaLabelProperty(closeBox, "close button"); + + // Make the maximizebox accessible for assistive devices + Roles.getButtonRole().set(maximizeRestoreBox); + Roles.getButtonRole().setAriaLabelProperty(maximizeRestoreBox, + "maximize button"); + + // Provide the title to assistive devices + AriaHelper.ensureHasId(headerText); + Roles.getDialogRole().setAriaLabelledbyProperty(getElement(), + Id.of(headerText)); + + // Handlers to Prevent tab to leave the window + topEventBlocker = new NativePreviewHandler() { + @Override + public void onPreviewNativeEvent(NativePreviewEvent event) { + NativeEvent nativeEvent = event.getNativeEvent(); + if (nativeEvent.getEventTarget().cast() == topTabStop + && nativeEvent.getKeyCode() == KeyCodes.KEY_TAB + && nativeEvent.getShiftKey()) { + nativeEvent.preventDefault(); + } + } + }; + + bottomEventBlocker = new NativePreviewHandler() { + @Override + public void onPreviewNativeEvent(NativePreviewEvent event) { + NativeEvent nativeEvent = event.getNativeEvent(); + if (nativeEvent.getEventTarget().cast() == bottomTabStop + && nativeEvent.getKeyCode() == KeyCodes.KEY_TAB + && !nativeEvent.getShiftKey()) { + nativeEvent.preventDefault(); + } + } + }; + } + + /** + * Sets the message that is provided to users of assistive devices when the + * user reaches the top of the window when leaving a window with the tab key + * is prevented. + * <p> + * This message is not visible on the screen. + * + * @param topMessage + * String provided when the user navigates with Shift-Tab keys to + * the top of the window + */ + public void setTabStopTopAssistiveText(String topMessage) { + Roles.getNoteRole().setAriaLabelProperty(topTabStop, topMessage); + } + + /** + * Sets the message that is provided to users of assistive devices when the + * user reaches the bottom of the window when leaving a window with the tab + * key is prevented. + * <p> + * This message is not visible on the screen. + * + * @param bottomMessage + * String provided when the user navigates with the Tab key to + * the bottom of the window + */ + public void setTabStopBottomAssistiveText(String bottomMessage) { + Roles.getNoteRole().setAriaLabelProperty(bottomTabStop, bottomMessage); + } + + /** + * Gets the message that is provided to users of assistive devices when the + * user reaches the top of the window when leaving a window with the tab key + * is prevented. + * + * @return the top message + */ + public String getTabStopTopAssistiveText() { + return Roles.getNoteRole().getAriaLabelProperty(topTabStop); + } + + /** + * Gets the message that is provided to users of assistive devices when the + * user reaches the bottom of the window when leaving a window with the tab + * key is prevented. + * + * @return the bottom message + */ + public String getTabStopBottomAssistiveText() { + return Roles.getNoteRole().getAriaLabelProperty(bottomTabStop); } /** @@ -509,6 +702,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, if (isAttached()) { showModalityCurtain(); } + addTabBlockHandlers(); deferOrdering(); } else { if (modalityCurtain != null) { @@ -517,6 +711,9 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } modalityCurtain = null; } + if (!doTabStop) { + removeTabBlockHandlers(); + } } } @@ -674,11 +871,64 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, if (icon != null) { icon = client.translateVaadinUri(icon); html = "<img src=\"" + Util.escapeAttribute(icon) - + "\" class=\"v-icon\" />" + html; + + "\" class=\"v-icon\" alt=\"\" />" + html; } + + // Provide information to assistive device users that a sub window was + // opened + String prefix = "<span class='" + + AriaHelper.ASSISTIVE_DEVICE_ONLY_STYLE + "'>" + + assistivePrefix + "</span>"; + String postfix = "<span class='" + + AriaHelper.ASSISTIVE_DEVICE_ONLY_STYLE + "'>" + + assistivePostfix + "</span>"; + + html = prefix + html + postfix; DOM.setInnerHTML(headerText, html); } + /** + * Setter for the text for assistive devices the window caption is prefixed + * with. + * + * @param assistivePrefix + * the assistivePrefix to set + */ + public void setAssistivePrefix(String assistivePrefix) { + this.assistivePrefix = assistivePrefix; + } + + /** + * Getter for the text for assistive devices the window caption is prefixed + * with. + * + * @return the assistivePrefix + */ + public String getAssistivePrefix() { + return assistivePrefix; + } + + /** + * Setter for the text for assistive devices the window caption is postfixed + * with. + * + * @param assistivePostfix + * the assistivePostfix to set + */ + public void setAssistivePostfix(String assistivePostfix) { + this.assistivePostfix = assistivePostfix; + } + + /** + * Getter for the text for assistive devices the window caption is postfixed + * with. + * + * @return the assistivePostfix + */ + public String getAssistivePostfix() { + return assistivePostfix; + } + @Override protected Element getContainerElement() { // in GWT 1.5 this method is used in PopupPanel constructor @@ -1056,6 +1306,13 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } @Override + public void onKeyUp(KeyUpEvent event) { + if (isClosable() && event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) { + onCloseClick(); + } + } + + @Override public void onBlur(BlurEvent event) { if (client.hasEventListeners(this, EventId.BLUR)) { client.updateVariable(id, EventId.BLUR, "", true); @@ -1092,9 +1349,104 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } /** + * Allows to specify which connectors contain the description for the + * window. Text contained in the widgets of the connectors will be read by + * assistive devices when it is opened. + * <p> + * When the provided array is empty, an existing description is removed. + * + * @param connectors + * with the connectors of the widgets to use as description + */ + public void setAssistiveDescription(Connector[] connectors) { + if (connectors != null) { + assistiveConnectors = connectors; + + if (connectors.length == 0) { + Roles.getDialogRole().removeAriaDescribedbyProperty( + getElement()); + } else { + Id[] ids = new Id[connectors.length]; + for (int index = 0; index < connectors.length; index++) { + if (connectors[index] == null) { + throw new IllegalArgumentException( + "All values in parameter description need to be non-null"); + } + + Element element = ((ComponentConnector) connectors[index]) + .getWidget().getElement(); + AriaHelper.ensureHasId(element); + ids[index] = Id.of(element); + } + + Roles.getDialogRole().setAriaDescribedbyProperty(getElement(), + ids); + } + } else { + throw new IllegalArgumentException( + "Parameter description must be non-null"); + } + } + + /** + * Gets the connectors that are used as assistive description. Text + * contained in these connectors will be read by assistive devices when the + * window is opened. + * + * @return list of previously set connectors + */ + public List<Connector> getAssistiveDescription() { + return Collections.unmodifiableList(Arrays.asList(assistiveConnectors)); + } + + /** + * Sets the WAI-ARIA role the window. + * + * This role defines how an assistive device handles a window. Available + * roles are alertdialog and dialog (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>). + * + * The default role is dialog. + * + * @param role + * WAI-ARIA role to set for the window + */ + public void setWaiAriaRole(WindowRole role) { + if ("alertdialog".equals(role)) { + Roles.getAlertdialogRole().set(getElement()); + } else { + Roles.getDialogRole().set(getElement()); + } + } + + /** + * Registers the handlers that prevent to leave the window using the + * Tab-key. + * <p> + * The value of the parameter doTabStop is stored and used for non-modal + * windows. For modal windows, the handlers are always registered, while + * preserving the stored value. + * + * @param doTabStop + * true to prevent leaving the window, false to allow leaving the + * window for non modal windows + */ + public void setTabStopEnabled(boolean doTabStop) { + this.doTabStop = doTabStop; + + if (doTabStop || vaadinModality) { + addTabBlockHandlers(); + } else { + removeTabBlockHandlers(); + } + } + + /** * Adds a Handler for when user moves the window. * * @since 7.1.9 + * * @return {@link HandlerRegistration} used to remove the handler */ public HandlerRegistration addMoveHandler(WindowMoveHandler handler) { diff --git a/client/src/com/vaadin/client/ui/VWindowOverlay.java b/client/src/com/vaadin/client/ui/VWindowOverlay.java new file mode 100644 index 0000000000..efc01cf63e --- /dev/null +++ b/client/src/com/vaadin/client/ui/VWindowOverlay.java @@ -0,0 +1,77 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.client.ui; + +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Element; +import com.google.gwt.user.client.ui.RootPanel; +import com.vaadin.client.ApplicationConnection; + +public class VWindowOverlay extends VOverlay { + public VWindowOverlay() { + } + + public VWindowOverlay(boolean autoHide, boolean modal, boolean showShadow) { + super(autoHide, modal, showShadow); + } + + /** + * Gets the 'overlay container' element. Tries to find the current + * {@link ApplicationConnection} using {@link #getApplicationConnection()}. + * + * @return the overlay container element for the current + * {@link ApplicationConnection} or another element if the current + * {@link ApplicationConnection} cannot be determined. + */ + @Override + public Element getOverlayContainer() { + ApplicationConnection ac = getApplicationConnection(); + if (ac == null) { + return super.getOverlayContainer(); + } else { + Element overlayContainer = getOverlayContainer(ac); + return overlayContainer; + } + } + + /** + * Gets the 'overlay container' element pertaining to the given + * {@link ApplicationConnection}. Each overlay should be created in a + * overlay container element, so that the correct theme and styles can be + * applied. + * + * @param ac + * A reference to {@link ApplicationConnection} + * @return The overlay container + */ + public static Element getOverlayContainer(ApplicationConnection ac) { + String id = ac.getConfiguration().getRootPanelId(); + id = id += "-window-overlays"; + Element container = DOM.getElementById(id); + if (container == null) { + container = DOM.createDiv(); + container.setId(id); + String styles = ac.getUIConnector().getWidget().getParent() + .getStyleName(); + container.addClassName(styles); + container.addClassName(CLASSNAME_CONTAINER); + RootPanel.get().getElement().appendChild(container); + } + + return container; + } +} diff --git a/client/src/com/vaadin/client/ui/button/ButtonConnector.java b/client/src/com/vaadin/client/ui/button/ButtonConnector.java index a6630f28b9..9a63808742 100644 --- a/client/src/com/vaadin/client/ui/button/ButtonConnector.java +++ b/client/src/com/vaadin/client/ui/button/ButtonConnector.java @@ -87,8 +87,7 @@ public class ButtonConnector extends AbstractComponentConnector implements getWidget().icon.getElement(), getWidget().captionElement); } - getWidget().icon.setUri(getIcon()); - getWidget().icon.setAlternateText(getState().iconAltText); + getWidget().icon.setUri(getIcon(), getState().iconAltText); } else { if (getWidget().icon != null) { getWidget().wrapper.removeChild(getWidget().icon diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java index 39de122694..344b5ce739 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java @@ -42,7 +42,6 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.HorizontalPanel; import com.vaadin.client.Util; -import com.vaadin.client.ui.VCalendar; import com.vaadin.shared.ui.calendar.DateConstants; /** @@ -105,7 +104,6 @@ public class DateCellDayEvent extends FocusableHTML implements eventContent.addClassName("v-calendar-event-content"); getElement().appendChild(eventContent); - VCalendar calendar = weekGrid.getCalendar(); if (weekGrid.getCalendar().isEventResizeAllowed()) { topResizeBar = DOM.createDiv(); bottomResizeBar = DOM.createDiv(); @@ -189,9 +187,11 @@ public class DateCellDayEvent extends FocusableHTML implements String escapedCaption = Util.escapeHTML(calendarEvent.getCaption()); String timeAsText = calendarEvent.getTimeAsText(); if (bigMode) { - innerHtml = "<span>" + timeAsText + "</span><br />" + escapedCaption; + innerHtml = "<span>" + timeAsText + "</span><br />" + + escapedCaption; } else { - innerHtml = "<span>" + timeAsText + "<span>:</span></span> " + escapedCaption; + innerHtml = "<span>" + timeAsText + "<span>:</span></span> " + + escapedCaption; } caption.setInnerHTML(innerHtml); eventContent.setInnerHTML(""); diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java b/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java index 6233e8111e..58b5fafa7f 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java @@ -72,8 +72,6 @@ public class DayToolbar extends HorizontalPanel implements ClickHandler { setCellWidth(nextLabel, MARGINRIGHT + "px"); setCellHorizontalAlignment(nextLabel, ALIGN_RIGHT); int cellw = width / (count - 2); - int remain = width % (count - 2); - int cellw2 = cellw + 1; if (cellw > 0) { int[] cellWidths = VCalendar .distributeSize(width, count - 2, 0); diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java b/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java index df9bc42d2a..3b1c774793 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java @@ -35,7 +35,6 @@ public class MonthGrid extends FocusableGrid implements KeyDownHandler { private SimpleDayCell selectionEnd; private final VCalendar calendar; private boolean rangeSelectDisabled; - private boolean disabled; private boolean enabled = true; private final HandlerRegistration keyDownHandler; diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java index cf8006ef66..00fc1ef3ea 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java @@ -83,7 +83,6 @@ public class SimpleDayCell extends FocusableFlowPanel implements private Widget clickedWidget; private HandlerRegistration bottomSpacerMouseDownHandler; private boolean scrollable = false; - private boolean eventCanceled; private MonthGrid monthGrid; private HandlerRegistration keyDownHandler; diff --git a/client/src/com/vaadin/client/ui/dd/VHtml5File.java b/client/src/com/vaadin/client/ui/dd/VHtml5File.java index 4b36e7fd1b..c4ad615fbd 100644 --- a/client/src/com/vaadin/client/ui/dd/VHtml5File.java +++ b/client/src/com/vaadin/client/ui/dd/VHtml5File.java @@ -35,7 +35,13 @@ public class VHtml5File extends JavaScriptObject { return this.type; }-*/; - public native final int getSize() + /* + * Browser implementations support files >2GB dropped and report the value + * as long. Due to JSNI limitations this value needs to be sent as double + * and then cast back to a long value. + * www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html#important + */ + public native final double getSize() /*-{ return this.size ? this.size : 0; }-*/; diff --git a/client/src/com/vaadin/client/ui/dd/VIsOverId.java b/client/src/com/vaadin/client/ui/dd/VIsOverId.java index f8083f8b60..7e2f596a20 100644 --- a/client/src/com/vaadin/client/ui/dd/VIsOverId.java +++ b/client/src/com/vaadin/client/ui/dd/VIsOverId.java @@ -19,7 +19,6 @@ package com.vaadin.client.ui.dd; import com.vaadin.client.ComponentConnector; -import com.vaadin.client.ConnectorMap; import com.vaadin.client.UIDL; import com.vaadin.shared.ui.dd.AcceptCriterion; import com.vaadin.ui.AbstractSelect; @@ -36,8 +35,6 @@ final public class VIsOverId extends VAcceptCriterion { .getCurrentDropHandler(); ComponentConnector dropHandlerConnector = currentDropHandler .getConnector(); - ConnectorMap paintableMap = ConnectorMap.get(currentDropHandler - .getApplicationConnection()); String pid2 = dropHandlerConnector.getConnectorId(); if (pid2.equals(pid)) { diff --git a/client/src/com/vaadin/client/ui/dd/VItemIdIs.java b/client/src/com/vaadin/client/ui/dd/VItemIdIs.java index 7d60eda4f9..b022f434f4 100644 --- a/client/src/com/vaadin/client/ui/dd/VItemIdIs.java +++ b/client/src/com/vaadin/client/ui/dd/VItemIdIs.java @@ -32,8 +32,6 @@ final public class VItemIdIs extends VAcceptCriterion { String pid = configuration.getStringAttribute("s"); ComponentConnector dragSource = drag.getTransferable() .getDragSource(); - VDropHandler currentDropHandler = VDragAndDropManager.get() - .getCurrentDropHandler(); String pid2 = dragSource.getConnectorId(); if (pid2.equals(pid)) { Object searchedId = drag.getTransferable().getData("itemId"); diff --git a/client/src/com/vaadin/client/ui/label/LabelConnector.java b/client/src/com/vaadin/client/ui/label/LabelConnector.java index 9639987e8d..6a04c91562 100644 --- a/client/src/com/vaadin/client/ui/label/LabelConnector.java +++ b/client/src/com/vaadin/client/ui/label/LabelConnector.java @@ -36,12 +36,6 @@ public class LabelConnector extends AbstractComponentConnector { } @Override - protected void init() { - super.init(); - getWidget().setConnection(getConnection()); - } - - @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { super.onStateChanged(stateChangeEvent); boolean sinkOnloads = false; diff --git a/client/src/com/vaadin/client/ui/link/LinkConnector.java b/client/src/com/vaadin/client/ui/link/LinkConnector.java index 228897278e..d2c41e9f38 100644 --- a/client/src/com/vaadin/client/ui/link/LinkConnector.java +++ b/client/src/com/vaadin/client/ui/link/LinkConnector.java @@ -17,38 +17,21 @@ package com.vaadin.client.ui.link; import com.google.gwt.user.client.DOM; -import com.vaadin.client.ApplicationConnection; -import com.vaadin.client.Paintable; -import com.vaadin.client.UIDL; import com.vaadin.client.communication.StateChangeEvent; -import com.vaadin.client.communication.StateChangeEvent.StateChangeHandler; import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.client.ui.Icon; import com.vaadin.client.ui.VLink; -import com.vaadin.shared.ui.BorderStyle; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.link.LinkConstants; import com.vaadin.shared.ui.link.LinkState; import com.vaadin.ui.Link; @Connect(Link.class) -public class LinkConnector extends AbstractComponentConnector implements - Paintable { +public class LinkConnector extends AbstractComponentConnector { @Override protected void init() { super.init(); - addStateChangeHandler("resources", new StateChangeHandler() { - @Override - public void onStateChanged(StateChangeEvent stateChangeEvent) { - getWidget().src = getResourceUrl(LinkConstants.HREF_RESOURCE); - if (getWidget().src == null) { - getWidget().anchor.removeAttribute("href"); - } else { - getWidget().anchor.setAttribute("href", getWidget().src); - } - } - }); } @Override @@ -62,35 +45,30 @@ public class LinkConnector extends AbstractComponentConnector implements } @Override - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - - if (!isRealUpdate(uidl)) { - return; - } - - getWidget().client = client; + public void onStateChanged(StateChangeEvent stateChangeEvent) { + super.onStateChanged(stateChangeEvent); getWidget().enabled = isEnabled(); - if (uidl.hasAttribute("name")) { - getWidget().target = uidl.getStringAttribute("name"); - getWidget().anchor.setAttribute("target", getWidget().target); - } - - if (uidl.hasAttribute("border")) { - if ("none".equals(uidl.getStringAttribute("border"))) { - getWidget().borderStyle = BorderStyle.NONE; + if (stateChangeEvent.hasPropertyChanged("resources")) { + getWidget().src = getResourceUrl(LinkConstants.HREF_RESOURCE); + if (getWidget().src == null) { + getWidget().anchor.removeAttribute("href"); } else { - getWidget().borderStyle = BorderStyle.MINIMAL; + getWidget().anchor.setAttribute("href", getWidget().src); } + } + + getWidget().target = getState().target; + if (getWidget().target == null) { + getWidget().anchor.removeAttribute("target"); } else { - getWidget().borderStyle = BorderStyle.DEFAULT; + getWidget().anchor.setAttribute("target", getWidget().target); } - getWidget().targetHeight = uidl.hasAttribute("targetHeight") ? uidl - .getIntAttribute("targetHeight") : -1; - getWidget().targetWidth = uidl.hasAttribute("targetWidth") ? uidl - .getIntAttribute("targetWidth") : -1; + getWidget().borderStyle = getState().targetBorder; + getWidget().targetWidth = getState().targetWidth; + getWidget().targetHeight = getState().targetHeight; // Set link caption getWidget().captionElement.setInnerText(getState().caption); @@ -111,13 +89,12 @@ public class LinkConnector extends AbstractComponentConnector implements if (getIcon() != null) { if (getWidget().icon == null) { - getWidget().icon = new Icon(client); + getWidget().icon = new Icon(getConnection()); getWidget().anchor.insertBefore(getWidget().icon.getElement(), getWidget().captionElement); } getWidget().icon.setUri(getIcon()); } - } @Override diff --git a/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java b/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java index 11a76b483b..2253397b16 100644 --- a/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java +++ b/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java @@ -94,7 +94,7 @@ public class NativeButtonConnector extends AbstractComponentConnector implements getWidget().icon.getElement(), getWidget().captionElement); } - getWidget().icon.setUri(getIcon()); + getWidget().icon.setUri(getIcon(), getState().iconAltText); } else { if (getWidget().icon != null) { getWidget().getElement().removeChild( diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java index 80a84f0a19..d2c700ab06 100644 --- a/client/src/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/com/vaadin/client/ui/table/TableConnector.java @@ -264,7 +264,7 @@ public class TableConnector extends AbstractHasComponentsConnector implements if (getWidget().focusedRow != null) { if (!getWidget().focusedRow.isAttached() - && !getWidget().rowRequestHandler.isRunning()) { + && !getWidget().rowRequestHandler.isRequestHandlerRunning()) { // focused row has been orphaned, can't focus if (getWidget().selectedRowKeys.contains(getWidget().focusedRow .getKey())) { diff --git a/client/src/com/vaadin/client/ui/tree/TreeConnector.java b/client/src/com/vaadin/client/ui/tree/TreeConnector.java index 7560a0f56b..61207ffa53 100644 --- a/client/src/com/vaadin/client/ui/tree/TreeConnector.java +++ b/client/src/com/vaadin/client/ui/tree/TreeConnector.java @@ -46,6 +46,11 @@ public class TreeConnector extends AbstractComponentConnector implements protected final Map<TreeNode, TooltipInfo> tooltipMap = new HashMap<TreeNode, TooltipInfo>(); @Override + protected void init() { + getWidget().connector = this; + } + + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; diff --git a/client/src/com/vaadin/client/ui/ui/UIConnector.java b/client/src/com/vaadin/client/ui/ui/UIConnector.java index 149d99de17..17a23baad5 100644 --- a/client/src/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/com/vaadin/client/ui/ui/UIConnector.java @@ -49,7 +49,6 @@ import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent; import com.vaadin.client.BrowserInfo; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorHierarchyChangeEvent; -import com.vaadin.client.ConnectorMap; import com.vaadin.client.Focusable; import com.vaadin.client.Paintable; import com.vaadin.client.ServerConnector; @@ -102,10 +101,6 @@ public class UIConnector extends AbstractSingleComponentContainerConnector protected void init() { super.init(); registerRpc(PageClientRpc.class, new PageClientRpc() { - @Override - public void setTitle(String title) { - com.google.gwt.user.client.Window.setTitle(title); - } @Override public void reload() { @@ -196,7 +191,6 @@ public class UIConnector extends AbstractSingleComponentContainerConnector @Override public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) { - ConnectorMap paintableMap = ConnectorMap.get(getConnection()); getWidget().id = getConnectorId(); boolean firstPaint = getWidget().connection == null; getWidget().connection = client; @@ -685,6 +679,11 @@ public class UIConnector extends AbstractSingleComponentContainerConnector configurePolling(); } + if (stateChangeEvent.hasPropertyChanged("pageState.title")) { + com.google.gwt.user.client.Window + .setTitle(getState().pageState.title); + } + if (stateChangeEvent.hasPropertyChanged("pushConfiguration")) { getConnection().setPushEnabled( getState().pushConfiguration.mode.isEnabled()); diff --git a/client/src/com/vaadin/client/ui/window/WindowConnector.java b/client/src/com/vaadin/client/ui/window/WindowConnector.java index 54ea384f5a..788799d81c 100644 --- a/client/src/com/vaadin/client/ui/window/WindowConnector.java +++ b/client/src/com/vaadin/client/ui/window/WindowConnector.java @@ -298,8 +298,18 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector if (getIcon() != null) { iconURL = getIcon(); } + + window.setAssistivePrefix(state.assistivePrefix); + window.setAssistivePostfix(state.assistivePostfix); window.setCaption(state.caption, iconURL); + window.setWaiAriaRole(getState().role); + window.setAssistiveDescription(state.contentDescription); + + window.setTabStopEnabled(getState().assistiveTabStop); + window.setTabStopTopAssistiveText(getState().assistiveTabStopTopText); + window.setTabStopBottomAssistiveText(getState().assistiveTabStopBottomText); + clickEventHandler.handleEventHandlerRegistration(); window.immediate = state.immediate; diff --git a/common.xml b/common.xml index a1c086c57a..a49c25c6be 100644 --- a/common.xml +++ b/common.xml @@ -139,6 +139,7 @@ <fileset dir="${src}"> <patternset> <include name="**/*.java" /> + <include name="**/*.properties" /> </patternset> </fileset> <fileset refid="common.files.for.all.jars" /> @@ -184,7 +185,7 @@ <property name="src" location="{$result.dir}/../src" /> <union id="jar.files"> - <fileset dir="${classes}" excludes="${classes.exclude}" erroronmissingdir="false" /> + <fileset dir="${classes}" excludes="${classes.exclude}" erroronmissingdir="false"/> <fileset dir="${src}" excludes="${jar.exclude}" erroronmissingdir="false" /> <fileset refid="common.files.for.all.jars" /> <union refid="extra.jar.includes" /> @@ -277,6 +278,9 @@ <classpath refid="classpath.compile.dependencies" /> <classpath refid="classpath.compile.custom" /> </javac> + <copy todir="${classes}"> + <fileset dir="${src}" includes="${extra.classes}"/> + </copy> </target> <target name="exec-buildhelper" depends="compile"> diff --git a/eclipse/Development Server (vaadin).launch b/eclipse/Development Server (vaadin).launch index 8f57c441ec..9505811c0b 100644 --- a/eclipse/Development Server (vaadin).launch +++ b/eclipse/Development Server (vaadin).launch @@ -6,6 +6,13 @@ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> +<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> +<listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> +<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" javaProject="vaadin" path="1" type="4"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=vaadin&amp;ivyXmlPath=uitest%2Fivy.xml&amp;confs=jetty-run" path="3" type="4"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="vaadin"/> </runtimeClasspathEntry> "/> +</listAttribute> +<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.vaadin.launcher.DevelopmentServerLauncher"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="vaadin"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/> diff --git a/push/build.xml b/push/build.xml index abeec2a8b0..0db99e815c 100644 --- a/push/build.xml +++ b/push/build.xml @@ -16,7 +16,7 @@ <property name="vaadinPush.debug.js" location="${result.dir}/js/VAADIN/vaadinPush.debug.js" /> <!-- Keep the version number in sync with ivy.xml, server/src/com/vaadin/server/Constants.java --> - <property name="atmosphere.runtime.version" value="1.0.18.vaadin1" /> + <property name="atmosphere.runtime.version" value="2.0.3.vaadin1" /> <property name="jquery.version" value="1.9.0" /> <path id="classpath.compile.custom" /> diff --git a/push/ivy.xml b/push/ivy.xml index 2be47512fe..b28c5c69d9 100644 --- a/push/ivy.xml +++ b/push/ivy.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ivy-module [ <!-- Keep the version number in sync with build.xml --> - <!ENTITY atmosphere.runtime.version "1.0.18.vaadin1"> + <!ENTITY atmosphere.runtime.version "2.0.3.vaadin1"> - <!ENTITY atmosphere.js.version "2.0.3.vaadin2"> + <!ENTITY atmosphere.js.version "2.0.8.vaadin1"> ]> <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/scripts/automerge7.sh b/scripts/automerge7.sh index bc3a7be0a4..10e6ee0ffb 100755 --- a/scripts/automerge7.sh +++ b/scripts/automerge7.sh @@ -1,8 +1,10 @@ #!/bin/bash -FROM=7.0 -TO=7.1 +IGNORE=7.0 +FROM=7.1 +TO=master +IGNORE_HEAD=origin/$IGNORE FROM_HEAD=origin/$FROM PUSH="origin HEAD:refs/for/$TO" @@ -86,7 +88,7 @@ fi git checkout $TO git fetch -pending=`git log $TO..$FROM_HEAD --reverse|grep "^commit "|sed "s/commit //"` +pending=`git log $TO..$FROM_HEAD ^$IGNORE_HEAD --reverse|grep "^commit "|sed "s/commit //"` pendingCommit= pendingCommitMessage= @@ -94,7 +96,7 @@ for commit in $pending do echo "Checking $commit..." mergeDirective=`git log -n 1 --format=%B $commit|grep "^Merge:"|sed "s/Merge: //"` - commitMsg=`git log -n 1 --format=oneline --abbrev-commit $commit` + commitMsg=`git log -n 1 --format=oneline --abbrev-commit $commit | sed 's/\\\\/\\\\\\\\/g'` #Multiple levels of unescaping, sed just changes \ to \\ if [ "$mergeDirective" == "" ] then if can_merge $commit @@ -107,7 +109,7 @@ do pendingCommit= pendingCommitMessage= echo - echo "Stopping merge because $commit because of merge conflicts" + echo "Stopping merge at $commit because of merge conflicts" echo "The following commit must be manually merged." show $commit exit 3 diff --git a/server/src/com/vaadin/annotations/Widgetset.java b/server/src/com/vaadin/annotations/Widgetset.java index 4cc81b4bd3..006bf59acf 100644 --- a/server/src/com/vaadin/annotations/Widgetset.java +++ b/server/src/com/vaadin/annotations/Widgetset.java @@ -24,7 +24,7 @@ import java.lang.annotation.Target; import com.vaadin.ui.UI; /** - * Defines a specific widget set for a {@link UI}. + * Defines a specific widgetset for a {@link UI}. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/server/src/com/vaadin/data/Container.java b/server/src/com/vaadin/data/Container.java index e93db52a35..bf553f31d2 100644 --- a/server/src/com/vaadin/data/Container.java +++ b/server/src/com/vaadin/data/Container.java @@ -582,6 +582,60 @@ public interface Container extends Serializable { public Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException; + /** + * An <code>Event</code> object specifying information about the added + * items. + */ + public interface ItemAddEvent extends ItemSetChangeEvent { + + /** + * Gets the item id of the first added item. + * + * @return item id of the first added item + */ + public Object getFirstItemId(); + + /** + * Gets the index of the first added item. + * + * @return index of the first added item + */ + public int getFirstIndex(); + + /** + * Gets the number of the added items. + * + * @return the number of added items. + */ + public int getAddedItemsCount(); + } + + /** + * An <code>Event</code> object specifying information about the removed + * items. + */ + public interface ItemRemoveEvent extends ItemSetChangeEvent { + /** + * Gets the item id of the first removed item. + * + * @return item id of the first removed item + */ + public Object getFirstItemId(); + + /** + * Gets the index of the first removed item. + * + * @return index of the first removed item + */ + public int getFirstIndex(); + + /** + * Gets the number of the removed items. + * + * @return the number of removed items + */ + public int getRemovedItemsCount(); + } } /** diff --git a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java index 23f2da53ce..7edcc9719c 100644 --- a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java +++ b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java @@ -23,7 +23,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; -import java.util.logging.Logger; import com.vaadin.data.Item; import com.vaadin.data.Property; @@ -55,9 +54,6 @@ import com.vaadin.util.ReflectTools; */ public class FieldGroup implements Serializable { - private static final Logger logger = Logger.getLogger(FieldGroup.class - .getName()); - private Item itemDataSource; private boolean buffered = true; @@ -1013,9 +1009,7 @@ public class FieldGroup implements Serializable { */ public Field<?> buildAndBind(String caption, Object propertyId) throws BindException { - Class<?> type = getPropertyType(propertyId); return buildAndBind(caption, propertyId, Field.class); - } /** diff --git a/server/src/com/vaadin/data/util/AbstractBeanContainer.java b/server/src/com/vaadin/data/util/AbstractBeanContainer.java index b19cdd980c..d94588bdc9 100644 --- a/server/src/com/vaadin/data/util/AbstractBeanContainer.java +++ b/server/src/com/vaadin/data/util/AbstractBeanContainer.java @@ -222,6 +222,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends @Override public boolean removeAllItems() { int origSize = size(); + IDTYPE firstItem = getFirstVisibleItem(); internalRemoveAllItems(); @@ -234,7 +235,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends // fire event only if the visible view changed, regardless of whether // filtered out items were removed or not if (origSize != 0) { - fireItemSetChange(); + fireItemsRemoved(0, firstItem, origSize); } return true; @@ -679,6 +680,8 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends protected void addAll(Collection<? extends BEANTYPE> collection) throws IllegalStateException, IllegalArgumentException { boolean modified = false; + int origSize = size(); + for (BEANTYPE bean : collection) { // TODO skipping invalid beans - should not allow them in javadoc? if (bean == null @@ -699,13 +702,22 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends if (modified) { // Filter the contents when all items have been added if (isFiltered()) { - filterAll(); - } else { - fireItemSetChange(); + doFilterContainer(!getFilters().isEmpty()); + } + if (visibleNewItemsWasAdded(origSize)) { + // fire event about added items + int firstPosition = origSize; + IDTYPE firstItemId = getVisibleItemIds().get(firstPosition); + int affectedItems = size() - origSize; + fireItemsAdded(firstPosition, firstItemId, affectedItems); } } } + private boolean visibleNewItemsWasAdded(int origSize) { + return size() > origSize; + } + /** * Use the bean resolver to get the identifier for a bean. * diff --git a/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java b/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java index 84304431bc..9a7922b928 100644 --- a/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java +++ b/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java @@ -15,8 +15,10 @@ */ package com.vaadin.data.util; +import java.io.Serializable; import java.util.Collection; import java.util.Collections; +import java.util.EventObject; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -146,6 +148,85 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE } } + private static abstract class BaseItemAddOrRemoveEvent extends + EventObject implements Serializable { + protected Object itemId; + protected int index; + protected int count; + + public BaseItemAddOrRemoveEvent(Container source, Object itemId, + int index, int count) { + super(source); + this.itemId = itemId; + this.index = index; + this.count = count; + } + + public Container getContainer() { + return (Container) getSource(); + } + + public Object getFirstItemId() { + return itemId; + } + + public int getFirstIndex() { + return index; + } + + public int getAffectedItemsCount() { + return count; + } + } + + /** + * An <code>Event</code> object specifying information about the added + * items. + * + * <p> + * This class provides information about the first added item and the number + * of added items. + * </p> + */ + protected static class BaseItemAddEvent extends + BaseItemAddOrRemoveEvent implements + Container.Indexed.ItemAddEvent { + + public BaseItemAddEvent(Container source, Object itemId, int index, + int count) { + super(source, itemId, index, count); + } + + @Override + public int getAddedItemsCount() { + return getAffectedItemsCount(); + } + } + + /** + * An <code>Event</code> object specifying information about the removed + * items. + * + * <p> + * This class provides information about the first removed item and the + * number of removed items. + * </p> + */ + protected static class BaseItemRemoveEvent extends + BaseItemAddOrRemoveEvent implements + Container.Indexed.ItemRemoveEvent { + + public BaseItemRemoveEvent(Container source, Object itemId, + int index, int count) { + super(source, itemId, index, count); + } + + @Override + public int getRemovedItemsCount() { + return getAffectedItemsCount(); + } + } + /** * Get an item even if filtered out. * @@ -898,36 +979,69 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE * Notify item set change listeners that an item has been added to the * container. * - * Unless subclasses specify otherwise, the default notification indicates a - * full refresh. - * * @param postion - * position of the added item in the view (if visible) + * position of the added item in the view * @param itemId * id of the added item * @param item * the added item */ protected void fireItemAdded(int position, ITEMIDTYPE itemId, ITEMCLASS item) { - fireItemSetChange(); + fireItemsAdded(position, itemId, 1); + } + + /** + * Notify item set change listeners that items has been added to the + * container. + * + * @param firstPosition + * position of the first visible added item in the view + * @param firstItemId + * id of the first visible added item + * @param numberOfItems + * the number of visible added items + */ + protected void fireItemsAdded(int firstPosition, ITEMIDTYPE firstItemId, + int numberOfItems) { + BaseItemAddEvent addEvent = new BaseItemAddEvent(this, + firstItemId, firstPosition, numberOfItems); + fireItemSetChange(addEvent); } /** * Notify item set change listeners that an item has been removed from the * container. * - * Unless subclasses specify otherwise, the default notification indicates a - * full refresh. + * @param position + * position of the removed item in the view prior to removal * - * @param postion - * position of the removed item in the view prior to removal (if - * was visible) * @param itemId * id of the removed item, of type {@link Object} to satisfy * {@link Container#removeItem(Object)} API */ protected void fireItemRemoved(int position, Object itemId) { - fireItemSetChange(); + fireItemsRemoved(position, itemId, 1); + } + + /** + * Notify item set change listeners that items has been removed from the + * container. + * + * @param firstPosition + * position of the first visible removed item in the view prior + * to removal + * @param firstItemId + * id of the first visible removed item, of type {@link Object} + * to satisfy {@link Container#removeItem(Object)} API + * @param numberOfItems + * the number of removed visible items + * + */ + protected void fireItemsRemoved(int firstPosition, Object firstItemId, + int numberOfItems) { + BaseItemRemoveEvent removeEvent = new BaseItemRemoveEvent(this, + firstItemId, firstPosition, numberOfItems); + fireItemSetChange(removeEvent); } // visible and filtered item identifier lists @@ -946,6 +1060,21 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE } /** + * Returns the item id of the first visible item after filtering. 'Null' is + * returned if there is no visible items. + * + * For internal use only. + * + * @return item id of the first visible item + */ + protected ITEMIDTYPE getFirstVisibleItem() { + if (!getVisibleItemIds().isEmpty()) { + return getVisibleItemIds().get(0); + } + return null; + } + + /** * Returns true is the container has active filters. * * @return true if the container is currently filtered diff --git a/server/src/com/vaadin/data/util/IndexedContainer.java b/server/src/com/vaadin/data/util/IndexedContainer.java index d7bf70caf6..5d20919208 100644 --- a/server/src/com/vaadin/data/util/IndexedContainer.java +++ b/server/src/com/vaadin/data/util/IndexedContainer.java @@ -226,6 +226,7 @@ public class IndexedContainer extends @Override public boolean removeAllItems() { int origSize = size(); + Object firstItem = getFirstVisibleItem(); internalRemoveAllItems(); @@ -235,7 +236,7 @@ public class IndexedContainer extends // filtered out items were removed or not if (origSize != 0) { // Sends a change event - fireItemSetChange(); + fireItemsRemoved(0, firstItem, origSize); } return true; @@ -620,8 +621,7 @@ public class IndexedContainer extends @Override protected void fireItemAdded(int position, Object itemId, Item item) { if (position >= 0) { - fireItemSetChange(new IndexedContainer.ItemSetChangeEvent(this, - position)); + super.fireItemAdded(position, itemId, item); } } @@ -1211,4 +1211,5 @@ public class IndexedContainer extends public Collection<Filter> getContainerFilters() { return super.getContainerFilters(); } + } diff --git a/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java b/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java index cadfdcc774..4d3717e9ba 100644 --- a/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java +++ b/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java @@ -16,6 +16,7 @@ package com.vaadin.data.util.converter; +import java.math.BigDecimal; import java.util.Date; import java.util.logging.Logger; @@ -103,10 +104,10 @@ public class DefaultConverterFactory implements ConverterFactory { return new StringToIntegerConverter(); } else if (Long.class.isAssignableFrom(sourceType)) { return new StringToLongConverter(); + } else if (BigDecimal.class.isAssignableFrom(sourceType)) { + return new StringToBigDecimalConverter(); } else if (Boolean.class.isAssignableFrom(sourceType)) { return new StringToBooleanConverter(); - } else if (Number.class.isAssignableFrom(sourceType)) { - return new StringToNumberConverter(); } else if (Date.class.isAssignableFrom(sourceType)) { return new StringToDateConverter(); } else { diff --git a/server/src/com/vaadin/data/util/converter/StringToBigDecimalConverter.java b/server/src/com/vaadin/data/util/converter/StringToBigDecimalConverter.java new file mode 100644 index 0000000000..75d4cedd23 --- /dev/null +++ b/server/src/com/vaadin/data/util/converter/StringToBigDecimalConverter.java @@ -0,0 +1,60 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.data.util.converter; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.Locale; + +/** + * A converter that converts from {@link String} to {@link BigDecimal} and back. + * Uses the given locale and a {@link NumberFormat} instance for formatting and + * parsing. + * <p> + * Leading and trailing white spaces are ignored when converting from a String. + * </p> + * <p> + * Override and overwrite {@link #getFormat(Locale)} to use a different format. + * </p> + * + * @author Vaadin Ltd + * @since 7.2 + */ +public class StringToBigDecimalConverter extends + AbstractStringToNumberConverter<BigDecimal> { + @Override + protected NumberFormat getFormat(Locale locale) { + NumberFormat numberFormat = super.getFormat(locale); + if (numberFormat instanceof DecimalFormat) { + ((DecimalFormat) numberFormat).setParseBigDecimal(true); + } + + return numberFormat; + } + + @Override + public BigDecimal convertToModel(String value, + Class<? extends BigDecimal> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return (BigDecimal) convertToNumber(value, BigDecimal.class, locale); + } + + @Override + public Class<BigDecimal> getModelType() { + return BigDecimal.class; + } +} diff --git a/server/src/com/vaadin/data/util/converter/StringToNumberConverter.java b/server/src/com/vaadin/data/util/converter/StringToNumberConverter.java deleted file mode 100644 index 22df42403f..0000000000 --- a/server/src/com/vaadin/data/util/converter/StringToNumberConverter.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2000-2013 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.data.util.converter; - -import java.text.NumberFormat; -import java.util.Locale; - -/** - * A converter that converts from {@link Number} to {@link String} and back. - * Uses the given locale and {@link NumberFormat} for formatting and parsing. - * <p> - * Override and overwrite {@link #getFormat(Locale)} to use a different format. - * </p> - * - * @author Vaadin Ltd - * @since 7.0 - */ -public class StringToNumberConverter extends - AbstractStringToNumberConverter<Number> { - - /* - * (non-Javadoc) - * - * @see - * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, - * java.lang.Class, java.util.Locale) - */ - @Override - public Number convertToModel(String value, - Class<? extends Number> targetType, Locale locale) - throws ConversionException { - if (targetType != getModelType()) { - throw new ConversionException("Converter only supports " - + getModelType().getName() + " (targetType was " - + targetType.getName() + ")"); - } - - return convertToNumber(value, targetType, locale); - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.data.util.converter.Converter#getModelType() - */ - @Override - public Class<Number> getModelType() { - return Number.class; - } - -} diff --git a/server/src/com/vaadin/data/validator/BeanValidator.java b/server/src/com/vaadin/data/validator/BeanValidator.java index ea7189bc5e..54efa51ac1 100644 --- a/server/src/com/vaadin/data/validator/BeanValidator.java +++ b/server/src/com/vaadin/data/validator/BeanValidator.java @@ -17,8 +17,6 @@ package com.vaadin.data.validator; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; import java.util.Locale; import java.util.Set; @@ -115,7 +113,9 @@ public class BeanValidator implements Validator { Set<?> violations = getJavaxBeanValidator().validateValue(beanClass, propertyName, value); if (violations.size() > 0) { - List<String> exceptions = new ArrayList<String>(); + InvalidValueException[] causes = new InvalidValueException[violations + .size()]; + int i = 0; for (Object v : violations) { final ConstraintViolation<?> violation = (ConstraintViolation<?>) v; String msg = getJavaxBeanValidatorFactory() @@ -123,16 +123,11 @@ public class BeanValidator implements Validator { violation.getMessageTemplate(), new SimpleContext(value, violation .getConstraintDescriptor()), locale); - exceptions.add(msg); + causes[i] = new InvalidValueException(msg); + ++i; } - StringBuilder b = new StringBuilder(); - for (int i = 0; i < exceptions.size(); i++) { - if (i != 0) { - b.append("<br/>"); - } - b.append(exceptions.get(i)); - } - throw new InvalidValueException(b.toString()); + + throw new InvalidValueException(null, causes); } } diff --git a/server/src/com/vaadin/event/UIEvents.java b/server/src/com/vaadin/event/UIEvents.java new file mode 100644 index 0000000000..321bfc9251 --- /dev/null +++ b/server/src/com/vaadin/event/UIEvents.java @@ -0,0 +1,116 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.event; + +import java.io.Serializable; +import java.lang.reflect.Method; + +import com.vaadin.ui.Component; +import com.vaadin.ui.UI; +import com.vaadin.util.ReflectTools; + +/** + * A class that contains events, listeners and handlers specific to the + * {@link UI} class. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public interface UIEvents { + + /** + * A {@link PollListener} receives and handles {@link PollEvent PollEvents} + * fired by {@link PollNotifier PollNotifiers}. + * + * @since 7.2 + * @author Vaadin Ltd + */ + public interface PollListener extends Serializable { + public static final Method POLL_METHOD = ReflectTools.findMethod( + PollListener.class, "poll", PollEvent.class); + + /** + * A poll request has been received by the server. + * + * @param event + * poll event + */ + public void poll(PollEvent event); + } + + /** + * An event that is fired whenever a client polls the server for + * asynchronous UI updates. + * + * @since 7.2 + * @author Vaadin Ltd + */ + public static class PollEvent extends Component.Event { + public PollEvent(UI ui) { + super(ui); + } + + /** + * Get the {@link UI} instance that received the poll request. + * + * @return the {@link UI} that received the poll request. Never + * <code>null</code>. + */ + public UI getUI() { + /* + * This cast is safe to make, since this class' constructor + * constrains the source to be a UI instance. + */ + return (UI) getComponent(); + } + } + + /** + * The interface for adding and removing {@link PollEvent} listeners. + * <p> + * By implementing this interface, a class publicly announces that it is + * able to send {@link PollEvent PollEvents} whenever the client sends a + * periodic poll message to the client, to check for asynchronous + * server-side modifications. + * + * @since 7.2 + * @see UI#setPollInterval(int) + */ + public interface PollNotifier extends Serializable { + /** + * Add a poll listener. + * <p> + * The listener is called whenever the client polls the server for + * asynchronous UI updates. + * + * @see UI#setPollInterval(int) + * @see #removePollListener(PollListener) + * @param listener + * the {@link PollListener} to add + */ + public void addPollListener(PollListener listener); + + /** + * Remove a poll listener. + * + * @see #addPollListener(PollListener) + * @param listener + * the listener to be removed + */ + public void removePollListener(PollListener listener); + } + +} diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index 0a4949ffa7..5a117958a0 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -146,14 +146,15 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { } @Override + protected boolean canHandleRequest(VaadinRequest request) { + // We do not want to handle /APP requests here, instead let it fall + // through and produce a 404 + return !ServletPortletHelper.isAppRequest(request); + } + + @Override public boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - if (ServletPortletHelper.isAppRequest(request)) { - // We do not want to handle /APP requests here, instead let it fall - // through and produce a 404 - return false; - } - try { // Update WebBrowser here only to make WebBrowser information // available in init for LegacyApplications diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java index b0841da314..a39c39fa72 100644 --- a/server/src/com/vaadin/server/Constants.java +++ b/server/src/com/vaadin/server/Constants.java @@ -67,7 +67,7 @@ public interface Constants { // Keep the version number in sync with push/build.xml and other locations // listed in that file - static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "1.0.18.vaadin1"; + static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.0.3.vaadin1"; static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n" + "=================================================================\n" diff --git a/server/src/com/vaadin/server/JsonCodec.java b/server/src/com/vaadin/server/JsonCodec.java index d533ed99f3..129307e5c1 100644 --- a/server/src/com/vaadin/server/JsonCodec.java +++ b/server/src/com/vaadin/server/JsonCodec.java @@ -31,6 +31,7 @@ import java.lang.reflect.WildcardType; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -45,6 +46,8 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; +import com.vaadin.server.communication.DateSerializer; +import com.vaadin.server.communication.JSONSerializer; import com.vaadin.shared.Connector; import com.vaadin.shared.JsonConstants; import com.vaadin.shared.communication.UidlValue; @@ -176,6 +179,11 @@ public class JsonCodec implements Serializable { */ private static Map<String, Class<?>> transportTypeToType = new HashMap<String, Class<?>>(); + private static Map<Class<?>, JSONSerializer<?>> customSerializers = new HashMap<Class<?>, JSONSerializer<?>>(); + static { + customSerializers.put(Date.class, new DateSerializer()); + } + static { registerType(String.class, JsonConstants.VTYPE_STRING); registerType(Connector.class, JsonConstants.VTYPE_CONNECTOR); @@ -283,6 +291,9 @@ public class JsonCodec implements Serializable { Class<?> classForType = getClassForType(targetType); return decodeEnum(classForType.asSubclass(Enum.class), (String) value); + } else if (customSerializers.containsKey(getClassForType(targetType))) { + return customSerializers.get(getClassForType(targetType)) + .deserialize(targetType, value, connectorTracker); } else { return decodeObject(targetType, (JSONObject) value, connectorTracker); @@ -676,6 +687,10 @@ public class JsonCodec implements Serializable { return encodeEnum((Enum<?>) value, connectorTracker); } else if (value instanceof JSONArray || value instanceof JSONObject) { return new EncodeResult(value); + } else if (customSerializers.containsKey(value.getClass())) { + JSONSerializer serializer = customSerializers.get(value.getClass()); + return new EncodeResult(serializer.serialize(value, + connectorTracker)); } else if (valueType instanceof Class<?>) { // Any object that we do not know how to encode we encode by looping // through fields diff --git a/server/src/com/vaadin/server/LegacyCommunicationManager.java b/server/src/com/vaadin/server/LegacyCommunicationManager.java index ad662cf6df..8d61968b47 100644 --- a/server/src/com/vaadin/server/LegacyCommunicationManager.java +++ b/server/src/com/vaadin/server/LegacyCommunicationManager.java @@ -316,8 +316,6 @@ public class LegacyCommunicationManager implements Serializable { private final HashMap<Class<? extends ClientConnector>, Integer> typeToKey = new HashMap<Class<? extends ClientConnector>, Integer>(); private int nextTypeKey = 0; - private BootstrapHandler bootstrapHandler; - /** * @deprecated As of 7.1. Will be removed in the future. */ diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java index 037d8e8352..5c8b1aeb42 100644 --- a/server/src/com/vaadin/server/Page.java +++ b/server/src/com/vaadin/server/Page.java @@ -476,6 +476,8 @@ public class Page implements Serializable { private final PageState state; + private String windowName; + public Page(UI uI, PageState state) { this.uI = uI; this.state = state; @@ -637,6 +639,7 @@ public class Page implements Serializable { String location = request.getParameter("v-loc"); String clientWidth = request.getParameter("v-cw"); String clientHeight = request.getParameter("v-ch"); + windowName = request.getParameter("v-wn"); if (location != null) { try { @@ -662,6 +665,17 @@ public class Page implements Serializable { } /** + * Gets the window.name value of the browser window of this page. + * + * @since 7.2 + * + * @return the window name, <code>null</code> if the name is not known + */ + public String getWindowName() { + return windowName; + } + + /** * Updates the internal state with the given values. Does not resize the * Page or browser window. * @@ -1124,7 +1138,7 @@ public class Page implements Serializable { * the new page title to set */ public void setTitle(String title) { - uI.getRpcProxy(PageClientRpc.class).setTitle(title); + getState(true).title = title; } /** diff --git a/server/src/com/vaadin/server/ServiceDestroyEvent.java b/server/src/com/vaadin/server/ServiceDestroyEvent.java new file mode 100644 index 0000000000..2ae4cc10af --- /dev/null +++ b/server/src/com/vaadin/server/ServiceDestroyEvent.java @@ -0,0 +1,50 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.util.EventObject; + +/** + * Event fired to {@link ServiceDestroyListener} when a {@link VaadinService} is + * being destroyed. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class ServiceDestroyEvent extends EventObject { + + /** + * Creates a new event for the given service. + * + * @param service + * the service being destroyed + */ + public ServiceDestroyEvent(VaadinService service) { + super(service); + } + + /* + * (non-Javadoc) + * + * @see java.util.EventObject#getSource() + */ + @Override + public VaadinService getSource() { + return (VaadinService) super.getSource(); + } + +} diff --git a/server/src/com/vaadin/server/ServiceDestroyListener.java b/server/src/com/vaadin/server/ServiceDestroyListener.java new file mode 100644 index 0000000000..ad4966dd58 --- /dev/null +++ b/server/src/com/vaadin/server/ServiceDestroyListener.java @@ -0,0 +1,39 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +/** + * Listener that gets notified when the {@link VaadinService} to which it has + * been registered is destroyed. + * + * @see VaadinService#addServiceDestroyListener(ServiceDestroyListener) + * @see VaadinService#removeServiceDestroyListener(ServiceDestroyListener) + * + * @since 7.2 + * @author Vaadin Ltd + */ +public interface ServiceDestroyListener extends Serializable { + /** + * Invoked when a service is destroyed + * + * @param event + * the event + */ + public void serviceDestroy(ServiceDestroyEvent event); +} diff --git a/server/src/com/vaadin/server/SynchronizedRequestHandler.java b/server/src/com/vaadin/server/SynchronizedRequestHandler.java index ac730dcecb..c695855d7d 100644 --- a/server/src/com/vaadin/server/SynchronizedRequestHandler.java +++ b/server/src/com/vaadin/server/SynchronizedRequestHandler.java @@ -32,6 +32,10 @@ public abstract class SynchronizedRequestHandler implements RequestHandler { @Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { + if (!canHandleRequest(request)) { + return false; + } + session.lock(); try { return synchronizedHandleRequest(session, request, response); @@ -62,4 +66,25 @@ public abstract class SynchronizedRequestHandler implements RequestHandler { public abstract boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException; + /** + * Check whether a request may be handled by this handler. This can be used + * as an optimization to avoid locking the session just to investigate some + * method property. The default implementation just returns + * <code>true</code> which means that all requests will be handled by + * calling + * {@link #synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse)} + * with the session locked. + * + * @since 7.2 + * @param request + * the request to handle + * @return <code>true</code> if the request handling should continue once + * the session has been locked; <code>false</code> if there's no + * need to lock the session since the request would still not be + * handled. + */ + protected boolean canHandleRequest(VaadinRequest request) { + return true; + } + } diff --git a/server/src/com/vaadin/server/SystemMessages.java b/server/src/com/vaadin/server/SystemMessages.java index 5e0fde1d4a..299c725207 100644 --- a/server/src/com/vaadin/server/SystemMessages.java +++ b/server/src/com/vaadin/server/SystemMessages.java @@ -63,32 +63,32 @@ public class SystemMessages implements Serializable { protected String sessionExpiredURL = null; protected boolean sessionExpiredNotificationEnabled = true; protected String sessionExpiredCaption = "Session Expired"; - protected String sessionExpiredMessage = "Take note of any unsaved data, and <u>click here</u> to continue."; + protected String sessionExpiredMessage = "Take note of any unsaved data, and <u>click here</u> or press ESC key to continue."; protected String communicationErrorURL = null; protected boolean communicationErrorNotificationEnabled = true; protected String communicationErrorCaption = "Communication problem"; - protected String communicationErrorMessage = "Take note of any unsaved data, and <u>click here</u> to continue."; + protected String communicationErrorMessage = "Take note of any unsaved data, and <u>click here</u> or press ESC to continue."; protected String authenticationErrorURL = null; protected boolean authenticationErrorNotificationEnabled = true; protected String authenticationErrorCaption = "Authentication problem"; - protected String authenticationErrorMessage = "Take note of any unsaved data, and <u>click here</u> to continue."; + protected String authenticationErrorMessage = "Take note of any unsaved data, and <u>click here</u> or press ESC to continue."; protected String internalErrorURL = null; protected boolean internalErrorNotificationEnabled = true; protected String internalErrorCaption = "Internal error"; - protected String internalErrorMessage = "Please notify the administrator.<br/>Take note of any unsaved data, and <u>click here</u> to continue."; + protected String internalErrorMessage = "Please notify the administrator.<br/>Take note of any unsaved data, and <u>click here</u> or press ESC to continue."; protected String outOfSyncURL = null; protected boolean outOfSyncNotificationEnabled = true; protected String outOfSyncCaption = "Out of sync"; - protected String outOfSyncMessage = "Something has caused us to be out of sync with the server.<br/>Take note of any unsaved data, and <u>click here</u> to re-sync."; + protected String outOfSyncMessage = "Something has caused us to be out of sync with the server.<br/>Take note of any unsaved data, and <u>click here</u> or press ESC to re-sync."; protected String cookiesDisabledURL = null; protected boolean cookiesDisabledNotificationEnabled = true; protected String cookiesDisabledCaption = "Cookies disabled"; - protected String cookiesDisabledMessage = "This application requires cookies to function.<br/>Please enable cookies in your browser and <u>click here</u> to try again."; + protected String cookiesDisabledMessage = "This application requires cookies to function.<br/>Please enable cookies in your browser and <u>click here</u> or press ESC to try again."; /** * Use {@link CustomizedSystemMessages} to customize diff --git a/server/src/com/vaadin/server/VaadinPortlet.java b/server/src/com/vaadin/server/VaadinPortlet.java index 093a1c9152..6cf30e85e9 100644 --- a/server/src/com/vaadin/server/VaadinPortlet.java +++ b/server/src/com/vaadin/server/VaadinPortlet.java @@ -365,7 +365,6 @@ public class VaadinPortlet extends GenericPortlet implements Constants, if (request instanceof RenderRequest) { return RequestType.RENDER; } else if (request instanceof ResourceRequest) { - ResourceRequest resourceRequest = (ResourceRequest) request; if (ServletPortletHelper.isUIDLRequest(vaadinRequest)) { return RequestType.UIDL; } else if (PortletUIInitHandler.isUIInitRequest(vaadinRequest)) { @@ -503,6 +502,12 @@ public class VaadinPortlet extends GenericPortlet implements Constants, handleRequest(request, response); } + @Override + public void destroy() { + super.destroy(); + getService().destroy(); + } + private static final Logger getLogger() { return Logger.getLogger(VaadinPortlet.class.getName()); } diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 216adce3c8..b457436b8f 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -41,7 +41,9 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; import java.util.logging.Logger; +import javax.portlet.Portlet; import javax.portlet.PortletContext; +import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletResponse; @@ -97,6 +99,10 @@ public abstract class VaadinService implements Serializable { .findMethod(SessionDestroyListener.class, "sessionDestroy", SessionDestroyEvent.class); + private static final Method SERVICE_DESTROY_METHOD = ReflectTools + .findMethod(ServiceDestroyListener.class, "serviceDestroy", + ServiceDestroyEvent.class); + /** * @deprecated As of 7.0. Only supported for {@link LegacyApplication}. */ @@ -1685,23 +1691,6 @@ public abstract class VaadinService implements Serializable { FutureAccess future = new FutureAccess(session, runnable); session.getPendingAccessQueue().add(future); - ensureAccessQueuePurged(session); - - return future; - } - - /** - * Makes sure the pending access queue is purged for the provided session. - * If the session is currently locked by the current thread or some other - * thread, the queue will be purged when the session is unlocked. If the - * lock is not held by any thread, it is acquired and the queue is purged - * right away. - * - * @since 7.1.2 - * @param session - * the session for which the access queue should be purged - */ - public void ensureAccessQueuePurged(VaadinSession session) { /* * If no thread is currently holding the lock, pending changes for UIs * with automatic push would not be processed and pushed until the next @@ -1724,6 +1713,8 @@ public abstract class VaadinService implements Serializable { } catch (InterruptedException e) { // Just ignore } + + return future; } /** @@ -1770,4 +1761,50 @@ public abstract class VaadinService implements Serializable { CurrentInstance.restoreInstances(oldInstances); } } + + /** + * Adds a service destroy listener that gets notified when this service is + * destroyed. + * + * @since 7.2 + * @param listener + * the service destroy listener to add + * + * @see #destroy() + * @see #removeServiceDestroyListener(ServiceDestroyListener) + * @see ServiceDestroyListener + */ + public void addServiceDestroyListener(ServiceDestroyListener listener) { + eventRouter.addListener(ServiceDestroyEvent.class, listener, + SERVICE_DESTROY_METHOD); + } + + /** + * Removes a service destroy listener that was previously added with + * {@link #addServiceDestroyListener(ServiceDestroyListener)}. + * + * @since 7.2 + * @param listener + * the service destroy listener to remove + */ + public void removeServiceDestroyListener(ServiceDestroyListener listener) { + eventRouter.removeListener(ServiceDestroyEvent.class, listener, + SERVICE_DESTROY_METHOD); + } + + /** + * Called when the servlet, portlet or similar for this service is being + * destroyed. After this method has been called, no more requests will be + * handled by this service. + * + * @see #addServiceDestroyListener(ServiceDestroyListener) + * @see Servlet#destroy() + * @see Portlet#destroy() + * + * @since 7.2 + */ + public void destroy() { + eventRouter.fireEvent(new ServiceDestroyEvent(this)); + } + } diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index 7c0f9599f3..baf97d23d9 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -43,7 +43,6 @@ import javax.servlet.http.HttpServletResponse; import com.vaadin.annotations.VaadinServletConfiguration; import com.vaadin.annotations.VaadinServletConfiguration.InitParameterName; import com.vaadin.sass.internal.ScssStylesheet; -import com.vaadin.server.communication.PushRequestHandler; import com.vaadin.server.communication.ServletUIInitHandler; import com.vaadin.shared.JsonConstants; import com.vaadin.ui.UI; @@ -670,21 +669,11 @@ public class VaadinServlet extends HttpServlet implements Constants { // Provide modification timestamp to the browser if it is known. if (lastModifiedTime > 0) { response.setDateHeader("Last-Modified", lastModifiedTime); - /* - * The browser is allowed to cache for 1 hour without checking if - * the file has changed. This forces browsers to fetch a new version - * when the Vaadin version is updated. This will cause more requests - * to the servlet than without this but for high volume sites the - * static files should never be served through the servlet. The - * cache timeout can be configured by setting the resourceCacheTime - * parameter in web.xml - */ - int resourceCacheTime = getService().getDeploymentConfiguration() - .getResourceCacheTime(); - String cacheControl = "max-age=" - + String.valueOf(resourceCacheTime); - if (filename.contains("nocache")) { - cacheControl = "public, max-age=0, must-revalidate"; + + String cacheControl = "public, max-age=0, must-revalidate"; + int resourceCacheTime = getCacheTime(filename); + if (resourceCacheTime > 0) { + cacheControl = "max-age=" + String.valueOf(resourceCacheTime); } response.setHeader("Cache-Control", cacheControl); } @@ -693,6 +682,43 @@ public class VaadinServlet extends HttpServlet implements Constants { } /** + * Calculates the cache lifetime for the given filename in seconds. By + * default filenames containing ".nocache." return 0, filenames containing + * ".cache." return one year, all other return the value defined in the + * web.xml using resourceCacheTime (defaults to 1 hour). + * + * @param filename + * @return cache lifetime for the given filename in seconds + */ + protected int getCacheTime(String filename) { + /* + * GWT conventions: + * + * - files containing .nocache. will not be cached. + * + * - files containing .cache. will be cached for one year. + * + * https://developers.google.com/web-toolkit/doc/latest/ + * DevGuideCompilingAndDebugging#perfect_caching + */ + if (filename.contains(".nocache.")) { + return 0; + } + if (filename.contains(".cache.")) { + return 60 * 60 * 24 * 365; + } + /* + * For all other files, the browser is allowed to cache for 1 hour + * without checking if the file has changed. This forces browsers to + * fetch a new version when the Vaadin version is updated. This will + * cause more requests to the servlet than without this but for high + * volume sites the static files should never be served through the + * servlet. + */ + return getService().getDeploymentConfiguration().getResourceCacheTime(); + } + + /** * Writes the contents of the given resourceUrl in the response. Can be * overridden to add/modify response headers and similar. * @@ -982,20 +1008,8 @@ public class VaadinServlet extends HttpServlet implements Constants { } protected boolean isStaticResourceRequest(HttpServletRequest request) { - String pathInfo = request.getPathInfo(); - if (pathInfo == null) { - return false; - } - - if ((request.getContextPath() != null) - && (request.getRequestURI().startsWith("/VAADIN/"))) { - return true; - } else if (request.getRequestURI().startsWith( - request.getContextPath() + "/VAADIN/")) { - return true; - } - - return false; + return request.getRequestURI().startsWith( + request.getContextPath() + "/VAADIN/"); } /** @@ -1075,15 +1089,15 @@ public class VaadinServlet extends HttpServlet implements Constants { return u; } + /* + * (non-Javadoc) + * + * @see javax.servlet.GenericServlet#destroy() + */ @Override public void destroy() { super.destroy(); - - for (RequestHandler handler : getService().getRequestHandlers()) { - if (handler instanceof PushRequestHandler) { - ((PushRequestHandler) handler).destroy(); - } - } + getService().destroy(); } /** diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java index fd2ed79acd..265d18b859 100644 --- a/server/src/com/vaadin/server/VaadinSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -22,12 +22,15 @@ import java.io.Serializable; import java.lang.reflect.Method; import java.util.Collection; import java.util.Collections; +import java.util.Enumeration; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Queue; +import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutionException; @@ -43,7 +46,6 @@ import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionBindingEvent; import javax.servlet.http.HttpSessionBindingListener; -import com.vaadin.annotations.PreserveOnRefresh; import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.ConverterFactory; import com.vaadin.data.util.converter.DefaultConverterFactory; @@ -205,7 +207,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { private int nextUIId = 0; private Map<Integer, UI> uIs = new HashMap<Integer, UI>(); - private final Map<String, Integer> retainOnRefreshUIs = new HashMap<String, Integer>(); + private final Map<String, Integer> embedIdMap = new HashMap<String, Integer>(); private final EventRouter eventRouter = new EventRouter(); @@ -424,6 +426,32 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { } /** + * Retrieves all {@link VaadinSession}s which are stored in the given HTTP + * session + * + * @since 7.2 + * @param httpSession + * the HTTP session + * @return the found VaadinSessions + */ + public static Collection<VaadinSession> getAllSessions( + HttpSession httpSession) { + Set<VaadinSession> sessions = new HashSet<VaadinSession>(); + Enumeration<String> attributeNames = httpSession.getAttributeNames(); + + while (attributeNames.hasMoreElements()) { + String attributeName = attributeNames.nextElement(); + if (attributeName.startsWith(VaadinSession.class.getName() + ".")) { + Object value = httpSession.getAttribute(attributeName); + if (value instanceof VaadinSession) { + sessions.add((VaadinSession) value); + } + } + } + return sessions; + } + + /** * Removes this VaadinSession from the HTTP session. * * @param service @@ -828,10 +856,13 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { */ public void removeUI(UI ui) { assert hasLock(); - int id = ui.getUIId(); + Integer id = Integer.valueOf(ui.getUIId()); ui.setSession(null); uIs.remove(id); - retainOnRefreshUIs.values().remove(id); + String embedId = ui.getEmbedId(); + if (embedId != null && id.equals(embedIdMap.get(embedId))) { + embedIdMap.remove(embedId); + } } /** @@ -938,14 +969,12 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { */ public void unlock() { assert hasLock(); - boolean ultimateRelease = false; try { /* * Run pending tasks and push if the reentrant lock will actually be * released by this unlock() invocation. */ if (((ReentrantLock) getLockInstance()).getHoldCount() == 1) { - ultimateRelease = true; getService().runPendingAccessTasks(this); for (UI ui : getUIs()) { @@ -963,18 +992,6 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { } finally { getLockInstance().unlock(); } - - /* - * If the session is locked when a new access task is added, it is - * assumed that the queue will be purged when the lock is released. This - * might however not happen if a task is enqueued between the moment - * when unlock() purges the queue and the moment when the lock is - * actually released. This means that the queue should be purged again - * if it is not empty after unlocking. - */ - if (ultimateRelease && !getPendingAccessQueue().isEmpty()) { - getService().ensureAccessQueuePurged(this); - } } /** @@ -1099,20 +1116,6 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { } /** - * Gets the mapping from <code>window.name</code> to UI id for UIs that are - * should be retained on refresh. - * - * @see VaadinService#preserveUIOnRefresh(VaadinRequest, UI, UIProvider) - * @see PreserveOnRefresh - * - * @return the mapping between window names and UI ids for this session. - */ - public Map<String, Integer> getPreserveOnRefreshUIs() { - assert hasLock(); - return retainOnRefreshUIs; - } - - /** * Adds an initialized UI to this session. * * @param ui @@ -1129,7 +1132,21 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { "The UI belongs to a different session"); } - uIs.put(Integer.valueOf(ui.getUIId()), ui); + Integer uiId = Integer.valueOf(ui.getUIId()); + uIs.put(uiId, ui); + + String embedId = ui.getEmbedId(); + if (embedId != null) { + Integer previousUiId = embedIdMap.put(embedId, uiId); + if (previousUiId != null) { + UI previousUi = uIs.get(previousUiId); + assert previousUi != null + && embedId.equals(previousUi.getEmbedId()) : "UI id map and embed id map not in sync"; + + // Will fire cleanup events at the end of the request handling. + previousUi.close(); + } + } } /** @@ -1340,4 +1357,25 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { stream.defaultReadObject(); pendingAccessQueue = new ConcurrentLinkedQueue<FutureAccess>(); } + + /** + * Finds the UI with the corresponding embed id. + * + * @since 7.2 + * @param embedId + * the embed id + * @return the UI with the corresponding embed id, or <code>null</code> if + * no UI is found + * + * @see UI#getEmbedId() + */ + public UI getUIByEmbedId(String embedId) { + Integer uiId = embedIdMap.get(embedId); + if (uiId == null) { + return null; + } else { + return getUIById(uiId.intValue()); + } + } + } diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java index b9d4955b12..56dd576403 100644 --- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java @@ -22,22 +22,16 @@ import java.io.Serializable; import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.logging.Level; -import java.util.logging.Logger; import org.atmosphere.cpr.AtmosphereResource; import org.atmosphere.cpr.AtmosphereResource.TRANSPORT; -import org.json.JSONException; import com.vaadin.shared.communication.PushConstants; import com.vaadin.ui.UI; /** - * {@link PushConnection} implementation using the Atmosphere push support that - * is by default included in Vaadin. + * A {@link PushConnection} implementation using the Atmosphere push support + * that is by default included in Vaadin. * * @author Vaadin Ltd * @since 7.1 @@ -92,55 +86,84 @@ public class AtmospherePushConnection implements PushConnection { } } + protected enum State { + /** + * Not connected. Trying to push will set the connection state to + * PUSH_PENDING or RESPONSE_PENDING and defer sending the message until + * a connection is established. + */ + DISCONNECTED, + + /** + * Not connected. An asynchronous push is pending the opening of the + * connection. + */ + PUSH_PENDING, + + /** + * Not connected. A response to a client request is pending the opening + * of the connection. + */ + RESPONSE_PENDING, + + /** + * Connected. Messages can be sent through the connection. + */ + CONNECTED; + } + + private State state = State.DISCONNECTED; private UI ui; private AtmosphereResource resource; - private Future<String> outgoingMessage; private FragmentedMessage incomingMessage; - public AtmospherePushConnection(UI ui, AtmosphereResource resource) { + public AtmospherePushConnection(UI ui) { this.ui = ui; - this.resource = resource; } @Override public void push() { - assert isConnected(); - try { - push(true); - } catch (IOException e) { - // TODO Error handling - throw new RuntimeException("Push failed", e); - } + push(true); } /** - * Pushes pending state changes and client RPC calls to the client. + * Pushes pending state changes and client RPC calls to the client. If + * {@code isConnected()} is false, defers the push until a connection is + * established. * * @param async * True if this push asynchronously originates from the server, * false if it is a response to a client request. - * @throws IOException */ - protected void push(boolean async) throws IOException { - Writer writer = new StringWriter(); - try { - new UidlWriter().write(getUI(), writer, false, async); - } catch (JSONException e) { - throw new IOException("Error writing UIDL", e); + public void push(boolean async) { + if (!isConnected()) { + if (async && state != State.RESPONSE_PENDING) { + state = State.PUSH_PENDING; + } else { + state = State.RESPONSE_PENDING; + } + } else { + try { + Writer writer = new StringWriter(); + new UidlWriter().write(getUI(), writer, false, async); + sendMessage("for(;;);[{" + writer.toString() + "}]"); + } catch (Exception e) { + throw new RuntimeException("Push failed", e); + } } - sendMessage("for(;;);[{" + writer.toString() + "}]"); } /** - * Sends the given message to the current client. + * Sends the given message to the current client. Cannot be called if + * {@isConnected()} is false. * * @param message * The message to send */ void sendMessage(String message) { + assert (isConnected()); // "Broadcast" the changes to the single client only - outgoingMessage = getResource().getBroadcaster().broadcast(message, - getResource()); + getResource().getBroadcaster().broadcast(message, getResource()); } /** @@ -157,7 +180,7 @@ public class AtmospherePushConnection implements PushConnection { */ protected Reader receiveMessage(Reader reader) throws IOException { - if (resource.transport() != TRANSPORT.WEBSOCKET) { + if (resource == null || resource.transport() != TRANSPORT.WEBSOCKET) { return reader; } @@ -179,9 +202,37 @@ public class AtmospherePushConnection implements PushConnection { @Override public boolean isConnected() { - return resource != null - && resource.getBroadcaster().getAtmosphereResources() - .contains(resource); + assert (state == State.CONNECTED) ^ (resource == null); + return state == State.CONNECTED; + } + + /** + * Associates this {@code AtmospherePushConnection} with the given + * {@AtmosphereResource} representing an established + * push connection. If already connected, calls {@link #disconnect()} first. + * If there is a deferred push, carries it out via the new connection. + * + * @since 7.2 + */ + public void connect(AtmosphereResource resource) { + + assert resource != null; + assert resource != this.resource; + + if (isConnected()) { + disconnect(); + } + + this.resource = resource; + State oldState = state; + state = State.CONNECTED; + + if (oldState == State.PUSH_PENDING + || oldState == State.RESPONSE_PENDING) { + // Sending a "response" message (async=false) also takes care of a + // pending push, but not vice versa + push(oldState == State.PUSH_PENDING); + } } /** @@ -202,33 +253,8 @@ public class AtmospherePushConnection implements PushConnection { @Override public void disconnect() { assert isConnected(); - - if (outgoingMessage != null) { - // Wait for the last message to be sent before closing the - // connection (assumes that futures are completed in order) - try { - outgoingMessage.get(1000, TimeUnit.MILLISECONDS); - } catch (TimeoutException e) { - getLogger() - .log(Level.INFO, - "Timeout waiting for messages to be sent to client before disconnect"); - } catch (Exception e) { - getLogger() - .log(Level.INFO, - "Error waiting for messages to be sent to client before disconnect"); - } - outgoingMessage = null; - } - resource.resume(); resource = null; - } - - /** - * @since - * @return - */ - private static Logger getLogger() { - return Logger.getLogger(AtmospherePushConnection.class.getName()); + state = State.DISCONNECTED; } } diff --git a/server/src/com/vaadin/server/communication/DateSerializer.java b/server/src/com/vaadin/server/communication/DateSerializer.java new file mode 100644 index 0000000000..9179eb922b --- /dev/null +++ b/server/src/com/vaadin/server/communication/DateSerializer.java @@ -0,0 +1,42 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.server.communication; + +import java.lang.reflect.Type; +import java.util.Date; + +import com.vaadin.ui.ConnectorTracker; + +/** + * Server side serializer/deserializer for java.util.Date + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class DateSerializer implements JSONSerializer<Date> { + + @Override + public Date deserialize(Type type, Object jsonValue, + ConnectorTracker connectorTracker) { + return new Date(Long.valueOf(String.valueOf(jsonValue))); + } + + @Override + public Object serialize(Date value, ConnectorTracker connectorTracker) { + return value.getTime(); + } + +} diff --git a/server/src/com/vaadin/server/communication/FileUploadHandler.java b/server/src/com/vaadin/server/communication/FileUploadHandler.java index 3f6bfd9267..41a16601fe 100644 --- a/server/src/com/vaadin/server/communication/FileUploadHandler.java +++ b/server/src/com/vaadin/server/communication/FileUploadHandler.java @@ -284,7 +284,7 @@ public class FileUploadHandler implements RequestHandler { // if boundary string does not exist, the posted file is from // XHR2.post(File) doHandleXhrFilePost(session, request, response, streamVariable, - variableName, source, request.getContentLength()); + variableName, source, getContentLength(request)); } return true; } @@ -336,7 +336,7 @@ public class FileUploadHandler implements RequestHandler { final InputStream inputStream = request.getInputStream(); - int contentLength = request.getContentLength(); + long contentLength = getContentLength(request); boolean atStart = false; boolean firstFileFieldFound = false; @@ -403,9 +403,22 @@ public class FileUploadHandler implements RequestHandler { } + /* + * request.getContentLength() is limited to "int" by the Servlet + * specification. To support larger file uploads manually evaluate the + * Content-Length header which can contain long values. + */ + private long getContentLength(VaadinRequest request) { + try { + return Long.parseLong(request.getHeader("Content-Length")); + } catch (NumberFormatException e) { + return -1l; + } + } + private void handleFileUploadValidationAndData(VaadinSession session, InputStream inputStream, StreamVariable streamVariable, - String filename, String mimeType, int contentLength, + String filename, String mimeType, long contentLength, ClientConnector connector, String variableName) throws UploadException { session.lock(); @@ -474,7 +487,7 @@ public class FileUploadHandler implements RequestHandler { protected void doHandleXhrFilePost(VaadinSession session, VaadinRequest request, VaadinResponse response, StreamVariable streamVariable, String variableName, - ClientConnector owner, int contentLength) throws IOException { + ClientConnector owner, long contentLength) throws IOException { // These are unknown in filexhr ATM, maybe add to Accept header that // is accessible in portlets @@ -504,7 +517,7 @@ public class FileUploadHandler implements RequestHandler { */ protected final boolean streamToReceiver(VaadinSession session, final InputStream in, StreamVariable streamVariable, - String filename, String type, int contentLength) + String filename, String type, long contentLength) throws UploadException { if (streamVariable == null) { throw new IllegalStateException( @@ -512,7 +525,7 @@ public class FileUploadHandler implements RequestHandler { } OutputStream out = null; - int totalBytes = 0; + long totalBytes = 0; StreamingStartEventImpl startedEvent = new StreamingStartEventImpl( filename, type, contentLength); try { diff --git a/server/src/com/vaadin/server/communication/HeartbeatHandler.java b/server/src/com/vaadin/server/communication/HeartbeatHandler.java index 4c95859203..04cb1b5a25 100644 --- a/server/src/com/vaadin/server/communication/HeartbeatHandler.java +++ b/server/src/com/vaadin/server/communication/HeartbeatHandler.java @@ -43,6 +43,11 @@ import com.vaadin.ui.UI; public class HeartbeatHandler extends SynchronizedRequestHandler implements SessionExpiredHandler { + @Override + protected boolean canHandleRequest(VaadinRequest request) { + return ServletPortletHelper.isHeartbeatRequest(request); + } + /** * Handles a heartbeat request for the given session. Reads the GET * parameter named {@link UIConstants#UI_ID_PARAMETER} to identify the UI. @@ -53,10 +58,6 @@ public class HeartbeatHandler extends SynchronizedRequestHandler implements @Override public boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - if (!ServletPortletHelper.isHeartbeatRequest(request)) { - return false; - } - UI ui = session.getService().findUI(request); if (ui != null) { ui.setLastHeartbeatTimestamp(System.currentTimeMillis()); diff --git a/server/src/com/vaadin/server/communication/JSONSerializer.java b/server/src/com/vaadin/server/communication/JSONSerializer.java new file mode 100644 index 0000000000..fe609c70b6 --- /dev/null +++ b/server/src/com/vaadin/server/communication/JSONSerializer.java @@ -0,0 +1,72 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.server.communication; + +import java.lang.reflect.Type; + +import com.vaadin.ui.ConnectorTracker; + +/** + * Implementors of this interface knows how to serialize an Object of a given + * type to JSON and how to deserialize the JSON back into an object. + * <p> + * The {@link #serialize(Object, ConnectorTracker)} and + * {@link #deserialize(Type, Object, ConnectorTracker)} methods must be + * symmetric so they can be chained and produce the original result (or an equal + * result). + * <p> + * Each {@link JSONSerializer} implementation can handle an object of a single + * type. + * <p> + * This is the server side interface, see + * com.vaadin.client.communication.JSONSerializer for the client side interface. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public interface JSONSerializer<T> { + /** + * Creates and deserializes an object received from the client. Must be + * compatible with {@link #serialize(Object, ConnectorTracker)} and also + * with the client side com.vaadin.client.communication.JSONSerializer. + * <p> + * The json parameter is of type Object as org.json JSON classes have no + * other common super class + * + * @param type + * The expected return type + * @param jsonValue + * the value from the JSON + * @param connectorTracker + * the connector tracker instance for the UI + * @return A deserialized object + */ + T deserialize(Type type, Object jsonValue, ConnectorTracker connectorTracker); + + /** + * Serialize the given object into JSON. Must be compatible with + * {@link #deserialize(Object, connectorTracker)} and the client side + * com.vaadin.client.communication.JSONSerializer + * + * @param value + * The object to serialize + * @param connectorTracker + * The connector tracker instance for the UI + * @return A JSON serialized version of the object + */ + Object serialize(T value, ConnectorTracker connectorTracker); + +} diff --git a/server/src/com/vaadin/server/communication/PushConnection.java b/server/src/com/vaadin/server/communication/PushConnection.java index 7f78d1d48e..cab3c94824 100644 --- a/server/src/com/vaadin/server/communication/PushConnection.java +++ b/server/src/com/vaadin/server/communication/PushConnection.java @@ -20,7 +20,12 @@ import com.vaadin.ui.UI; /** * Represents a bidirectional ("push") connection between a single UI and its - * client-side. + * client-side. A single {@code PushConnection} instance is bound to a UI as + * long as push is enabled in that UI, even if the actual connection is + * momentarily dropped either due to a network failure or as a normal part of + * the transport mechanism. + * <p> + * This interface is an internal API, only meant to be used by the framework. * * @author Vaadin Ltd * @since 7.1 @@ -28,9 +33,10 @@ import com.vaadin.ui.UI; public interface PushConnection { /** - * Pushes pending state changes and client RPC calls to the client. Cannot - * be called if {@link #isConnected()} is false. It is NOT safe to invoke - * this method if not holding the session lock. + * Pushes pending state changes and client RPC calls to the client. Can be + * called even if {@link #isConnected()} is false; the push will be deferred + * until a connection is available. It is NOT safe to invoke this method if + * not holding the session lock. * <p> * This is internal API; please use {@link UI#push()} instead. */ diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java index 09428e47a9..99aff3780f 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -19,7 +19,6 @@ package com.vaadin.server.communication; import java.io.IOException; import java.io.Reader; import java.io.Writer; -import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; @@ -43,7 +42,6 @@ import com.vaadin.server.VaadinService; import com.vaadin.server.VaadinServletRequest; import com.vaadin.server.VaadinServletService; import com.vaadin.server.VaadinSession; -import com.vaadin.server.WebBrowser; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.communication.PushMode; import com.vaadin.ui.UI; @@ -75,8 +73,8 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter @Override public void run(AtmosphereResource resource, UI ui) throws IOException { getLogger().log(Level.FINER, - "New push connection with transport {0}", - resource.transport()); + "New push connection for resource {0} with transport {1}", + new Object[] { resource.uuid(), resource.transport() }); resource.addEventListener(PushHandler.this); @@ -84,14 +82,6 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter VaadinSession session = ui.getSession(); if (resource.transport() == TRANSPORT.STREAMING) { - // IE8 requires a longer padding to work properly if the - // initial message is small (#11573). Chrome does not work - // without the original padding... - WebBrowser browser = session.getBrowser(); - if (browser.isIE() && browser.getBrowserMajorVersion() == 8) { - resource.padding(LONG_PADDING); - } - // Must ensure that the streaming response contains // "Connection: close", otherwise iOS 6 will wait for the // response to this request before sending another request to @@ -115,10 +105,9 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter resource.suspend(); - AtmospherePushConnection connection = new AtmospherePushConnection( - ui, resource); - - ui.setPushConnection(connection); + AtmospherePushConnection connection = getConnectionForUI(ui); + assert (connection != null); + connection.connect(resource); } }; @@ -182,11 +171,11 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter @Override public void run(AtmosphereResource resource, UI ui) throws IOException { PushMode pushMode = ui.getPushConfiguration().getPushMode(); - AtmospherePushConnection pushConnection = getConnectionForUI(ui); + AtmospherePushConnection connection = getConnectionForUI(ui); String id = resource.uuid(); - if (pushConnection == null) { + if (connection == null) { getLogger() .log(Level.WARNING, "Could not find push connection to close: {0} with transport {1}", @@ -209,19 +198,11 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter "Connection unexpectedly closed for resource {0} with transport {1}", new Object[] { id, resource.transport() }); } - ui.setPushConnection(null); + connection.disconnect(); } } }; - private static final String LONG_PADDING; - - static { - char[] array = new char[4096]; - Arrays.fill(array, '-'); - LONG_PADDING = String.copyValueOf(array); - - } private VaadinServletService service; public PushHandler(VaadinServletService service) { @@ -351,10 +332,10 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter private static AtmospherePushConnection getConnectionForUI(UI ui) { PushConnection pushConnection = ui.getPushConnection(); if (pushConnection instanceof AtmospherePushConnection) { - assert pushConnection.isConnected(); return (AtmospherePushConnection) pushConnection; + } else { + return null; } - return null; } @Override @@ -391,7 +372,7 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter break; case JSONP: case LONG_POLLING: - resource.resume(); + disconnect(event); break; default: getLogger().log(Level.SEVERE, "Unknown transport {0}", @@ -415,13 +396,6 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter } @Override - public void onResume(AtmosphereResourceEvent event) { - // Log event on trace level - super.onResume(event); - disconnect(event); - } - - @Override public void destroy() { } @@ -444,8 +418,8 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter */ private static void sendRefreshAndDisconnect(AtmosphereResource resource) throws IOException { - AtmospherePushConnection connection = new AtmospherePushConnection( - null, resource); + AtmospherePushConnection connection = new AtmospherePushConnection(null); + connection.connect(resource); try { connection.sendMessage(VaadinService .createCriticalNotificationJSON(null, null, null, null)); diff --git a/server/src/com/vaadin/server/communication/PushRequestHandler.java b/server/src/com/vaadin/server/communication/PushRequestHandler.java index aff07d96d7..f3869a76f8 100644 --- a/server/src/com/vaadin/server/communication/PushRequestHandler.java +++ b/server/src/com/vaadin/server/communication/PushRequestHandler.java @@ -29,6 +29,8 @@ import org.atmosphere.cpr.AtmosphereRequest; import org.atmosphere.cpr.AtmosphereResponse; import com.vaadin.server.RequestHandler; +import com.vaadin.server.ServiceDestroyEvent; +import com.vaadin.server.ServiceDestroyListener; import com.vaadin.server.ServiceException; import com.vaadin.server.ServletPortletHelper; import com.vaadin.server.SessionExpiredHandler; @@ -75,6 +77,13 @@ public class PushRequestHandler implements RequestHandler, } }; + service.addServiceDestroyListener(new ServiceDestroyListener() { + @Override + public void serviceDestroy(ServiceDestroyEvent event) { + destroy(); + } + }); + pushHandler = new PushHandler(service); atmosphere.addAtmosphereHandler("/*", pushHandler); atmosphere.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, diff --git a/server/src/com/vaadin/server/communication/ServerRpcHandler.java b/server/src/com/vaadin/server/communication/ServerRpcHandler.java index ea25777525..ce9cec5e2a 100644 --- a/server/src/com/vaadin/server/communication/ServerRpcHandler.java +++ b/server/src/com/vaadin/server/communication/ServerRpcHandler.java @@ -20,8 +20,6 @@ import java.io.IOException; import java.io.Reader; import java.io.Serializable; import java.lang.reflect.Type; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -32,6 +30,7 @@ import java.util.logging.Logger; import org.json.JSONArray; import org.json.JSONException; +import org.json.JSONObject; import com.vaadin.server.ClientConnector; import com.vaadin.server.JsonCodec; @@ -62,10 +61,71 @@ import com.vaadin.ui.UI; */ public class ServerRpcHandler implements Serializable { - /* Variable records indexes */ - public static final char VAR_BURST_SEPARATOR = '\u001d'; + /** + * A data transfer object representing an RPC request sent by the client + * side. + * + * @since 7.2 + * @author Vaadin Ltd + */ + public static class RpcRequest implements Serializable { + + private final String csrfToken; + private final JSONArray invocations; + private final int syncId; + private final JSONObject json; + + public RpcRequest(String jsonString) throws JSONException { + json = new JSONObject(jsonString); + csrfToken = json.getString(ApplicationConstants.CSRF_TOKEN); + syncId = json.getInt(ApplicationConstants.SERVER_SYNC_ID); + invocations = new JSONArray( + json.getString(ApplicationConstants.RPC_INVOCATIONS)); + } - public static final char VAR_ESCAPE_CHARACTER = '\u001b'; + /** + * Gets the CSRF security token (double submit cookie) for this request. + * + * @return the CSRF security token for this current change request + */ + public String getCsrfToken() { + return csrfToken; + } + + /** + * Gets the data to recreate the RPC as requested by the client side. + * + * @return the data describing which RPC should be made, and all their + * data + */ + public JSONArray getRpcInvocationsData() { + return invocations; + } + + /** + * Gets the sync id last seen by the client. + * + * @return the last sync id given by the server, according to the + * client's request + */ + public int getSyncId() { + return syncId; + } + + /** + * Gets the entire request in JSON format, as it was received from the + * client. + * <p> + * <em>Note:</em> This is a shared reference - any modifications made + * will be shared. + * + * @return the raw JSON object that was received from the client + * + */ + public JSONObject getRawJson() { + return json; + } + } private static final int MAX_BUFFER_SIZE = 64 * 1024; @@ -90,45 +150,50 @@ public class ServerRpcHandler implements Serializable { throws IOException, InvalidUIDLSecurityKeyException, JSONException { ui.getSession().setLastRequestTimestamp(System.currentTimeMillis()); - String changes = getMessage(reader); + String changeMessage = getMessage(reader); - final String[] bursts = changes.split(String - .valueOf(VAR_BURST_SEPARATOR)); - - if (bursts.length > 2) { - throw new RuntimeException( - "Multiple variable bursts not supported in Vaadin 7"); - } else if (bursts.length <= 1) { + if (changeMessage == null || changeMessage.equals("")) { // The client sometimes sends empty messages, this is probably a bug return; } + RpcRequest rpcRequest = new RpcRequest(changeMessage); + // Security: double cookie submission pattern unless disabled by // property - if (!VaadinService.isCsrfTokenValid(ui.getSession(), bursts[0])) { + if (!VaadinService.isCsrfTokenValid(ui.getSession(), + rpcRequest.getCsrfToken())) { throw new InvalidUIDLSecurityKeyException(""); } - handleBurst(ui, unescapeBurst(bursts[1])); + handleInvocations(ui, rpcRequest.getSyncId(), + rpcRequest.getRpcInvocationsData()); + + ui.getConnectorTracker().cleanConcurrentlyRemovedConnectorIds( + rpcRequest.getSyncId()); } /** - * Processes a message burst received from the client. - * - * A burst can contain any number of RPC calls, including legacy variable - * change calls that are processed separately. - * + * Processes invocations data received from the client. + * <p> + * The invocations data can contain any number of RPC calls, including + * legacy variable change calls that are processed separately. + * <p> * Consecutive changes to the value of the same variable are combined and * changeVariables() is only called once for them. This preserves the Vaadin * 6 semantics for components and add-ons that do not use Vaadin 7 RPC * directly. * - * @param source * @param uI - * the UI receiving the burst - * @param burst - * the content of the burst as a String to be parsed + * the UI receiving the invocations data + * @param lastSyncIdSeenByClient + * the most recent sync id the client has seen at the time the + * request was sent + * @param invocationsData + * JSON containing all information needed to execute all + * requested RPC calls. */ - private void handleBurst(UI uI, String burst) { + private void handleInvocations(UI uI, int lastSyncIdSeenByClient, + JSONArray invocationsData) { // TODO PUSH Refactor so that this is not needed LegacyCommunicationManager manager = uI.getSession() .getCommunicationManager(); @@ -137,7 +202,8 @@ public class ServerRpcHandler implements Serializable { Set<Connector> enabledConnectors = new HashSet<Connector>(); List<MethodInvocation> invocations = parseInvocations( - uI.getConnectorTracker(), burst); + uI.getConnectorTracker(), invocationsData, + lastSyncIdSeenByClient); for (MethodInvocation invocation : invocations) { final ClientConnector connector = manager.getConnector(uI, invocation.getConnectorId()); @@ -243,21 +309,22 @@ public class ServerRpcHandler implements Serializable { } /** - * Parse a message burst from the client into a list of MethodInvocation - * instances. + * Parse JSON from the client into a list of MethodInvocation instances. * * @param connectorTracker * The ConnectorTracker used to lookup connectors - * @param burst - * message string (JSON) + * @param invocationsJson + * JSON containing all information needed to execute all + * requested RPC calls. + * @param lastSyncIdSeenByClient + * the most recent sync id the client has seen at the time the + * request was sent * @return list of MethodInvocation to perform * @throws JSONException */ private List<MethodInvocation> parseInvocations( - ConnectorTracker connectorTracker, String burst) - throws JSONException { - JSONArray invocationsJson = new JSONArray(burst); - + ConnectorTracker connectorTracker, JSONArray invocationsJson, + int lastSyncIdSeenByClient) throws JSONException { ArrayList<MethodInvocation> invocations = new ArrayList<MethodInvocation>(); MethodInvocation previousInvocation = null; @@ -267,7 +334,8 @@ public class ServerRpcHandler implements Serializable { JSONArray invocationJson = invocationsJson.getJSONArray(i); MethodInvocation invocation = parseInvocation(invocationJson, - previousInvocation, connectorTracker); + previousInvocation, connectorTracker, + lastSyncIdSeenByClient); if (invocation != null) { // Can be null if the invocation was a legacy invocation and it // was merged with the previous one or if the invocation was @@ -281,7 +349,8 @@ public class ServerRpcHandler implements Serializable { private MethodInvocation parseInvocation(JSONArray invocationJson, MethodInvocation previousInvocation, - ConnectorTracker connectorTracker) throws JSONException { + ConnectorTracker connectorTracker, long lastSyncIdSeenByClient) + throws JSONException { String connectorId = invocationJson.getString(0); String interfaceName = invocationJson.getString(1); String methodName = invocationJson.getString(2); @@ -289,18 +358,22 @@ public class ServerRpcHandler implements Serializable { if (connectorTracker.getConnector(connectorId) == null && !connectorId .equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) { - getLogger() - .log(Level.WARNING, - "RPC call to " - + interfaceName - + "." - + methodName - + " received for connector " - + connectorId - + " but no such connector could be found. Resynchronizing client."); - // This is likely an out of sync issue (client tries to update a - // connector which is not present). Force resync. - connectorTracker.markAllConnectorsDirty(); + + if (!connectorTracker.connectorWasPresentAsRequestWasSent( + connectorId, lastSyncIdSeenByClient)) { + getLogger() + .log(Level.WARNING, + "RPC call to " + + interfaceName + + "." + + methodName + + " received for connector " + + connectorId + + " but no such connector could be found. Resynchronizing client."); + // This is likely an out of sync issue (client tries to update a + // connector which is not present). Force resync. + connectorTracker.markAllConnectorsDirty(); + } return null; } @@ -396,50 +469,6 @@ public class ServerRpcHandler implements Serializable { owner.changeVariables(source, m); } - /** - * Unescape encoded burst separator characters in a burst received from the - * client. This protects from separator injection attacks. - * - * @param encodedValue - * to decode - * @return decoded value - */ - protected String unescapeBurst(String encodedValue) { - final StringBuilder result = new StringBuilder(); - final StringCharacterIterator iterator = new StringCharacterIterator( - encodedValue); - char character = iterator.current(); - while (character != CharacterIterator.DONE) { - if (VAR_ESCAPE_CHARACTER == character) { - character = iterator.next(); - switch (character) { - case VAR_ESCAPE_CHARACTER + 0x30: - // escaped escape character - result.append(VAR_ESCAPE_CHARACTER); - break; - case VAR_BURST_SEPARATOR + 0x30: - // +0x30 makes these letters for easier reading - result.append((char) (character - 0x30)); - break; - case CharacterIterator.DONE: - // error - throw new RuntimeException( - "Communication error: Unexpected end of message"); - default: - // other escaped character - probably a client-server - // version mismatch - throw new RuntimeException( - "Invalid escaped character from the client - check that the widgetset and server versions match"); - } - } else { - // not a special character - add it to the result as is - result.append(character); - } - character = iterator.next(); - } - return result.toString(); - } - protected String getMessage(Reader reader) throws IOException { StringBuilder sb = new StringBuilder(MAX_BUFFER_SIZE); diff --git a/server/src/com/vaadin/server/communication/UIInitHandler.java b/server/src/com/vaadin/server/communication/UIInitHandler.java index d4b0bc709f..6ab9d9dc58 100644 --- a/server/src/com/vaadin/server/communication/UIInitHandler.java +++ b/server/src/com/vaadin/server/communication/UIInitHandler.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.StringWriter; import java.util.List; -import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -38,6 +37,7 @@ import com.vaadin.server.VaadinResponse; import com.vaadin.server.VaadinService; import com.vaadin.server.VaadinSession; import com.vaadin.shared.ApplicationConstants; +import com.vaadin.shared.JsonConstants; import com.vaadin.shared.communication.PushMode; import com.vaadin.shared.ui.ui.Transport; import com.vaadin.shared.ui.ui.UIConstants; @@ -56,12 +56,13 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { protected abstract boolean isInitRequest(VaadinRequest request); @Override + protected boolean canHandleRequest(VaadinRequest request) { + return isInitRequest(request); + } + + @Override public boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - if (!isInitRequest(request)) { - return false; - } - StringWriter stringWriter = new StringWriter(); try { @@ -107,7 +108,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { static boolean commitJsonResponse(VaadinRequest request, VaadinResponse response, String json) throws IOException { // The response was produced without errors so write it to the client - response.setContentType("application/json; charset=UTF-8"); + response.setContentType(JsonConstants.JSON_CONTENT_TYPE); // Ensure that the browser does not cache UIDL responses. // iOS 6 Safari requires this (#9732) @@ -163,31 +164,29 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { return null; } - // Check for an existing UI based on window.name + // Check for an existing UI based on embed id - // Special parameter sent by vaadinBootstrap.js - String windowName = request.getParameter("v-wn"); + String embedId = getEmbedId(request); - Map<String, Integer> retainOnRefreshUIs = session - .getPreserveOnRefreshUIs(); - if (windowName != null && !retainOnRefreshUIs.isEmpty()) { - // Check for a known UI - - Integer retainedUIId = retainOnRefreshUIs.get(windowName); - - if (retainedUIId != null) { - UI retainedUI = session.getUIById(retainedUIId.intValue()); + UI retainedUI = session.getUIByEmbedId(embedId); + if (retainedUI != null) { + if (vaadinService.preserveUIOnRefresh(provider, new UICreateEvent( + request, uiClass))) { if (uiClass.isInstance(retainedUI)) { reinitUI(retainedUI, request); return retainedUI; } else { getLogger().info( - "Not using retained UI in " + windowName - + " because retained UI was of type " + "Not using the preserved UI " + embedId + + " because it is of type " + retainedUI.getClass() + " but " + uiClass + " is expected for the request."); } } + /* + * Previous UI without preserve on refresh will be closed when the + * new UI gets added to the session. + */ } // No existing UI found - go on by creating and initializing one @@ -220,26 +219,45 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { // Set thread local here so it is available in init UI.setCurrent(ui); - ui.doInit(request, uiId.intValue()); + ui.doInit(request, uiId.intValue(), embedId); session.addUI(ui); - // Remember if it should be remembered - if (vaadinService.preserveUIOnRefresh(provider, event)) { - // Remember this UI - if (windowName == null) { - getLogger().warning( - "There is no window.name available for UI " + uiClass - + " that should be preserved."); - } else { - session.getPreserveOnRefreshUIs().put(windowName, uiId); - } + // Warn if the window can't be preserved + if (embedId == null + && vaadinService.preserveUIOnRefresh(provider, event)) { + getLogger().warning( + "There is no embed id available for UI " + uiClass + + " that should be preserved."); } return ui; } /** + * Constructs an embed id based on information in the request. + * + * @since 7.2 + * + * @param request + * the request to get embed information from + * @return the embed id, or <code>null</code> if id is not available. + * + * @see UI#getEmbedId() + */ + protected String getEmbedId(VaadinRequest request) { + // Parameters sent by vaadinBootstrap.js + String windowName = request.getParameter("v-wn"); + String appId = request.getParameter("v-appId"); + + if (windowName != null && appId != null) { + return windowName + '.' + appId; + } else { + return null; + } + } + + /** * Updates a UI that has already been initialized but is now loaded again, * e.g. because of {@link PreserveOnRefresh}. * diff --git a/server/src/com/vaadin/server/communication/UidlRequestHandler.java b/server/src/com/vaadin/server/communication/UidlRequestHandler.java index d52c5e9fe0..cf25910fa4 100644 --- a/server/src/com/vaadin/server/communication/UidlRequestHandler.java +++ b/server/src/com/vaadin/server/communication/UidlRequestHandler.java @@ -60,11 +60,13 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements } @Override + protected boolean canHandleRequest(VaadinRequest request) { + return ServletPortletHelper.isUIDLRequest(request); + } + + @Override public boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - if (!ServletPortletHelper.isUIDLRequest(request)) { - return false; - } UI uI = session.getService().findUI(request); if (uI == null) { // This should not happen but it will if the UI has been closed. We diff --git a/server/src/com/vaadin/server/communication/UidlWriter.java b/server/src/com/vaadin/server/communication/UidlWriter.java index 60933a75c2..b46fbbf58a 100644 --- a/server/src/com/vaadin/server/communication/UidlWriter.java +++ b/server/src/com/vaadin/server/communication/UidlWriter.java @@ -38,6 +38,7 @@ import com.vaadin.server.LegacyCommunicationManager; import com.vaadin.server.LegacyCommunicationManager.ClientCache; import com.vaadin.server.SystemMessages; import com.vaadin.server.VaadinSession; +import com.vaadin.shared.ApplicationConstants; import com.vaadin.ui.ConnectorTracker; import com.vaadin.ui.UI; @@ -98,6 +99,9 @@ public class UidlWriter implements Serializable { uiConnectorTracker.setWritingResponse(true); try { + writer.write("\"" + ApplicationConstants.SERVER_SYNC_ID + + "\": " + uiConnectorTracker.getCurrentSyncId() + ", "); + writer.write("\"changes\" : "); JsonPaintTarget paintTarget = new JsonPaintTarget(manager, writer, diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 61bcf00ad8..33aa689a88 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -31,13 +31,13 @@ import com.vaadin.event.ConnectorActionManager; import com.vaadin.event.ShortcutListener; import com.vaadin.server.AbstractClientConnector; import com.vaadin.server.ComponentSizeValidator; -import com.vaadin.server.ErrorHandler; import com.vaadin.server.ErrorMessage; import com.vaadin.server.Resource; import com.vaadin.server.VaadinSession; import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.ComponentConstants; import com.vaadin.shared.ui.ComponentStateUtil; +import com.vaadin.ui.Field.ValueChangeEvent; import com.vaadin.util.ReflectTools; /** @@ -85,8 +85,6 @@ public abstract class AbstractComponent extends AbstractClientConnector private static final Pattern sizePattern = Pattern .compile("^(-?\\d+(\\.\\d+)?)(%|px|em|rem|ex|in|cm|mm|pt|pc)?$"); - private ErrorHandler errorHandler = null; - /** * Keeps track of the Actions added to this component; the actual * handling/notifying is delegated, usually to the containing window. @@ -97,6 +95,8 @@ public abstract class AbstractComponent extends AbstractClientConnector private HasComponents parent; + private Boolean explicitImmediateValue; + /* Constructor */ /** @@ -360,25 +360,29 @@ public abstract class AbstractComponent extends AbstractClientConnector } } - /* - * Tests if the component is in the immediate mode. Don't add a JavaDoc - * comment here, we use the default documentation from implemented - * interface. - */ public boolean isImmediate() { - return getState(false).immediate; + if (explicitImmediateValue != null) { + return explicitImmediateValue; + } else if (hasListeners(ValueChangeEvent.class)) { + /* + * Automatic immediate for fields that developers are interested + * about. + */ + return true; + } else { + return false; + } } /** - * Sets the component's immediate mode to the specified status. This method - * will trigger a {@link RepaintRequestEvent}. + * Sets the component's immediate mode to the specified status. * * @param immediate * the boolean value specifying if the component should be in the * immediate mode after the call. - * @see Component#isImmediate() */ public void setImmediate(boolean immediate) { + explicitImmediateValue = immediate; getState().immediate = immediate; } @@ -675,6 +679,8 @@ public abstract class AbstractComponent extends AbstractClientConnector } else { getState().errorMessage = null; } + + getState().immediate = isImmediate(); } /* General event framework */ diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index b96e331889..300e130c4e 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -1086,6 +1086,8 @@ public abstract class AbstractField<T> extends AbstractComponent implements public void addValueChangeListener(Property.ValueChangeListener listener) { addListener(AbstractField.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); + // ensure "automatic immediate handling" works + markAsDirty(); } /** @@ -1107,6 +1109,8 @@ public abstract class AbstractField<T> extends AbstractComponent implements public void removeValueChangeListener(Property.ValueChangeListener listener) { removeListener(AbstractField.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); + // ensure "automatic immediate handling" works + markAsDirty(); } /** diff --git a/server/src/com/vaadin/ui/AbstractSelect.java b/server/src/com/vaadin/ui/AbstractSelect.java index 556b16943f..a32d40b11d 100644 --- a/server/src/com/vaadin/ui/AbstractSelect.java +++ b/server/src/com/vaadin/ui/AbstractSelect.java @@ -878,6 +878,37 @@ public abstract class AbstractSelect extends AbstractField<Object> implements return retval; } + /** + * Adds given items with given item ids to container. + * + * @since 7.2 + * @param itemId + * item identifiers to be added to underlying container + * @throws UnsupportedOperationException + * if the underlying container don't support adding items with + * identifiers + */ + public void addItems(Object... itemId) throws UnsupportedOperationException { + for (Object id : itemId) { + addItem(id); + } + } + + /** + * Adds given items with given item ids to container. + * + * @since 7.2 + * @param itemIds + * item identifiers to be added to underlying container + * @throws UnsupportedOperationException + * if the underlying container don't support adding items with + * identifiers + */ + public void addItems(Collection<Object> itemIds) + throws UnsupportedOperationException { + addItems(itemIds.toArray()); + } + /* * (non-Javadoc) * diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java index 88e895df82..5fb2f81011 100644 --- a/server/src/com/vaadin/ui/ComboBox.java +++ b/server/src/com/vaadin/ui/ComboBox.java @@ -56,8 +56,6 @@ public class ComboBox extends AbstractSelect implements */ protected int pageLength = 10; - private int columns = 0; - // Current page when the user is 'paging' trough options private int currentPage = -1; diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index 485327bb54..c385805675 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -651,7 +651,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { public Locale getLocale(); /** - * Adds an unique id for component that get's transferred to terminal for + * Adds an unique id for component that is used in the client-side for * testing purposes. Keeping identifiers unique is the responsibility of the * programmer. * @@ -661,7 +661,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { public void setId(String id); /** - * Get's currently set debug identifier + * Gets currently set debug identifier * * @return current id, null if not set */ @@ -669,7 +669,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { /** * <p> - * Gets the component's description, used in tooltips and can be displayed + * Gets the components description, used in tooltips and can be displayed * directly in certain other components such as forms. The description can * be used to briefly describe the state of the component to the user. The * description string may contain certain XML tags: diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index 0f8ec60104..33d585adca 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -25,6 +25,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; @@ -81,6 +82,16 @@ public class ConnectorTracker implements Serializable { private Map<StreamVariable, String> streamVariableToSeckey; + private int currentSyncId = 0; + + /** + * Map to track on which syncId each connector was removed. + * + * @see #getCurrentSyncId() + * @see #cleanConcurrentlyRemovedConnectorIds(long) + */ + private TreeMap<Integer, Set<String>> syncIdToUnregisteredConnectorIds = new TreeMap<Integer, Set<String>>(); + /** * Gets a logger for this class * @@ -170,6 +181,15 @@ public class ConnectorTracker implements Serializable { + " is not the one that was registered for that id"); } + Set<String> unregisteredConnectorIds = syncIdToUnregisteredConnectorIds + .get(currentSyncId); + if (unregisteredConnectorIds == null) { + unregisteredConnectorIds = new HashSet<String>(); + syncIdToUnregisteredConnectorIds.put(currentSyncId, + unregisteredConnectorIds); + } + unregisteredConnectorIds.add(connectorId); + dirtyConnectors.remove(connector); if (unregisteredConnectors.add(connector)) { if (getLogger().isLoggable(Level.FINE)) { @@ -570,12 +590,18 @@ public class ConnectorTracker implements Serializable { /** * Sets the current response write status. Connectors can not be marked as * dirty when the response is written. + * <p> + * This method has a side-effect of incrementing the sync id by one (see + * {@link #getCurrentSyncId()}), if {@link #isWritingResponse()} returns + * <code>false</code> and <code>writingResponse</code> is set to + * <code>true</code>. * * @param writingResponse * the new response status. * * @see #markDirty(ClientConnector) * @see #isWritingResponse() + * @see #getCurrentSyncId() * * @throws IllegalArgumentException * if the new response status is the same as the previous value. @@ -587,6 +613,14 @@ public class ConnectorTracker implements Serializable { throw new IllegalArgumentException( "The old value is same as the new value"); } + + /* + * the right hand side of the && is unnecessary here because of the + * if-clause above, but rigorous coding is always rigorous coding. + */ + if (writingResponse && !this.writingResponse) { + currentSyncId++; + } this.writingResponse = writingResponse; } @@ -732,4 +766,105 @@ public class ConnectorTracker implements Serializable { } return streamVariableToSeckey.get(variable); } + + /** + * Check whether a connector was present on the client when the it was + * creating this request, but was removed server-side before the request + * arrived. + * + * @since 7.2 + * @param connectorId + * The connector id to check for whether it was removed + * concurrently or not. + * @param lastSyncIdSeenByClient + * the most recent sync id the client has seen at the time the + * request was sent + * @return <code>true</code> if the connector was removed before the client + * had a chance to react to it. + */ + public boolean connectorWasPresentAsRequestWasSent(String connectorId, + long lastSyncIdSeenByClient) { + + assert getConnector(connectorId) == null : "Connector " + connectorId + + " is still attached"; + + boolean clientRequestIsTooOld = lastSyncIdSeenByClient < currentSyncId; + if (clientRequestIsTooOld) { + /* + * The headMap call is present here because we're only interested in + * connectors removed "in the past" (i.e. the server has removed + * them before the client ever knew about that), since those are the + * ones that we choose to handle as a special case. + */ + /*- + * Server Client + * [#1 add table] ---------. + * \ + * [push: #2 remove table]-. `--> [adding table, storing #1] + * \ .- [table from request #1 needs more data] + * \/ + * /`-> [removing table, storing #2] + * [#1 < #2 - ignoring] <---´ + */ + for (Set<String> unregisteredConnectors : syncIdToUnregisteredConnectorIds + .headMap(currentSyncId).values()) { + if (unregisteredConnectors.contains(connectorId)) { + return true; + } + } + } + + return false; + } + + /** + * Gets the most recently generated server sync id. + * <p> + * The sync id is incremented by one whenever a new response is being + * written. This id is then sent over to the client. The client then adds + * the most recent sync id to each communication packet it sends back to the + * server. This way, the server knows at what state the client is when the + * packet is sent. If the state has changed on the server side since that, + * the server can try to adjust the way it handles the actions from the + * client side. + * + * @see #setWritingResponse(boolean) + * @see #connectorWasPresentAsRequestWasSent(String, long) + * @since 7.2 + * @return the current sync id + */ + public int getCurrentSyncId() { + return currentSyncId; + } + + /** + * Maintains the bookkeeping connector removal and concurrency by removing + * entries that have become too old. + * <p> + * <em>It is important to run this call for each transmission from the client</em> + * , otherwise the bookkeeping gets out of date and the results form + * {@link #connectorWasPresentAsRequestWasSent(String, long)} will become + * invalid (that is, even though the client knew the component was removed, + * the aforementioned method would start claiming otherwise). + * <p> + * Entries that both client and server agree upon are removed. Since + * argument is the last sync id that the client has seen from the server, we + * know that entries earlier than that cannot cause any problems anymore. + * + * @see #connectorWasPresentAsRequestWasSent(String, long) + * @since 7.2 + * @param lastSyncIdSeenByClient + * the sync id the client has most recently received from the + * server. + */ + public void cleanConcurrentlyRemovedConnectorIds(int lastSyncIdSeenByClient) { + /* + * We remove all entries _older_ than the one reported right now, + * because the remaining still contain components that might cause + * conflicts. In any case, it's better to clean up too little than too + * much, especially as the data will hardly grow into the kilobytes. + */ + syncIdToUnregisteredConnectorIds.headMap(lastSyncIdSeenByClient) + .clear(); + } } diff --git a/server/src/com/vaadin/ui/DragAndDropWrapper.java b/server/src/com/vaadin/ui/DragAndDropWrapper.java index 5d6825c868..2ab3e872c6 100644 --- a/server/src/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/com/vaadin/ui/DragAndDropWrapper.java @@ -56,7 +56,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, for (int i = 0; i < fc; i++) { Html5File file = new Html5File( (String) rawVariables.get("fn" + i), // name - (Integer) rawVariables.get("fs" + i), // size + ((Double) rawVariables.get("fs" + i)).longValue(), // size (String) rawVariables.get("ft" + i)); // mime String id = (String) rawVariables.get("fi" + i); files[i] = file; diff --git a/server/src/com/vaadin/ui/Label.java b/server/src/com/vaadin/ui/Label.java index d7cee2a80d..3aa83de420 100644 --- a/server/src/com/vaadin/ui/Label.java +++ b/server/src/com/vaadin/ui/Label.java @@ -18,7 +18,6 @@ package com.vaadin.ui; import java.lang.reflect.Method; import java.util.Locale; -import java.util.logging.Logger; import com.vaadin.data.Property; import com.vaadin.data.util.AbstractProperty; @@ -56,9 +55,6 @@ public class Label extends AbstractComponent implements Property<String>, Property.Viewer, Property.ValueChangeListener, Property.ValueChangeNotifier, Comparable<Label> { - private static final Logger logger = Logger - .getLogger(Label.class.getName()); - /** * @deprecated As of 7.0, use {@link ContentMode#TEXT} instead */ diff --git a/server/src/com/vaadin/ui/Link.java b/server/src/com/vaadin/ui/Link.java index cf8e1a9693..e1a47777bd 100644 --- a/server/src/com/vaadin/ui/Link.java +++ b/server/src/com/vaadin/ui/Link.java @@ -16,13 +16,10 @@ package com.vaadin.ui; -import java.util.Map; - -import com.vaadin.server.PaintException; -import com.vaadin.server.PaintTarget; import com.vaadin.server.Resource; import com.vaadin.shared.ui.BorderStyle; import com.vaadin.shared.ui.link.LinkConstants; +import com.vaadin.shared.ui.link.LinkState; /** * Link is used to create external or internal URL links. @@ -31,7 +28,7 @@ import com.vaadin.shared.ui.link.LinkConstants; * @since 3.0 */ @SuppressWarnings("serial") -public class Link extends AbstractComponent implements LegacyComponent { +public class Link extends AbstractComponent { /** * @deprecated As of 7.0, use {@link BorderStyle#NONE} instead @@ -51,14 +48,6 @@ public class Link extends AbstractComponent implements LegacyComponent { @Deprecated public static final BorderStyle TARGET_BORDER_DEFAULT = BorderStyle.DEFAULT; - private String targetName; - - private BorderStyle targetBorder = BorderStyle.DEFAULT; - - private int targetWidth = -1; - - private int targetHeight = -1; - /** * Creates a new link. */ @@ -105,43 +94,14 @@ public class Link extends AbstractComponent implements LegacyComponent { setTargetBorder(border); } - /** - * Paints the content of this component. - * - * @param target - * the Paint Event. - * @throws PaintException - * if the paint operation failed. - */ @Override - public void paintContent(PaintTarget target) throws PaintException { - if (getResource() == null) { - return; - } - - // Target window name - final String name = getTargetName(); - if (name != null && name.length() > 0) { - target.addAttribute("name", name); - } - - // Target window size - if (getTargetWidth() >= 0) { - target.addAttribute("targetWidth", getTargetWidth()); - } - if (getTargetHeight() >= 0) { - target.addAttribute("targetHeight", getTargetHeight()); - } - - // Target window border - switch (getTargetBorder()) { - case MINIMAL: - target.addAttribute("border", "minimal"); - break; - case NONE: - target.addAttribute("border", "none"); - break; - } + protected LinkState getState() { + return (LinkState) super.getState(); + } + + @Override + protected LinkState getState(boolean markAsDirty) { + return (LinkState) super.getState(markAsDirty); } /** @@ -150,7 +110,7 @@ public class Link extends AbstractComponent implements LegacyComponent { * @return the target window border. */ public BorderStyle getTargetBorder() { - return targetBorder; + return getState(false).targetBorder; } /** @@ -159,7 +119,8 @@ public class Link extends AbstractComponent implements LegacyComponent { * @return the target window height. */ public int getTargetHeight() { - return targetHeight < 0 ? -1 : targetHeight; + return getState(false).targetHeight < 0 ? -1 + : getState(false).targetHeight; } /** @@ -169,7 +130,7 @@ public class Link extends AbstractComponent implements LegacyComponent { * @return the target window name. */ public String getTargetName() { - return targetName; + return getState(false).target; } /** @@ -178,7 +139,8 @@ public class Link extends AbstractComponent implements LegacyComponent { * @return the target window width. */ public int getTargetWidth() { - return targetWidth < 0 ? -1 : targetWidth; + return getState(false).targetWidth < 0 ? -1 + : getState(false).targetWidth; } /** @@ -188,8 +150,7 @@ public class Link extends AbstractComponent implements LegacyComponent { * the targetBorder to set. */ public void setTargetBorder(BorderStyle targetBorder) { - this.targetBorder = targetBorder; - markAsDirty(); + getState().targetBorder = targetBorder; } /** @@ -199,8 +160,7 @@ public class Link extends AbstractComponent implements LegacyComponent { * the targetHeight to set. */ public void setTargetHeight(int targetHeight) { - this.targetHeight = targetHeight; - markAsDirty(); + getState().targetHeight = targetHeight; } /** @@ -210,8 +170,7 @@ public class Link extends AbstractComponent implements LegacyComponent { * the targetName to set. */ public void setTargetName(String targetName) { - this.targetName = targetName; - markAsDirty(); + getState().target = targetName; } /** @@ -221,8 +180,7 @@ public class Link extends AbstractComponent implements LegacyComponent { * the targetWidth to set. */ public void setTargetWidth(int targetWidth) { - this.targetWidth = targetWidth; - markAsDirty(); + getState().targetWidth = targetWidth; } /** @@ -244,8 +202,4 @@ public class Link extends AbstractComponent implements LegacyComponent { setResource(LinkConstants.HREF_RESOURCE, resource); } - @Override - public void changeVariables(Object source, Map<String, Object> variables) { - // TODO Remove once LegacyComponent is no longer implemented - } } diff --git a/server/src/com/vaadin/ui/Notification.java b/server/src/com/vaadin/ui/Notification.java index cf1d03ab5c..31fa265b02 100644 --- a/server/src/com/vaadin/ui/Notification.java +++ b/server/src/com/vaadin/ui/Notification.java @@ -21,6 +21,7 @@ import java.io.Serializable; import com.vaadin.server.Page; import com.vaadin.server.Resource; import com.vaadin.shared.Position; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; /** * A notification message, used to display temporary messages to the user - for @@ -63,7 +64,7 @@ import com.vaadin.shared.Position; */ public class Notification implements Serializable { public enum Type { - HUMANIZED_MESSAGE, WARNING_MESSAGE, ERROR_MESSAGE, TRAY_NOTIFICATION; + HUMANIZED_MESSAGE, WARNING_MESSAGE, ERROR_MESSAGE, TRAY_NOTIFICATION, ASSISTIVE_NOTIFICATION; } @Deprecated @@ -190,21 +191,38 @@ public class Notification implements Serializable { case WARNING_MESSAGE: delayMsec = 1500; styleName = "warning"; + setNavigationConfiguration("Warning: ", "", Role.ALERT); break; case ERROR_MESSAGE: delayMsec = -1; styleName = "error"; + setNavigationConfiguration("Error: ", " - close with ESC", + Role.ALERT); break; case TRAY_NOTIFICATION: delayMsec = 3000; position = Position.BOTTOM_RIGHT; styleName = "tray"; - + setNavigationConfiguration("Info: ", "", Role.STATUS); + break; + case ASSISTIVE_NOTIFICATION: + delayMsec = 3000; + position = Position.ASSISTIVE; + styleName = "assistive"; + setNavigationConfiguration("Note: ", "", Role.ALERT); + break; case HUMANIZED_MESSAGE: default: + styleName = "humanized"; + setNavigationConfiguration("Info: ", "", Role.ALERT); break; } + } + private void setNavigationConfiguration(String prefix, String postfix, + Role ariaRole) { + UI.getCurrent().getNotificationConfiguration() + .setStyleConfiguration(styleName, prefix, postfix, ariaRole); } /** @@ -322,6 +340,132 @@ public class Notification implements Serializable { } /** + * Sets the accessibility prefix for a notification type. + * + * This prefix is read to assistive device users before the content of the + * notification, but not visible on the page. + * + * @param type + * Type of the notification + * @param prefix + * String that is placed before the notification content + */ + public void setAssistivePrefixForType(Type type, String prefix) { + UI.getCurrent().getNotificationConfiguration() + .setAssistivePrefixForStyle(getStyle(type), prefix); + } + + /** + * Gets the accessibility prefix for a notification type. + * + * This prefix is read to assistive device users before the content of the + * notification, but not visible on the page. + * + * @param type + * Type of the notification + * @return The accessibility prefix for the provided notification type + */ + public String getAssistivePrefixForType(Type type) { + return UI.getCurrent().getNotificationConfiguration() + .getAssistivePrefixForStyle(getStyle(type)); + } + + /** + * Sets the accessibility postfix for a notification type. + * + * This postfix is read to assistive device users after the content of the + * notification, but not visible on the page. + * + * @param type + * Type of the notification + * @param postfix + * String that is placed after the notification content + */ + public void setAssistivePostfixForType(Type type, String postfix) { + UI.getCurrent().getNotificationConfiguration() + .setAssistivePostfixForStyle(getStyle(type), postfix); + } + + /** + * Gets the accessibility postfix for a notification type. + * + * This postfix is read to assistive device users after the content of the + * notification, but not visible on the page. + * + * @param type + * Type of the notification + * @return The accessibility postfix for the provided notification type + */ + public String getAssistivePostfixForType(Type type) { + return UI.getCurrent().getNotificationConfiguration() + .getAssistivePostfixForStyle(getStyle(type)); + } + + /** + * Sets the WAI-ARIA role for a notification type. + * + * This role defines how an assistive device handles a notification. + * Available roles are alert and status (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>). + * + * The default role is alert. + * + * @param type + * Type of the notification + * @param role + * Role to set for the notification type + */ + public void setAssistiveRoleForType(Type type, Role role) { + UI.getCurrent().getNotificationConfiguration() + .setAssistiveRoleForStyle(getStyle(type), role); + } + + /** + * Gets the WAI-ARIA role for a notification type. + * + * This role defines how an assistive device handles a notification. + * Available roles are alert and status (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>) + * + * The default role is alert. + * + * @param type + * Type of the notification + * @return Role to set for the notification type + */ + public Role getAssistiveRoleForType(Type type) { + return UI.getCurrent().getNotificationConfiguration() + .getAssistiveRoleForStyle(getStyle(type)); + } + + private String getStyle(Type type) { + String style = ""; + + switch (type) { + case WARNING_MESSAGE: + style = "warning"; + break; + case ERROR_MESSAGE: + style = "error"; + break; + case TRAY_NOTIFICATION: + style = "tray"; + break; + case ASSISTIVE_NOTIFICATION: + style = "assistive"; + break; + case HUMANIZED_MESSAGE: + default: + style = "humanized"; + break; + } + + return style; + } + + /** * Sets whether html is allowed in the caption and description. If set to * true, the texts are passed to the browser as html and the developer is * responsible for ensuring no harmful html is used. If set to false, the @@ -414,4 +558,4 @@ public class Notification implements Serializable { public static void show(String caption, String description, Type type) { new Notification(caption, description, type).show(Page.getCurrent()); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/NotificationConfiguration.java b/server/src/com/vaadin/ui/NotificationConfiguration.java new file mode 100644 index 0000000000..52d3e76d63 --- /dev/null +++ b/server/src/com/vaadin/ui/NotificationConfiguration.java @@ -0,0 +1,269 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * + */ +package com.vaadin.ui; + +import java.io.Serializable; + +import com.vaadin.shared.ui.ui.NotificationConfigurationBean; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; +import com.vaadin.shared.ui.ui.UIState.NotificationConfigurationState; + +/** + * Provides methods for configuring the notification. + * + * @author Vaadin Ltd + * @since 7.1 + */ +public interface NotificationConfiguration extends Serializable { + public void setStyleConfiguration(String style, String prefix, + String postfix, Role ariaRole); + + /** + * Returns the complete configuration object for the given notification + * style. + * + * @param style + * String of the notification style to return + * @return The notification configuration object + */ + public NotificationConfigurationBean getStyleConfiguration(String style); + + /** + * Sets the accessibility prefix for the given notification style. + * + * This prefix is read to assistive device users in front of the content of + * the notification, but not visible on the page. + * + * @param style + * String of the notification style + * @param prefix + * String that is placed before the notification content + */ + public void setAssistivePrefixForStyle(String style, String prefix); + + /** + * Returns the accessibility prefix for the given notification style. + * + * This prefix is read to assistive device users in front of the content of + * the notification, but not visible on the page. + * + * @param style + * String of the notification style + * @return The prefix of the provided notification style + */ + public String getAssistivePrefixForStyle(String style); + + /** + * Sets the accessibility postfix for the given notification style. + * + * This postfix is read to assistive device users after the content of the + * notification, but not visible on the page. + * + * @param style + * String of the notification style + * @param postfix + * String that is placed after the notification content + */ + public void setAssistivePostfixForStyle(String style, String postfix); + + /** + * Returns the accessibility postfix for the given notification style. + * + * This postfix is read to assistive device users after the content of the + * notification, but not visible on the page. + * + * @param style + * String of the notification style + * @return The postfix of the provided notification style + */ + public String getAssistivePostfixForStyle(String style); + + /** + * Sets the WAI-ARIA role for a notification style. + * + * This role defines how an assistive device handles a notification. + * Available roles are alert, alertdialog and status (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>) + * + * The default role is alert. + * + * @param style + * String of the notification style + * @param role + * Role to set for the notification type + */ + public void setAssistiveRoleForStyle(String style, Role role); + + /** + * Returns the WAI-ARIA role for a notification style. + * + * This role defines how an assistive device handles a notification. + * Available roles are alert, alertdialog and status (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a> ) + * + * The default role is alert. + * + * @param style + * String of the notification style + * @return The current Role for the notification type + */ + public Role getAssistiveRoleForStyle(String style); +} + +class NotificationConfigurationImpl implements NotificationConfiguration { + + private UI ui; + + public NotificationConfigurationImpl(UI ui) { + this.ui = ui; + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.NotificationConfiguration#setStyleConfiguration(java.lang + * .String, java.lang.String, java.lang.String, + * com.vaadin.ui.NotificationConfiguration.Role) + */ + @Override + public void setStyleConfiguration(String style, String prefix, + String postfix, Role ariaRole) { + getState().setup.put(style, new NotificationConfigurationBean(prefix, + postfix, ariaRole)); + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.NotificationConfiguration#getStyleConfiguration(java.lang + * .String) + */ + @Override + public NotificationConfigurationBean getStyleConfiguration(String style) { + return getState(false).setup.get(style); + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.NotificationConfiguration#setStylePrefix(java.lang.String, + * java.lang.String) + */ + @Override + public void setAssistivePrefixForStyle(String style, String prefix) { + getConfigurationBean(style).setAssistivePrefix(prefix); + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.NotificationConfiguration#getStylePrefix(java.lang.String) + */ + @Override + public String getAssistivePrefixForStyle(String style) { + NotificationConfigurationBean styleSetup = getState().setup.get(style); + if (styleSetup != null) { + return styleSetup.getAssistivePrefix(); + } + + return null; + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.NotificationConfiguration#setStylePostfix(com.vaadin.ui + * .Notification.Type, java.lang.String) + */ + @Override + public void setAssistivePostfixForStyle(String style, String postfix) { + getConfigurationBean(style).setAssistivePostfix(postfix); + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.NotificationConfiguration#getStylePostfix(com.vaadin.ui + * .Notification.Type) + */ + @Override + public String getAssistivePostfixForStyle(String style) { + NotificationConfigurationBean styleSetup = getState().setup.get(style); + if (styleSetup != null) { + return styleSetup.getAssistivePostfix(); + } + + return null; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.ui.NotificationConfiguration#setStyleRole(com.vaadin.ui. + * Notification.Type, com.vaadin.ui.NotificationConfiguration.Role) + */ + @Override + public void setAssistiveRoleForStyle(String style, Role role) { + getConfigurationBean(style).setAssistiveRole(role); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.ui.NotificationConfiguration#getStyleRole(com.vaadin.ui. + * Notification.Type) + */ + @Override + public Role getAssistiveRoleForStyle(String style) { + NotificationConfigurationBean styleSetup = getState().setup.get(style); + if (styleSetup != null) { + return styleSetup.getAssistiveRole(); + } + + return null; + } + + private NotificationConfigurationBean getConfigurationBean(String style) { + NotificationConfigurationBean styleSetup = getState().setup.get(style); + if (styleSetup == null) { + styleSetup = new NotificationConfigurationBean(); + getState().setup.put(style, styleSetup); + } + + return styleSetup; + } + + private NotificationConfigurationState getState() { + return ui.getState().notificationConfiguration; + } + + private NotificationConfigurationState getState(boolean markAsDirty) { + return ui.getState(markAsDirty).notificationConfiguration; + } + +} diff --git a/server/src/com/vaadin/ui/PushConfiguration.java b/server/src/com/vaadin/ui/PushConfiguration.java index a592b39bef..49738c5aff 100644 --- a/server/src/com/vaadin/ui/PushConfiguration.java +++ b/server/src/com/vaadin/ui/PushConfiguration.java @@ -21,6 +21,7 @@ import java.util.Collection; import java.util.Collections; import com.vaadin.server.VaadinSession; +import com.vaadin.server.communication.AtmospherePushConnection; import com.vaadin.shared.communication.PushMode; import com.vaadin.shared.ui.ui.Transport; import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; @@ -170,20 +171,32 @@ class PushConfigurationImpl implements PushConfiguration { throw new IllegalArgumentException("Push mode cannot be null"); } - if (pushMode.isEnabled()) { - VaadinSession session = ui.getSession(); - if (session != null && !session.getService().ensurePushAvailable()) { - throw new IllegalStateException( - "Push is not available. See previous log messages for more information."); - } + VaadinSession session = ui.getSession(); + + if (session == null) { + throw new UIDetachedException( + "Cannot set the push mode for a detached UI"); + } + + assert session.hasLock(); + + if (pushMode.isEnabled() && !session.getService().ensurePushAvailable()) { + throw new IllegalStateException( + "Push is not available. See previous log messages for more information."); } - /* - * Client-side will open a new connection or disconnect the old - * connection, so there's nothing more to do on the server at this - * point. - */ - getState().mode = pushMode; + PushMode oldMode = getState().mode; + if (oldMode != pushMode) { + getState().mode = pushMode; + + if (!oldMode.isEnabled() && pushMode.isEnabled()) { + // The push connection is initially in a disconnected state; + // the client will establish the connection + ui.setPushConnection(new AtmospherePushConnection(ui)); + } + // Nothing to do here if disabling push; + // the client will close the connection + } } /* @@ -274,9 +287,8 @@ class PushConfigurationImpl implements PushConfiguration { @Override public Collection<String> getParameterNames() { - return Collections - .unmodifiableCollection(ui.getState(false).pushConfiguration.parameters - .keySet()); + return Collections.unmodifiableCollection(getState(false).parameters + .keySet()); } } diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java index 36022adb74..a1f9e9dd26 100644 --- a/server/src/com/vaadin/ui/TabSheet.java +++ b/server/src/com/vaadin/ui/TabSheet.java @@ -268,7 +268,34 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * @return the created {@link Tab} */ public Tab addTab(Component c, String caption, Resource icon) { - return addTab(c, caption, icon, components.size()); + return addTab(c, caption, icon, "", components.size()); + } + + /** + * Adds a new tab into TabSheet. + * + * The first tab added to a tab sheet is automatically selected and a tab + * selection event is fired. + * + * If the component is already present in the tab sheet, changes its caption + * and icon and icon alternate text and returns the corresponding (old) tab, + * preserving other tab metadata. + * + * @param c + * the component to be added onto tab - should not be null. + * @param caption + * the caption to be set for the component and used rendered in + * tab bar + * @param icon + * the icon to be set for the component and used rendered in tab + * bar + * @param iconAltText + * the alternate text for the icon + * @return the created {@link Tab} + */ + public Tab addTab(Component c, String caption, Resource icon, + String iconAltText) { + return addTab(c, caption, icon, iconAltText, components.size()); } /** @@ -294,12 +321,41 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * @return the created {@link Tab} */ public Tab addTab(Component c, String caption, Resource icon, int position) { + return addTab(c, caption, icon, "", position); + } + + /** + * Adds a new tab into TabSheet. + * + * The first tab added to a tab sheet is automatically selected and a tab + * selection event is fired. + * + * If the component is already present in the tab sheet, changes its caption + * and icon and icon alternate text and returns the corresponding (old) tab, + * preserving other tab metadata like the position. + * + * @param c + * the component to be added onto tab - should not be null. + * @param caption + * the caption to be set for the component and used rendered in + * tab bar + * @param icon + * the icon to be set for the component and used rendered in tab + * bar + * @param iconAltText + * the alternate text for the icon + * @param position + * the position at where the the tab should be added. + * @return the created {@link Tab} + */ + public Tab addTab(Component c, String caption, Resource icon, + String iconAltText, int position) { if (c == null) { return null; } else if (tabs.containsKey(c)) { Tab tab = tabs.get(c); tab.setCaption(caption); - tab.setIcon(icon); + tab.setIcon(icon, iconAltText); return tab; } else { components.add(position, c); @@ -371,13 +427,15 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, final Component c = i.next(); String caption = null; Resource icon = null; + String iconAltText = ""; if (TabSheet.class.isAssignableFrom(source.getClass())) { Tab tab = ((TabSheet) source).getTab(c); caption = tab.getCaption(); icon = tab.getIcon(); + iconAltText = tab.getIconAltText(); } source.removeComponent(c); - addTab(c, caption, icon); + addTab(c, caption, icon, iconAltText); } } @@ -429,9 +487,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, if (icon != null) { target.addAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_ICON, icon); + target.addAttribute( + TabsheetBaseConstants.ATTRIBUTE_TAB_ICON_ALT, + tab.getIconAltText()); } final String caption = tab.getCaption(); - if (caption != null && caption.length() > 0) { + if (caption != null && !caption.isEmpty()) { target.addAttribute( TabsheetBaseConstants.ATTRIBUTE_TAB_CAPTION, caption); } @@ -449,10 +510,15 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, } final String styleName = tab.getStyleName(); - if (styleName != null && styleName.length() != 0) { + if (styleName != null && !styleName.isEmpty()) { target.addAttribute(TabsheetConstants.TAB_STYLE_NAME, styleName); } + final String id = tab.getId(); + if (id != null && !id.isEmpty()) { + target.addAttribute("id", id); + } + target.addAttribute("key", keyMapper.key(component)); if (component.equals(selected)) { target.addAttribute("selected", true); @@ -549,6 +615,11 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, // connector if (selected != null) { selected.markAsDirtyRecursive(); + + Tab tab = getTab(c); + if (tab != null && tab.getDefaultFocusComponent() != null) { + tab.getDefaultFocusComponent().focus(); + } } } @@ -889,6 +960,23 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, public void setClosable(boolean closable); /** + * Set the component that should automatically focused when the tab is + * selected. + * + * @param component + * the component to focus + */ + public void setDefaultFocusComponent(Focusable component); + + /** + * Get the component that should be automatically focused when the tab + * is selected. + * + * @return the focusable component + */ + public Focusable getDefaultFocusComponent(); + + /** * Returns the enabled status for the tab. A disabled tab is shown as * such in the tab bar and cannot be selected. * @@ -932,6 +1020,27 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, public void setIcon(Resource icon); /** + * Sets the icon and alt text for the tab. + * + * @param icon + * the icon to set + */ + public void setIcon(Resource icon, String iconAltText); + + /** + * Gets the icon alt text for the tab. + */ + public String getIconAltText(); + + /** + * Sets the icon alt text for the tab. + * + * @param iconAltText + * the icon to set + */ + public void setIconAltText(String iconAltText); + + /** * Gets the description for the tab. The description can be used to * briefly describe the state of the tab to the user, and is typically * shown as a tooltip when hovering over the tab. @@ -1015,6 +1124,23 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * @see #setStyleName(String) */ public String getStyleName(); + + /** + * Adds an unique id for component that is used in the client-side for + * testing purposes. Keeping identifiers unique is the responsibility of + * the programmer. + * + * @param id + * An alphanumeric id + */ + public void setId(String id); + + /** + * Gets currently set debug identifier + * + * @return current id, null if not set + */ + public String getId(); } /** @@ -1030,6 +1156,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, private String description = null; private ErrorMessage componentError = null; private String styleName; + private String id; + private String iconAltText = ""; + private Focusable defaultFocus; public TabSheetTabImpl(String caption, Resource icon) { if (caption == null) { @@ -1061,11 +1190,38 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, @Override public void setIcon(Resource icon) { + setIcon(icon, ""); + } + + @Override + public void setIcon(Resource icon, String iconAltText) { this.icon = icon; + this.iconAltText = iconAltText; markAsDirty(); } @Override + public String getIconAltText() { + return iconAltText; + } + + @Override + public void setIconAltText(String iconAltText) { + this.iconAltText = iconAltText; + markAsDirty(); + } + + @Override + public void setDefaultFocusComponent(Focusable defaultFocus) { + this.defaultFocus = defaultFocus; + } + + @Override + public Focusable getDefaultFocusComponent() { + return defaultFocus; + } + + @Override public boolean isEnabled() { return enabled; } @@ -1150,6 +1306,18 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, public String getStyleName() { return styleName; } + + @Override + public void setId(String id) { + this.id = id; + markAsDirty(); + + } + + @Override + public String getId() { + return id; + } } /** @@ -1309,7 +1477,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, */ private static void copyTabMetadata(Tab from, Tab to) { to.setCaption(from.getCaption()); - to.setIcon(from.getIcon()); + to.setIcon(from.getIcon(), from.getIconAltText()); to.setDescription(from.getDescription()); to.setVisible(from.isVisible()); to.setEnabled(from.isEnabled()); diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index 32ed738697..06e82dedcb 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -2165,7 +2165,6 @@ public class Table extends AbstractSelect implements Action.Container, // more efficient implementation for containers supporting access by // index - Container.Indexed indexed = ((Container.Indexed) items); List<?> itemIds = getItemIds(firstIndex, rows); for (int i = 0; i < rows && i < itemIds.size(); i++) { Object id = itemIds.get(i); diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 746fa194ac..e688c06061 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -32,6 +32,9 @@ import com.vaadin.event.Action.Handler; import com.vaadin.event.ActionManager; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.event.UIEvents.PollEvent; +import com.vaadin.event.UIEvents.PollListener; +import com.vaadin.event.UIEvents.PollNotifier; import com.vaadin.navigator.Navigator; import com.vaadin.server.ClientConnector; import com.vaadin.server.ComponentSizeValidator; @@ -52,6 +55,7 @@ import com.vaadin.server.communication.PushConnection; import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; +import com.vaadin.shared.communication.PushMode; import com.vaadin.shared.ui.ui.DebugWindowClientRpc; import com.vaadin.shared.ui.ui.DebugWindowServerRpc; import com.vaadin.shared.ui.ui.ScrollClientRpc; @@ -77,7 +81,7 @@ import com.vaadin.util.CurrentInstance; * When a new UI instance is needed, typically because the user opens a URL in a * browser window which points to e.g. {@link VaadinServlet}, all * {@link UIProvider}s registered to the current {@link VaadinSession} are - * queried for the UI class that should be used. The selection is by defaylt + * queried for the UI class that should be used. The selection is by default * based on the <code>UI</code> init parameter from web.xml. * </p> * <p> @@ -95,7 +99,8 @@ import com.vaadin.util.CurrentInstance; * @since 7.0 */ public abstract class UI extends AbstractSingleComponentContainer implements - Action.Container, Action.Notifier, LegacyComponent, Focusable { + Action.Container, Action.Notifier, PollNotifier, LegacyComponent, + Focusable { /** * The application to which this UI belongs @@ -167,10 +172,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements @Override public void poll() { - /* - * No-op. This is only called to cause a server visit to check for - * changes. - */ + fireEvent(new PollEvent(UI.this)); } }; private DebugWindowServerRpc debugRpc = new DebugWindowServerRpc() { @@ -222,6 +224,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements private PushConfiguration pushConfiguration = new PushConfigurationImpl( this); + private NotificationConfiguration notificationConfiguration = new NotificationConfigurationImpl( + this); + /** * Creates a new empty UI without a caption. The content of the UI must be * set by calling {@link #setContent(Component)} before using the UI. @@ -418,8 +423,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements } else { if (session == null) { detach(); - // Close the push connection when UI is detached. Otherwise the + // Disable push when the UI is detached. Otherwise the // push connection and possibly VaadinSession will live on. + getPushConfiguration().setPushMode(PushMode.DISABLED); setPushConnection(null); } this.session = session; @@ -546,11 +552,11 @@ public abstract class UI extends AbstractSingleComponentContainer implements private transient PushConnection pushConnection = null; - private boolean hasPendingPush = false; - private LocaleService localeService = new LocaleService(this, getState(false).localeServiceState); + private String embedId; + /** * This method is used by Component.Focusable objects to request focus to * themselves. Focus renders must be handled at window level (instead of @@ -598,12 +604,19 @@ public abstract class UI extends AbstractSingleComponentContainer implements * the initialization request * @param uiId * the id of the new ui + * @param embedId + * the embed id of this UI, or <code>null</code> if no id is + * known + * + * @see #getUIId() + * @see #getEmbedId() */ - public void doInit(VaadinRequest request, int uiId) { + public void doInit(VaadinRequest request, int uiId, String embedId) { if (this.uiId != -1) { throw new IllegalStateException("UI id has already been defined"); } this.uiId = uiId; + this.embedId = embedId; // Actual theme - used for finding CustomLayout templates theme = request.getParameter("theme"); @@ -1334,6 +1347,15 @@ public abstract class UI extends AbstractSingleComponentContainer implements } /** + * Retrieves the object used for configuring notifications. + * + * @return The instance used for notification configuration + */ + public NotificationConfiguration getNotificationConfiguration() { + return notificationConfiguration; + } + + /** * Retrieves the object used for configuring the loading indicator. * * @return The instance used for configuring the loading indicator @@ -1346,6 +1368,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Pushes the pending changes and client RPC invocations of this UI to the * client-side. * <p> + * If push is enabled, but the push connection is not currently open, the + * push will be done when the connection is established. + * <p> * As with all UI methods, the session must be locked when calling this * method. It is also recommended that {@link UI#getCurrent()} is set up to * return this UI since writing the response may invoke logic in any @@ -1363,79 +1388,73 @@ public abstract class UI extends AbstractSingleComponentContainer implements */ public void push() { VaadinSession session = getSession(); - if (session != null) { - assert session.hasLock(); - - /* - * Purge the pending access queue as it might mark a connector as - * dirty when the push would otherwise be ignored because there are - * no changes to push. - */ - session.getService().runPendingAccessTasks(session); - - if (!getConnectorTracker().hasDirtyConnectors()) { - // Do not push if there is nothing to push - return; - } - if (!getPushConfiguration().getPushMode().isEnabled()) { - throw new IllegalStateException("Push not enabled"); - } + if (session == null) { + throw new UIDetachedException("Cannot push a detached UI"); + } + assert session.hasLock(); - if (pushConnection == null) { - hasPendingPush = true; - } else { - pushConnection.push(); - } - } else { - throw new UIDetachedException("Trying to push a detached UI"); + if (!getPushConfiguration().getPushMode().isEnabled()) { + throw new IllegalStateException("Push not enabled"); } + assert pushConnection != null; + + /* + * Purge the pending access queue as it might mark a connector as dirty + * when the push would otherwise be ignored because there are no changes + * to push. + */ + session.getService().runPendingAccessTasks(session); + + if (!getConnectorTracker().hasDirtyConnectors()) { + // Do not push if there is nothing to push + return; + } + + pushConnection.push(); } /** * Returns the internal push connection object used by this UI. This method - * should only be called by the framework. If the returned PushConnection is - * not null, it is guaranteed to have {@code isConnected() == true}. + * should only be called by the framework. * <p> * This method is not intended to be overridden. If it is overridden, care * should be taken since this method might be called in situations where * {@link UI#getCurrent()} does not return this UI. * - * @return the push connection used by this UI, <code>null</code> if there - * is no active push connection. + * @return the push connection used by this UI, or {@code null} if push is + * not available. */ public PushConnection getPushConnection() { - assert (pushConnection == null || pushConnection.isConnected()); + assert !(getPushConfiguration().getPushMode().isEnabled() && pushConnection == null); return pushConnection; } /** * Sets the internal push connection object used by this UI. This method - * should only be called by the framework. If {@pushConnection} is not null, - * its {@code isConnected()} must be true. + * should only be called by the framework. + * <p> + * The {@code pushConnection} argument must be non-null if and only if + * {@code getPushConfiguration().getPushMode().isEnabled()}. * * @param pushConnection * the push connection to use for this UI */ public void setPushConnection(PushConnection pushConnection) { - // If pushMode is disabled then there should never be a pushConnection - assert (pushConnection == null || getPushConfiguration().getPushMode() - .isEnabled()); - assert (pushConnection == null || pushConnection.isConnected()); + // If pushMode is disabled then there should never be a pushConnection; + // if enabled there should always be + assert (pushConnection == null) + ^ getPushConfiguration().getPushMode().isEnabled(); if (pushConnection == this.pushConnection) { return; } - if (this.pushConnection != null) { + if (this.pushConnection != null && this.pushConnection.isConnected()) { this.pushConnection.disconnect(); } this.pushConnection = pushConnection; - if (pushConnection != null && hasPendingPush) { - hasPendingPush = false; - pushConnection.push(); - } } /** @@ -1469,6 +1488,17 @@ public abstract class UI extends AbstractSingleComponentContainer implements return getState(false).pollInterval; } + @Override + public void addPollListener(PollListener listener) { + addListener(EventId.POLL, PollEvent.class, listener, + PollListener.POLL_METHOD); + } + + @Override + public void removePollListener(PollListener listener) { + removeListener(EventId.POLL, PollEvent.class, listener); + } + /** * Retrieves the object used for configuring the push channel. * @@ -1518,4 +1548,18 @@ public abstract class UI extends AbstractSingleComponentContainer implements private static Logger getLogger() { return Logger.getLogger(UI.class.getName()); } + + /** + * Gets a string the uniquely distinguishes this UI instance based on where + * it is embedded. The embed identifier is based on the + * <code>window.name</code> DOM attribute of the browser window where the UI + * is displayed and the id of the div element where the UI is embedded. + * + * @since 7.2 + * @return the embed id for this UI, or <code>null</code> if no id known + */ + public String getEmbedId() { + return embedId; + } + } diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index c173b401b9..d3afdaacf1 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -18,6 +18,9 @@ package com.vaadin.ui; import java.io.Serializable; import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import java.util.Map; import com.vaadin.event.FieldEvents.BlurEvent; @@ -33,10 +36,12 @@ import com.vaadin.event.ShortcutAction.ModifierKey; import com.vaadin.event.ShortcutListener; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; +import com.vaadin.shared.Connector; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.window.WindowMode; import com.vaadin.shared.ui.window.WindowServerRpc; import com.vaadin.shared.ui.window.WindowState; +import com.vaadin.shared.ui.window.WindowState.WindowRole; import com.vaadin.util.ReflectTools; /** @@ -238,8 +243,6 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, // Don't do anything if not attached to a UI if (uI != null) { - // focus is restored to the parent window - uI.focus(); // window is removed from the UI uI.removeWindow(this); } @@ -644,7 +647,10 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * Sets window modality. When a modal window is open, components outside - * that window it cannot be accessed. + * that window cannot be accessed. + * <p> + * Keyboard navigation is restricted by blocking the tab key at the top and + * bottom of the window by activating the tab stop function internally. * * @param modal * true if modality is to be turned on @@ -1005,4 +1011,194 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, protected WindowState getState(boolean markAsDirty) { return (WindowState) super.getState(markAsDirty); } + + /** + * Allows to specify which components contain the description for the + * window. Text contained in these components will be read by assistive + * devices when it is opened. + * + * @param connectors + * with the components to use as description + */ + public void setAssistiveDescription(Connector... connectors) { + if (connectors == null) { + throw new IllegalArgumentException( + "Parameter connectors must be non-null"); + } else { + getState().contentDescription = connectors; + } + } + + /** + * Gets the components that are used as assistive description. Text + * contained in these components will be read by assistive devices when the + * window is opened. + * + * @return list of previously set components + */ + public List<Connector> getAssistiveDescription() { + return Collections.unmodifiableList(Arrays + .asList(getState().contentDescription)); + } + + /** + * Sets the accessibility prefix for the window caption. + * + * This prefix is read to assistive device users before the window caption, + * but not visible on the page. + * + * @param prefix + * String that is placed before the window caption + */ + public void setAssistivePrefix(String prefix) { + getState().assistivePrefix = prefix; + } + + /** + * Gets the accessibility prefix for the window caption. + * + * This prefix is read to assistive device users before the window caption, + * but not visible on the page. + * + * @return The accessibility prefix + */ + public String getAssistivePrefix() { + return getState().assistivePrefix; + } + + /** + * Sets the accessibility postfix for the window caption. + * + * This postfix is read to assistive device users after the window caption, + * but not visible on the page. + * + * @param prefix + * String that is placed after the window caption + */ + public void setAssistivePostfix(String assistivePostfix) { + getState().assistivePostfix = assistivePostfix; + } + + /** + * Gets the accessibility postfix for the window caption. + * + * This postfix is read to assistive device users after the window caption, + * but not visible on the page. + * + * @return The accessibility postfix + */ + public String getAssistivePostfix() { + return getState().assistivePostfix; + } + + /** + * Sets the WAI-ARIA role the window. + * + * This role defines how an assistive device handles a window. Available + * roles are alertdialog and dialog (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>). + * + * The default role is dialog. + * + * @param role + * WAI-ARIA role to set for the window + */ + public void setAssistiveRole(WindowRole role) { + getState().role = role; + } + + /** + * Gets the WAI-ARIA role the window. + * + * This role defines how an assistive device handles a window. Available + * roles are alertdialog and dialog (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>). + * + * @return WAI-ARIA role set for the window + */ + public WindowRole getAssistiveRole() { + return getState().role; + } + + /** + * Set if it should be prevented to set the focus to a component outside a + * non-modal window with the tab key. + * <p> + * This is meant to help users of assistive devices to not leaving the + * window unintentionally. + * <p> + * For modal windows, this function is activated automatically, while + * preserving the stored value of tabStop. + * + * @param tabStop + * true to keep the focus inside the window when reaching the top + * or bottom, false (default) to allow leaving the window + */ + public void setTabStopEnabled(boolean tabStop) { + getState().assistiveTabStop = tabStop; + } + + /** + * Get if it is prevented to leave a window with the tab key. + * + * @return true when the focus is limited to inside the window, false when + * focus can leave the window + */ + public boolean isTabStopEnabled() { + return getState().assistiveTabStop; + } + + /** + * Sets the message that is provided to users of assistive devices when the + * user reaches the top of the window when leaving a window with the tab key + * is prevented. + * <p> + * This message is not visible on the screen. + * + * @param topMessage + * String provided when the user navigates with Shift-Tab keys to + * the top of the window + */ + public void setTabStopTopAssistiveText(String topMessage) { + getState().assistiveTabStopTopText = topMessage; + } + + /** + * Sets the message that is provided to users of assistive devices when the + * user reaches the bottom of the window when leaving a window with the tab + * key is prevented. + * <p> + * This message is not visible on the screen. + * + * @param bottomMessage + * String provided when the user navigates with the Tab key to + * the bottom of the window + */ + public void setTabStopBottomAssistiveText(String bottomMessage) { + getState().assistiveTabStopBottomText = bottomMessage; + } + + /** + * Gets the message that is provided to users of assistive devices when the + * user reaches the top of the window when leaving a window with the tab key + * is prevented. + * + * @return the top message + */ + public String getTabStopTopAssistiveText() { + return getState().assistiveTabStopTopText; + } + + /** + * Gets the message that is provided to users of assistive devices when the + * user reaches the bottom of the window when leaving a window with the tab + * key is prevented. + * + * @return the bottom message + */ + public String getTabStopBottomAssistiveText() { + return getState().assistiveTabStopBottomText; + } } diff --git a/server/tests/src/com/vaadin/data/util/BeanContainerTest.java b/server/tests/src/com/vaadin/data/util/BeanContainerTest.java index 684ab5d6bc..a6c3bb0b8b 100644 --- a/server/tests/src/com/vaadin/data/util/BeanContainerTest.java +++ b/server/tests/src/com/vaadin/data/util/BeanContainerTest.java @@ -466,6 +466,8 @@ public class BeanContainerTest extends AbstractBeanContainerTest { assertTrue(container .addNestedContainerProperty("address.postalCodeObject")); assertTrue(container.addNestedContainerProperty("address.street")); + // the nested properties added with allowNullBean setting should return + // null assertNull(container.getContainerProperty("John", "address.street") .getValue()); } diff --git a/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java b/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java index 767a9e2e4d..b9633753b4 100644 --- a/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java +++ b/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java @@ -10,8 +10,15 @@ import java.util.Map; import junit.framework.Assert; +import org.easymock.Capture; +import org.easymock.EasyMock; + import com.vaadin.data.Container; +import com.vaadin.data.Container.Indexed.ItemAddEvent; +import com.vaadin.data.Container.Indexed.ItemRemoveEvent; +import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.Item; +import com.vaadin.data.util.filter.Compare; /** * Test basic functionality of BeanItemContainer. @@ -723,7 +730,186 @@ public class BeanItemContainerTest extends AbstractBeanContainerTest { assertTrue(container .addNestedContainerProperty("address.postalCodeObject")); assertTrue(container.addNestedContainerProperty("address.street")); + // the nested properties should return null assertNull(container.getContainerProperty(john, "address.street") .getValue()); } + + public void testItemAddedEvent() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + Person bean = new Person("John"); + ItemSetChangeListener addListener = createListenerMockFor(container); + addListener.containerItemSetChange(EasyMock.isA(ItemAddEvent.class)); + EasyMock.replay(addListener); + + container.addItem(bean); + + EasyMock.verify(addListener); + } + + public void testItemAddedEvent_AddedItem() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + Person bean = new Person("John"); + ItemSetChangeListener addListener = createListenerMockFor(container); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + + container.addItem(bean); + + assertEquals(bean, capturedEvent.getValue().getFirstItemId()); + } + + public void testItemAddedEvent_addItemAt_IndexOfAddedItem() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + Person bean = new Person("John"); + container.addItem(bean); + ItemSetChangeListener addListener = createListenerMockFor(container); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + + container.addItemAt(1, new Person("")); + + assertEquals(1, capturedEvent.getValue().getFirstIndex()); + } + + public void testItemAddedEvent_addItemAfter_IndexOfAddedItem() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + Person bean = new Person("John"); + container.addItem(bean); + ItemSetChangeListener addListener = createListenerMockFor(container); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + + container.addItemAfter(bean, new Person("")); + + assertEquals(1, capturedEvent.getValue().getFirstIndex()); + } + + public void testItemAddedEvent_amountOfAddedItems() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + ItemSetChangeListener addListener = createListenerMockFor(container); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + List<Person> beans = Arrays.asList(new Person("Jack"), new Person( + "John")); + + container.addAll(beans); + + assertEquals(2, capturedEvent.getValue().getAddedItemsCount()); + } + + public void testItemAddedEvent_someItemsAreFiltered_amountOfAddedItemsIsReducedByAmountOfFilteredItems() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + ItemSetChangeListener addListener = createListenerMockFor(container); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + List<Person> beans = Arrays.asList(new Person("Jack"), new Person( + "John")); + container.addFilter(new Compare.Equal("name", "John")); + + container.addAll(beans); + + assertEquals(1, capturedEvent.getValue().getAddedItemsCount()); + } + + public void testItemAddedEvent_someItemsAreFiltered_addedItemIsTheFirstVisibleItem() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + Person bean = new Person("John"); + ItemSetChangeListener addListener = createListenerMockFor(container); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + List<Person> beans = Arrays.asList(new Person("Jack"), bean); + container.addFilter(new Compare.Equal("name", "John")); + + container.addAll(beans); + + assertEquals(bean, capturedEvent.getValue().getFirstItemId()); + } + + public void testItemRemovedEvent() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + Person bean = new Person("John"); + container.addItem(bean); + ItemSetChangeListener removeListener = createListenerMockFor(container); + removeListener.containerItemSetChange(EasyMock + .isA(ItemRemoveEvent.class)); + EasyMock.replay(removeListener); + + container.removeItem(bean); + + EasyMock.verify(removeListener); + } + + public void testItemRemovedEvent_RemovedItem() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + Person bean = new Person("John"); + container.addItem(bean); + ItemSetChangeListener removeListener = createListenerMockFor(container); + Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); + EasyMock.replay(removeListener); + + container.removeItem(bean); + + assertEquals(bean, capturedEvent.getValue().getFirstItemId()); + } + + public void testItemRemovedEvent_indexOfRemovedItem() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + container.addItem(new Person("Jack")); + Person secondBean = new Person("John"); + container.addItem(secondBean); + ItemSetChangeListener removeListener = createListenerMockFor(container); + Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); + EasyMock.replay(removeListener); + + container.removeItem(secondBean); + + assertEquals(1, capturedEvent.getValue().getFirstIndex()); + } + + public void testItemRemovedEvent_amountOfRemovedItems() { + BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class); + container.addItem(new Person("Jack")); + container.addItem(new Person("John")); + ItemSetChangeListener removeListener = createListenerMockFor(container); + Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); + EasyMock.replay(removeListener); + + container.removeAllItems(); + + assertEquals(2, capturedEvent.getValue().getRemovedItemsCount()); + } + + private Capture<ItemAddEvent> captureAddEvent( + ItemSetChangeListener addListener) { + Capture<ItemAddEvent> capturedEvent = new Capture<ItemAddEvent>(); + addListener.containerItemSetChange(EasyMock.capture(capturedEvent)); + return capturedEvent; + } + + private Capture<ItemRemoveEvent> captureRemoveEvent( + ItemSetChangeListener removeListener) { + Capture<ItemRemoveEvent> capturedEvent = new Capture<ItemRemoveEvent>(); + removeListener.containerItemSetChange(EasyMock.capture(capturedEvent)); + return capturedEvent; + } + + private ItemSetChangeListener createListenerMockFor( + BeanItemContainer<Person> container) { + ItemSetChangeListener listener = EasyMock + .createNiceMock(ItemSetChangeListener.class); + container.addItemSetChangeListener(listener); + return listener; + } } diff --git a/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java b/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java index 09e5a26c15..5da0bdc8a2 100644 --- a/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java +++ b/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java @@ -4,6 +4,12 @@ import java.util.List; import junit.framework.Assert; +import org.easymock.Capture; +import org.easymock.EasyMock; + +import com.vaadin.data.Container.Indexed.ItemAddEvent; +import com.vaadin.data.Container.Indexed.ItemRemoveEvent; +import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.Item; public class TestIndexedContainer extends AbstractInMemoryContainerTest { @@ -271,6 +277,113 @@ public class TestIndexedContainer extends AbstractInMemoryContainerTest { counter.assertNone(); } + public void testItemAddedEvent() { + IndexedContainer container = new IndexedContainer(); + ItemSetChangeListener addListener = createListenerMockFor(container); + addListener.containerItemSetChange(EasyMock.isA(ItemAddEvent.class)); + EasyMock.replay(addListener); + + container.addItem(); + + EasyMock.verify(addListener); + } + + public void testItemAddedEvent_AddedItem() { + IndexedContainer container = new IndexedContainer(); + ItemSetChangeListener addListener = createListenerMockFor(container); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + + Object itemId = container.addItem(); + + assertEquals(itemId, capturedEvent.getValue().getFirstItemId()); + } + + public void testItemAddedEvent_IndexOfAddedItem() { + IndexedContainer container = new IndexedContainer(); + ItemSetChangeListener addListener = createListenerMockFor(container); + container.addItem(); + Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); + EasyMock.replay(addListener); + + container.addItemAt(1); + + assertEquals(1, capturedEvent.getValue().getFirstIndex()); + } + + public void testItemRemovedEvent() { + IndexedContainer container = new IndexedContainer(); + Object itemId = container.addItem(); + ItemSetChangeListener removeListener = createListenerMockFor(container); + removeListener.containerItemSetChange(EasyMock + .isA(ItemRemoveEvent.class)); + EasyMock.replay(removeListener); + + container.removeItem(itemId); + + EasyMock.verify(removeListener); + } + + public void testItemRemovedEvent_RemovedItem() { + IndexedContainer container = new IndexedContainer(); + Object itemId = container.addItem(); + ItemSetChangeListener removeListener = createListenerMockFor(container); + Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); + EasyMock.replay(removeListener); + + container.removeItem(itemId); + + assertEquals(itemId, capturedEvent.getValue().getFirstItemId()); + } + + public void testItemRemovedEvent_indexOfRemovedItem() { + IndexedContainer container = new IndexedContainer(); + container.addItem(); + Object secondItemId = container.addItem(); + ItemSetChangeListener removeListener = createListenerMockFor(container); + Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); + EasyMock.replay(removeListener); + + container.removeItem(secondItemId); + + assertEquals(1, capturedEvent.getValue().getFirstIndex()); + } + + public void testItemRemovedEvent_amountOfRemovedItems() { + IndexedContainer container = new IndexedContainer(); + container.addItem(); + container.addItem(); + ItemSetChangeListener removeListener = createListenerMockFor(container); + Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); + EasyMock.replay(removeListener); + + container.removeAllItems(); + + assertEquals(2, capturedEvent.getValue().getRemovedItemsCount()); + } + + private Capture<ItemAddEvent> captureAddEvent( + ItemSetChangeListener addListener) { + Capture<ItemAddEvent> capturedEvent = new Capture<ItemAddEvent>(); + addListener.containerItemSetChange(EasyMock.capture(capturedEvent)); + return capturedEvent; + } + + private Capture<ItemRemoveEvent> captureRemoveEvent( + ItemSetChangeListener removeListener) { + Capture<ItemRemoveEvent> capturedEvent = new Capture<ItemRemoveEvent>(); + removeListener.containerItemSetChange(EasyMock.capture(capturedEvent)); + return capturedEvent; + } + + private ItemSetChangeListener createListenerMockFor( + IndexedContainer container) { + ItemSetChangeListener listener = EasyMock + .createNiceMock(ItemSetChangeListener.class); + container.addItemSetChangeListener(listener); + return listener; + } + // Ticket 8028 public void testGetItemIdsRangeIndexOutOfBounds() { IndexedContainer ic = new IndexedContainer(); diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java index 844ef705b1..4c132eba30 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java @@ -1917,7 +1917,6 @@ public class SQLContainerTest { EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { @Override - @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( @@ -1990,7 +1989,6 @@ public class SQLContainerTest { EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { @Override - @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( @@ -2134,7 +2132,6 @@ public class SQLContainerTest { EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { @Override - @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( @@ -2213,7 +2210,6 @@ public class SQLContainerTest { EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { @Override - @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( @@ -2292,7 +2288,6 @@ public class SQLContainerTest { EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { @Override - @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/TicketTests.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/TicketTests.java index 8e8c83d234..110225e206 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/TicketTests.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/TicketTests.java @@ -88,7 +88,6 @@ public class TicketTests { EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer<StatementHelper>() { @Override - @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( diff --git a/server/tests/src/com/vaadin/server/VaadinSessionTest.java b/server/tests/src/com/vaadin/server/VaadinSessionTest.java index 68f198410c..51ae2a2d13 100644 --- a/server/tests/src/com/vaadin/server/VaadinSessionTest.java +++ b/server/tests/src/com/vaadin/server/VaadinSessionTest.java @@ -100,7 +100,7 @@ public class VaadinSessionTest { } }; - ui.doInit(vaadinRequest, session.getNextUIid()); + ui.doInit(vaadinRequest, session.getNextUIid(), null); ui.setSession(session); session.addUI(ui); diff --git a/server/tests/src/com/vaadin/tests/data/bean/BeanToValidate.java b/server/tests/src/com/vaadin/tests/data/bean/BeanToValidate.java index 416563baba..034609764f 100644 --- a/server/tests/src/com/vaadin/tests/data/bean/BeanToValidate.java +++ b/server/tests/src/com/vaadin/tests/data/bean/BeanToValidate.java @@ -4,6 +4,7 @@ import javax.validation.constraints.Digits; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; public class BeanToValidate { @@ -21,6 +22,10 @@ public class BeanToValidate { @Digits(integer = 3, fraction = 2) private String decimals; + @Pattern(regexp = "V*", message = "Must start with letter V") + @Size(min = 3, max = 6, message = "Must contain 3 - 6 letters") + private String nickname; + public String getFirstname() { return firstname; } @@ -53,4 +58,12 @@ public class BeanToValidate { this.decimals = decimals; } + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + } diff --git a/server/tests/src/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java b/server/tests/src/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java index 93b2273263..575730d946 100644 --- a/server/tests/src/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java +++ b/server/tests/src/com/vaadin/tests/data/bean/PersonWithBeanValidationAnnotations.java @@ -8,12 +8,15 @@ import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Past; +import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; public class PersonWithBeanValidationAnnotations { @NotNull @Size(min = 5, max = 20) + @Pattern(regexp = "A.*") private String firstName; + @NotNull private String lastName; diff --git a/server/tests/src/com/vaadin/tests/data/converter/TestStringToBigDecimalConverter.java b/server/tests/src/com/vaadin/tests/data/converter/TestStringToBigDecimalConverter.java new file mode 100644 index 0000000000..5db33691b6 --- /dev/null +++ b/server/tests/src/com/vaadin/tests/data/converter/TestStringToBigDecimalConverter.java @@ -0,0 +1,53 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.data.converter; + +import java.math.BigDecimal; +import java.util.Locale; + +import junit.framework.TestCase; + +import com.vaadin.data.util.converter.StringToBigDecimalConverter; + +public class TestStringToBigDecimalConverter extends TestCase { + + StringToBigDecimalConverter converter = new StringToBigDecimalConverter(); + + public void testNullConversion() { + assertEquals(null, + converter.convertToModel(null, BigDecimal.class, null)); + } + + public void testEmptyStringConversion() { + assertEquals(null, converter.convertToModel("", BigDecimal.class, null)); + } + + public void testValueParsing() { + BigDecimal converted = converter.convertToModel("10", BigDecimal.class, + null); + BigDecimal expected = new BigDecimal(10); + assertEquals(expected, converted); + } + + public void testValueFormatting() { + BigDecimal bd = new BigDecimal(12.5); + String expected = "12,5"; + + String converted = converter.convertToPresentation(bd, String.class, + Locale.GERMAN); + assertEquals(expected, converted); + } +} diff --git a/server/tests/src/com/vaadin/tests/data/converter/TestStringToNumberConverter.java b/server/tests/src/com/vaadin/tests/data/converter/TestStringToNumberConverter.java deleted file mode 100644 index 66fc4f6532..0000000000 --- a/server/tests/src/com/vaadin/tests/data/converter/TestStringToNumberConverter.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.vaadin.tests.data.converter; - -import junit.framework.TestCase; - -import com.vaadin.data.util.converter.StringToNumberConverter; - -public class TestStringToNumberConverter extends TestCase { - - StringToNumberConverter converter = new StringToNumberConverter(); - - public void testNullConversion() { - assertEquals(null, converter.convertToModel(null, Number.class, null)); - } - - public void testEmptyStringConversion() { - assertEquals(null, converter.convertToModel("", Number.class, null)); - } - - public void testValueConversion() { - assertEquals(Long.valueOf(10), - converter.convertToModel("10", Number.class, null)); - assertEquals(10.5, converter.convertToModel("10.5", Number.class, null)); - } -} diff --git a/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java b/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java index e5420b8921..705bae3d98 100644 --- a/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java +++ b/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java @@ -42,6 +42,7 @@ public class TestClassesSerializable extends TestCase { "com\\.vaadin\\.event\\.FieldEvents", // "com\\.vaadin\\.event\\.LayoutEvents", // "com\\.vaadin\\.event\\.MouseEvents", // + "com\\.vaadin\\.event\\.UIEvents", // "com\\.vaadin\\.server\\.VaadinPortlet", // "com\\.vaadin\\.server\\.MockServletConfig", // "com\\.vaadin\\.server\\.MockServletContext", // diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java index a5e825bddb..85116dd152 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java @@ -205,14 +205,15 @@ public class AbsFieldValueConversions extends TestCase { } + // Now specific to Integer because StringToNumberConverter has been removed public static class NumberBean { - private Number number; + private Integer number; - public Number getNumber() { + public Integer getNumber() { return number; } - public void setNumber(Number number) { + public void setNumber(Integer number) { this.number = number; } @@ -239,7 +240,7 @@ public class AbsFieldValueConversions extends TestCase { tf.setPropertyDataSource(new MethodProperty<Number>(nb, "number")); Converter c2 = tf.getConverter(); assertTrue( - "StringToNumber converter is ok for integer types and should stay even though property is changed", + "StringToInteger converter is ok for integer types and should stay even though property is changed", c1 == c2); assertEquals(490, tf.getPropertyDataSource().getValue()); assertEquals("490", tf.getValue()); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestVarargsItemAddition.java b/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestVarargsItemAddition.java new file mode 100644 index 0000000000..5575b8fd3d --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestVarargsItemAddition.java @@ -0,0 +1,26 @@ +package com.vaadin.tests.server.component.abstractselect; + +import java.util.Collection; + +import junit.framework.TestCase; + +import org.junit.Assert; + +import com.vaadin.ui.OptionGroup; + +public class TestVarargsItemAddition extends TestCase { + + public void itemAddition() throws Exception { + + OptionGroup optionGroup = new OptionGroup(); + + optionGroup.addItems("foo", "bar", "car"); + + Collection<?> itemIds = optionGroup.getItemIds(); + Assert.assertEquals(3, itemIds.size()); + Assert.assertTrue(itemIds.contains("foo")); + Assert.assertTrue(itemIds.contains("bar")); + Assert.assertTrue(itemIds.contains("car")); + + } +} diff --git a/server/tests/src/com/vaadin/tests/server/validation/TestBeanValidation.java b/server/tests/src/com/vaadin/tests/server/validation/TestBeanValidation.java index e1d08a989b..1d1a3c297e 100644 --- a/server/tests/src/com/vaadin/tests/server/validation/TestBeanValidation.java +++ b/server/tests/src/com/vaadin/tests/server/validation/TestBeanValidation.java @@ -1,7 +1,6 @@ package com.vaadin.tests.server.validation; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; import com.vaadin.data.Validator.InvalidValueException; @@ -59,6 +58,32 @@ public class TestBeanValidation { } @Test + public void testBeanValidationException_OneValidationError() { + InvalidValueException[] causes = null; + BeanValidator validator = new BeanValidator(BeanToValidate.class, + "lastname"); + try { + validator.validate(null); + } catch (InvalidValueException e) { + causes = e.getCauses(); + } + + Assert.assertEquals(1, causes.length); + } + + @Test + public void testBeanValidationsException_TwoValidationErrors() { + InvalidValueException[] causes = null; + BeanValidator validator = new BeanValidator(BeanToValidate.class, + "nickname"); + try { + validator.validate("A"); + } catch (InvalidValueException e) { + causes = e.getCauses(); + } + + Assert.assertEquals(2, causes.length); + } public void testBeanValidationNotAddedTwice() { // See ticket #11045 BeanFieldGroup<BeanToValidate> fieldGroup = new BeanFieldGroup<BeanToValidate>( diff --git a/shared/build.xml b/shared/build.xml index 73a0a8df7f..966d250d66 100644 --- a/shared/build.xml +++ b/shared/build.xml @@ -15,7 +15,7 @@ <property name="src.filtered" location="${result.dir}/filtered-src" /> <property name="src" location="${src.filtered}" /> <path id="classpath.compile.custom" /> - + <path id="classpath.test.custom" /> <target name="jar"> <property name="shared.osgi.import" value="org.json;version="0.0.20080701", com.google.gwt.thirdparty.guava.common.annotations;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.base;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.base.internal;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.cache;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.collect;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.eventbus;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.io;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.net;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.primitives;version="10.0.1.rebased", com.google.gwt.thirdparty.guava.common.util.concurrent;version="10.0.1.rebased", com.google.gwt.thirdparty.streamhtmlparser;version="0.1.5.r10-rebased", com.google.gwt.thirdparty.streamhtmlparser.impl;version="0.1.5.r10-rebased", com.google.gwt.thirdparty.streamhtmlparser.util;version="0.1.5.r10-rebased", org.w3c.flute.parser;version="1.3.0.gg2", org.w3c.flute.parser.selectors;version="1.3.0.gg2", org.w3c.flute.util;version="1.3.0.gg2"" /> @@ -57,8 +57,7 @@ </target> <target name="test" depends="checkstyle"> - <!--<antcall target="common.test.run" /> --> - <echo>WHAT? No tests for ${module.name}!</echo> + <antcall target="common.test.run" /> </target> </project> diff --git a/shared/ivy.xml b/shared/ivy.xml index 3b044e9ab4..169a52034d 100644 --- a/shared/ivy.xml +++ b/shared/ivy.xml @@ -21,7 +21,11 @@ </publications> <dependencies> <dependency org="com.vaadin" name="vaadin-shared-deps" - rev="1.0.2" conf="build,ide,test->default" /> + rev="1.0.3" conf="build,ide,test->default" /> + + <dependency org="junit" name="junit" rev="4.11" + conf="test,ide -> default" /> + </dependencies> </ivy-module> diff --git a/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java index 4b5dc9140b..a81f29b77c 100644 --- a/shared/src/com/vaadin/shared/ApplicationConstants.java +++ b/shared/src/com/vaadin/shared/ApplicationConstants.java @@ -94,4 +94,26 @@ public class ApplicationConstants implements Serializable { * Name of the parameter used to transmit the CSRF token. */ public static final String CSRF_TOKEN_PARAMETER = "v-csrfToken"; + + /** + * The name of the parameter used to transmit RPC invocations + * + * @since 7.2 + */ + public static final String RPC_INVOCATIONS = "rpc"; + + /** + * The name of the parameter used to transmit the CSRF token + * + * @since 7.2 + */ + public static final String CSRF_TOKEN = "csrfToken"; + + /** + * The name of the parameter used to transmit the sync id + * + * @see com.vaadin.ui.ConnectorTracker#getCurrentSyncId() + * @since 7.2 + */ + public static final String SERVER_SYNC_ID = "syncId"; } diff --git a/shared/src/com/vaadin/shared/EventId.java b/shared/src/com/vaadin/shared/EventId.java index dd30379d41..d669f8fa83 100644 --- a/shared/src/com/vaadin/shared/EventId.java +++ b/shared/src/com/vaadin/shared/EventId.java @@ -22,5 +22,5 @@ public interface EventId extends Serializable { public static final String FOCUS = "focus"; public static final String CLICK_EVENT_IDENTIFIER = "click"; public static final String LAYOUT_CLICK_EVENT_IDENTIFIER = "lClick"; - + public static final String POLL = "poll"; } diff --git a/shared/src/com/vaadin/shared/Position.java b/shared/src/com/vaadin/shared/Position.java index cd34ee8b87..3df42d65d8 100755 --- a/shared/src/com/vaadin/shared/Position.java +++ b/shared/src/com/vaadin/shared/Position.java @@ -16,5 +16,10 @@ package com.vaadin.shared; public enum Position { - TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT; + TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, + /** + * Position that is only accessible for assistive devices, invisible for + * visual users. + **/ + ASSISTIVE; } diff --git a/shared/src/com/vaadin/shared/ui/link/LinkState.java b/shared/src/com/vaadin/shared/ui/link/LinkState.java index 269496767d..33ede86378 100644 --- a/shared/src/com/vaadin/shared/ui/link/LinkState.java +++ b/shared/src/com/vaadin/shared/ui/link/LinkState.java @@ -16,9 +16,15 @@ package com.vaadin.shared.ui.link; import com.vaadin.shared.AbstractComponentState; +import com.vaadin.shared.ui.BorderStyle; public class LinkState extends AbstractComponentState { { primaryStyleName = "v-link"; } + public String name = ""; + public String target = null; + public BorderStyle targetBorder = BorderStyle.DEFAULT; + public int targetWidth = -1; + public int targetHeight = -1; } diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java index 7eb23a9887..b7f337a5a8 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java @@ -29,5 +29,7 @@ public class TabsheetBaseConstants implements Serializable { public static final String ATTRIBUTE_TAB_CAPTION = "caption"; @Deprecated public static final String ATTRIBUTE_TAB_ICON = "icon"; + @Deprecated + public static final String ATTRIBUTE_TAB_ICON_ALT = "iconalt"; } diff --git a/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java b/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java new file mode 100644 index 0000000000..05a1706763 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java @@ -0,0 +1,137 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * + */ +package com.vaadin.shared.ui.ui; + +import java.io.Serializable; + +/** + * Holds configuration information for a notification type. + * + * @author Vaadin Ltd + */ +public class NotificationConfigurationBean implements Serializable { + /** + * Available WAI-ARIA roles for a notification. + */ + public enum Role { + ALERT, STATUS + }; + + private String prefix; + private String postfix; + private Role role = Role.ALERT; + + public NotificationConfigurationBean() { + } + + public NotificationConfigurationBean(String prefix, String postfix, + Role role) { + this.prefix = prefix; + this.postfix = postfix; + this.role = role; + } + + /** + * Returns the accessibility prefix, which is placed before the notification + * content. + * + * @return the prefix + */ + public String getAssistivePrefix() { + return prefix; + } + + /** + * Sets the accessibility prefix, which is placed before the notification + * content. + * + * @param pefix + * the prefix to set + */ + public void setAssistivePrefix(String prefix) { + this.prefix = prefix; + } + + /** + * Checks if an accessibility prefix is set. + * + * @return true when assistivePrefix is not null and has a length > 0, false + * otherwise + */ + public boolean hasAssistivePrefix() { + return prefix != null && !prefix.isEmpty(); + } + + /** + * Returns the accessibility postfix, which is placed after the notification + * content. + * + * @return the postfix + */ + public String getAssistivePostfix() { + return postfix; + } + + /** + * Sets the accessibility postfix, which is placed after the notification + * content. + * + * @param postfix + * the postfix to set + */ + public void setAssistivePostfix(String postfix) { + this.postfix = postfix; + } + + /** + * Checks if an accessibility postfix is set. + * + * @return true when postfix is not null and has a length > 0, false + * otherwise + */ + public boolean hasAssistivePostfix() { + return postfix != null && !postfix.isEmpty(); + } + + /** + * Returns the WAI-ARIA role that defines how an assistive device will + * inform the user about a notification. + * + * @return the role + */ + public Role getAssistiveRole() { + return role; + } + + /** + * Sets the WAI-ARIA role that defines how an assistive device will inform + * the user about a notification. + * + * Available roles are alert, alertdialog and status (@see <a + * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles + * Model</a>). + * + * @param role + * the role to set + */ + public void setAssistiveRole(Role role) { + this.role = role; + } +} diff --git a/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java index eb847bacd0..76a3fbfdb6 100644 --- a/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java @@ -20,8 +20,6 @@ import com.vaadin.shared.communication.ClientRpc; public interface PageClientRpc extends ClientRpc { - public void setTitle(String title); - public void reload(); } diff --git a/shared/src/com/vaadin/shared/ui/ui/PageState.java b/shared/src/com/vaadin/shared/ui/ui/PageState.java index 0b51eb4bba..ded73d16d5 100644 --- a/shared/src/com/vaadin/shared/ui/ui/PageState.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageState.java @@ -30,4 +30,9 @@ public class PageState implements Serializable { * True if the page has browser window resize listeners. */ public boolean hasResizeListeners = false; + + /** + * Non-null if the title is set. + */ + public String title = null; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/ui/Transport.java b/shared/src/com/vaadin/shared/ui/ui/Transport.java index ea641c0a3c..ebc0ba3aea 100644 --- a/shared/src/com/vaadin/shared/ui/ui/Transport.java +++ b/shared/src/com/vaadin/shared/ui/ui/Transport.java @@ -30,7 +30,11 @@ public enum Transport { /** * HTTP streaming */ - STREAMING("streaming"); + STREAMING("streaming"), + /** + * HTTP long polling + */ + LONG_POLLING("long-polling"); private String identifier; diff --git a/shared/src/com/vaadin/shared/ui/ui/UIState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java index 8d042a835f..4cde452a2b 100644 --- a/shared/src/com/vaadin/shared/ui/ui/UIState.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java @@ -23,10 +23,12 @@ import java.util.Map; import com.vaadin.shared.communication.PushMode; import com.vaadin.shared.ui.TabIndexState; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; public class UIState extends TabIndexState { public TooltipConfigurationState tooltipConfiguration = new TooltipConfigurationState(); public LoadingIndicatorConfigurationState loadingIndicatorConfiguration = new LoadingIndicatorConfigurationState(); + public NotificationConfigurationState notificationConfiguration = new NotificationConfigurationState(); public int pollInterval = -1; // Informing users of assistive devices, that the content of this container @@ -48,6 +50,22 @@ public class UIState extends TabIndexState { public int maxWidth = 500; } + public static class NotificationConfigurationState implements Serializable { + public Map<String, NotificationConfigurationBean> setup = new HashMap<String, NotificationConfigurationBean>(); + { + setup.put("error", new NotificationConfigurationBean("Error: ", + " - close with ESC-key", Role.ALERT)); + setup.put("warning", new NotificationConfigurationBean("Warning: ", + null, Role.ALERT)); + setup.put("humanized", new NotificationConfigurationBean("Info: ", + null, Role.ALERT)); + setup.put("tray", new NotificationConfigurationBean("Status: ", + null, Role.STATUS)); + setup.put("assistive", new NotificationConfigurationBean("Note: ", + null, Role.STATUS)); + }; + } + public static class PushConfigurationState implements Serializable { public static final String TRANSPORT_PARAM = "transport"; public static final String FALLBACK_TRANSPORT_PARAM = "fallbackTransport"; diff --git a/shared/src/com/vaadin/shared/ui/window/WindowState.java b/shared/src/com/vaadin/shared/ui/window/WindowState.java index 5a2d2b81b0..3cb6bbe61e 100644 --- a/shared/src/com/vaadin/shared/ui/window/WindowState.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowState.java @@ -15,6 +15,7 @@ */ package com.vaadin.shared.ui.window; +import com.vaadin.shared.Connector; import com.vaadin.shared.ui.panel.PanelState; public class WindowState extends PanelState { @@ -22,6 +23,13 @@ public class WindowState extends PanelState { primaryStyleName = "v-window"; } + /** + * Available WAI-ARIA roles for a window. + */ + public enum WindowRole { + ALERTDIALOG, DIALOG + }; + public boolean modal = false; public boolean resizable = true; public boolean resizeLazy = false; @@ -30,4 +38,12 @@ public class WindowState extends PanelState { public int positionX = -1; public int positionY = -1; public WindowMode windowMode = WindowMode.NORMAL; + + public String assistivePrefix = ""; + public String assistivePostfix = ""; + public Connector[] contentDescription = new Connector[0]; + public WindowRole role = WindowRole.DIALOG; + public boolean assistiveTabStop = false; + public String assistiveTabStopTopText = "Top of dialog"; + public String assistiveTabStopBottomText = "Bottom of Dialog"; }
\ No newline at end of file diff --git a/shared/tests/src/readme.txt b/shared/tests/src/readme.txt new file mode 100644 index 0000000000..0cffbcdcbb --- /dev/null +++ b/shared/tests/src/readme.txt @@ -0,0 +1 @@ +Add tests here. A dummy so that Git creates the directory structure diff --git a/theme-compiler/build.xml b/theme-compiler/build.xml index 03d0531a68..aed0f91fbb 100644 --- a/theme-compiler/build.xml +++ b/theme-compiler/build.xml @@ -20,8 +20,8 @@ </path> <path id="classpath.test.custom" /> - <!--<property name="classes.exclude" value="com/vaadin/buildhelpers/**" - /> --> + <property name="classes.exclude" value="**/*.properties"/> + <property name="extra.classes" value="${classes.exclude}"/> <target name="parser"> <!-- Copy javacc-5.0.jar to ${result.dir}/javacc/javacc.jar as the diff --git a/theme-compiler/ivy.xml b/theme-compiler/ivy.xml index 7b99b2cdaa..0f84966508 100644 --- a/theme-compiler/ivy.xml +++ b/theme-compiler/ivy.xml @@ -42,6 +42,8 @@ <!-- Testing libs --> <dependency org="junit" name="junit" rev="4.11" conf="ide,test -> default" /> + <dependency org="org.jsoup" name="jsoup" rev="1.6.3" + conf="ide,test -> default" /> <!-- Internally used, for now --> <dependency org="com.carrotsearch" name="smartsprites" diff --git a/theme-compiler/src/com/vaadin/sass/CustomConsoleHandler.java b/theme-compiler/src/com/vaadin/sass/CustomConsoleHandler.java new file mode 100644 index 0000000000..44c9e345db --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/CustomConsoleHandler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.sass; + +import java.io.PrintStream; +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.LogRecord; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class CustomConsoleHandler extends ConsoleHandler { + + private ConsoleHandler stdoutHandler; + + public CustomConsoleHandler() { + PrintStream err = System.err; + /* + * ConsoleHandler uses System.err to output all messages. Replace + * System.err temporary to construct ConsoleHandler and set it back + * after construction. + */ + System.setErr(System.out); + stdoutHandler = new ConsoleHandler(); + System.setErr(err); + } + + @Override + public void publish(LogRecord record) { + if (!Level.SEVERE.equals(record.getLevel())) { + stdoutHandler.publish(record); + } else { + super.publish(record); + } + } +} diff --git a/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java b/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java index dbb3e571dc..63f59cdfab 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java +++ b/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java @@ -19,24 +19,27 @@ package com.vaadin.sass.internal; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.logging.LogManager; import java.util.logging.Logger; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.InputSource; +import com.vaadin.buildhelpers.CompileTheme; import com.vaadin.sass.internal.handler.SCSSDocumentHandler; import com.vaadin.sass.internal.handler.SCSSDocumentHandlerImpl; import com.vaadin.sass.internal.handler.SCSSErrorHandler; import com.vaadin.sass.internal.parser.ParseException; import com.vaadin.sass.internal.parser.Parser; import com.vaadin.sass.internal.parser.SCSSParseException; +import com.vaadin.sass.internal.resolver.ClassloaderResolver; +import com.vaadin.sass.internal.resolver.FilesystemResolver; import com.vaadin.sass.internal.resolver.ScssStylesheetResolver; -import com.vaadin.sass.internal.resolver.VaadinResolver; import com.vaadin.sass.internal.tree.BlockNode; import com.vaadin.sass.internal.tree.MixinDefNode; import com.vaadin.sass.internal.tree.Node; @@ -59,10 +62,12 @@ public class ScssStylesheet extends Node { private static HashMap<Node, Node> lastNodeAdded = new HashMap<Node, Node>(); - private String fileName; + private File file; private String charset; + private List<ScssStylesheetResolver> resolvers = new ArrayList<ScssStylesheetResolver>(); + /** * Read in a file SCSS and parse it into a ScssStylesheet * @@ -90,18 +95,48 @@ public class ScssStylesheet extends Node { } /** - * Main entry point for the SASS compiler. Takes in a file and encoding then - * builds up a ScssStylesheet tree out of it. Calling compile() on it will - * transform SASS into CSS. Calling toString() will print out the SCSS/CSS. + * Main entry point for the SASS compiler. Takes in a file and an optional + * parent style sheet, then builds up a ScssStylesheet tree out of it. + * Calling compile() on it will transform SASS into CSS. Calling toString() + * will print out the SCSS/CSS. + * + * @param identifier + * The file path. If null then null is returned. + * @param parentStylesheet + * Style sheet from which to inherit resolvers and encoding. May + * be null. + * @return + * @throws CSSException + * @throws IOException + */ + public static ScssStylesheet get(String identifier, + ScssStylesheet parentStylesheet) throws CSSException, IOException { + return get(identifier, parentStylesheet, new SCSSDocumentHandlerImpl(), + new SCSSErrorHandler()); + } + + /** + * Main entry point for the SASS compiler. Takes in a file, an optional + * parent stylesheet, and document and error handlers. Then builds up a + * ScssStylesheet tree out of it. Calling compile() on it will transform + * SASS into CSS. Calling toString() will print out the SCSS/CSS. * * @param identifier * The file path. If null then null is returned. - * @param encoding + * @param parentStylesheet + * Style sheet from which to inherit resolvers and encoding. May + * be null. + * @param documentHandler + * Instance of document handler. May not be null. + * @param errorHandler + * Instance of error handler. May not be null. * @return * @throws CSSException * @throws IOException */ - public static ScssStylesheet get(String identifier, String encoding) + public static ScssStylesheet get(String identifier, + ScssStylesheet parentStylesheet, + SCSSDocumentHandler documentHandler, SCSSErrorHandler errorHandler) throws CSSException, IOException { /* * The encoding to be used is passed through "encoding" parameter. the @@ -120,18 +155,27 @@ public class ScssStylesheet extends Node { File file = new File(identifier); file = file.getCanonicalFile(); - SCSSDocumentHandler handler = new SCSSDocumentHandlerImpl(); - ScssStylesheet stylesheet = handler.getStyleSheet(); - - InputSource source = stylesheet.resolveStylesheet(identifier); + ScssStylesheet stylesheet = documentHandler.getStyleSheet(); + if (parentStylesheet == null) { + // Use default resolvers + stylesheet.addResolver(new FilesystemResolver()); + stylesheet.addResolver(new ClassloaderResolver()); + } else { + // Use parent resolvers + stylesheet.setResolvers(parentStylesheet.getResolvers()); + } + InputSource source = stylesheet.resolveStylesheet(identifier, + parentStylesheet); if (source == null) { return null; } - source.setEncoding(encoding); + if (parentStylesheet != null) { + source.setEncoding(parentStylesheet.getCharset()); + } Parser parser = new Parser(); - parser.setErrorHandler(new SCSSErrorHandler()); - parser.setDocumentHandler(handler); + parser.setErrorHandler(errorHandler); + parser.setDocumentHandler(documentHandler); try { parser.parseStyleSheet(source); @@ -145,24 +189,13 @@ public class ScssStylesheet extends Node { return stylesheet; } - private static ScssStylesheetResolver[] resolvers = null; - - public static void setStylesheetResolvers( - ScssStylesheetResolver... styleSheetResolvers) { - resolvers = Arrays.copyOf(styleSheetResolvers, - styleSheetResolvers.length); - } - - public InputSource resolveStylesheet(String identifier) { - if (resolvers == null) { - setStylesheetResolvers(new VaadinResolver()); - } - - for (ScssStylesheetResolver resolver : resolvers) { - InputSource source = resolver.resolve(identifier); + public InputSource resolveStylesheet(String identifier, + ScssStylesheet parentStylesheet) { + for (ScssStylesheetResolver resolver : getResolvers()) { + InputSource source = resolver.resolve(parentStylesheet, identifier); if (source != null) { File f = new File(source.getURI()); - setFileName(f.getParent()); + setFile(f); return source; } } @@ -171,6 +204,38 @@ public class ScssStylesheet extends Node { } /** + * Retrieves a list of resolvers to use when resolving imports + * + * @since 7.2 + * @return the resolvers used to resolving imports + */ + public List<ScssStylesheetResolver> getResolvers() { + return Collections.unmodifiableList(resolvers); + } + + /** + * Sets the list of resolvers to use when resolving imports + * + * @since 7.2 + * @param resolvers + * the resolvers to set + */ + public void setResolvers(List<ScssStylesheetResolver> resolvers) { + this.resolvers = new ArrayList<ScssStylesheetResolver>(resolvers); + } + + /** + * Adds the given resolver to the resolver list + * + * @since 7.2 + * @param resolver + * The resolver to add + */ + public void addResolver(ScssStylesheetResolver resolver) { + resolvers.add(resolver); + } + + /** * Applies all the visitors and compiles SCSS into Css. * * @throws Exception @@ -355,12 +420,28 @@ public class ScssStylesheet extends Node { return mixinDefs.get(name); } - public void setFileName(String fileName) { - this.fileName = fileName; + public void setFile(File file) { + this.file = file; } + /** + * Returns the directory containing this style sheet + * + * @since 7.2 + * @return The directory containing this style sheet + */ + public String getDirectory() { + return file.getParent(); + } + + /** + * Returns the full file name for this style sheet + * + * @since 7.2 + * @return The full file name for this style sheet + */ public String getFileName() { - return fileName; + return file.getPath(); } public static HashMap<Node, Node> getLastNodeAdded() { @@ -378,4 +459,19 @@ public class ScssStylesheet extends Node { public void setCharset(String charset) { this.charset = charset; } + + static { + String logFile = System.getProperty("java.util.logging.config.file"); + if (logFile == null) { + try { + LogManager.getLogManager().readConfiguration( + CompileTheme.class + .getResourceAsStream("/logging.properties")); + } catch (SecurityException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java index 633ab98b9c..8c09e44f7c 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java +++ b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java @@ -20,6 +20,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Stack; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.InputSource; @@ -98,7 +100,7 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { public ForNode forDirective(String var, String from, String to, boolean exclusive, String body) { ForNode node = new ForNode(var, from, to, exclusive, body); - System.out.println(node); + log(node); return node; } @@ -126,7 +128,7 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { @Override public WhileNode whileDirective(String condition, String body) { WhileNode node = new WhileNode(condition, body); - System.out.println(node); + log(node); return node; } @@ -138,14 +140,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { @Override public void ignorableAtRule(String atRule) throws CSSException { - System.out.println("ignorableAtRule(String atRule): " + atRule); + log("ignorableAtRule(String atRule): " + atRule); } @Override public void namespaceDeclaration(String prefix, String uri) throws CSSException { - System.out.println("namespaceDeclaration(String prefix, String uri): " - + prefix + ", " + uri); + log("namespaceDeclaration(String prefix, String uri): " + prefix + ", " + + uri); } @Override @@ -167,14 +169,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { @Override public void startPage(String name, String pseudo_page) throws CSSException { - System.out.println("startPage(String name, String pseudo_page): " - + name + ", " + pseudo_page); + log("startPage(String name, String pseudo_page): " + name + ", " + + pseudo_page); } @Override public void endPage(String name, String pseudo_page) throws CSSException { - System.out.println("endPage(String name, String pseudo_page): " + name - + ", " + pseudo_page); + log("endPage(String name, String pseudo_page): " + name + ", " + + pseudo_page); } @Override @@ -380,4 +382,17 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { public void endInclude() { nodeStack.pop(); } + + private void log(Object object) { + if (object != null) { + log(object.toString()); + } else { + log(null); + } + } + + private void log(String msg) { + Logger.getLogger(SCSSDocumentHandlerImpl.class.getName()).log( + Level.INFO, msg); + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java index 2e51c686d4..a7c65073ee 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java +++ b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java @@ -15,34 +15,42 @@ */ package com.vaadin.sass.internal.handler; +import java.util.logging.Level; +import java.util.logging.Logger; + import org.w3c.css.sac.CSSException; import org.w3c.css.sac.CSSParseException; import org.w3c.css.sac.ErrorHandler; public class SCSSErrorHandler implements ErrorHandler { + public SCSSErrorHandler() { + } + @Override public void error(CSSParseException arg0) throws CSSException { - System.out.println("Error when parsing file \n" + arg0.getURI() - + " on line " + arg0.getLineNumber() + ", column " - + arg0.getColumnNumber()); - System.out.println(arg0.getMessage() + "\n"); + log("Error when parsing file \n" + arg0.getURI() + " on line " + + arg0.getLineNumber() + ", column " + arg0.getColumnNumber()); + log(arg0.getMessage() + "\n"); } @Override public void fatalError(CSSParseException arg0) throws CSSException { - System.out.println("FATAL Error when parsing file \n" + arg0.getURI() - + " on line " + arg0.getLineNumber() + ", column " - + arg0.getColumnNumber()); - System.out.println(arg0.getMessage() + "\n"); + log("FATAL Error when parsing file \n" + arg0.getURI() + " on line " + + arg0.getLineNumber() + ", column " + arg0.getColumnNumber()); + log(arg0.getMessage() + "\n"); } @Override public void warning(CSSParseException arg0) throws CSSException { - System.out.println("Warning when parsing file \n" + arg0.getURI() - + " on line " + arg0.getLineNumber() + ", column " - + arg0.getColumnNumber()); - System.out.println(arg0.getMessage() + "\n"); + log("Warning when parsing file \n" + arg0.getURI() + " on line " + + arg0.getLineNumber() + ", column " + arg0.getColumnNumber()); + log(arg0.getMessage() + "\n"); + } + + private void log(String msg) { + Logger.getLogger(SCSSDocumentHandlerImpl.class.getName()).log( + Level.SEVERE, msg); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java b/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java index e43320453c..c22f19451b 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java @@ -127,4 +127,4 @@ interface CharStream { void Done(); } -/* JavaCC - OriginalChecksum=18aae0a549695f0fec96a11297b442bb (do not edit this line) */ +/* JavaCC - OriginalChecksum=deb80d024b50bdc8bfaadaf528157233 (do not edit this line) */ diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java index 5035263588..af1165adac 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java @@ -739,13 +739,6 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, previous); } - @Override - public LexicalUnitImpl clone() { - LexicalUnitImpl cloned = new LexicalUnitImpl(type, line, column, prev); - cloned.replaceValue(this); - return cloned; - } - /** * Tries to return the value for this {@link LexicalUnitImpl} without * considering any related units. diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java b/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java index ac244a9582..35589e0a94 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java @@ -23,8 +23,13 @@ */ package com.vaadin.sass.internal.parser; +import java.util.logging.Level; +import java.util.logging.Logger; + import org.w3c.css.sac.Locator; +import com.vaadin.sass.internal.handler.SCSSDocumentHandlerImpl; + /** * @version $Revision: 1.2 $ * @author Philippe Le Hegaret @@ -51,14 +56,17 @@ public class LocatorImpl implements Locator { int line; int column; + @Override public String getURI() { return uri; } + @Override public int getLineNumber() { return line; } + @Override public int getColumnNumber() { return column; } @@ -68,7 +76,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl(Parser p) { if (W3CDebug) { - System.err.println("LocatorImpl::newLocator(" + p + ");"); + log("LocatorImpl::newLocator(" + p + ");"); } uri = p.source.getURI(); line = p.token.beginLine; @@ -80,8 +88,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl(Parser p, Token tok) { if (W3CDebug) { - System.err.println("LocatorImpl::newLocator(" + p + ", " + tok - + ");"); + log("LocatorImpl::newLocator(" + p + ", " + tok + ");"); } uri = p.source.getURI(); line = tok.beginLine; @@ -93,8 +100,8 @@ public class LocatorImpl implements Locator { */ public LocatorImpl(Parser p, int line, int column) { if (W3CDebug) { - System.err.println("LocatorImpl::newLocator(" + p + ", " + line - + ", " + column + ");"); + log("LocatorImpl::newLocator(" + p + ", " + line + ", " + column + + ");"); } uri = p.source.getURI(); this.line = line; @@ -106,7 +113,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl reInit(Parser p) { if (W3CDebug) { - System.err.println("LocatorImpl::reInit(" + p + ");"); + log("LocatorImpl::reInit(" + p + ");"); } uri = p.source.getURI(); line = p.token.beginLine; @@ -119,7 +126,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl reInit(Parser p, Token tok) { if (W3CDebug) { - System.err.println("LocatorImpl::reInit(" + p + ", " + tok + ");"); + log("LocatorImpl::reInit(" + p + ", " + tok + ");"); } uri = p.source.getURI(); line = tok.beginLine; @@ -132,12 +139,16 @@ public class LocatorImpl implements Locator { */ public LocatorImpl reInit(Parser p, int line, int column) { if (W3CDebug) { - System.err.println("LocatorImpl::reInit(" + p + ", " + line + ", " - + column + ");"); + log("LocatorImpl::reInit(" + p + ", " + line + ", " + column + ");"); } uri = p.source.getURI(); this.line = line; this.column = column; return this; } + + private void log(String msg) { + Logger.getLogger(SCSSDocumentHandlerImpl.class.getName()).log( + Level.SEVERE, msg); + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java index ab0f6161d7..e68b24355b 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java @@ -22,6 +22,8 @@ import java.util.ArrayList; import java.util.Locale; import java.util.Map; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.ConditionFactory; import org.w3c.css.sac.Condition; @@ -1158,6 +1160,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { case NONASCII: case DEBUG_SYM: case WARN_SYM: + case CONTENT_SYM: case STRING: case IDENT: case NUMBER: @@ -1180,53 +1183,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { jj_la1[37] = jj_gen; break label_28; } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DEBUG_SYM: - case WARN_SYM: - debuggingDirective(); - break; - case PLUS: - case PRECEDES: - case SIBLING: - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case INTERPOLATION: - case IDENT: - case HASH: - styleRule(); - break; - case CDO: - case LBRACE: - case DASHMATCH: - case INCLUDES: - case MINUS: - case COMMA: - case SEMICOLON: - case NONASCII: - case STRING: - case NUMBER: - case URL: - case PERCENTAGE: - case IMPORT_SYM: - case MEDIA_SYM: - case CHARSET_SYM: - case PAGE_SYM: - case FONT_FACE_SYM: - case ATKEYWORD: - case IMPORTANT_SYM: - case UNICODERANGE: - case FUNCTION: - case UNKNOWN: - skipUnknownRule(); - break; - default: - jj_la1[38] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + mediaDirective(); } jj_consume_token(RBRACE); label_29: @@ -1236,7 +1193,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { ; break; default: - jj_la1[39] = jj_gen; + jj_la1[38] = jj_gen; break label_29; } jj_consume_token(S); @@ -1248,11 +1205,64 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } finally { if (start) { - documentHandler.endMedia(ml); + documentHandler.endMedia(ml); } } } + final public void mediaDirective() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DEBUG_SYM: + case WARN_SYM: + debuggingDirective(); + break; + case PLUS: + case PRECEDES: + case SIBLING: + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case INTERPOLATION: + case IDENT: + case HASH: + styleRule(); + break; + case CDO: + case LBRACE: + case DASHMATCH: + case INCLUDES: + case MINUS: + case COMMA: + case SEMICOLON: + case NONASCII: + case STRING: + case NUMBER: + case URL: + case PERCENTAGE: + case IMPORT_SYM: + case MEDIA_SYM: + case CHARSET_SYM: + case PAGE_SYM: + case FONT_FACE_SYM: + case ATKEYWORD: + case IMPORTANT_SYM: + case UNICODERANGE: + case FUNCTION: + case UNKNOWN: + skipUnknownRule(); + break; + case CONTENT_SYM: + contentDirective(); + break; + default: + jj_la1[39] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + final public void mediaStatement(MediaListImpl ml) throws ParseException { Token t; t = getToken(1); @@ -2194,88 +2204,13 @@ char connector = ' '; } } break; - case HASH: - cond = hash(cond); - label_58: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - ; - break; - default: - jj_la1[82] = jj_gen; - break label_58; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - cond = _class(cond); - break; - case LBRACKET: - cond = attrib(cond); - break; - case COLON: - cond = pseudo(cond); - break; - default: - jj_la1[83] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; + case LBRACKET: case DOT: - cond = _class(cond); - label_59: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; - default: - jj_la1[84] = jj_gen; - break label_59; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case HASH: - cond = hash(cond); - break; - case DOT: - cond = _class(cond); - break; - case LBRACKET: - cond = attrib(cond); - break; - case COLON: - cond = pseudo(cond); - break; - default: - jj_la1[85] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; case COLON: - cond = pseudo(cond); - label_60: + case HASH: + label_58: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; - default: - jj_la1[86] = jj_gen; - break label_60; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case HASH: cond = hash(cond); break; @@ -2289,16 +2224,10 @@ char connector = ' '; cond = pseudo(cond); break; default: - jj_la1[87] = jj_gen; + jj_la1[82] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - } - break; - case LBRACKET: - cond = attrib(cond); - label_61: - while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: case DOT: @@ -2307,31 +2236,13 @@ char connector = ' '; ; break; default: - jj_la1[88] = jj_gen; - break label_61; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case HASH: - cond = hash(cond); - break; - case DOT: - cond = _class(cond); - break; - case LBRACKET: - cond = attrib(cond); - break; - case COLON: - cond = pseudo(cond); - break; - default: - jj_la1[89] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + jj_la1[83] = jj_gen; + break label_58; } } break; default: - jj_la1[90] = jj_gen; + jj_la1[84] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2376,7 +2287,7 @@ char connector = ' '; Token t; String s = "."; jj_consume_token(DOT); - label_62: + label_59: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENT: @@ -2388,7 +2299,7 @@ String s = "."; s += t.image; break; default: - jj_la1[91] = jj_gen; + jj_la1[85] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2398,8 +2309,8 @@ String s = "."; ; break; default: - jj_la1[92] = jj_gen; - break label_62; + jj_la1[86] = jj_gen; + break label_59; } } if (pred == null) { @@ -2418,7 +2329,7 @@ String s = "."; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTERPOLATION: case IDENT: - label_63: + label_60: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENT: @@ -2430,7 +2341,7 @@ String s = "."; s += t.image; break; default: - jj_la1[93] = jj_gen; + jj_la1[87] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2440,8 +2351,8 @@ String s = "."; ; break; default: - jj_la1[94] = jj_gen; - break label_63; + jj_la1[88] = jj_gen; + break label_60; } } {if (true) return s;} @@ -2455,7 +2366,7 @@ String s = "."; {if (true) return "&";} break; default: - jj_la1[95] = jj_gen; + jj_la1[89] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2471,28 +2382,28 @@ String s = "."; Token val = null; String attValue = null; jj_consume_token(LBRACKET); - label_64: + label_61: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[96] = jj_gen; - break label_64; + jj_la1[90] = jj_gen; + break label_61; } jj_consume_token(S); } att = jj_consume_token(IDENT); - label_65: + label_62: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[97] = jj_gen; - break label_65; + jj_la1[91] = jj_gen; + break label_62; } jj_consume_token(S); } @@ -2529,19 +2440,19 @@ String s = "."; cases = 6; break; default: - jj_la1[98] = jj_gen; + jj_la1[92] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_66: + label_63: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[99] = jj_gen; - break label_66; + jj_la1[93] = jj_gen; + break label_63; } jj_consume_token(S); } @@ -2555,25 +2466,25 @@ String s = "."; attValue = val.image; break; default: - jj_la1[100] = jj_gen; + jj_la1[94] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_67: + label_64: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[101] = jj_gen; - break label_67; + jj_la1[95] = jj_gen; + break label_64; } jj_consume_token(S); } break; default: - jj_la1[102] = jj_gen; + jj_la1[96] = jj_gen; ; } jj_consume_token(RBRACKET); @@ -2629,7 +2540,7 @@ boolean isPseudoElement = false; isPseudoElement=true; break; default: - jj_la1[103] = jj_gen; + jj_la1[97] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2655,19 +2566,19 @@ boolean isPseudoElement = false; break; case FUNCTION: n = jj_consume_token(FUNCTION); - label_68: + label_65: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[104] = jj_gen; - break label_68; + jj_la1[98] = jj_gen; + break label_65; } jj_consume_token(S); } - d = skipStatementUntilRightParan(); + d = skipStatementUntilMatchingRightParan(); jj_consume_token(RPARAN); // accept anything between function and a right parenthesis String f = convertIdent(n.image); @@ -2680,7 +2591,7 @@ boolean isPseudoElement = false; } break; default: - jj_la1[105] = jj_gen; + jj_la1[99] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2710,15 +2621,15 @@ boolean isPseudoElement = false; try { name = variableName(); jj_consume_token(COLON); - label_69: + label_66: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[106] = jj_gen; - break label_69; + jj_la1[100] = jj_gen; + break label_66; } jj_consume_token(S); } @@ -2728,21 +2639,21 @@ boolean isPseudoElement = false; guarded = guarded(); break; default: - jj_la1[107] = jj_gen; + jj_la1[101] = jj_gen; ; } - label_70: + label_67: while (true) { jj_consume_token(SEMICOLON); - label_71: + label_68: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[108] = jj_gen; - break label_71; + jj_la1[102] = jj_gen; + break label_68; } jj_consume_token(S); } @@ -2751,8 +2662,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[109] = jj_gen; - break label_70; + jj_la1[103] = jj_gen; + break label_67; } } exp = replaceNullValues(exp); @@ -2810,7 +2721,7 @@ boolean isPseudoElement = false; eachDirective(); break; default: - jj_la1[110] = jj_gen; + jj_la1[104] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2849,7 +2760,7 @@ boolean isPseudoElement = false; keyframes(); break; default: - jj_la1[111] = jj_gen; + jj_la1[105] = jj_gen; if (jj_2_3(2147483647)) { variable(); } else { @@ -2865,7 +2776,7 @@ boolean isPseudoElement = false; atRuleDeclaration(); break; default: - jj_la1[112] = jj_gen; + jj_la1[106] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2878,7 +2789,7 @@ boolean isPseudoElement = false; String s = null; String evaluator = ""; jj_consume_token(IF_SYM); - label_72: + label_69: while (true) { s = booleanExpressionToken(); evaluator += s; @@ -2904,26 +2815,26 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[113] = jj_gen; - break label_72; + jj_la1[107] = jj_gen; + break label_69; } } jj_consume_token(LBRACE); - label_73: + label_70: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[114] = jj_gen; - break label_73; + jj_la1[108] = jj_gen; + break label_70; } jj_consume_token(S); } documentHandler.startIfElseDirective(); documentHandler.ifDirective(evaluator); - label_74: + label_71: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -2952,8 +2863,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[115] = jj_gen; - break label_74; + jj_la1[109] = jj_gen; + break label_71; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -2984,33 +2895,33 @@ boolean isPseudoElement = false; fontFace(); break; default: - jj_la1[116] = jj_gen; + jj_la1[110] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_75: + label_72: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[117] = jj_gen; - break label_75; + jj_la1[111] = jj_gen; + break label_72; } jj_consume_token(S); } - label_76: + label_73: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ELSE_SYM: ; break; default: - jj_la1[118] = jj_gen; - break label_76; + jj_la1[112] = jj_gen; + break label_73; } elseDirective(); } @@ -3022,22 +2933,22 @@ boolean isPseudoElement = false; Token n = null; String s = null; jj_consume_token(ELSE_SYM); - label_77: + label_74: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[119] = jj_gen; - break label_77; + jj_la1[113] = jj_gen; + break label_74; } jj_consume_token(S); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IF: jj_consume_token(IF); - label_78: + label_75: while (true) { s = booleanExpressionToken(); evaluator += s; @@ -3063,31 +2974,31 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[120] = jj_gen; - break label_78; + jj_la1[114] = jj_gen; + break label_75; } } break; default: - jj_la1[121] = jj_gen; + jj_la1[115] = jj_gen; ; } jj_consume_token(LBRACE); - label_79: + label_76: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[122] = jj_gen; - break label_79; + jj_la1[116] = jj_gen; + break label_76; } jj_consume_token(S); } if(!evaluator.trim().equals("")){ documentHandler.ifDirective(evaluator); } else{ documentHandler.elseDirective(); } - label_80: + label_77: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3116,8 +3027,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[123] = jj_gen; - break label_80; + jj_la1[117] = jj_gen; + break label_77; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3148,21 +3059,21 @@ boolean isPseudoElement = false; fontFace(); break; default: - jj_la1[124] = jj_gen; + jj_la1[118] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_81: + label_78: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[125] = jj_gen; - break label_81; + jj_la1[119] = jj_gen; + break label_78; } jj_consume_token(S); } @@ -3227,7 +3138,7 @@ boolean isPseudoElement = false; n = jj_consume_token(NOT_EQ); break; default: - jj_la1[126] = jj_gen; + jj_la1[120] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3242,41 +3153,41 @@ boolean isPseudoElement = false; ArrayList<String> list = null; String listVariable = null; jj_consume_token(EACH_SYM); - label_82: + label_79: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[127] = jj_gen; - break label_82; + jj_la1[121] = jj_gen; + break label_79; } jj_consume_token(S); } var = jj_consume_token(VARIABLE); - label_83: + label_80: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[128] = jj_gen; - break label_83; + jj_la1[122] = jj_gen; + break label_80; } jj_consume_token(S); } jj_consume_token(EACH_IN); - label_84: + label_81: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[129] = jj_gen; - break label_84; + jj_la1[123] = jj_gen; + break label_81; } jj_consume_token(S); } @@ -3290,24 +3201,24 @@ boolean isPseudoElement = false; documentHandler.startEachDirective(var.image, listVariable); break; default: - jj_la1[130] = jj_gen; + jj_la1[124] = jj_gen; jj_consume_token(-1); throw new ParseException(); } jj_consume_token(LBRACE); - label_85: + label_82: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[131] = jj_gen; - break label_85; + jj_la1[125] = jj_gen; + break label_82; } jj_consume_token(S); } - label_86: + label_83: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3335,21 +3246,21 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[132] = jj_gen; - break label_86; + jj_la1[126] = jj_gen; + break label_83; } ifContentStatement(); } jj_consume_token(RBRACE); - label_87: + label_84: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[133] = jj_gen; - break label_87; + jj_la1[127] = jj_gen; + break label_84; } jj_consume_token(S); } @@ -3360,53 +3271,53 @@ boolean isPseudoElement = false; ArrayList<String > strings = new ArrayList<String >(); Token input; input = jj_consume_token(IDENT); - label_88: + label_85: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[134] = jj_gen; - break label_88; + jj_la1[128] = jj_gen; + break label_85; } jj_consume_token(S); } strings.add(input.image); - label_89: + label_86: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: - jj_la1[135] = jj_gen; - break label_89; + jj_la1[129] = jj_gen; + break label_86; } jj_consume_token(COMMA); - label_90: + label_87: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[136] = jj_gen; - break label_90; + jj_la1[130] = jj_gen; + break label_87; } jj_consume_token(S); } input = jj_consume_token(IDENT); strings.add(input.image); - label_91: + label_88: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[137] = jj_gen; - break label_91; + jj_la1[131] = jj_gen; + break label_88; } jj_consume_token(S); } @@ -3420,15 +3331,15 @@ boolean isPseudoElement = false; ArrayList<VariableNode> args = null; String body; jj_consume_token(MIXIN_SYM); - label_92: + label_89: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[138] = jj_gen; - break label_92; + jj_la1[132] = jj_gen; + break label_89; } jj_consume_token(S); } @@ -3441,39 +3352,39 @@ boolean isPseudoElement = false; name = functionName(); args = arglist(); jj_consume_token(RPARAN); - label_93: + label_90: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[139] = jj_gen; - break label_93; + jj_la1[133] = jj_gen; + break label_90; } jj_consume_token(S); } break; default: - jj_la1[140] = jj_gen; + jj_la1[134] = jj_gen; jj_consume_token(-1); throw new ParseException(); } jj_consume_token(LBRACE); - label_94: + label_91: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[141] = jj_gen; - break label_94; + jj_la1[135] = jj_gen; + break label_91; } jj_consume_token(S); } documentHandler.startMixinDirective(name, args); - label_95: + label_92: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3503,8 +3414,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[142] = jj_gen; - break label_95; + jj_la1[136] = jj_gen; + break label_92; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3538,21 +3449,21 @@ boolean isPseudoElement = false; page(); break; default: - jj_la1[143] = jj_gen; + jj_la1[137] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_96: + label_93: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[144] = jj_gen; - break label_96; + jj_la1[138] = jj_gen; + break label_93; } jj_consume_token(S); } @@ -3566,26 +3477,26 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VARIABLE: arg = mixinArg(); - label_97: + label_94: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: - jj_la1[145] = jj_gen; - break label_97; + jj_la1[139] = jj_gen; + break label_94; } jj_consume_token(COMMA); - label_98: + label_95: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[146] = jj_gen; - break label_98; + jj_la1[140] = jj_gen; + break label_95; } jj_consume_token(S); } @@ -3595,7 +3506,7 @@ boolean isPseudoElement = false; hasNonOptionalArgument = checkMixinForNonOptionalArguments(arg, hasNonOptionalArgument); args.add(arg); break; default: - jj_la1[147] = jj_gen; + jj_la1[141] = jj_gen; ; } {if (true) return args;} @@ -3631,45 +3542,45 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); - label_99: + label_96: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[148] = jj_gen; - break label_99; + jj_la1[142] = jj_gen; + break label_96; } jj_consume_token(S); } first = nonVariableTerm(null); prev = first; - label_100: + label_97: while (true) { if (jj_2_5(3)) { ; } else { - break label_100; + break label_97; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_101: + label_98: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[149] = jj_gen; - break label_101; + jj_la1[143] = jj_gen; + break label_98; } jj_consume_token(S); } break; default: - jj_la1[150] = jj_gen; + jj_la1[144] = jj_gen; ; } prev = nonVariableTerm(prev); @@ -3681,13 +3592,13 @@ boolean isPseudoElement = false; prev, variable.image); break; default: - jj_la1[151] = jj_gen; + jj_la1[145] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[152] = jj_gen; + jj_la1[146] = jj_gen; ; } VariableNode arg = new VariableNode(name, first, false); @@ -3736,7 +3647,7 @@ boolean isPseudoElement = false; case FUNCTION: first = term(null); args.add(first); prev = first; - label_102: + label_99: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3776,58 +3687,58 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[153] = jj_gen; - break label_102; + jj_la1[147] = jj_gen; + break label_99; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); - label_103: + label_100: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[154] = jj_gen; - break label_103; + jj_la1[148] = jj_gen; + break label_100; } jj_consume_token(S); } break; default: - jj_la1[155] = jj_gen; + jj_la1[149] = jj_gen; ; } next = term(prev); prev.setNextLexicalUnit(next); prev = next; } - label_104: + label_101: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: - jj_la1[156] = jj_gen; - break label_104; + jj_la1[150] = jj_gen; + break label_101; } jj_consume_token(COMMA); - label_105: + label_102: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[157] = jj_gen; - break label_105; + jj_la1[151] = jj_gen; + break label_102; } jj_consume_token(S); } first = term(null); args.add(first); prev = first; - label_106: + label_103: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3867,27 +3778,27 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[158] = jj_gen; - break label_106; + jj_la1[152] = jj_gen; + break label_103; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); - label_107: + label_104: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[159] = jj_gen; - break label_107; + jj_la1[153] = jj_gen; + break label_104; } jj_consume_token(S); } break; default: - jj_la1[160] = jj_gen; + jj_la1[154] = jj_gen; ; } next = term(prev); @@ -3896,7 +3807,7 @@ boolean isPseudoElement = false; } break; default: - jj_la1[161] = jj_gen; + jj_la1[155] = jj_gen; ; } {if (true) return args;} @@ -3907,15 +3818,15 @@ boolean isPseudoElement = false; String name; ArrayList<LexicalUnitImpl> args=null; jj_consume_token(INCLUDE_SYM); - label_108: + label_105: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[162] = jj_gen; - break label_108; + jj_la1[156] = jj_gen; + break label_105; } jj_consume_token(S); } @@ -3932,21 +3843,21 @@ boolean isPseudoElement = false; name = functionName(); args = argValuelist(); jj_consume_token(RPARAN); - label_109: + label_106: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[163] = jj_gen; - break label_109; + jj_la1[157] = jj_gen; + break label_106; } jj_consume_token(S); } break; default: - jj_la1[164] = jj_gen; + jj_la1[158] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3959,7 +3870,7 @@ boolean isPseudoElement = false; includeDirectiveTerminator(); break; default: - jj_la1[165] = jj_gen; + jj_la1[159] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3968,18 +3879,18 @@ boolean isPseudoElement = false; final public void includeDirectiveTerminator() throws ParseException { try { - label_110: + label_107: while (true) { jj_consume_token(SEMICOLON); - label_111: + label_108: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[166] = jj_gen; - break label_111; + jj_la1[160] = jj_gen; + break label_108; } jj_consume_token(S); } @@ -3988,8 +3899,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[167] = jj_gen; - break label_110; + jj_la1[161] = jj_gen; + break label_107; } } } catch (ParseException e) { @@ -3999,19 +3910,19 @@ boolean isPseudoElement = false; final public void includeDirectiveBlockContents() throws ParseException { jj_consume_token(LBRACE); - label_112: + label_109: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[168] = jj_gen; - break label_112; + jj_la1[162] = jj_gen; + break label_109; } jj_consume_token(S); } - label_113: + label_110: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -4033,8 +3944,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[169] = jj_gen; - break label_113; + jj_la1[163] = jj_gen; + break label_110; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -4058,21 +3969,21 @@ boolean isPseudoElement = false; keyframeSelector(); break; default: - jj_la1[170] = jj_gen; + jj_la1[164] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_114: + label_111: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[171] = jj_gen; - break label_114; + jj_la1[165] = jj_gen; + break label_111; } jj_consume_token(S); } @@ -4095,28 +4006,28 @@ boolean isPseudoElement = false; //refactor, remove those 3 LOOKAHEAD(5). n = jj_consume_token(VARIABLE); variable = n.image; - label_115: + label_112: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[172] = jj_gen; - break label_115; + jj_la1[166] = jj_gen; + break label_112; } jj_consume_token(S); } jj_consume_token(COLON); - label_116: + label_113: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[173] = jj_gen; - break label_116; + jj_la1[167] = jj_gen; + break label_113; } jj_consume_token(S); } @@ -4131,19 +4042,19 @@ boolean isPseudoElement = false; type = jj_consume_token(CONTAINS); break; default: - jj_la1[174] = jj_gen; + jj_la1[168] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_117: + label_114: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[175] = jj_gen; - break label_117; + jj_la1[169] = jj_gen; + break label_114; } jj_consume_token(S); } @@ -4153,19 +4064,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[176] = jj_gen; + jj_la1[170] = jj_gen; ; } jj_consume_token(COMMA); - label_118: + label_115: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[177] = jj_gen; - break label_118; + jj_la1[171] = jj_gen; + break label_115; } jj_consume_token(S); } @@ -4173,35 +4084,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_119: + label_116: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[178] = jj_gen; - break label_119; + jj_la1[172] = jj_gen; + break label_116; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_120: + label_117: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[179] = jj_gen; - break label_120; + jj_la1[173] = jj_gen; + break label_117; } jj_consume_token(S); } break; default: - jj_la1[180] = jj_gen; + jj_la1[174] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4221,28 +4132,28 @@ boolean isPseudoElement = false; default: break; } - label_121: + label_118: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[181] = jj_gen; - break label_121; + jj_la1[175] = jj_gen; + break label_118; } jj_consume_token(S); } jj_consume_token(SEMICOLON); - label_122: + label_119: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[182] = jj_gen; - break label_122; + jj_la1[176] = jj_gen; + break label_119; } jj_consume_token(S); } @@ -4259,41 +4170,41 @@ boolean isPseudoElement = false; Token n = null; n = jj_consume_token(VARIABLE); variable = n.image; - label_123: + label_120: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[183] = jj_gen; - break label_123; + jj_la1[177] = jj_gen; + break label_120; } jj_consume_token(S); } jj_consume_token(COLON); - label_124: + label_121: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[184] = jj_gen; - break label_124; + jj_la1[178] = jj_gen; + break label_121; } jj_consume_token(S); } jj_consume_token(APPEND); - label_125: + label_122: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[185] = jj_gen; - break label_125; + jj_la1[179] = jj_gen; + break label_122; } jj_consume_token(S); } @@ -4303,19 +4214,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[186] = jj_gen; + jj_la1[180] = jj_gen; ; } jj_consume_token(COMMA); - label_126: + label_123: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[187] = jj_gen; - break label_126; + jj_la1[181] = jj_gen; + break label_123; } jj_consume_token(S); } @@ -4323,35 +4234,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_127: + label_124: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[188] = jj_gen; - break label_127; + jj_la1[182] = jj_gen; + break label_124; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_128: + label_125: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[189] = jj_gen; - break label_128; + jj_la1[183] = jj_gen; + break label_125; } jj_consume_token(S); } break; default: - jj_la1[190] = jj_gen; + jj_la1[184] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4369,41 +4280,41 @@ boolean isPseudoElement = false; Token n = null; n = jj_consume_token(VARIABLE); variable = n.image; - label_129: + label_126: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[191] = jj_gen; - break label_129; + jj_la1[185] = jj_gen; + break label_126; } jj_consume_token(S); } jj_consume_token(COLON); - label_130: + label_127: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[192] = jj_gen; - break label_130; + jj_la1[186] = jj_gen; + break label_127; } jj_consume_token(S); } jj_consume_token(REMOVE); - label_131: + label_128: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[193] = jj_gen; - break label_131; + jj_la1[187] = jj_gen; + break label_128; } jj_consume_token(S); } @@ -4413,19 +4324,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[194] = jj_gen; + jj_la1[188] = jj_gen; ; } jj_consume_token(COMMA); - label_132: + label_129: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[195] = jj_gen; - break label_132; + jj_la1[189] = jj_gen; + break label_129; } jj_consume_token(S); } @@ -4433,35 +4344,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_133: + label_130: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[196] = jj_gen; - break label_133; + jj_la1[190] = jj_gen; + break label_130; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_134: + label_131: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[197] = jj_gen; - break label_134; + jj_la1[191] = jj_gen; + break label_131; } jj_consume_token(S); } break; default: - jj_la1[198] = jj_gen; + jj_la1[192] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4481,46 +4392,46 @@ boolean isPseudoElement = false; case VARIABLE: n = jj_consume_token(VARIABLE); variable = n.image; - label_135: + label_132: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[199] = jj_gen; - break label_135; + jj_la1[193] = jj_gen; + break label_132; } jj_consume_token(S); } jj_consume_token(COLON); - label_136: + label_133: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[200] = jj_gen; - break label_136; + jj_la1[194] = jj_gen; + break label_133; } jj_consume_token(S); } break; default: - jj_la1[201] = jj_gen; + jj_la1[195] = jj_gen; ; } jj_consume_token(CONTAINS); - label_137: + label_134: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[202] = jj_gen; - break label_137; + jj_la1[196] = jj_gen; + break label_134; } jj_consume_token(S); } @@ -4530,19 +4441,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[203] = jj_gen; + jj_la1[197] = jj_gen; ; } jj_consume_token(COMMA); - label_138: + label_135: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[204] = jj_gen; - break label_138; + jj_la1[198] = jj_gen; + break label_135; } jj_consume_token(S); } @@ -4550,35 +4461,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_139: + label_136: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[205] = jj_gen; - break label_139; + jj_la1[199] = jj_gen; + break label_136; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_140: + label_137: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[206] = jj_gen; - break label_140; + jj_la1[200] = jj_gen; + break label_137; } jj_consume_token(S); } break; default: - jj_la1[207] = jj_gen; + jj_la1[201] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4683,7 +4594,7 @@ boolean isPseudoElement = false; warnDirective(); break; default: - jj_la1[208] = jj_gen; + jj_la1[202] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4693,18 +4604,18 @@ boolean isPseudoElement = false; jj_consume_token(DEBUG_SYM); String content = skipStatementUntil(new int[] {SEMICOLON,RBRACE,EOF}); // TODO should evaluate the content expression, call documentHandler.debugDirective() etc. - System.out.println(content); + Logger.getLogger(Parser.class.getName()).log(Level.INFO, content); try { jj_consume_token(SEMICOLON); - label_141: + label_138: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[209] = jj_gen; - break label_141; + jj_la1[203] = jj_gen; + break label_138; } jj_consume_token(S); } @@ -4717,18 +4628,18 @@ boolean isPseudoElement = false; jj_consume_token(WARN_SYM); String content = skipStatementUntil(new int[] {SEMICOLON,RBRACE,EOF}); // TODO should evaluate the content expression, call documentHandler.warnDirective() etc. - System.err.println(content); + Logger.getLogger(Parser.class.getName()).log(Level.SEVERE, content); try { jj_consume_token(SEMICOLON); - label_142: + label_139: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[210] = jj_gen; - break label_142; + jj_la1[204] = jj_gen; + break label_139; } jj_consume_token(S); } @@ -4757,20 +4668,20 @@ boolean isPseudoElement = false; exclusive = false; break; default: - jj_la1[211] = jj_gen; + jj_la1[205] = jj_gen; jj_consume_token(-1); throw new ParseException(); } to = skipStatementUntilLeftBrace(); - label_143: + label_140: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[212] = jj_gen; - break label_143; + jj_la1[206] = jj_gen; + break label_140; } jj_consume_token(S); } @@ -4791,33 +4702,33 @@ boolean isPseudoElement = false; final public void extendDirective() throws ParseException { ArrayList<String> list; jj_consume_token(EXTEND_SYM); - label_144: + label_141: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[213] = jj_gen; - break label_144; + jj_la1[207] = jj_gen; + break label_141; } jj_consume_token(S); } list = selectorList(); documentHandler.extendDirective(list); try { - label_145: + label_142: while (true) { jj_consume_token(SEMICOLON); - label_146: + label_143: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[214] = jj_gen; - break label_146; + jj_la1[208] = jj_gen; + break label_143; } jj_consume_token(S); } @@ -4826,8 +4737,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[215] = jj_gen; - break label_145; + jj_la1[209] = jj_gen; + break label_142; } } } catch (ParseException e) { @@ -4837,31 +4748,31 @@ boolean isPseudoElement = false; final public void contentDirective() throws ParseException { jj_consume_token(CONTENT_SYM); - label_147: + label_144: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[216] = jj_gen; - break label_147; + jj_la1[210] = jj_gen; + break label_144; } jj_consume_token(S); } try { - label_148: + label_145: while (true) { jj_consume_token(SEMICOLON); - label_149: + label_146: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[217] = jj_gen; - break label_149; + jj_la1[211] = jj_gen; + break label_146; } jj_consume_token(S); } @@ -4870,8 +4781,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[218] = jj_gen; - break label_148; + jj_la1[212] = jj_gen; + break label_145; } } } catch (ParseException e) { @@ -4901,28 +4812,28 @@ boolean isPseudoElement = false; LexicalUnit exp; name = property(); jj_consume_token(COLON); - label_150: + label_147: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[219] = jj_gen; - break label_150; + jj_la1[213] = jj_gen; + break label_147; } jj_consume_token(S); } jj_consume_token(LBRACE); - label_151: + label_148: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[220] = jj_gen; - break label_151; + jj_la1[214] = jj_gen; + break label_148; } jj_consume_token(S); } @@ -4933,29 +4844,29 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[221] = jj_gen; + jj_la1[215] = jj_gen; ; } - label_152: + label_149: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: ; break; default: - jj_la1[222] = jj_gen; - break label_152; + jj_la1[216] = jj_gen; + break label_149; } jj_consume_token(SEMICOLON); - label_153: + label_150: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[223] = jj_gen; - break label_153; + jj_la1[217] = jj_gen; + break label_150; } jj_consume_token(S); } @@ -4965,21 +4876,21 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[224] = jj_gen; + jj_la1[218] = jj_gen; ; } } jj_consume_token(RBRACE); documentHandler.endNestedProperties(name); - label_154: + label_151: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[225] = jj_gen; - break label_154; + jj_la1[219] = jj_gen; + break label_151; } jj_consume_token(S); } @@ -4996,7 +4907,7 @@ LexicalUnit exp; debuggingDirective(); break; default: - jj_la1[226] = jj_gen; + jj_la1[220] = jj_gen; if (jj_2_6(2147483647)) { styleRule(); } else if (jj_2_7(3)) { @@ -5017,7 +4928,7 @@ LexicalUnit exp; styleRule(); break; default: - jj_la1[227] = jj_gen; + jj_la1[221] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5062,15 +4973,15 @@ LexicalUnit exp; name = property(); save = token; jj_consume_token(COLON); - label_155: + label_152: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[228] = jj_gen; - break label_155; + jj_la1[222] = jj_gen; + break label_152; } jj_consume_token(S); } @@ -5114,7 +5025,7 @@ LexicalUnit exp; important = prio(); break; default: - jj_la1[229] = jj_gen; + jj_la1[223] = jj_gen; ; } Token next = getToken(1); @@ -5133,15 +5044,15 @@ LexicalUnit exp; break; case LBRACE: jj_consume_token(LBRACE); - label_156: + label_153: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[230] = jj_gen; - break label_156; + jj_la1[224] = jj_gen; + break label_153; } jj_consume_token(S); } @@ -5152,29 +5063,29 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[231] = jj_gen; + jj_la1[225] = jj_gen; ; } - label_157: + label_154: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: ; break; default: - jj_la1[232] = jj_gen; - break label_157; + jj_la1[226] = jj_gen; + break label_154; } jj_consume_token(SEMICOLON); - label_158: + label_155: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[233] = jj_gen; - break label_158; + jj_la1[227] = jj_gen; + break label_155; } jj_consume_token(S); } @@ -5184,27 +5095,27 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[234] = jj_gen; + jj_la1[228] = jj_gen; ; } } jj_consume_token(RBRACE); - label_159: + label_156: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[235] = jj_gen; - break label_159; + jj_la1[229] = jj_gen; + break label_156; } jj_consume_token(S); } documentHandler.endNestedProperties(name); break; default: - jj_la1[236] = jj_gen; + jj_la1[230] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5254,15 +5165,15 @@ LexicalUnit exp; name = property(); save = token; jj_consume_token(COLON); - label_160: + label_157: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[237] = jj_gen; - break label_160; + jj_la1[231] = jj_gen; + break label_157; } jj_consume_token(S); } @@ -5272,7 +5183,7 @@ LexicalUnit exp; important = prio(); break; default: - jj_la1[238] = jj_gen; + jj_la1[232] = jj_gen; ; } documentHandler.property(name, exp, important); @@ -5315,15 +5226,15 @@ LexicalUnit exp; */ final public boolean prio() throws ParseException { jj_consume_token(IMPORTANT_SYM); - label_161: + label_158: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[239] = jj_gen; - break label_161; + jj_la1[233] = jj_gen; + break label_158; } jj_consume_token(S); } @@ -5333,15 +5244,15 @@ LexicalUnit exp; final public boolean guarded() throws ParseException { jj_consume_token(GUARDED_SYM); - label_162: + label_159: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[240] = jj_gen; - break label_162; + jj_la1[234] = jj_gen; + break label_159; } jj_consume_token(S); } @@ -5366,15 +5277,15 @@ LexicalUnit exp; * 3. parenthesis is not supported now. */ n = jj_consume_token(COMMA); - label_163: + label_160: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[241] = jj_gen; - break label_163; + jj_la1[235] = jj_gen; + break label_160; } jj_consume_token(S); } @@ -5384,15 +5295,15 @@ LexicalUnit exp; break; case DIV: n = jj_consume_token(DIV); - label_164: + label_161: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[242] = jj_gen; - break label_164; + jj_la1[236] = jj_gen; + break label_161; } jj_consume_token(S); } @@ -5402,15 +5313,15 @@ LexicalUnit exp; break; case ANY: n = jj_consume_token(ANY); - label_165: + label_162: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[243] = jj_gen; - break label_165; + jj_la1[237] = jj_gen; + break label_162; } jj_consume_token(S); } @@ -5420,15 +5331,15 @@ LexicalUnit exp; break; case MOD: n = jj_consume_token(MOD); - label_166: + label_163: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[244] = jj_gen; - break label_166; + jj_la1[238] = jj_gen; + break label_163; } jj_consume_token(S); } @@ -5438,7 +5349,7 @@ LexicalUnit exp; break; case PLUS: n = jj_consume_token(PLUS); - label_167: + label_164: while (true) { jj_consume_token(S); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5446,8 +5357,8 @@ LexicalUnit exp; ; break; default: - jj_la1[245] = jj_gen; - break label_167; + jj_la1[239] = jj_gen; + break label_164; } } {if (true) return LexicalUnitImpl.createAdd(n.beginLine, @@ -5456,7 +5367,7 @@ LexicalUnit exp; break; case MINUS: n = jj_consume_token(MINUS); - label_168: + label_165: while (true) { jj_consume_token(S); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5464,8 +5375,8 @@ LexicalUnit exp; ; break; default: - jj_la1[246] = jj_gen; - break label_168; + jj_la1[240] = jj_gen; + break label_165; } } {if (true) return LexicalUnitImpl.createMinus(n.beginLine, @@ -5473,7 +5384,7 @@ LexicalUnit exp; prev);} break; default: - jj_la1[247] = jj_gen; + jj_la1[241] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5488,12 +5399,12 @@ LexicalUnit exp; char op; first = term(null); res = first; - label_169: + label_166: while (true) { if (jj_2_8(2)) { ; } else { - break label_169; + break label_166; } if (jj_2_9(2)) { res = operator(res); @@ -5520,7 +5431,7 @@ LexicalUnit exp; {if (true) return '+';} break; default: - jj_la1[248] = jj_gen; + jj_la1[242] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5573,7 +5484,7 @@ LexicalUnit exp; result = variableTerm(prev); break; default: - jj_la1[249] = jj_gen; + jj_la1[243] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5626,7 +5537,7 @@ LexicalUnitImpl result = null; op = unaryOperator(); break; default: - jj_la1[250] = jj_gen; + jj_la1[244] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5742,7 +5653,7 @@ LexicalUnitImpl result = null; result = function(op, prev); break; default: - jj_la1[251] = jj_gen; + jj_la1[245] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5775,7 +5686,7 @@ LexicalUnitImpl result = null; s+="."; break; default: - jj_la1[252] = jj_gen; + jj_la1[246] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5792,7 +5703,7 @@ LexicalUnitImpl result = null; n = jj_consume_token(FROM); break; default: - jj_la1[253] = jj_gen; + jj_la1[247] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5839,25 +5750,25 @@ LexicalUnitImpl result = null; result = unicode(prev); break; default: - jj_la1[254] = jj_gen; + jj_la1[248] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[255] = jj_gen; + jj_la1[249] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_170: + label_167: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[256] = jj_gen; - break label_170; + jj_la1[250] = jj_gen; + break label_167; } jj_consume_token(S); } @@ -5873,15 +5784,15 @@ LexicalUnitImpl result = null; Token n; LexicalUnit params = null; n = jj_consume_token(FUNCTION); - label_171: + label_168: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[257] = jj_gen; - break label_171; + jj_la1[251] = jj_gen; + break label_168; } jj_consume_token(S); } @@ -5932,7 +5843,7 @@ LexicalUnitImpl result = null; params = expr(); break; default: - jj_la1[258] = jj_gen; + jj_la1[252] = jj_gen; ; } jj_consume_token(RPARAN); @@ -6202,9 +6113,35 @@ LexicalUnitImpl result = null; return skipStatementUntil(lBrace); } - String skipStatementUntilRightParan() throws ParseException { - int[] rParan = {RPARAN}; - return skipStatementUntil(rParan); + String skipStatementUntilMatchingRightParan() throws ParseException { + int[] leftTokens = {LPARAN, FUNCTION}; // a FUNCTION also contains "(" + int[] rightTokens = {RPARAN}; + StringBuffer s = new StringBuffer(); + int difference = 1; + Token tok; + while(difference != 0){ + tok = getToken(1); + if(tok.kind == EOF) { + return null; + } + for(int sym : leftTokens){ + if(tok.kind == sym){ + difference++; + } + } + for(int sym : rightTokens){ + if(tok.kind == sym){ + difference--; + } + } + if(difference != 0){ + if (tok.image != null) { + s.append(tok.image); + } + getNextToken(); + } + } + return s.toString().trim(); } String skipStatementUntil(int[] symbols) throws ParseException { @@ -6389,15 +6326,15 @@ LexicalUnitImpl result = null; // TODO required by original parser but not used by Vaadin? final public void _parseRule() throws ParseException { String ret = null; - label_172: + label_169: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[259] = jj_gen; - break label_172; + jj_la1[253] = jj_gen; + break label_169; } jj_consume_token(S); } @@ -6432,7 +6369,7 @@ LexicalUnitImpl result = null; fontFace(); break; default: - jj_la1[260] = jj_gen; + jj_la1[254] = jj_gen; ret = skipStatement(); if ((ret == null) || (ret.length() == 0)) { {if (true) return;} @@ -6447,15 +6384,15 @@ LexicalUnitImpl result = null; } final public void _parseImportRule() throws ParseException { - label_173: + label_170: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[261] = jj_gen; - break label_173; + jj_la1[255] = jj_gen; + break label_170; } jj_consume_token(S); } @@ -6463,15 +6400,15 @@ LexicalUnitImpl result = null; } final public void _parseMediaRule() throws ParseException { - label_174: + label_171: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[262] = jj_gen; - break label_174; + jj_la1[256] = jj_gen; + break label_171; } jj_consume_token(S); } @@ -6479,15 +6416,15 @@ LexicalUnitImpl result = null; } final public void _parseDeclarationBlock() throws ParseException { - label_175: + label_172: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[263] = jj_gen; - break label_175; + jj_la1[257] = jj_gen; + break label_172; } jj_consume_token(S); } @@ -6497,29 +6434,29 @@ LexicalUnitImpl result = null; declaration(); break; default: - jj_la1[264] = jj_gen; + jj_la1[258] = jj_gen; ; } - label_176: + label_173: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: ; break; default: - jj_la1[265] = jj_gen; - break label_176; + jj_la1[259] = jj_gen; + break label_173; } jj_consume_token(SEMICOLON); - label_177: + label_174: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[266] = jj_gen; - break label_177; + jj_la1[260] = jj_gen; + break label_174; } jj_consume_token(S); } @@ -6529,7 +6466,7 @@ LexicalUnitImpl result = null; declaration(); break; default: - jj_la1[267] = jj_gen; + jj_la1[261] = jj_gen; ; } } @@ -6538,15 +6475,15 @@ LexicalUnitImpl result = null; final public ArrayList<String> _parseSelectors() throws ParseException { ArrayList<String> p = null; try { - label_178: + label_175: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[268] = jj_gen; - break label_178; + jj_la1[262] = jj_gen; + break label_175; } jj_consume_token(S); } @@ -6628,7 +6565,7 @@ LexicalUnitImpl result = null; finally { jj_save(8, xla); } } - private boolean jj_3R_200() { + private boolean jj_3R_194() { if (jj_scan_token(VARIABLE)) return true; Token xsp; while (true) { @@ -6643,10 +6580,10 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_182() { + private boolean jj_3R_179() { Token xsp; xsp = jj_scanpos; - if (jj_3R_200()) jj_scanpos = xsp; + if (jj_3R_194()) jj_scanpos = xsp; if (jj_scan_token(CONTAINS)) return true; while (true) { xsp = jj_scanpos; @@ -6656,12 +6593,12 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_218() { - if (jj_3R_217()) return true; + private boolean jj_3R_212() { + if (jj_3R_211()) return true; return false; } - private boolean jj_3R_217() { + private boolean jj_3R_211() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(18)) { @@ -6678,64 +6615,64 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_179() { - if (jj_3R_189()) return true; + private boolean jj_3R_191() { + if (jj_scan_token(S)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_212()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_176() { + if (jj_3R_186()) return true; if (jj_scan_token(COLON)) return true; Token xsp; while (true) { xsp = jj_scanpos; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } - if (jj_3R_190()) return true; + if (jj_3R_187()) return true; xsp = jj_scanpos; - if (jj_3R_191()) jj_scanpos = xsp; - if (jj_3R_192()) return true; + if (jj_3R_188()) jj_scanpos = xsp; + if (jj_3R_189()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_192()) { jj_scanpos = xsp; break; } + if (jj_3R_189()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_194() { - if (jj_scan_token(S)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_218()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_193() { - if (jj_3R_217()) return true; + private boolean jj_3R_190() { + if (jj_3R_211()) return true; return false; } - private boolean jj_3R_180() { + private boolean jj_3R_177() { Token xsp; xsp = jj_scanpos; - if (jj_3R_193()) { + if (jj_3R_190()) { jj_scanpos = xsp; - if (jj_3R_194()) return true; + if (jj_3R_191()) return true; } return false; } - private boolean jj_3R_220() { + private boolean jj_3R_262() { if (jj_scan_token(HASH)) return true; return false; } private boolean jj_3_7() { - if (jj_3R_186()) return true; + if (jj_3R_183()) return true; return false; } - private boolean jj_3R_290() { + private boolean jj_3R_279() { if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_291() { + private boolean jj_3R_280() { if (jj_scan_token(FUNCTION)) return true; Token xsp; while (true) { @@ -6746,42 +6683,42 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_207() { + private boolean jj_3R_201() { if (jj_scan_token(LBRACE)) return true; return false; } - private boolean jj_3R_289() { + private boolean jj_3R_278() { if (jj_scan_token(COLON)) return true; return false; } - private boolean jj_3R_206() { - if (jj_3R_190()) return true; + private boolean jj_3R_200() { + if (jj_3R_187()) return true; return false; } - private boolean jj_3R_222() { + private boolean jj_3R_265() { if (jj_scan_token(COLON)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_289()) jj_scanpos = xsp; + if (jj_3R_278()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_290()) { + if (jj_3R_279()) { jj_scanpos = xsp; - if (jj_3R_291()) return true; + if (jj_3R_280()) return true; } return false; } private boolean jj_3_6() { - if (jj_3R_185()) return true; + if (jj_3R_182()) return true; if (jj_scan_token(LBRACE)) return true; return false; } - private boolean jj_3R_186() { - if (jj_3R_205()) return true; + private boolean jj_3R_183() { + if (jj_3R_199()) return true; if (jj_scan_token(COLON)) return true; Token xsp; while (true) { @@ -6789,19 +6726,19 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_206()) { + if (jj_3R_200()) { jj_scanpos = xsp; - if (jj_3R_207()) return true; + if (jj_3R_201()) return true; } return false; } - private boolean jj_3R_269() { - if (jj_3R_190()) return true; + private boolean jj_3R_268() { + if (jj_3R_187()) return true; return false; } - private boolean jj_3R_259() { + private boolean jj_3R_254() { if (jj_scan_token(FUNCTION)) return true; Token xsp; while (true) { @@ -6809,85 +6746,85 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_269()) jj_scanpos = xsp; + if (jj_3R_268()) jj_scanpos = xsp; if (jj_scan_token(RPARAN)) return true; return false; } - private boolean jj_3R_250() { - if (jj_3R_263()) return true; + private boolean jj_3R_241() { + if (jj_3R_258()) return true; return false; } - private boolean jj_3R_249() { - if (jj_3R_262()) return true; + private boolean jj_3R_240() { + if (jj_3R_257()) return true; return false; } - private boolean jj_3R_248() { - if (jj_3R_261()) return true; + private boolean jj_3R_239() { + if (jj_3R_256()) return true; return false; } - private boolean jj_3R_310() { + private boolean jj_3R_290() { if (jj_scan_token(STRING)) return true; return false; } - private boolean jj_3R_308() { + private boolean jj_3R_288() { if (jj_scan_token(STARMATCH)) return true; return false; } - private boolean jj_3R_309() { - if (jj_scan_token(IDENT)) return true; + private boolean jj_3R_287() { + if (jj_scan_token(DOLLARMATCH)) return true; return false; } - private boolean jj_3R_307() { - if (jj_scan_token(DOLLARMATCH)) return true; + private boolean jj_3R_289() { + if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_306() { + private boolean jj_3R_286() { if (jj_scan_token(CARETMATCH)) return true; return false; } - private boolean jj_3R_305() { + private boolean jj_3R_285() { if (jj_scan_token(DASHMATCH)) return true; return false; } - private boolean jj_3R_304() { + private boolean jj_3R_284() { if (jj_scan_token(INCLUDES)) return true; return false; } - private boolean jj_3R_271() { + private boolean jj_3R_270() { if (jj_scan_token(INTERPOLATION)) return true; return false; } - private boolean jj_3R_303() { + private boolean jj_3R_283() { if (jj_scan_token(EQ)) return true; return false; } - private boolean jj_3R_296() { + private boolean jj_3R_277() { Token xsp; xsp = jj_scanpos; - if (jj_3R_303()) { + if (jj_3R_283()) { jj_scanpos = xsp; - if (jj_3R_304()) { + if (jj_3R_284()) { jj_scanpos = xsp; - if (jj_3R_305()) { + if (jj_3R_285()) { jj_scanpos = xsp; - if (jj_3R_306()) { + if (jj_3R_286()) { jj_scanpos = xsp; - if (jj_3R_307()) { + if (jj_3R_287()) { jj_scanpos = xsp; - if (jj_3R_308()) return true; + if (jj_3R_288()) return true; } } } @@ -6898,9 +6835,9 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_309()) { + if (jj_3R_289()) { jj_scanpos = xsp; - if (jj_3R_310()) return true; + if (jj_3R_290()) return true; } while (true) { xsp = jj_scanpos; @@ -6909,7 +6846,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_223() { + private boolean jj_3R_264() { if (jj_scan_token(LBRACKET)) return true; Token xsp; while (true) { @@ -6922,12 +6859,12 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_296()) jj_scanpos = xsp; + if (jj_3R_277()) jj_scanpos = xsp; if (jj_scan_token(RBRACKET)) return true; return false; } - private boolean jj_3R_183() { + private boolean jj_3R_180() { if (jj_scan_token(COMMA)) return true; Token xsp; while (true) { @@ -6937,30 +6874,30 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_302() { + private boolean jj_3R_282() { if (jj_scan_token(INTERPOLATION)) return true; return false; } - private boolean jj_3R_257() { + private boolean jj_3R_248() { if (jj_scan_token(PARENT)) return true; return false; } - private boolean jj_3R_256() { + private boolean jj_3R_247() { if (jj_scan_token(ANY)) return true; return false; } - private boolean jj_3R_260() { + private boolean jj_3R_255() { if (jj_scan_token(DOT)) return true; return false; } - private boolean jj_3R_247() { + private boolean jj_3R_238() { Token xsp; xsp = jj_scanpos; - if (jj_3R_260()) jj_scanpos = xsp; + if (jj_3R_255()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_scan_token(72)) { jj_scanpos = xsp; @@ -6978,71 +6915,71 @@ LexicalUnitImpl result = null; private boolean jj_3_5() { Token xsp; xsp = jj_scanpos; - if (jj_3R_183()) jj_scanpos = xsp; - if (jj_3R_184()) return true; + if (jj_3R_180()) jj_scanpos = xsp; + if (jj_3R_181()) return true; return false; } - private boolean jj_3R_266() { + private boolean jj_3R_261() { Token xsp; xsp = jj_scanpos; - if (jj_3R_270()) { + if (jj_3R_269()) { jj_scanpos = xsp; - if (jj_3R_271()) return true; + if (jj_3R_270()) return true; } return false; } - private boolean jj_3R_270() { + private boolean jj_3R_269() { if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_246() { + private boolean jj_3R_237() { if (jj_scan_token(STRING)) return true; return false; } - private boolean jj_3R_219() { + private boolean jj_3R_213() { Token xsp; xsp = jj_scanpos; - if (jj_3R_255()) { + if (jj_3R_246()) { jj_scanpos = xsp; - if (jj_3R_256()) { + if (jj_3R_247()) { jj_scanpos = xsp; - if (jj_3R_257()) return true; + if (jj_3R_248()) return true; } } return false; } - private boolean jj_3R_255() { + private boolean jj_3R_246() { Token xsp; - if (jj_3R_266()) return true; + if (jj_3R_261()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_266()) { jj_scanpos = xsp; break; } + if (jj_3R_261()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_245() { - if (jj_3R_259()) return true; + private boolean jj_3R_236() { + if (jj_3R_254()) return true; return false; } - private boolean jj_3R_202() { + private boolean jj_3R_196() { Token xsp; xsp = jj_scanpos; - if (jj_3R_246()) { + if (jj_3R_237()) { jj_scanpos = xsp; - if (jj_3R_247()) { + if (jj_3R_238()) { jj_scanpos = xsp; - if (jj_3R_248()) { + if (jj_3R_239()) { jj_scanpos = xsp; - if (jj_3R_249()) { + if (jj_3R_240()) { jj_scanpos = xsp; - if (jj_3R_250()) return true; + if (jj_3R_241()) return true; } } } @@ -7050,394 +6987,273 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_244() { + private boolean jj_3R_235() { if (jj_scan_token(DIMEN)) return true; return false; } - private boolean jj_3R_301() { - if (jj_scan_token(IDENT)) return true; - return false; - } - - private boolean jj_3R_284() { + private boolean jj_3R_276() { Token xsp; xsp = jj_scanpos; - if (jj_3R_301()) { + if (jj_3R_281()) { jj_scanpos = xsp; - if (jj_3R_302()) return true; + if (jj_3R_282()) return true; } return false; } - private boolean jj_3R_243() { + private boolean jj_3R_281() { + if (jj_scan_token(IDENT)) return true; + return false; + } + + private boolean jj_3R_234() { if (jj_scan_token(KHZ)) return true; return false; } - private boolean jj_3R_300() { - if (jj_3R_222()) return true; + private boolean jj_3R_233() { + if (jj_scan_token(HZ)) return true; return false; } - private boolean jj_3R_221() { + private boolean jj_3R_263() { if (jj_scan_token(DOT)) return true; Token xsp; - if (jj_3R_284()) return true; + if (jj_3R_276()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_284()) { jj_scanpos = xsp; break; } + if (jj_3R_276()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_242() { - if (jj_scan_token(HZ)) return true; + private boolean jj_3R_232() { + if (jj_scan_token(MS)) return true; return false; } - private boolean jj_3R_298() { - if (jj_3R_221()) return true; + private boolean jj_3R_231() { + if (jj_scan_token(SECOND)) return true; return false; } - private boolean jj_3R_241() { - if (jj_scan_token(MS)) return true; + private boolean jj_3R_230() { + if (jj_scan_token(GRAD)) return true; return false; } - private boolean jj_3R_293() { - if (jj_3R_221()) return true; + private boolean jj_3R_252() { + if (jj_3R_265()) return true; return false; } - private boolean jj_3R_295() { - if (jj_3R_222()) return true; + private boolean jj_3R_275() { + if (jj_3R_265()) return true; return false; } - private boolean jj_3R_283() { - if (jj_3R_222()) return true; + private boolean jj_3R_229() { + if (jj_scan_token(RAD)) return true; return false; } - private boolean jj_3R_286() { - if (jj_3R_221()) return true; + private boolean jj_3R_228() { + if (jj_scan_token(DEG)) return true; return false; } - private boolean jj_3R_288() { - if (jj_3R_222()) return true; + private boolean jj_3R_273() { + if (jj_3R_263()) return true; return false; } - private boolean jj_3R_240() { - if (jj_scan_token(SECOND)) return true; + private boolean jj_3R_227() { + if (jj_scan_token(EXS)) return true; return false; } - private boolean jj_3R_239() { - if (jj_scan_token(GRAD)) return true; + private boolean jj_3R_250() { + if (jj_3R_263()) return true; return false; } - private boolean jj_3R_238() { - if (jj_scan_token(RAD)) return true; + private boolean jj_3R_226() { + if (jj_scan_token(REM)) return true; return false; } - private boolean jj_3R_237() { - if (jj_scan_token(DEG)) return true; + private boolean jj_3R_225() { + if (jj_scan_token(LEM)) return true; return false; } - private boolean jj_3R_299() { - if (jj_3R_223()) return true; + private boolean jj_3R_224() { + if (jj_scan_token(EMS)) return true; return false; } - private boolean jj_3R_236() { - if (jj_scan_token(EXS)) return true; + private boolean jj_3R_223() { + if (jj_scan_token(PX)) return true; return false; } - private boolean jj_3R_276() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_297()) { - jj_scanpos = xsp; - if (jj_3R_298()) { - jj_scanpos = xsp; - if (jj_3R_299()) { - jj_scanpos = xsp; - if (jj_3R_300()) return true; - } - } - } + private boolean jj_3R_251() { + if (jj_3R_264()) return true; return false; } - private boolean jj_3R_297() { - if (jj_3R_220()) return true; + private boolean jj_3R_274() { + if (jj_3R_264()) return true; return false; } - private boolean jj_3R_235() { - if (jj_scan_token(REM)) return true; + private boolean jj_3R_222() { + if (jj_scan_token(IN)) return true; return false; } - private boolean jj_3R_275() { + private boolean jj_3R_271() { Token xsp; xsp = jj_scanpos; - if (jj_3R_292()) { + if (jj_3R_272()) { jj_scanpos = xsp; - if (jj_3R_293()) { + if (jj_3R_273()) { jj_scanpos = xsp; - if (jj_3R_294()) { + if (jj_3R_274()) { jj_scanpos = xsp; - if (jj_3R_295()) return true; + if (jj_3R_275()) return true; } } } return false; } - private boolean jj_3R_292() { - if (jj_3R_220()) return true; + private boolean jj_3R_272() { + if (jj_3R_262()) return true; return false; } - private boolean jj_3R_280() { - if (jj_3R_222()) return true; + private boolean jj_3R_221() { + if (jj_scan_token(PC)) return true; return false; } - private boolean jj_3R_274() { + private boolean jj_3R_214() { Token xsp; xsp = jj_scanpos; - if (jj_3R_285()) { + if (jj_3R_249()) { jj_scanpos = xsp; - if (jj_3R_286()) { + if (jj_3R_250()) { jj_scanpos = xsp; - if (jj_3R_287()) { + if (jj_3R_251()) { jj_scanpos = xsp; - if (jj_3R_288()) return true; - } - } + if (jj_3R_252()) return true; } - return false; - } - - private boolean jj_3R_285() { - if (jj_3R_220()) return true; - return false; - } - - private boolean jj_3R_294() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_234() { - if (jj_scan_token(LEM)) return true; - return false; - } - - private boolean jj_3R_282() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_287() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_233() { - if (jj_scan_token(EMS)) return true; - return false; - } - - private boolean jj_3R_273() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_281()) { - jj_scanpos = xsp; - if (jj_3R_282()) { - jj_scanpos = xsp; - if (jj_3R_283()) return true; } } return false; } - private boolean jj_3R_278() { - if (jj_3R_221()) return true; - return false; - } - - private boolean jj_3R_281() { - if (jj_3R_221()) return true; - return false; - } - - private boolean jj_3R_232() { - if (jj_scan_token(PX)) return true; - return false; - } - - private boolean jj_3R_231() { - if (jj_scan_token(IN)) return true; - return false; - } - - private boolean jj_3R_230() { - if (jj_scan_token(PC)) return true; + private boolean jj_3R_249() { + if (jj_3R_262()) return true; return false; } - private boolean jj_3R_229() { + private boolean jj_3R_220() { if (jj_scan_token(MM)) return true; return false; } - private boolean jj_3R_199() { - if (jj_3R_223()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_276()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_198() { - if (jj_3R_222()) return true; + private boolean jj_3R_193() { Token xsp; + if (jj_3R_214()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_275()) { jj_scanpos = xsp; break; } + if (jj_3R_214()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_228() { + private boolean jj_3R_219() { if (jj_scan_token(CM)) return true; return false; } - private boolean jj_3R_279() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_197() { - if (jj_3R_221()) return true; + private boolean jj_3R_192() { + if (jj_3R_213()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_274()) { jj_scanpos = xsp; break; } + if (jj_3R_271()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_227() { + private boolean jj_3R_218() { if (jj_scan_token(PT)) return true; return false; } - private boolean jj_3R_196() { - if (jj_3R_220()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_273()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_272() { + private boolean jj_3R_178() { Token xsp; xsp = jj_scanpos; - if (jj_3R_277()) { - jj_scanpos = xsp; - if (jj_3R_278()) { + if (jj_3R_192()) { jj_scanpos = xsp; - if (jj_3R_279()) { - jj_scanpos = xsp; - if (jj_3R_280()) return true; - } - } + if (jj_3R_193()) return true; } return false; } - private boolean jj_3R_277() { - if (jj_3R_220()) return true; + private boolean jj_3R_217() { + if (jj_scan_token(PERCENTAGE)) return true; return false; } - private boolean jj_3R_226() { - if (jj_scan_token(PERCENTAGE)) return true; + private boolean jj_3R_243() { + if (jj_3R_211()) return true; + if (jj_3R_178()) return true; return false; } - private boolean jj_3R_209() { - if (jj_3R_254()) return true; + private boolean jj_3R_203() { + if (jj_3R_245()) return true; return false; } - private boolean jj_3R_195() { - if (jj_3R_219()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_272()) { jj_scanpos = xsp; break; } - } + private boolean jj_3R_216() { + if (jj_scan_token(NUMBER)) return true; return false; } - private boolean jj_3R_225() { - if (jj_scan_token(NUMBER)) return true; + private boolean jj_3R_215() { + if (jj_3R_253()) return true; return false; } - private boolean jj_3R_181() { + private boolean jj_3R_195() { Token xsp; xsp = jj_scanpos; - if (jj_3R_195()) { + if (jj_3R_215()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_216()) { jj_scanpos = xsp; - if (jj_3R_196()) { + if (jj_3R_217()) { jj_scanpos = xsp; - if (jj_3R_197()) { + if (jj_3R_218()) { jj_scanpos = xsp; - if (jj_3R_198()) { + if (jj_3R_219()) { + jj_scanpos = xsp; + if (jj_3R_220()) { + jj_scanpos = xsp; + if (jj_3R_221()) { + jj_scanpos = xsp; + if (jj_3R_222()) { + jj_scanpos = xsp; + if (jj_3R_223()) { + jj_scanpos = xsp; + if (jj_3R_224()) { jj_scanpos = xsp; - if (jj_3R_199()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_224() { - if (jj_3R_258()) return true; - return false; - } - - private boolean jj_3R_252() { - if (jj_3R_217()) return true; - if (jj_3R_181()) return true; - return false; - } - - private boolean jj_3R_201() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_224()) jj_scanpos = xsp; - xsp = jj_scanpos; if (jj_3R_225()) { jj_scanpos = xsp; if (jj_3R_226()) { @@ -7460,25 +7276,7 @@ LexicalUnitImpl result = null; jj_scanpos = xsp; if (jj_3R_235()) { jj_scanpos = xsp; - if (jj_3R_236()) { - jj_scanpos = xsp; - if (jj_3R_237()) { - jj_scanpos = xsp; - if (jj_3R_238()) { - jj_scanpos = xsp; - if (jj_3R_239()) { - jj_scanpos = xsp; - if (jj_3R_240()) { - jj_scanpos = xsp; - if (jj_3R_241()) { - jj_scanpos = xsp; - if (jj_3R_242()) { - jj_scanpos = xsp; - if (jj_3R_243()) { - jj_scanpos = xsp; - if (jj_3R_244()) { - jj_scanpos = xsp; - if (jj_3R_245()) return true; + if (jj_3R_236()) return true; } } } @@ -7502,12 +7300,12 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_184() { + private boolean jj_3R_181() { Token xsp; xsp = jj_scanpos; - if (jj_3R_201()) { + if (jj_3R_195()) { jj_scanpos = xsp; - if (jj_3R_202()) return true; + if (jj_3R_196()) return true; } while (true) { xsp = jj_scanpos; @@ -7516,121 +7314,121 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_261() { + private boolean jj_3R_256() { if (jj_scan_token(HASH)) return true; return false; } - private boolean jj_3R_254() { - if (jj_3R_189()) return true; + private boolean jj_3R_245() { + if (jj_3R_186()) return true; return false; } - private boolean jj_3R_262() { + private boolean jj_3R_257() { if (jj_scan_token(URL)) return true; return false; } - private boolean jj_3R_208() { - if (jj_3R_184()) return true; + private boolean jj_3_2() { + if (jj_3R_177()) return true; + if (jj_3R_178()) return true; return false; } - private boolean jj_3R_187() { + private boolean jj_3R_202() { + if (jj_3R_181()) return true; + return false; + } + + private boolean jj_3R_184() { Token xsp; xsp = jj_scanpos; - if (jj_3R_208()) { + if (jj_3R_202()) { jj_scanpos = xsp; - if (jj_3R_209()) return true; + if (jj_3R_203()) return true; } return false; } private boolean jj_3_9() { - if (jj_3R_188()) return true; - return false; - } - - private boolean jj_3_2() { - if (jj_3R_180()) return true; - if (jj_3R_181()) return true; + if (jj_3R_185()) return true; return false; } - private boolean jj_3R_204() { + private boolean jj_3R_198() { if (jj_scan_token(COMMA)) return true; Token xsp; while (true) { xsp = jj_scanpos; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } - if (jj_3R_203()) return true; + if (jj_3R_197()) return true; return false; } - private boolean jj_3R_251() { - if (jj_3R_181()) return true; + private boolean jj_3R_242() { + if (jj_3R_178()) return true; return false; } - private boolean jj_3R_268() { + private boolean jj_3R_197() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_242()) { + jj_scanpos = xsp; + if (jj_3R_243()) return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3_2()) { jj_scanpos = xsp; break; } + } + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_267() { if (jj_scan_token(PLUS)) return true; return false; } - private boolean jj_3R_258() { + private boolean jj_3R_253() { Token xsp; xsp = jj_scanpos; - if (jj_3R_267()) { + if (jj_3R_266()) { jj_scanpos = xsp; - if (jj_3R_268()) return true; + if (jj_3R_267()) return true; } return false; } - private boolean jj_3R_267() { + private boolean jj_3R_266() { if (jj_scan_token(MINUS)) return true; return false; } - private boolean jj_3R_263() { + private boolean jj_3R_258() { if (jj_scan_token(UNICODERANGE)) return true; return false; } - private boolean jj_3R_203() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_251()) { - jj_scanpos = xsp; - if (jj_3R_252()) return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_3_2()) { jj_scanpos = xsp; break; } - } - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - private boolean jj_3_8() { Token xsp; xsp = jj_scanpos; if (jj_3_9()) jj_scanpos = xsp; - if (jj_3R_187()) return true; + if (jj_3R_184()) return true; return false; } private boolean jj_3_4() { - if (jj_3R_182()) return true; + if (jj_3R_179()) return true; return false; } - private boolean jj_3R_190() { - if (jj_3R_187()) return true; + private boolean jj_3R_187() { + if (jj_3R_184()) return true; Token xsp; while (true) { xsp = jj_scanpos; @@ -7639,22 +7437,22 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3_1() { - if (jj_3R_179()) return true; - return false; - } - - private boolean jj_3R_185() { - if (jj_3R_203()) return true; + private boolean jj_3R_182() { + if (jj_3R_197()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_204()) { jj_scanpos = xsp; break; } + if (jj_3R_198()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_215() { + private boolean jj_3_1() { + if (jj_3R_176()) return true; + return false; + } + + private boolean jj_3R_209() { if (jj_scan_token(MINUS)) return true; Token xsp; if (jj_scan_token(1)) return true; @@ -7665,7 +7463,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_214() { + private boolean jj_3R_208() { if (jj_scan_token(PLUS)) return true; Token xsp; if (jj_scan_token(1)) return true; @@ -7677,11 +7475,11 @@ LexicalUnitImpl result = null; } private boolean jj_3_3() { - if (jj_3R_179()) return true; + if (jj_3R_176()) return true; return false; } - private boolean jj_3R_213() { + private boolean jj_3R_207() { if (jj_scan_token(MOD)) return true; Token xsp; while (true) { @@ -7691,7 +7489,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_212() { + private boolean jj_3R_206() { if (jj_scan_token(ANY)) return true; Token xsp; while (true) { @@ -7701,7 +7499,12 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_211() { + private boolean jj_3R_260() { + if (jj_scan_token(INTERPOLATION)) return true; + return false; + } + + private boolean jj_3R_205() { if (jj_scan_token(DIV)) return true; Token xsp; while (true) { @@ -7711,7 +7514,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_210() { + private boolean jj_3R_204() { if (jj_scan_token(COMMA)) return true; Token xsp; while (true) { @@ -7721,20 +7524,20 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_188() { + private boolean jj_3R_185() { Token xsp; xsp = jj_scanpos; - if (jj_3R_210()) { + if (jj_3R_204()) { jj_scanpos = xsp; - if (jj_3R_211()) { + if (jj_3R_205()) { jj_scanpos = xsp; - if (jj_3R_212()) { + if (jj_3R_206()) { jj_scanpos = xsp; - if (jj_3R_213()) { + if (jj_3R_207()) { jj_scanpos = xsp; - if (jj_3R_214()) { + if (jj_3R_208()) { jj_scanpos = xsp; - if (jj_3R_215()) return true; + if (jj_3R_209()) return true; } } } @@ -7743,12 +7546,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_265() { - if (jj_scan_token(INTERPOLATION)) return true; - return false; - } - - private boolean jj_3R_216() { + private boolean jj_3R_210() { if (jj_scan_token(GUARDED_SYM)) return true; Token xsp; while (true) { @@ -7758,8 +7556,8 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_192() { - if (jj_scan_token(SEMICOLON)) return true; + private boolean jj_3R_186() { + if (jj_scan_token(VARIABLE)) return true; Token xsp; while (true) { xsp = jj_scanpos; @@ -7769,7 +7567,7 @@ LexicalUnitImpl result = null; } private boolean jj_3R_189() { - if (jj_scan_token(VARIABLE)) return true; + if (jj_scan_token(SEMICOLON)) return true; Token xsp; while (true) { xsp = jj_scanpos; @@ -7778,27 +7576,27 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_253() { + private boolean jj_3R_244() { Token xsp; xsp = jj_scanpos; - if (jj_3R_264()) { + if (jj_3R_259()) { jj_scanpos = xsp; - if (jj_3R_265()) return true; + if (jj_3R_260()) return true; } return false; } - private boolean jj_3R_264() { + private boolean jj_3R_259() { if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_205() { + private boolean jj_3R_199() { Token xsp; - if (jj_3R_253()) return true; + if (jj_3R_244()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_253()) { jj_scanpos = xsp; break; } + if (jj_3R_244()) { jj_scanpos = xsp; break; } } while (true) { xsp = jj_scanpos; @@ -7807,8 +7605,8 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_191() { - if (jj_3R_216()) return true; + private boolean jj_3R_188() { + if (jj_3R_210()) return true; return false; } @@ -7822,7 +7620,7 @@ LexicalUnitImpl result = null; private Token jj_scanpos, jj_lastpos; private int jj_la; private int jj_gen; - final private int[] jj_la1 = new int[269]; + final private int[] jj_la1 = new int[263]; static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; @@ -7834,16 +7632,16 @@ LexicalUnitImpl result = null; jj_la1_init_3(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x0,0x302,0x302,0x0,0x300,0x2,0x2,0x2,0xd4c40000,0x0,0x300,0x2,0x300,0x2,0x0,0x2,0x2,0x2,0x0,0x0,0x2,0x2,0x0,0x0,0x2,0x0,0x2,0x100000,0x2,0x0,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x2,0x2,0xd4fd1500,0xd4fd1500,0x2,0x2,0x2,0x0,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x391500,0xc40000,0xc40002,0xc40000,0x2,0x2,0x80120002,0x80120002,0x2,0x0,0x0,0x2,0x2,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0xd4c40000,0x2,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0xd4000000,0x0,0x0,0x0,0x0,0x50000000,0x2,0x2,0x3f000,0x2,0x0,0x2,0x3f000,0x0,0x2,0x0,0x2,0x0,0x2,0x200000,0x0,0xd4c40000,0x0,0x134e0002,0x2,0xd4c40000,0xd4c40000,0x2,0x0,0x2,0x134e0002,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x134e0002,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0x0,0x2,0x2,0x100000,0x0,0x0,0x800c0000,0x2,0x0,0x100000,0x2,0x800c0000,0x2,0x0,0x800c0000,0x2,0x2,0x0,0x200400,0x2,0x200000,0x2,0xd4c40000,0xd4c40000,0x2,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x0,0x2,0x2,0x0,0x2,0x2,0x2,0x200000,0x2,0x2,0x200000,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x0,0xd4c40000,0x2,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x800c0400,0x2,0x0,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x321c0000,0xc0000,0x800c0000,0xc0000,0x0,0x80000000,0x0,0x80000000,0x800c0000,0x2,0x2,0x800c0000,0x2,0xd4c40000,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,}; + jj_la1_0 = new int[] {0x0,0x302,0x302,0x0,0x300,0x2,0x2,0x2,0xd4c40000,0x0,0x300,0x2,0x300,0x2,0x0,0x2,0x2,0x2,0x0,0x0,0x2,0x2,0x0,0x0,0x2,0x0,0x2,0x100000,0x2,0x0,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x2,0x2,0xd4fd1500,0x2,0xd4fd1500,0x2,0x2,0x0,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x391500,0xc40000,0xc40002,0xc40000,0x2,0x2,0x80120002,0x80120002,0x2,0x0,0x0,0x2,0x2,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0xd4c40000,0x2,0x84000000,0x84000000,0x84000000,0x84000000,0xd4000000,0x0,0x0,0x0,0x0,0x50000000,0x2,0x2,0x3f000,0x2,0x0,0x2,0x3f000,0x0,0x2,0x0,0x2,0x0,0x2,0x200000,0x0,0xd4c40000,0x0,0x134e0002,0x2,0xd4c40000,0xd4c40000,0x2,0x0,0x2,0x134e0002,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x134e0002,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0x0,0x2,0x2,0x100000,0x0,0x0,0x800c0000,0x2,0x0,0x100000,0x2,0x800c0000,0x2,0x0,0x800c0000,0x2,0x2,0x0,0x200400,0x2,0x200000,0x2,0xd4c40000,0xd4c40000,0x2,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x0,0x2,0x2,0x0,0x2,0x2,0x2,0x200000,0x2,0x2,0x200000,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x0,0xd4c40000,0x2,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x800c0400,0x2,0x0,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x321c0000,0xc0000,0x800c0000,0xc0000,0x0,0x80000000,0x0,0x80000000,0x800c0000,0x2,0x2,0x800c0000,0x2,0xd4c40000,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,}; } private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x566000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x80,0x0,0x0,0x120000,0x120000,0x0,0x120000,0x0,0x0,0x0,0x120000,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x60001c0,0x60001c0,0x0,0x0,0x0,0x0,0x40,0x0,0x80,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0xc2,0xc2,0x0,0x80,0x80,0x0,0x0,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0xc0,0x0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x50000000,0x64000c0,0x50000000,0x3f,0x0,0x564000c0,0x564000c0,0x0,0x80000000,0x0,0x3f,0x0,0x0,0x564000c0,0x564000c0,0x0,0x3f,0x0,0x0,0x0,0x0,0x0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x40,0x160040,0x0,0x40,0x0,0x0,0x160040,0x0,0x40,0x160000,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x61200c0,0x61200c0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x6000000,0x0,0x0,0x60000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x6000000,0xc0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x160000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x160000,0x0,0x0,0x0,0x160000,0x160000,0x160000,0x0,0x0,0x160000,0x0,0x60000c0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,}; + jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x566000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x80,0x0,0x0,0x120000,0x120000,0x0,0x120000,0x0,0x0,0x0,0x120000,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x60001c0,0x0,0x60001c0,0x0,0x0,0x0,0x40,0x0,0x80,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0xc2,0xc2,0x0,0x80,0x80,0x0,0x0,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0xc0,0x0,0x40,0x40,0x40,0x40,0xc0,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x50000000,0x64000c0,0x50000000,0x3f,0x0,0x564000c0,0x564000c0,0x0,0x80000000,0x0,0x3f,0x0,0x0,0x564000c0,0x564000c0,0x0,0x3f,0x0,0x0,0x0,0x0,0x0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x40,0x160040,0x0,0x40,0x0,0x0,0x160040,0x0,0x40,0x160000,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x61200c0,0x61200c0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x6000000,0x0,0x0,0x60000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x6000000,0xc0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x160000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x160000,0x0,0x0,0x0,0x160000,0x160000,0x160000,0x0,0x0,0x160000,0x0,0x60000c0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,}; } private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x1000,0x0,0x0,0x0,0x0,0x880,0x0,0x0,0x0,0x100,0x100,0x0,0x0,0x2008,0x2008,0x0,0x2000,0x0,0x0,0x0,0x2000,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x2b80,0x2b80,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x2a80,0x0,0x0,0x0,0x0,0x0,0x380,0x380,0x0,0x100,0x100,0x0,0x0,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x100,0x100,0x100,0x100,0x100,0x0,0x0,0x0,0x0,0x180,0x0,0x0,0x0,0x0,0x100,0x0,0x40,0x0,0x0,0x0,0x109,0x1000,0x1300,0x0,0x1109,0x1109,0x0,0x0,0x0,0x1300,0x20,0x0,0x1109,0x1109,0x0,0x1300,0x0,0x0,0x0,0x1100,0x0,0x1109,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x1109,0x1109,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x1000,0x1000,0xfffffb80,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0x0,0xfffffb80,0x0,0x0,0x1100,0x0,0x0,0x0,0x0,0x2100,0x2100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0xfffffb80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0xffffe200,0x0,0x100,0x980,0xffffeb80,0x0,0x0,0xfffffb80,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,}; + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x1000,0x0,0x0,0x0,0x0,0x880,0x0,0x0,0x0,0x100,0x100,0x0,0x0,0x2008,0x2008,0x0,0x2000,0x0,0x0,0x0,0x2000,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x2b88,0x0,0x2b88,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x2a80,0x0,0x0,0x0,0x0,0x0,0x380,0x380,0x0,0x100,0x100,0x0,0x0,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x100,0x100,0x100,0x100,0x100,0x100,0x0,0x0,0x0,0x0,0x180,0x0,0x0,0x0,0x0,0x100,0x0,0x40,0x0,0x0,0x0,0x109,0x1000,0x1300,0x0,0x1109,0x1109,0x0,0x0,0x0,0x1300,0x20,0x0,0x1109,0x1109,0x0,0x1300,0x0,0x0,0x0,0x1100,0x0,0x1109,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x1109,0x1109,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x1000,0x1000,0xfffffb80,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0x0,0xfffffb80,0x0,0x0,0x1100,0x0,0x0,0x0,0x0,0x2100,0x2100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0xfffffb80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0xffffe200,0x0,0x100,0x980,0xffffeb80,0x0,0x0,0xfffffb80,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,}; } private static void jj_la1_init_3() { - jj_la1_3 = new int[] {0x8,0x80,0x80,0x2,0x80,0x0,0x0,0x0,0x75,0x0,0x80,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0xc5,0x0,0x0,0x0,0xc401bf,0xc401bf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc401be,0x0,0x0,0x0,0x0,0x0,0x400000,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc7,0xc7,0x0,0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x0,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x45,0x80,0x200000,0x0,0xe5,0xe5,0x0,0x0,0x0,0x200000,0x0,0x0,0xe5,0xe5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0xf5,0xf5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x440001,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x1,0x1,0x0,0x0,0x0,0x380000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x400000,0x0,0x0,0x40001,0x440001,0x0,0x0,0x440001,0x0,0x37,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; + jj_la1_3 = new int[] {0x8,0x80,0x80,0x2,0x80,0x0,0x0,0x0,0x75,0x0,0x80,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0xc5,0x0,0x0,0x0,0xc401bf,0x0,0xc401bf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc401be,0x0,0x0,0x0,0x0,0x0,0x400000,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc7,0xc7,0x0,0x0,0x0,0x1,0x0,0x1,0x1,0x1,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x45,0x80,0x200000,0x0,0xe5,0xe5,0x0,0x0,0x0,0x200000,0x0,0x0,0xe5,0xe5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0xf5,0xf5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x440001,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x1,0x1,0x0,0x0,0x0,0x380000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x400000,0x0,0x0,0x40001,0x440001,0x0,0x0,0x440001,0x0,0x37,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; } final private JJCalls[] jj_2_rtns = new JJCalls[9]; private boolean jj_rescan = false; @@ -7855,7 +7653,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 269; i++) jj_la1[i] = -1; + for (int i = 0; i < 263; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -7865,7 +7663,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 269; i++) jj_la1[i] = -1; + for (int i = 0; i < 263; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -7875,7 +7673,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 269; i++) jj_la1[i] = -1; + for (int i = 0; i < 263; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -7885,7 +7683,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 269; i++) jj_la1[i] = -1; + for (int i = 0; i < 263; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -8002,7 +7800,7 @@ LexicalUnitImpl result = null; la1tokens[jj_kind] = true; jj_kind = -1; } - for (int i = 0; i < 269; i++) { + for (int i = 0; i < 263; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1<<j)) != 0) { diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj index 9e1b781a6a..f8b6a86af7 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj @@ -40,6 +40,8 @@ import java.util.ArrayList; import java.util.Locale; import java.util.Map; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.ConditionFactory; import org.w3c.css.sac.Condition; @@ -912,18 +914,24 @@ void media() : <MEDIA_SYM> ( <S> )* mediaStatement(ml) { start = true; documentHandler.startMedia(ml); } - <LBRACE> ( <S> )* ( debuggingDirective() | styleRule() | skipUnknownRule() )* <RBRACE> ( <S> )* + <LBRACE> ( <S> )* ( mediaDirective() )* <RBRACE> ( <S> )* } catch (ParseException e) { reportError(getLocator(), e); skipStatement(); // reportWarningSkipText(getLocator(), skipStatement()); } finally { if (start) { - documentHandler.endMedia(ml); + documentHandler.endMedia(ml); } } } +void mediaDirective() : +{} +{ + debuggingDirective() | styleRule() | skipUnknownRule() | contentDirective() +} + void mediaStatement(MediaListImpl ml) : { Token t; @@ -1272,18 +1280,12 @@ String simple_selector(String selector, char comb) : pseudoElt = null; } { - ( simple_current=element_name() - ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=hash(cond) ( cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=_class(cond) ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=pseudo(cond) ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=attrib(cond) ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - ) + ( (simple_current=element_name() + ( cond=hash(cond) | cond=_class(cond) + | cond=attrib(cond) | cond=pseudo(cond) )* ) + | ( cond = hash(cond) | cond=_class(cond) + | cond=attrib(cond) | cond=pseudo(cond) )+ + ) { if (simple_current == null) { simple_current = ""; @@ -1445,7 +1447,7 @@ boolean isPseudoElement = false; } } } - | ( n=<FUNCTION> ( <S> )* d=skipStatementUntilRightParan() <RPARAN> + | ( n=<FUNCTION> ( <S> )* d=skipStatementUntilMatchingRightParan() <RPARAN> { // accept anything between function and a right parenthesis String f = convertIdent(n.image); @@ -2013,7 +2015,7 @@ void debugDirective() : { String content = skipStatementUntil(new int[] {SEMICOLON,RBRACE,EOF}); // TODO should evaluate the content expression, call documentHandler.debugDirective() etc. - System.out.println(content); + Logger.getLogger(Parser.class.getName()).log(Level.INFO, content); } try { ";" (<S>)* @@ -2030,7 +2032,7 @@ void warnDirective() : { String content = skipStatementUntil(new int[] {SEMICOLON,RBRACE,EOF}); // TODO should evaluate the content expression, call documentHandler.warnDirective() etc. - System.err.println(content); + Logger.getLogger(Parser.class.getName()).log(Level.SEVERE, content); } try { ";" (<S>)* @@ -2842,9 +2844,35 @@ String skipStatementUntilLeftBrace(){ } JAVACODE -String skipStatementUntilRightParan(){ - int[] rParan = {RPARAN}; - return skipStatementUntil(rParan); +String skipStatementUntilMatchingRightParan(){ + int[] leftTokens = {LPARAN, FUNCTION}; // a FUNCTION also contains "(" + int[] rightTokens = {RPARAN}; + StringBuffer s = new StringBuffer(); + int difference = 1; + Token tok; + while(difference != 0){ + tok = getToken(1); + if(tok.kind == EOF) { + return null; + } + for(int sym : leftTokens){ + if(tok.kind == sym){ + difference++; + } + } + for(int sym : rightTokens){ + if(tok.kind == sym){ + difference--; + } + } + if(difference != 0){ + if (tok.image != null) { + s.append(tok.image); + } + getNextToken(); + } + } + return s.toString().trim(); } JAVACODE diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java b/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java index d54ab4fa7e..0db4e4e2f8 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java @@ -21,6 +21,8 @@ import java.util.ArrayList; import java.util.Locale; import java.util.Map; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.ConditionFactory; import org.w3c.css.sac.Condition; import org.w3c.css.sac.SelectorFactory; diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java b/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java index ba29df7d33..26d1121f96 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java @@ -143,4 +143,4 @@ public class Token implements java.io.Serializable { } } -/* JavaCC - OriginalChecksum=8b653fc6be4ca9bd10137ee3ad4c32c4 (do not edit this line) */ +/* JavaCC - OriginalChecksum=dad2146dc89e68f66e77382c9e448fb7 (do not edit this line) */ diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java b/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java index 1757cf6705..f093357e96 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java @@ -159,4 +159,4 @@ public class TokenMgrError extends Error this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } } -/* JavaCC - OriginalChecksum=525946b34c715198d7c29f668b049f5d (do not edit this line) */ +/* JavaCC - OriginalChecksum=c7c96e9cf4a9320d03dd722437439354 (do not edit this line) */ diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/AbstractResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/AbstractResolver.java new file mode 100644 index 0000000000..5de1f95264 --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/AbstractResolver.java @@ -0,0 +1,200 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.sass.internal.resolver; + +import java.io.File; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +import org.w3c.css.sac.InputSource; + +import com.vaadin.sass.internal.ScssStylesheet; + +/** + * Base class for resolvers. Implements functionality for locating paths which + * an import can be relative to and helpers for extracting path information from + * the identifier. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public abstract class AbstractResolver implements ScssStylesheetResolver, + Serializable { + /* + * (non-Javadoc) + * + * @see + * com.vaadin.sass.internal.resolver.ScssStylesheetResolver#resolve(java + * .lang.String) + */ + @Override + public InputSource resolve(ScssStylesheet parentStylesheet, + String identifier) { + // Remove a possible ".scss" suffix + identifier = identifier.replaceFirst(".scss$", ""); + + List<String> potentialParentPaths = getPotentialParentPaths( + parentStylesheet, identifier); + + // remove path from identifier as it has already been added to the + // parent path + if (identifier.contains("/")) { + identifier = identifier.substring(identifier.lastIndexOf("/") + 1); + } + + for (String path : potentialParentPaths) { + InputSource source = normalizeAndResolve(path + "/" + identifier); + + if (source != null) { + return source; + } + + // Try to find partial import (_identifier.scss) + source = normalizeAndResolve(path + "/_" + identifier); + + if (source != null) { + return source; + } + + } + + return normalizeAndResolve(identifier); + } + + /** + * Retrieves the parent paths which should be used while resolving relative + * identifiers. By default uses the parent stylesheet location and a + * possible absolute path in the identifier. + * + * @param parentStylesheet + * The parent stylesheet or null if there is no parent + * @param identifier + * The identifier to be resolved + * @return a list of paths in which to look for the relative import + */ + protected List<String> getPotentialParentPaths( + ScssStylesheet parentStylesheet, String identifier) { + List<String> potentialParents = new ArrayList<String>(); + if (parentStylesheet != null) { + potentialParents.add(extractFullPath( + parentStylesheet.getDirectory(), identifier)); + } + + // Identifier can be a full path so extract the path part also as a + // potential parent + if (identifier.contains("/")) { + potentialParents.add(extractFullPath("", identifier)); + } + + return potentialParents; + + } + + /** + * Extracts the full path from the path combined with the identifier + * + * @param path + * The base path + * @param identifier + * The identifier which may contain a path part, separated by "/" + * from the real identifier + * @return a normalized version of the path where identifier does not + * contain any directory information + */ + protected String extractFullPath(String path, String identifier) { + int lastSlashPosition = identifier.lastIndexOf("/"); + if (lastSlashPosition == -1) { + return path; + } + String identifierPath = identifier.substring(0, lastSlashPosition); + if ("".equals(path)) { + return identifierPath; + } else { + return path + "/" + identifierPath; + } + } + + /** + * Resolves the normalized version of the given identifier + * + * @param identifier + * The identifier to resolve + * @return An input source if the resolver found one or null otherwise + */ + protected InputSource normalizeAndResolve(String identifier) { + String normalized = normalize(identifier); + return resolveNormalized(normalized); + } + + /** + * Resolves the identifier after it has been normalized using + * {@link #normalize(String)}. + * + * @param identifier + * The normalized identifier + * @return an InputSource if the resolver found a source or null otherwise + */ + protected abstract InputSource resolveNormalized(String identifier); + + /** + * Normalizes "." and ".." from the path string where parent path segments + * can be removed. Preserve leading "..". Also ensure / is used instead of \ + * in all places. + * + * @param path + * A relative or absolute file path + * @return The normalized path + */ + protected String normalize(String path) { + + // Ensure only "/" is used, also in Windows + path = path.replace(File.separatorChar, '/'); + + // Split into segments + String[] segments = path.split("/"); + Stack<String> result = new Stack<String>(); + + // Replace '.' and '..' segments + for (int i = 0; i < segments.length; i++) { + if (segments[i].equals(".")) { + // Segments marked '.' are ignored + + } else if (segments[i].equals("..") && !result.isEmpty() + && !result.lastElement().equals("..")) { + // If segment is ".." then remove the previous iff the previous + // element is not a ".." and the result stack is not empty + result.pop(); + } else { + // Other segments are just added to the stack + result.push(segments[i]); + } + } + + // Reconstruct path + StringBuilder pathBuilder = new StringBuilder(); + for (int i = 0; i < result.size(); i++) { + if (i > 0) { + pathBuilder.append("/"); + } + pathBuilder.append(result.get(i)); + } + return pathBuilder.toString(); + } + +} diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java index 8711a0a3e9..755073bc4c 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java @@ -15,31 +15,19 @@ */ package com.vaadin.sass.internal.resolver; -import java.io.File; import java.io.InputStream; import org.w3c.css.sac.InputSource; -public class ClassloaderResolver implements ScssStylesheetResolver { +public class ClassloaderResolver extends AbstractResolver { @Override - public InputSource resolve(String identifier) { - // identifier should not have .scss, fileName should - String ext = ".scss"; - if (identifier.endsWith(".css")) { - ext = ".css"; - } + public InputSource resolveNormalized(String identifier) { String fileName = identifier; - if (identifier.endsWith(ext)) { - identifier = identifier.substring(0, - identifier.length() - ext.length()); - } else { - fileName = fileName + ext; + if (!fileName.endsWith(".css")) { + fileName += ".scss"; } - // Ensure only "/" is used, also in Windows - fileName = fileName.replace(File.separatorChar, '/'); - // Filename should be a relative path starting with VAADIN/... int vaadinIdx = fileName.lastIndexOf("VAADIN/"); if (vaadinIdx > -1) { diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java index 9bb1969ab1..786d0875da 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java @@ -18,24 +18,46 @@ package com.vaadin.sass.internal.resolver; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; +import java.util.List; import org.w3c.css.sac.InputSource; -public class FilesystemResolver implements ScssStylesheetResolver { +import com.vaadin.sass.internal.ScssStylesheet; +public class FilesystemResolver extends AbstractResolver { + + private String[] customPaths = null; + + public FilesystemResolver(String... customPaths) { + this.customPaths = customPaths; + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.sass.internal.resolver.AbstractResolver#getPotentialPaths( + * com.vaadin.sass.internal.ScssStylesheet, java.lang.String) + */ @Override - public InputSource resolve(String identifier) { - // identifier should not have .scss, fileName should - String ext = ".scss"; - if (identifier.endsWith(".css")) { - ext = ".css"; + protected List<String> getPotentialParentPaths( + ScssStylesheet parentStyleSheet, String identifier) { + List<String> potentialPaths = super.getPotentialParentPaths( + parentStyleSheet, identifier); + if (customPaths != null) { + for (String path : customPaths) { + potentialPaths.add(extractFullPath(path, identifier)); + } } + + return potentialPaths; + } + + @Override + public InputSource resolveNormalized(String identifier) { String fileName = identifier; - if (identifier.endsWith(ext)) { - identifier = identifier.substring(0, - identifier.length() - ext.length()); - } else { - fileName = fileName + ext; + if (!fileName.endsWith(".css")) { + fileName += ".scss"; } try { diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java index 45f10836a3..64b3d10d88 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java @@ -17,6 +17,8 @@ package com.vaadin.sass.internal.resolver; import org.w3c.css.sac.InputSource; +import com.vaadin.sass.internal.ScssStylesheet; + public interface ScssStylesheetResolver { /** * Called with the "identifier" of a stylesheet that the resolver should try @@ -26,9 +28,12 @@ public interface ScssStylesheetResolver { * stylesheet was found, e.g "runo.scss" might result in a URI like * "VAADIN/themes/runo/runo.scss". * + * @param parentStylesheet + * The parent style sheet * @param identifier * used fo find stylesheet * @return InputSource for stylesheet (with URI set) or null if not found */ - public InputSource resolve(String identifier); + public InputSource resolve(ScssStylesheet parentStylesheet, + String identifier); }
\ No newline at end of file diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/VaadinResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/VaadinResolver.java deleted file mode 100644 index fec16a54c8..0000000000 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/VaadinResolver.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2000-2013 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.sass.internal.resolver; - -import java.io.File; -import java.util.Stack; - -import org.w3c.css.sac.InputSource; - -public class VaadinResolver implements ScssStylesheetResolver { - - @Override - public InputSource resolve(String identifier) { - - // Remove extra "." and ".." - identifier = normalize(identifier); - - InputSource source = null; - - // Can we find the scss from the file system? - ScssStylesheetResolver resolver = new FilesystemResolver(); - source = resolver.resolve(identifier); - - if (source == null) { - // How about the classpath? - resolver = new ClassloaderResolver(); - source = resolver.resolve(identifier); - } - - return source; - } - - /** - * Normalizes "." and ".." from the path string where parent path segments - * can be removed. Preserve leading "..". - * - * @param path - * A relative or absolute file path - * @return The normalized path - */ - private static String normalize(String path) { - - // Ensure only "/" is used, also in Windows - path = path.replace(File.separatorChar, '/'); - - // Split into segments - String[] segments = path.split("/"); - Stack<String> result = new Stack<String>(); - - // Replace '.' and '..' segments - for (int i = 0; i < segments.length; i++) { - if (segments[i].equals(".")) { - // Segments marked '.' are ignored - - } else if (segments[i].equals("..") && !result.isEmpty() - && !result.lastElement().equals("..")) { - // If segment is ".." then remove the previous iff the previous - // element is not a ".." and the result stack is not empty - result.pop(); - } else { - // Other segments are just added to the stack - result.push(segments[i]); - } - } - - // Reconstruct path - StringBuilder pathBuilder = new StringBuilder(); - for (int i = 0; i < result.size(); i++) { - if (i > 0) { - pathBuilder.append("/"); - } - pathBuilder.append(result.get(i)); - } - return pathBuilder.toString(); - } - -} diff --git a/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java b/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java index 744b560116..c1f26f968e 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java +++ b/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java @@ -16,6 +16,9 @@ package com.vaadin.sass.internal.selector; +import java.util.logging.Level; +import java.util.logging.Logger; + import org.w3c.css.sac.CombinatorCondition; import org.w3c.css.sac.Condition; import org.w3c.css.sac.ConditionFactory; @@ -115,7 +118,7 @@ public class SelectorUtil { } else if (selector.getSelectorType() == CompositeSelector.SCSS_COMPOSITE_SELECTOR) { return toString((CompositeSelector) selector); } else { - System.out.println("SU !Unknown selector type, type: " + log("SU !Unknown selector type, type: " + selector.getSelectorType() + ", " + selector.toString()); } return ""; @@ -162,8 +165,8 @@ public class SelectorUtil { PseudoClassConditionImpl pseudoClassCondition = (PseudoClassConditionImpl) condition; return ":" + pseudoClassCondition.getValue(); } else { - System.out.println("CU !condition type not identified, type: " - + conditionType + ", " + condition.toString()); + log("CU !condition type not identified, type: " + conditionType + + ", " + condition.toString()); return ""; } } @@ -330,4 +333,8 @@ public class SelectorUtil { throw new Exception("Invalid selector type"); } } + + private static void log(String msg) { + Logger.getLogger(SelectorUtil.class.getName()).log(Level.INFO, msg); + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java index 6ce67a3abd..8db522ea1a 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java @@ -17,6 +17,8 @@ package com.vaadin.sass.internal.tree; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; import com.vaadin.sass.internal.ScssStylesheet; import com.vaadin.sass.internal.visitor.BlockNodeHandler; @@ -109,7 +111,8 @@ public class BlockNode extends Node implements IVariableNode { BlockNodeHandler.traverse(this); replaceVariables(ScssStylesheet.getVariables()); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(BlockNode.class.getName()).log(Level.SEVERE, null, + e); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java index 417849d13b..dcabd2ff01 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java @@ -17,6 +17,8 @@ package com.vaadin.sass.internal.tree; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; import com.vaadin.sass.internal.visitor.ExtendNodeHandler; @@ -54,7 +56,8 @@ public class ExtendNode extends Node implements IVariableNode { ExtendNodeHandler.traverse(this); getParentNode().removeChild(this); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(ExtendNode.class.getName()).log(Level.SEVERE, + null, e); } } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java index e702bc8577..c5ffb6d73d 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java @@ -19,6 +19,8 @@ package com.vaadin.sass.internal.tree; import java.util.ArrayList; import java.util.Collection; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import com.vaadin.sass.internal.ScssStylesheet; import com.vaadin.sass.internal.parser.LexicalUnitImpl; @@ -119,7 +121,8 @@ public class MixinNode extends Node implements IVariableNode { ScssStylesheet.closeVariableScope(variableScope); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(MixinNode.class.getName()).log(Level.SEVERE, null, + e); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java index 735d83a898..8449a9d891 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java @@ -15,6 +15,9 @@ */ package com.vaadin.sass.internal.tree.controldirective; +import java.util.logging.Level; +import java.util.logging.Logger; + import com.vaadin.sass.internal.tree.Node; import com.vaadin.sass.internal.visitor.IfElseNodeHandler; @@ -40,7 +43,8 @@ public class IfElseDefNode extends Node { IfElseNodeHandler.traverse(this); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(IfElseDefNode.class.getName()).log(Level.SEVERE, + null, e); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java b/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java index bc30ffdd6c..af66eb9a74 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java +++ b/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java @@ -22,13 +22,15 @@ import java.io.ObjectOutputStream; import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Utility for making deep copies (vs. clone()'s shallow copies) of objects. * Objects are first serialized and then deserialized. Error checking is fairly * minimal in this implementation. If an object is encountered that cannot be * serialized (or that references an object that cannot be serialized) an error - * is printed to System.err and null is returned. Depending on your specific + * is printed to the logger and null is returned. Depending on your specific * application, it might make more sense to have copy(...) re-throw the * exception. */ @@ -56,9 +58,9 @@ public class DeepCopy { obj = in.readObject(); in.close(); } catch (IOException e) { - e.printStackTrace(); + log(e); } catch (ClassNotFoundException cnfe) { - cnfe.printStackTrace(); + log(cnfe); } return obj; } else { @@ -80,4 +82,8 @@ public class DeepCopy { } return copies; } + + private static void log(Throwable e) { + Logger.getLogger(DeepCopy.class.getName()).log(Level.SEVERE, null, e); + } }
\ No newline at end of file diff --git a/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java b/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java index cb9896967a..daf01a3eab 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java +++ b/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java @@ -16,10 +16,11 @@ package com.vaadin.sass.internal.visitor; -import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.LexicalUnit; @@ -57,25 +58,14 @@ public class ImportNodeHandler { ImportNode importNode = (ImportNode) n; if (!importNode.isPureCssImport()) { try { - StringBuilder filePathBuilder = new StringBuilder( - styleSheet.getFileName()); - filePathBuilder.append(File.separatorChar).append( - importNode.getUri()); - if (!filePathBuilder.toString().endsWith(".scss")) { - filePathBuilder.append(".scss"); - } - // set parent's charset to imported node. ScssStylesheet imported = ScssStylesheet.get( - filePathBuilder.toString(), - styleSheet.getCharset()); - if (imported == null) { - imported = ScssStylesheet.get(importNode.getUri()); - } + importNode.getUri(), styleSheet); if (imported == null) { - throw new FileNotFoundException(importNode.getUri() - + " (parent: " - + ScssStylesheet.get().getFileName() + ")"); + throw new FileNotFoundException("Import '" + + importNode.getUri() + "' in '" + + styleSheet.getFileName() + + "' could not be found"); } traverse(imported); @@ -90,9 +80,11 @@ public class ImportNodeHandler { importNode); node.removeChild(importNode); } catch (CSSException e) { - e.printStackTrace(); + Logger.getLogger(ImportNodeHandler.class.getName()) + .log(Level.SEVERE, null, e); } catch (IOException e) { - e.printStackTrace(); + Logger.getLogger(ImportNodeHandler.class.getName()) + .log(Level.SEVERE, null, e); } } else { if (styleSheet != node) { diff --git a/theme-compiler/src/logging.properties b/theme-compiler/src/logging.properties new file mode 100644 index 0000000000..b563d4b68e --- /dev/null +++ b/theme-compiler/src/logging.properties @@ -0,0 +1,2 @@ +handlers = com.vaadin.sass.CustomConsoleHandler +.level = ALL
\ No newline at end of file diff --git a/theme-compiler/tests/resources/automatic/css/media.css b/theme-compiler/tests/resources/automatic/css/media.css index f4183d9a07..5f7267fa9a 100644 --- a/theme-compiler/tests/resources/automatic/css/media.css +++ b/theme-compiler/tests/resources/automatic/css/media.css @@ -1,3 +1,14 @@ +@media screen { + .v-view { + overflow: visible; + } + .details { + font-size: 1pt; + font-weight: bold; + } + width: 100%; +} + @media screen and (max-width: 480px) { .abc { background: red; diff --git a/theme-compiler/tests/resources/automatic/css/mixin-empty-paramlist.css b/theme-compiler/tests/resources/automatic/css/mixin-empty-paramlist.css deleted file mode 100644 index 59ef68680d..0000000000 --- a/theme-compiler/tests/resources/automatic/css/mixin-empty-paramlist.css +++ /dev/null @@ -1,15 +0,0 @@ -body { - color: blue; -} - -h1 { - text-align: center; -} - -p { - font-style: italic; -} - -table { - width: 100%; -}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/automatic/scss/media.scss b/theme-compiler/tests/resources/automatic/scss/media.scss index 7db52de9ed..311c5088c8 100644 --- a/theme-compiler/tests/resources/automatic/scss/media.scss +++ b/theme-compiler/tests/resources/automatic/scss/media.scss @@ -1,3 +1,24 @@ +@mixin media-settings { + @media screen { + .v-view { + overflow: visible; + } + @content; + } +} + +@include media-settings { + .details { + font: { + size : 1pt; + weight: bold; + } + } + + width:100%; +} + + @media screen and (max-width: 480px) { .abc { background: red; diff --git a/theme-compiler/tests/resources/automatic/scss/mixin-empty-paramlist.scss b/theme-compiler/tests/resources/automatic/scss/mixin-empty-paramlist.scss deleted file mode 100644 index 27033ba850..0000000000 --- a/theme-compiler/tests/resources/automatic/scss/mixin-empty-paramlist.scss +++ /dev/null @@ -1,28 +0,0 @@ -@mixin emptyarglist1(){ - body{ - color: blue; - } -} - -@mixin emptyarglist2(){ - h1{ - text-align:center; - } -} - -@mixin emptyarglist3{ - p{ - font-style:italic; - } -} - -@mixin emptyarglist4{ - table{ - width: 100%; - } -} - -@include emptyarglist1(); -@include emptyarglist2; -@include emptyarglist3(); -@include emptyarglist4;
\ No newline at end of file diff --git a/theme-compiler/tests/resources/css/compass-import.css b/theme-compiler/tests/resources/css/compass-import.css new file mode 100644 index 0000000000..e3d4b5fcca --- /dev/null +++ b/theme-compiler/tests/resources/css/compass-import.css @@ -0,0 +1,49 @@ +.content-navigation { + border-color: #3bbfce; + color: #0000ff; +} + +.border { + padding: 8px; + margin: 8px; + border-color: #3bbfce; +} + +.body { + background-image: url(compass/folder-test2/bg.png); + background: transparent url(compass/folder-test2/img/loading-indicator.gif); + background-image: url(http://abc/bg.png); + background-image: url(/abc/bg.png); +} + +.base { + color: red; +} + +.text { + font-weight: bold; +} + +.footer { + border: 2px solid black; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; +} + +.banner { + border: 1px solid black; + font-color: red; +} + +.interpolation-test { + font-size: 14px; +} + +.header { + width: 100%; +} + +.badError { + border-width: 3px; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/sasslang/css/100-test_optional_extend_does_not_warn_when_extension_fails.css b/theme-compiler/tests/resources/sasslangbroken/css/100-test_optional_extend_does_not_warn_when_extension_fails.css index 29116d880b..29116d880b 100644 --- a/theme-compiler/tests/resources/sasslang/css/100-test_optional_extend_does_not_warn_when_extension_fails.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/100-test_optional_extend_does_not_warn_when_extension_fails.css diff --git a/theme-compiler/tests/resources/sasslang/css/36-test_extend_self_loop.css b/theme-compiler/tests/resources/sasslangbroken/css/36-test_extend_self_loop.css index 234d524066..234d524066 100644 --- a/theme-compiler/tests/resources/sasslang/css/36-test_extend_self_loop.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/36-test_extend_self_loop.css diff --git a/theme-compiler/tests/resources/sasslang/css/37-test_extend_warns_when_extendee_doesnt_exist.css b/theme-compiler/tests/resources/sasslangbroken/css/37-test_extend_warns_when_extendee_doesnt_exist.css index 8b13789179..8b13789179 100644 --- a/theme-compiler/tests/resources/sasslang/css/37-test_extend_warns_when_extendee_doesnt_exist.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/37-test_extend_warns_when_extendee_doesnt_exist.css diff --git a/theme-compiler/tests/resources/sasslang/css/38-test_extend_warns_when_extension_fails.css b/theme-compiler/tests/resources/sasslangbroken/css/38-test_extend_warns_when_extension_fails.css index 29116d880b..29116d880b 100644 --- a/theme-compiler/tests/resources/sasslang/css/38-test_extend_warns_when_extension_fails.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/38-test_extend_warns_when_extension_fails.css diff --git a/theme-compiler/tests/resources/sasslang/css/57-test_long_extendee_requires_all_selectors.css b/theme-compiler/tests/resources/sasslangbroken/css/57-test_long_extendee_requires_all_selectors.css index 234d524066..234d524066 100644 --- a/theme-compiler/tests/resources/sasslang/css/57-test_long_extendee_requires_all_selectors.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/57-test_long_extendee_requires_all_selectors.css diff --git a/theme-compiler/tests/resources/sasslang/css/60-test_long_extender_aborts_unification.css b/theme-compiler/tests/resources/sasslangbroken/css/60-test_long_extender_aborts_unification.css index 18bc24e7cd..18bc24e7cd 100644 --- a/theme-compiler/tests/resources/sasslang/css/60-test_long_extender_aborts_unification.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/60-test_long_extender_aborts_unification.css diff --git a/theme-compiler/tests/resources/sasslang/css/71-test_nested_extender_aborts_unification.css b/theme-compiler/tests/resources/sasslangbroken/css/71-test_nested_extender_aborts_unification.css index 2337e9af40..2337e9af40 100644 --- a/theme-compiler/tests/resources/sasslang/css/71-test_nested_extender_aborts_unification.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/71-test_nested_extender_aborts_unification.css diff --git a/theme-compiler/tests/resources/sasslang/css/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.css b/theme-compiler/tests/resources/sasslangbroken/css/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.css index 8b13789179..8b13789179 100644 --- a/theme-compiler/tests/resources/sasslang/css/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.css +++ b/theme-compiler/tests/resources/sasslangbroken/css/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.css diff --git a/theme-compiler/tests/resources/sasslang/scss/100-test_optional_extend_does_not_warn_when_extension_fails.scss b/theme-compiler/tests/resources/sasslangbroken/scss/100-test_optional_extend_does_not_warn_when_extension_fails.scss index 6d707236f2..6d707236f2 100644 --- a/theme-compiler/tests/resources/sasslang/scss/100-test_optional_extend_does_not_warn_when_extension_fails.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/100-test_optional_extend_does_not_warn_when_extension_fails.scss diff --git a/theme-compiler/tests/resources/sasslang/scss/36-test_extend_self_loop.scss b/theme-compiler/tests/resources/sasslangbroken/scss/36-test_extend_self_loop.scss index ac40f00573..ac40f00573 100644 --- a/theme-compiler/tests/resources/sasslang/scss/36-test_extend_self_loop.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/36-test_extend_self_loop.scss diff --git a/theme-compiler/tests/resources/sasslang/scss/37-test_extend_warns_when_extendee_doesnt_exist.scss b/theme-compiler/tests/resources/sasslangbroken/scss/37-test_extend_warns_when_extendee_doesnt_exist.scss index cd54108c97..cd54108c97 100644 --- a/theme-compiler/tests/resources/sasslang/scss/37-test_extend_warns_when_extendee_doesnt_exist.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/37-test_extend_warns_when_extendee_doesnt_exist.scss diff --git a/theme-compiler/tests/resources/sasslang/scss/38-test_extend_warns_when_extension_fails.scss b/theme-compiler/tests/resources/sasslangbroken/scss/38-test_extend_warns_when_extension_fails.scss index 8381c7279a..8381c7279a 100644 --- a/theme-compiler/tests/resources/sasslang/scss/38-test_extend_warns_when_extension_fails.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/38-test_extend_warns_when_extension_fails.scss diff --git a/theme-compiler/tests/resources/sasslang/scss/57-test_long_extendee_requires_all_selectors.scss b/theme-compiler/tests/resources/sasslangbroken/scss/57-test_long_extendee_requires_all_selectors.scss index 011d26a83e..011d26a83e 100644 --- a/theme-compiler/tests/resources/sasslang/scss/57-test_long_extendee_requires_all_selectors.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/57-test_long_extendee_requires_all_selectors.scss diff --git a/theme-compiler/tests/resources/sasslang/scss/60-test_long_extender_aborts_unification.scss b/theme-compiler/tests/resources/sasslangbroken/scss/60-test_long_extender_aborts_unification.scss index 5238f3f93e..5238f3f93e 100644 --- a/theme-compiler/tests/resources/sasslang/scss/60-test_long_extender_aborts_unification.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/60-test_long_extender_aborts_unification.scss diff --git a/theme-compiler/tests/resources/sasslang/scss/71-test_nested_extender_aborts_unification.scss b/theme-compiler/tests/resources/sasslangbroken/scss/71-test_nested_extender_aborts_unification.scss index bcbb6e181d..bcbb6e181d 100644 --- a/theme-compiler/tests/resources/sasslang/scss/71-test_nested_extender_aborts_unification.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/71-test_nested_extender_aborts_unification.scss diff --git a/theme-compiler/tests/resources/sasslang/scss/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.scss b/theme-compiler/tests/resources/sasslangbroken/scss/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.scss index 551764036f..551764036f 100644 --- a/theme-compiler/tests/resources/sasslang/scss/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.scss +++ b/theme-compiler/tests/resources/sasslangbroken/scss/99-test_optional_extend_does_not_warn_when_extendee_doesnt_exist.scss diff --git a/theme-compiler/tests/resources/scss/compass-test/compass-import.scss b/theme-compiler/tests/resources/scss/compass-test/compass-import.scss new file mode 100644 index 0000000000..36d041b33c --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test/compass-import.scss @@ -0,0 +1,4 @@ +@import "compass"; +.badError { + border-width: 3px; +} diff --git a/theme-compiler/tests/resources/scss/compass-test2/_compass.scss b/theme-compiler/tests/resources/scss/compass-test2/_compass.scss new file mode 100644 index 0000000000..9b741c0f03 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/_compass.scss @@ -0,0 +1,3 @@ +@import "compass/utilities"; +@import "compass/typography"; +@import "compass/css3"; diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass-import2.scss b/theme-compiler/tests/resources/scss/compass-test2/compass-import2.scss new file mode 100644 index 0000000000..36d041b33c --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass-import2.scss @@ -0,0 +1,4 @@ +@import "compass"; +.badError { + border-width: 3px; +} diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/_css3.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/_css3.scss new file mode 100644 index 0000000000..42163ba193 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/_css3.scss @@ -0,0 +1,3 @@ +@import "css3/border-radius"; +@import "css3/inline-block"; +@import "css3/opacity"; diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/_typography.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/_typography.scss new file mode 100644 index 0000000000..a65c1ff292 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/_typography.scss @@ -0,0 +1,3 @@ +@import "typography/links"; +@import "typography/lists"; +@import "typography/text"; diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/_utilities.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/_utilities.scss new file mode 100644 index 0000000000..644ad3368b --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/_utilities.scss @@ -0,0 +1,3 @@ +@import "utilities/color"; +@import "utilities/general"; +@import "utilities/sprites"; diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_border-radius.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_border-radius.scss new file mode 100644 index 0000000000..752003104b --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_border-radius.scss @@ -0,0 +1,4 @@ +.banner { + border: 1px solid black; + font-color: red; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_inline-block.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_inline-block.scss new file mode 100644 index 0000000000..3fefab83b2 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_inline-block.scss @@ -0,0 +1,3 @@ +.interpolation-test { + font-size: 14px; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_opacity.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_opacity.scss new file mode 100644 index 0000000000..f6bf34fe24 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/css3/_opacity.scss @@ -0,0 +1,3 @@ +.header { + width: 100%; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_links.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_links.scss new file mode 100644 index 0000000000..bc7318558e --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_links.scss @@ -0,0 +1,3 @@ +.base { + color: red; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_lists.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_lists.scss new file mode 100644 index 0000000000..af174b7095 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_lists.scss @@ -0,0 +1,3 @@ +.text { + font-weight: bold; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_text.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_text.scss new file mode 100644 index 0000000000..8239527f7b --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/typography/_text.scss @@ -0,0 +1,6 @@ +.footer { + border: 2px solid black; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_color.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_color.scss new file mode 100644 index 0000000000..ea1b7a55f0 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_color.scss @@ -0,0 +1,4 @@ +.content-navigation { + border-color: #3bbfce; + color: #0000ff; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_general.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_general.scss new file mode 100644 index 0000000000..0c58c6433d --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_general.scss @@ -0,0 +1,5 @@ +.border { + padding: 8px; + margin: 8px; + border-color: #3bbfce; +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_sprites.scss b/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_sprites.scss new file mode 100644 index 0000000000..28960f89fc --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/compass/utilities/_sprites.scss @@ -0,0 +1,6 @@ +.body { + background-image: url(../folder-test2/bg.png); + background: transparent url(../folder-test2/img/loading-indicator.gif); + background-image: url(http://abc/bg.png); + background-image: url(/abc/bg.png); +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/compass-test2/license-readme.txt b/theme-compiler/tests/resources/scss/compass-test2/license-readme.txt new file mode 100644 index 0000000000..90ba808179 --- /dev/null +++ b/theme-compiler/tests/resources/scss/compass-test2/license-readme.txt @@ -0,0 +1,26 @@ +The design here is to use the stylesheets located at: +https://github com/chriseppstein/compass/tree/stable/frameworks/compass/stylesheets + +and update the VAADIN code to be able to read them in such that an existing JRuby implementation can be replaced with VAADIN without any changes to one's *.scss and *.css files. + +The current short snippets of SCSS that are included here only for testing Compass compatibility might not qualify as significant or substantial parts, but in any case Compass is being mentioned for related tests pointing to the original implementation. These small portions of Compass are copied and modified for the testing of compatibility only. + +The license for Compass mentioned here: +https://github.com/chriseppstein/compass/blob/stable/LICENSE.markdown + +is as follows: + + + + +Copyright (c) 2009 Christopher M. Eppstein + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. No attribution is required by products that make use of this software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. + +Contributors to this project agree to grant all rights to the copyright holder of the primary product. Attribution is maintained in the source control history of the product. diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.0.scss new file mode 100644 index 0000000000..2f1e55e87e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-001.htm */ + +html { margin:10px; border:20px solid black; padding:30px; } +body { height:10000px; margin:0; } +div { position:absolute; width:100px; height:100px; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.1.scss new file mode 100644 index 0000000000..7b5eace311 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-001.htm */ +.style { top:0; background:yellow; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.2.scss new file mode 100644 index 0000000000..c94661f654 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-001.htm */ +.style { right:0; background:orange; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.3.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.3.scss new file mode 100644 index 0000000000..893b95ca14 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-001.htm */ +.style { bottom:0; background:brown; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.4.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.4.scss new file mode 100644 index 0000000000..71d199866c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-001.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-001.htm */ +.style { left:0; background:pink; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004a.0.scss new file mode 100644 index 0000000000..457f6a2d2f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004a.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004a.htm */ +.style { position:absolute; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004b.0.scss new file mode 100644 index 0000000000..8990089fb6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004b.htm */ +.style { position:fixed; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004c.0.scss new file mode 100644 index 0000000000..1bad688abe --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004c.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004c.htm */ +.style { position:absolute; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black; display:table; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004d.0.scss new file mode 100644 index 0000000000..8f8b50e4c7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004d.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004d.htm */ +.style { position:fixed; left:100px; top:100px; width:100px; height:100px; background:yellow; border:10px solid black; display:table } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004e.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004e.0.scss new file mode 100644 index 0000000000..0c460b5c3f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004e.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004e.htm */ +.style { display:table } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004e.1.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004e.1.scss new file mode 100644 index 0000000000..29c22194fd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004e.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004e.htm */ +.style { position:absolute; left:100px; top:100px; width:100px; height:100px; border:10px solid black; background:yellow; margin:0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004f.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004f.0.scss new file mode 100644 index 0000000000..33f39b6ab6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004f.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004f.htm */ +.style { display:table } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004f.1.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004f.1.scss new file mode 100644 index 0000000000..c458e5dc33 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-004f.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-004f.htm */ +.style { position:fixed; left:100px; top:100px; width:100px; height:100px; border:10px solid black; background:yellow; margin:0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005a.0.scss new file mode 100644 index 0000000000..a724d1b918 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005a.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-005a.htm */ +.style { position:absolute; width:100px; height:100px; background:yellow; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005b.0.scss new file mode 100644 index 0000000000..d9b1214a4b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-005b.htm */ +.style { position:absolute; width:100px; height:100px; display:table; background:yellow; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005c.0.scss new file mode 100644 index 0000000000..e6e7f6b90b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005c.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-005c.htm */ +.style { position:fixed; width:100px; height:100px; background:yellow; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005d.0.scss new file mode 100644 index 0000000000..1bc05d796a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-005d.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-005d.htm */ +.style { position:fixed; width:100px; height:100px; display:table; background:yellow; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-007.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-007.0.scss new file mode 100644 index 0000000000..9080cba258 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-007.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-007.htm */ +.style { position:relative; top:100px; left:100px; height:100px; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-007.1.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-007.1.scss new file mode 100644 index 0000000000..40f293c03b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-007.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-007.htm */ +.style { position:absolute; margin:0; bottom:0; height:30px; border:10px solid orange; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009a.0.scss new file mode 100644 index 0000000000..ac865fb846 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009a.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-009a.htm */ +.style { width:50%; height:50%; margin:50px; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009b.0.scss new file mode 100644 index 0000000000..0b108fff62 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-009b.htm */ +.style { position:absolute; left:50px; top:50px; width:50%; height:50%; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009e.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009e.0.scss new file mode 100644 index 0000000000..f5bda4dc9f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009e.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-009e.htm */ +.style { position:absolute; width:50%; height:50%; top:50px; left:50px; margin:0; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009f.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009f.0.scss new file mode 100644 index 0000000000..788e50c119 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009f.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-009f.htm */ +.style { position:relative; height:50%; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009f.1.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009f.1.scss new file mode 100644 index 0000000000..e1c3142ad8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-containing-block-initial-009f.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-containing-block-initial-009f.htm */ +.style { position:absolute; width:50%; top:50px; left:50px; height:100%; margin:0; border:10px solid black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-non-replaced-width-margin-000.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-non-replaced-width-margin-000.0.scss new file mode 100644 index 0000000000..69f5c2fa6a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-non-replaced-width-margin-000.0.scss @@ -0,0 +1,93 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-non-replaced-width-margin-000.htm */ + + +div { height: 1px; direction: ltr; } + +/* + * Every case here has three divs nested inside of each other. The + * innermost div (absolutely positioned) is the testcase (and has + * color). The middle div's content edge establishes the containing + * block it would have if it were statically positioned. The outermost + * div is actually its containing block. + * + * the abs pos containing block runs from 50px to 700px from the left edge + * the static pos containing block runs from 150px to 650px from the left edge + */ + +/* totals for html and body: 21px on the left, 34px on the right */ +html, body { border: transparent medium solid; } +html { margin: 0 3px 0 2px; padding: 0 4px 0 3px; border-width: 0 3px 0 8px; } +body { margin: 0 6px 0 3px; padding: 0 7px 0 1px; border-width: 0 11px 0 4px; } + +body > div { + position: relative; + + top: 0; + left: 4px; + + margin-left: 16px; + border-left: 9px solid transparent; + /* sum of above items (29px), plus 21px above, is 50px */ + padding-left: 40px; + + width: 595px; + + padding-right: 15px; + /* sum of above items (650px), plus 50px above, is 700px */ + + border-right: 27px solid transparent; + margin-right: 13px; +} + +body > div > div { + /* padding-left above: 40px */ + margin-left: 7px; + border-left: 29px solid transparent; + padding-left: 24px; + /* sum of above items (100px), plus 50px above, is 150px */ + + /* padding-right above: 15px */ + padding-right: 14px; + border-right: 3px solid transparent; + margin-right: 18px; + /* sum of above items (50px), subtracted from 700px, is 650px */ +} + +body > div > div > div { + background: navy; + position: absolute; + top: 0; + bottom: 0; + + /* specify everything; we'll put the autos as overrides below */ + left: 3px; + margin-left: 17px; + border-left: 6px solid transparent; + padding-left: 1px; + padding-right: 9px; + border-right: 8px solid transparent; + margin-right: 19px; + right: 8px; +} + +/* and give it 72px of intrinsic width for the case where it has width:auto */ +body > div > div > div > div { + width: 72px; +} + +/* now we want to test all 128 combinations of presence of the following */ + +body > div.adir { direction: rtl; } +body > div.sdir > div { direction: rtl; } +body > div.edir > div > div { direction: rtl; } +body > div.ol > div > div { left: auto; } +body > div.or > div > div { right: auto; } +body > div.ml > div > div { margin-left: auto; } +body > div.mr > div > div { margin-right: auto; } + +/* combined with each of these three */ +body > div.narrowwidth > div > div { width: 153px; } +body > div.autowidth > div > div { width: auto; } +body > div.widewidth > div > div { width: 660px; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/abspos-replaced-width-margin-000.0.scss b/theme-compiler/tests/resources/w3ctests/scss/abspos-replaced-width-margin-000.0.scss new file mode 100644 index 0000000000..99f2a308f3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/abspos-replaced-width-margin-000.0.scss @@ -0,0 +1,88 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/abspos-replaced-width-margin-000.htm */ + + +div { height: 1px; direction: ltr; } + +/* + * Every case here has two divs and an image nested inside of each other. The + * innermost div (absolutely positioned) is the testcase (and has + * color). The middle div's content edge establishes the containing + * block it would have if it were statically positioned. The outermost + * div is actually its containing block. + * + * the abs pos containing block runs from 50px to 700px from the left edge + * the static pos containing block runs from 150px to 650px from the left edge + */ + +/* totals for html and body: 21px on the left, 34px on the right */ +html, body { border: transparent medium solid; } +html { margin: 0 3px 0 2px; padding: 0 4px 0 3px; border-width: 0 3px 0 8px; } +body { margin: 0 6px 0 3px; padding: 0 7px 0 1px; border-width: 0 11px 0 4px; } + +body > div { + position: relative; + + top: 0; + left: 4px; + + margin-left: 16px; + border-left: 9px solid transparent; + /* sum of above items (29px), plus 21px above, is 50px */ + padding-left: 40px; + + width: 595px; + + padding-right: 15px; + /* sum of above items (650px), plus 50px above, is 700px */ + + border-right: 27px solid transparent; + margin-right: 13px; +} + +body > div > div { + /* padding-left above: 40px */ + margin-left: 7px; + border-left: 29px solid transparent; + padding-left: 24px; + /* sum of above items (100px), plus 50px above, is 150px */ + + /* padding-right above: 15px */ + padding-right: 14px; + border-right: 3px solid transparent; + margin-right: 18px; + /* sum of above items (50px), subtracted from 700px, is 650px */ +} + +body > div > div > img { + background: navy; + position: absolute; + top: 0; + bottom: 0; + + /* specify everything; we'll put the autos as overrides below */ + left: 3px; + margin-left: 17px; + border-left: 6px solid transparent; + padding-left: 1px; + padding-right: 9px; + border-right: 8px solid transparent; + margin-right: 19px; + right: 8px; +} + +/* now we want to test all 128 combinations of presence of the following */ + +body > div.adir { direction: rtl; } +body > div.sdir > div { direction: rtl; } +body > div.edir > div > img { direction: rtl; } +body > div.ol > div > img { left: auto; } +body > div.or > div > img { right: auto; } +body > div.ml > div > img { margin-left: auto; } +body > div.mr > div > img { margin-right: auto; } + +/* combined with each of these three (as appropriate for narrow/wide images) */ +body > div.narrowwidth > div > img { width: 153px; height: 1px; } +body > div.autowidth > div > img { width: auto; } +body > div.widewidth > div > img { width: 660px; height: 1px; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/anonymous-boxes-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/anonymous-boxes-001.0.scss new file mode 100644 index 0000000000..3c30052779 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/anonymous-boxes-001.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/anonymous-boxes-001.htm */ + + #parent { height: 200px; position: relative; } + #child { float: left; height: 50%; width: 100px; background: green; position: relative } + #background { position: absolute; top: 0; left: 0; width: 100px; height: 100px; background: red } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-quotes-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-quotes-001.0.scss new file mode 100644 index 0000000000..3a4f2c68a2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-quotes-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-quotes-001.htm */ + + body { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-quotes-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-quotes-001.1.scss Binary files differnew file mode 100644 index 0000000000..f9ff59ef63 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-quotes-001.1.scss diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-001.0.scss new file mode 100644 index 0000000000..e81cd566d8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-space-001.htm */ + + body { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-001.1.scss Binary files differnew file mode 100644 index 0000000000..89cf375ace --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-001.1.scss diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-002.0.scss new file mode 100644 index 0000000000..f37bd48b03 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-002.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-space-002.htm */ + + body { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-002.1.scss Binary files differnew file mode 100644 index 0000000000..4ca1f3465a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-space-002.1.scss diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-be-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-be-001.0.scss new file mode 100644 index 0000000000..82b8dcb50a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-be-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-utf16-be-001.htm */ + + body { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-be-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-be-001.1.scss Binary files differnew file mode 100644 index 0000000000..3bf9f5f6b4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-be-001.1.scss diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-le-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-le-001.0.scss new file mode 100644 index 0000000000..92ca00bc53 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-le-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-utf16-le-001.htm */ + + body { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-le-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-le-001.1.scss Binary files differnew file mode 100644 index 0000000000..483b8494dd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/at-charset-utf16-le-001.1.scss diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-001.0.scss new file mode 100644 index 0000000000..ed10b1ea02 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-001.0.scss @@ -0,0 +1,40 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-001.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + /* 100 x 120 bgpaint area */ + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-none.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-none.svg); + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-002.0.scss new file mode 100644 index 0000000000..849421d055 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-002.0.scss @@ -0,0 +1,42 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-002.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-width.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-width.svg); + } + .control { + width: 60px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-003.0.scss new file mode 100644 index 0000000000..baac57662f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-003.0.scss @@ -0,0 +1,42 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-003.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-height.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-height.svg); + } + .control { + height: 60px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-004.0.scss new file mode 100644 index 0000000000..22a6983830 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-004.0.scss @@ -0,0 +1,45 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-004.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-ratio-portrait.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-ratio-portrait.svg); + } + .cover .control { + width: 66px; + } + .limit .control { + width: 67px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-005.0.scss new file mode 100644 index 0000000000..cc0e002964 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-005.0.scss @@ -0,0 +1,45 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-005.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-ratio-landscape.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-ratio-landscape.svg); + } + .cover .control { + height: 53px; + } + .limit .control { + height: 54px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-006.0.scss new file mode 100644 index 0000000000..fda8699018 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-006.0.scss @@ -0,0 +1,43 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-006.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-width-pc-height-pc.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-width-pc-height-pc.svg); + } + .control { + width: 32px; + height: 60px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-007.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-007.0.scss new file mode 100644 index 0000000000..09b38ffacb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-007.0.scss @@ -0,0 +1,43 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-007.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-width-ratio.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-width-ratio.svg); + } + .control { + width: 40px; + height: 60px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-008.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-008.0.scss new file mode 100644 index 0000000000..f54ce9a61a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-008.0.scss @@ -0,0 +1,43 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-008.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-height-ratio.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-height-ratio.svg); + } + .control { + width: 40px; + height: 60px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-009.0.scss b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-009.0.scss new file mode 100644 index 0000000000..6b9b2d6456 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/background-intrinsic-009.0.scss @@ -0,0 +1,43 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/background-intrinsic-009.htm */ + + /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */ + div { + position: relative; + } + .cover, .limit { + width: 120px; + height: 120px; + margin: 0.5em; + background: green; /* Used to match reference; remove for debugging. */ + } + .control { + position: absolute; + top: 10px; bottom: 10px; + left: 10px; right: 30px; + } + .cover .control { + background: red; + } + .limit .control { + background: green; + } + .test { + /* 80x100 bgpos area */ + height: 80px; + width: 60px; + padding: 10px; + border: 10px solid transparent; + } + + /* Test */ + .cover .test { + background: no-repeat url(support/green-intrinsic-width-height.svg); + } + .limit .test { + background: no-repeat url(support/red-intrinsic-width-height.svg); + } + .control { + width: 40px; + height: 60px; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-display-types-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-display-types-001.0.scss new file mode 100644 index 0000000000..5a3d20fd24 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-display-types-001.0.scss @@ -0,0 +1,25 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-display-types-001.htm */ + +div { counter-reset:ctr; quotes:"\0022" "\0022" "\0022" "\0022"} + +div:before { + content:counter(ctr) url(support/square-outline-32x32.png) open-quote "Before " attr(class); + counter-increment:ctr; +} +div:after { + content:counter(ctr) url(support/square-outline-32x32.png) "After " attr(class) close-quote; + counter-increment:ctr; +} + +.block:before, .block:after { display:block; } +.inline:before, .inline:after { display:inline; } +.inline-block:before, .inline-block:after { display:inline-block; } +.table:before, .table:after { display:table; } +.inline-table:before, .inline-table:after { display:inline-table; } +.table-row-group:before, .table-row-group:after { display:table-row-group; } +.table-row:before, .table-row:after { display:table-row; } +.table-cell:before, .table-cell:after { display:table-cell; } +.table-caption:before, .table-caption:after { display:table-caption; } + +div { border:1px solid green; margin:5px; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-dynamic-attr-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-dynamic-attr-001.0.scss new file mode 100644 index 0000000000..b2b28a5c97 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-dynamic-attr-001.0.scss @@ -0,0 +1,12 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-dynamic-attr-001.htm */ + +body { + font-family:sans-serif; +} +body:before { + content:attr(my-attr); +} +body:after { + content:attr(my-attr-2); +} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-dynamic-restyle-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-dynamic-restyle-001.0.scss new file mode 100644 index 0000000000..4a1861941e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-dynamic-restyle-001.0.scss @@ -0,0 +1,11 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-dynamic-restyle-001.htm */ + +body:before { + content:"Before"; + border:inherit; +} +.cl:after { + display:block; + content:"After"; +} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-floated-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-floated-001.0.scss new file mode 100644 index 0000000000..324cae53d2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-floated-001.0.scss @@ -0,0 +1,29 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-floated-001.htm */ + +div { counter-reset:ctr; quotes:"\0022" "\0022" "\0022" "\0022"; } + +div:before { + content:counter(ctr) url(support/square-outline-32x32.png) open-quote "Before " attr(class); + counter-increment:ctr; +} +div:after { + content:counter(ctr) url(support/square-outline-32x32.png) "After " attr(class) close-quote; + counter-increment:ctr; +} + +.beforeleft:before { + float:left; +} +.beforeright:before { + float:right; +} +.afterleft:after { + float:left; +} +.afterright:after { + float:right; +} + +div { border:1px solid green; margin:5px; } +div { overflow:auto; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-images-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-images-001.0.scss new file mode 100644 index 0000000000..c419306c2a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-images-001.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-images-001.htm */ + +div:before { + content:url(missing-image.png); +} +div { border:1px solid green; margin:5px; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-positioned-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-positioned-001.0.scss new file mode 100644 index 0000000000..a5b7d7b26b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-positioned-001.0.scss @@ -0,0 +1,33 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-positioned-001.htm */ + +div { counter-reset:ctr; quotes:"\0022" "\0022" "\0022" "\0022"; } + +.gen:before { + content:counter(ctr) url(support/square-outline-32x32.png) open-quote "Before " attr(class); + counter-increment:ctr; +} +.gen:after { + content:counter(ctr) url(support/square-outline-32x32.png) "After " attr(class) close-quote; + counter-increment:ctr; +} + +.abs:before { + position:absolute; + left:0; +} +.abs:after { + position:absolute; + right:0; +} + +.rel:before { + position:relative; + top:-10px; +} +.rel:after { + position:relative; + top:10px; +} + +div { border:1px solid green; margin:5px; height:100px; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-positioned-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-positioned-001.1.scss new file mode 100644 index 0000000000..33ee1ef76b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-positioned-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-positioned-001.htm */ +.style { position:relative; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-table-parts-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-table-parts-001.0.scss new file mode 100644 index 0000000000..f199f3ae10 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-table-parts-001.0.scss @@ -0,0 +1,44 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-table-parts-001.htm */ + +table, div.gen { counter-reset:ctr; quotes:"\0022" "\0022" "\0022" "\0022"; } + +.gen:before { + content:counter(ctr) url(support/square-outline-32x32.png) open-quote "Before " attr(class); + counter-increment:ctr; +} +.gen:after { + content:counter(ctr) url(support/square-outline-32x32.png) "After " attr(class) close-quote; + counter-increment:ctr; +} + +table { border:1px solid blue; } +td { border:1px solid cyan; } +td { border-spacing:0; padding:0; } + +tr.gen:before, tr.gen:after { display:table-cell; } +tbody.gen:before, tbody.gen:after { display:table-row; } +table.gen:before, table.gen:after { display:table-row-group; } +table.col:before, table.gen.col:after { display:table-column-group; } +/* note reordering here! */ +table.headfoot:after { display:table-header-group; } +table.headfoot:before { display:table-footer-group; } + +.cell { display:table-cell; } +.row { display:table-row; } +.rowgroup { display:table-row-group; } +.table { display:table; } +div.gencell:before, div.gencell:after { display:table-cell; } +div.genrow:before, div.genrow:after { display:table-row; } +div.genblock:before, div.genblock:after { display:block; } +div.geninline:before, div.geninline:after { display:inline; } + +div { border:1px solid green; margin:5px; } + +.varyheight:before { height:100px; background:yellow; } +.varyheight > div { height:80px; background:orange; } +.varyheight:after { height:60px; background:brown; } + +.varywidth:before { background:yellow; } +.varywidth > div { background:orange; } +.varywidth:after { background:brown; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-table-parts-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-table-parts-001.1.scss new file mode 100644 index 0000000000..652b7fb64f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-table-parts-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-table-parts-001.htm */ +.style { border:none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/before-after-table-whitespace-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/before-after-table-whitespace-001.0.scss new file mode 100644 index 0000000000..a4bd9b3f27 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/before-after-table-whitespace-001.0.scss @@ -0,0 +1,17 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/before-after-table-whitespace-001.htm */ + +.gen0:before { + padding:1px; +} +.gen1:before { + content: " "; +} +.gen2:before { + content: attr(missing); +} +.gen3:before { + content: url(missing-image.png); +} + +div { border:1px solid green; margin:5px; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-001.0.scss new file mode 100644 index 0000000000..f2d73053d4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-001.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-append-001.htm */ + + + body > span { outline: 1px dotted black; } + body > span > span { display: block; width: 10em; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-002.0.scss new file mode 100644 index 0000000000..15821f265e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-002.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-append-002.htm */ + + #outermost { border: 2px solid; } + #outer { border: 4px solid yellow; } + #inner { border: 6px sold green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-002.1.scss new file mode 100644 index 0000000000..92b70020f2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-append-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-append-002.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.0.scss new file mode 100644 index 0000000000..c59fe1cefd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-001.htm */ +.style { direction: ltr } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.1.scss new file mode 100644 index 0000000000..24f75e5c03 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-001.htm */ +.style { border: 5px solid blue; border-left: none; border-right: none; padding-right: 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.2.scss new file mode 100644 index 0000000000..578cdb672b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-001.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.0.scss new file mode 100644 index 0000000000..ebd82de172 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-002.htm */ +.style { direction: rtl } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.1.scss new file mode 100644 index 0000000000..800d89067f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-002.htm */ +.style { border: 5px solid blue; border-left: none; border-right: none; padding-right: 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.2.scss new file mode 100644 index 0000000000..47d968fb36 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-002.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.0.scss new file mode 100644 index 0000000000..bec0ff7a45 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-003.htm */ +.style { direction: ltr } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.1.scss new file mode 100644 index 0000000000..d55949134e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-003.htm */ +.style { border: 5px solid blue; border-left: none; border-right: none; padding-left: 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.2.scss new file mode 100644 index 0000000000..972cbf30eb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-003.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.0.scss new file mode 100644 index 0000000000..6259effef6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-004.htm */ +.style { direction: rtl } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.1.scss new file mode 100644 index 0000000000..85f7e37a8c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-004.htm */ +.style { border: 5px solid blue; border-left: none; border-right: none; padding-left: 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.2.scss new file mode 100644 index 0000000000..e4dfb13524 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-empty-004.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-empty-004.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.0.scss new file mode 100644 index 0000000000..081e58affc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-float-between-001.htm */ +.style { position: relative; left: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.1.scss new file mode 100644 index 0000000000..99babd326f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-float-between-001.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.2.scss new file mode 100644 index 0000000000..8f5a27f693 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-float-between-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-float-between-001.htm */ +.style { float: left } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001a.0.scss new file mode 100644 index 0000000000..4482654240 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001a.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001a.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001b.0.scss new file mode 100644 index 0000000000..d0b1193abc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001b.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001c.0.scss new file mode 100644 index 0000000000..a820d992bc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001c.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001c.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001d.0.scss new file mode 100644 index 0000000000..dc7c044309 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001d.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001d.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001e.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001e.0.scss new file mode 100644 index 0000000000..4ee59b7c3c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001e.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001e.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001f.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001f.0.scss new file mode 100644 index 0000000000..544fddaee6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001f.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001f.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001g.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001g.0.scss new file mode 100644 index 0000000000..5bbfb01512 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001g.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001g.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001h.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001h.0.scss new file mode 100644 index 0000000000..d03bbf51a7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001h.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001h.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001i.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001i.0.scss new file mode 100644 index 0000000000..d48cc6477c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001i.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001i.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001j.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001j.0.scss new file mode 100644 index 0000000000..8662fec547 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001j.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001j.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001k.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001k.0.scss new file mode 100644 index 0000000000..ed1c00b772 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001k.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001k.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001l.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001l.0.scss new file mode 100644 index 0000000000..7e792b2f0b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-001l.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-001l.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002a.0.scss new file mode 100644 index 0000000000..76a2977e4f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002a.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002a.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002b.0.scss new file mode 100644 index 0000000000..1c468dc942 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002b.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002c.0.scss new file mode 100644 index 0000000000..17517332ea --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002c.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002c.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002d.0.scss new file mode 100644 index 0000000000..697822ae0a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002d.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002d.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002e.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002e.0.scss new file mode 100644 index 0000000000..20d8d46d16 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002e.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002e.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002f.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002f.0.scss new file mode 100644 index 0000000000..b0680028e7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002f.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002f.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002g.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002g.0.scss new file mode 100644 index 0000000000..67bc7ebadc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002g.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002g.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002h.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002h.0.scss new file mode 100644 index 0000000000..5c7c0a767d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002h.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002h.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002i.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002i.0.scss new file mode 100644 index 0000000000..810b088676 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-002i.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-002i.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-003.0.scss new file mode 100644 index 0000000000..71760d321c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-003.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-003.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-004.0.scss new file mode 100644 index 0000000000..7d18b5f0bb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-004.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-004.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-006.0.scss new file mode 100644 index 0000000000..5fae99411f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-006.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-006.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-007.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-007.0.scss new file mode 100644 index 0000000000..3e59471379 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-007.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-007.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008a.0.scss new file mode 100644 index 0000000000..840e4c41ac --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008a.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-008a.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008b.0.scss new file mode 100644 index 0000000000..b1e3f46489 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-008b.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008c.0.scss new file mode 100644 index 0000000000..9ccc845aa6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-008c.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-008c.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-009.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-009.0.scss new file mode 100644 index 0000000000..134414535f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-009.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-009.htm */ + + body > span { border: 3px solid blue } + body > span > span { border: 3px solid cyan } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-010.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-010.0.scss new file mode 100644 index 0000000000..62431c82a3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-010.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-010.htm */ + + body > span { border: 3px solid blue } + body > span > span { border: 3px solid cyan } + body > span > span:after { content: "Ten" } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-011.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-011.0.scss new file mode 100644 index 0000000000..2844241d70 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-011.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-011.htm */ + + body > span { border: 3px solid blue } + body > span > span { border: 3px solid cyan } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-012.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-012.0.scss new file mode 100644 index 0000000000..105753b69f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-012.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-012.htm */ + + #i { display: inline; border: 2px solid; } + #i:after { display: block; content: "Three"; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-013.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-013.0.scss new file mode 100644 index 0000000000..dd0da56c7d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-013.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-013.htm */ + + #i { border: 2px solid; } + #i:before { display: block; content: "One"; } + #i:after { content: "Three"; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-013.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-013.1.scss new file mode 100644 index 0000000000..fce9f7e44a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-013.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-013.htm */ +.style { display: none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-014.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-014.0.scss new file mode 100644 index 0000000000..0d1f7f3a3e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-014.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-014.htm */ + + #i { border: 2px solid; } + #i:before { display: block; content: "One"; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-014.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-014.1.scss new file mode 100644 index 0000000000..4fb8ca38ec --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-014.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-014.htm */ +.style { display: none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-015.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-015.0.scss new file mode 100644 index 0000000000..064cb0734c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-015.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-015.htm */ + + #i { display: inline; border: 2px solid; } + #i:after { display: block; content: "Three"; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016a.0.scss new file mode 100644 index 0000000000..27a0dd79bd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-016a.htm */ + + #i { border: 2px solid; } + #i:after { display: block; content: "Two"; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016a.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016a.1.scss new file mode 100644 index 0000000000..e2ddc868f4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016a.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-016a.htm */ +.style { display: none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016b.0.scss new file mode 100644 index 0000000000..7b53f1212b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-016b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-016b.htm */ + + #i { border: 2px solid; } + #i:after { display: block; content: "Two"; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.0.scss new file mode 100644 index 0000000000..fb90ff7fde --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-017.htm */ +.style { width: 0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.1.scss new file mode 100644 index 0000000000..7efbd77d83 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-017.htm */ +.style { border: 2px solid blue; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.2.scss new file mode 100644 index 0000000000..95aac0261c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-insert-017.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-insert-017.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001a.0.scss new file mode 100644 index 0000000000..d683f3fa54 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001a.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-001a.htm */ +.style { direction: ltr; width: 100px; border: 1px solid green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001a.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001a.1.scss new file mode 100644 index 0000000000..aae6310bf0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001a.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-001a.htm */ +.style { display: block; height: 20px; width: 80px; margin: 10px; border: 5px solid black } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.0.scss new file mode 100644 index 0000000000..4a040231ea --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-001b.htm */ +.style { direction: ltr; width: 100px; border: 1px solid green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.1.scss new file mode 100644 index 0000000000..5f99cd4c5c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-001b.htm */ +.style { direction: rtl } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.2.scss new file mode 100644 index 0000000000..bede015e4e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-001b.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-001b.htm */ +.style { display: block; height: 20px; width: 80px; margin: 10px; border: 5px solid black } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002a.0.scss new file mode 100644 index 0000000000..7c7cbd0808 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002a.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-002a.htm */ +.style { direction: rtl; width: 100px; border: 1px solid green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002a.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002a.1.scss new file mode 100644 index 0000000000..305b8ac11a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002a.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-002a.htm */ +.style { display: block; height: 20px; width: 80px; margin: 10px; border: 5px solid black } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.0.scss new file mode 100644 index 0000000000..7b8252e044 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-002b.htm */ +.style { direction: rtl; width: 100px; border: 1px solid green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.1.scss new file mode 100644 index 0000000000..11e90f792e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-002b.htm */ +.style { direction: ltr } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.2.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.2.scss new file mode 100644 index 0000000000..3416f8de01 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-margins-002b.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-margins-002b.htm */ +.style { display: block; height: 20px; width: 80px; margin: 10px; border: 5px solid black } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-001.0.scss new file mode 100644 index 0000000000..e78538e895 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-nested-001.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-002.0.scss new file mode 100644 index 0000000000..9367c041d0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-002.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-nested-002.htm */ +.style { border: 5px solid blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-002.1.scss new file mode 100644 index 0000000000..fee6eb9e60 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-nested-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-nested-002.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-percents-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-percents-001.0.scss new file mode 100644 index 0000000000..efb841d5dc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-percents-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-percents-001.htm */ +.style { height: 200px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-percents-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-percents-001.1.scss new file mode 100644 index 0000000000..57e6d10c49 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-percents-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-percents-001.htm */ +.style { display: block; height: 50%; border: 10px solid black } diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-001.0.scss new file mode 100644 index 0000000000..ebe1d5373b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-remove-001.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-002.0.scss new file mode 100644 index 0000000000..ca9c6e7a45 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-002.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-remove-002.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-003.0.scss new file mode 100644 index 0000000000..dc223e8297 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-003.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-remove-003.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-004.0.scss new file mode 100644 index 0000000000..ed1891d7f0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-004.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-remove-004.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-005.0.scss new file mode 100644 index 0000000000..c3f1c4fcc0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-005.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-remove-005.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-006.0.scss new file mode 100644 index 0000000000..2f4d5643be --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-remove-006.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-remove-006.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-whitespace-001a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-whitespace-001a.0.scss new file mode 100644 index 0000000000..a0fdf69e23 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-whitespace-001a.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-whitespace-001a.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-whitespace-001b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-whitespace-001b.0.scss new file mode 100644 index 0000000000..4c860c2a7e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/block-in-inline-whitespace-001b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/block-in-inline-whitespace-001b.htm */ + + body > span { border: 3px solid blue } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.0.scss new file mode 100644 index 0000000000..898d753e68 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-001.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.1.scss new file mode 100644 index 0000000000..7a2f6b66db --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-001.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.2.scss new file mode 100644 index 0000000000..bfd8fdb6e5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-001.htm */ +.style { border-style:none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.0.scss new file mode 100644 index 0000000000..e0dbae8b77 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-002.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.1.scss new file mode 100644 index 0000000000..a5f32321c6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-002.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.2.scss new file mode 100644 index 0000000000..49b52904b4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-002.htm */ +.style { border-width:11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-003.0.scss new file mode 100644 index 0000000000..8b018c1980 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-003.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-003.1.scss new file mode 100644 index 0000000000..c4dc834384 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-003.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.0.scss new file mode 100644 index 0000000000..1f0a0f3c56 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-004.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.1.scss new file mode 100644 index 0000000000..14810d15b6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-004.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.2.scss new file mode 100644 index 0000000000..15f89578e1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-004.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-004.htm */ +.style { border-style:none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.0.scss new file mode 100644 index 0000000000..5117efb468 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-005.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.1.scss new file mode 100644 index 0000000000..2e248a0aaa --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-005.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.2.scss new file mode 100644 index 0000000000..15ba20a79f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-cell-005.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-cell-005.htm */ +.style { border-style:none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.0.scss new file mode 100644 index 0000000000..d6af94204f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-001.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.1.scss new file mode 100644 index 0000000000..1d942d6b38 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-001.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.2.scss new file mode 100644 index 0000000000..27a43b6bd8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-001.htm */ +.style { border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.0.scss new file mode 100644 index 0000000000..ae15dde154 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-002.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.1.scss new file mode 100644 index 0000000000..8ee152dc38 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-002.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.2.scss new file mode 100644 index 0000000000..c6318a3584 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-002.htm */ +.style { border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.0.scss new file mode 100644 index 0000000000..0d7f407a9d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-003.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.1.scss new file mode 100644 index 0000000000..e58b8bb8df --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-003.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.2.scss new file mode 100644 index 0000000000..cadad9538f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-colgroup-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-colgroup-003.htm */ +.style { border:outset green 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.0.scss new file mode 100644 index 0000000000..ba42b5052f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-001.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.1.scss new file mode 100644 index 0000000000..262d6bbedd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-001.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.2.scss new file mode 100644 index 0000000000..d32773435c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-001.htm */ +.style { border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.0.scss new file mode 100644 index 0000000000..4ca986a899 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-002.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.1.scss new file mode 100644 index 0000000000..caf207660d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-002.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.2.scss new file mode 100644 index 0000000000..f7228f354e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-002.htm */ +.style { border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.0.scss new file mode 100644 index 0000000000..d5b7eae31a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-003.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.1.scss new file mode 100644 index 0000000000..4b42a2998c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-003.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.2.scss new file mode 100644 index 0000000000..a967891706 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-column-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-column-003.htm */ +.style { border:outset green 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.0.scss new file mode 100644 index 0000000000..070b886636 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-001.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.1.scss new file mode 100644 index 0000000000..0aec943a6c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-001.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.2.scss new file mode 100644 index 0000000000..1c23b85d86 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-001.htm */ +.style { border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.0.scss new file mode 100644 index 0000000000..7bfdeac373 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-002.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.1.scss new file mode 100644 index 0000000000..f50de68330 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-002.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.2.scss new file mode 100644 index 0000000000..62bb238c7a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-002.htm */ +.style { border:solid green 2px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.0.scss new file mode 100644 index 0000000000..a18235986c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-003.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.1.scss new file mode 100644 index 0000000000..16f289c84f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-003.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.2.scss new file mode 100644 index 0000000000..0cef689399 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-row-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-row-003.htm */ +.style { border:outset green 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.0.scss new file mode 100644 index 0000000000..aa87c0c1d3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-001.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.1.scss new file mode 100644 index 0000000000..9d26fe3df3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-001.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.2.scss new file mode 100644 index 0000000000..7195bcef72 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-001.htm */ +.style { border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.0.scss new file mode 100644 index 0000000000..be951ef050 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-002.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.1.scss new file mode 100644 index 0000000000..8fde9220db --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-002.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.2.scss new file mode 100644 index 0000000000..86f188e449 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-002.htm */ +.style { border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.0.scss new file mode 100644 index 0000000000..7a94d7c74b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-003.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.1.scss new file mode 100644 index 0000000000..2c43199f38 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-003.htm */ +.style { border-collapse:collapse } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.2.scss new file mode 100644 index 0000000000..08d7e668d6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-rowgroup-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-rowgroup-003.htm */ +.style { border:outset green 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-001.0.scss new file mode 100644 index 0000000000..98f04c7a57 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-table-001.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-001.1.scss new file mode 100644 index 0000000000..7a7cf28388 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-table-001.htm */ +.style { border-collapse:collapse; border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-002.0.scss new file mode 100644 index 0000000000..d5453532b4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-table-002.htm */ + +td { border: 10px green solid;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-002.1.scss new file mode 100644 index 0000000000..da3a1b0a1b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-table-002.htm */ +.style { border-collapse:collapse; border:solid green 11px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-003.0.scss new file mode 100644 index 0000000000..aff4d99c71 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-table-003.htm */ + +td { border: 10px green outset;} +table {margin: 30px} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-003.1.scss new file mode 100644 index 0000000000..fd48bad69d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-dynamic-table-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-dynamic-table-003.htm */ +.style { border-collapse:collapse; border:none green 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.0.scss new file mode 100644 index 0000000000..10da13d64d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-offset-001.htm */ + +td {width: 100px; text-align:center} +div {position:absolute; border:green 4px solid} + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.1.scss new file mode 100644 index 0000000000..c87fcbc76a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-offset-001.htm */ +.style { border-collapse:collapse; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.2.scss new file mode 100644 index 0000000000..340f309e2e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-offset-001.htm */ +.style { border:solid 4px orange; height:30px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.0.scss new file mode 100644 index 0000000000..d33ffa4284 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-offset-002.htm */ + +td {width: 100px; text-align:center} +caption {border:solid 4px green} + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.1.scss new file mode 100644 index 0000000000..88535218ab --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-offset-002.htm */ +.style { border-collapse:collapse; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.2.scss new file mode 100644 index 0000000000..ee3eb8c007 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/border-collapse-offset-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/border-collapse-offset-002.htm */ +.style { border:solid 4px orange; height:30px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/charset-attr-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/charset-attr-001.0.scss new file mode 100644 index 0000000000..b09d86f8f7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/charset-attr-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/charset-attr-001.htm */ + + body { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/charset-attr-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/charset-attr-001.1.scss Binary files differnew file mode 100644 index 0000000000..bfaba9dc01 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/charset-attr-001.1.scss diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-1.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-1.0.scss new file mode 100644 index 0000000000..f0a8248396 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-1.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-1.html */ +li,p { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-10.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-10.0.scss new file mode 100644 index 0000000000..d0d1a14d60 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-10.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-10.html */ +p { background-color : red } +p[title$="bar"] { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-11.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-11.0.scss new file mode 100644 index 0000000000..ca558792b0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-11.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-11.html */ +p { background-color : red } +p[title*="bar"] { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-13.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-13.0.scss new file mode 100644 index 0000000000..344a9e8e46 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-13.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-13.html */ +li { background-color : red } +.t1 { background-color : lime } +li.t2 { background-color : lime } +.t3 { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14.0.scss new file mode 100644 index 0000000000..faf4d3c7cb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14.0.scss @@ -0,0 +1,10 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-14.html */ +p { background-color : red ; border : thick solid red ; padding : 1em } +p.t1 { background-color : lime } +p.t2 { border : thick solid green } + +div { background: green; color: white; } +div.teST { background: red; color: yellow; } +div.te { background: red; color: yellow; } +div.st { background: red; color: yellow; } +div.te.st { background: red; color: yellow; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-144.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-144.0.scss new file mode 100644 index 0000000000..c669785ac7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-144.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-144.html */ +div :not(:enabled):not(:disabled) { background: lime; } +p { background : red;} diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-148.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-148.0.scss new file mode 100644 index 0000000000..a41bb1ed85 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-148.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-148.html */ + + p { background: lime; } + p:empty { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-149.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-149.0.scss new file mode 100644 index 0000000000..23eba2f553 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-149.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-149.html */ + + address:empty { background: lime; } + address { background: red; margin: 0; height: 1em; } + .text { margin: -1em 0 0 0; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-149b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-149b.0.scss new file mode 100644 index 0000000000..ae6c5ca1c7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-149b.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-149b.html */ + + address:empty { background: lime; } + address { background: red; margin: 0; height: 1em; } + .text { margin: -1em 0 0 0; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14b.0.scss new file mode 100644 index 0000000000..5851edc2e3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14b.0.scss @@ -0,0 +1,10 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-14b.html */ + +p { background: green; color: white; } +.t1.fail { background: red; color: yellow; } +.fail.t1 { background: red; color: yellow; } +.t2.fail { background: red; color: yellow; } +.fail.t2 { background: red; color: yellow; } +/* Note: This is a valid test even per CSS1, since in CSS1 those rules + are invalid and should be dropped. */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14c.0.scss new file mode 100644 index 0000000000..d32fec8496 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14c.0.scss @@ -0,0 +1,9 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-14c.html */ + +p { background: red; color: yellow; } +p.t1.t2 { background: green; color: white; } +div { background: green; color: white; } +div.t1 { background: red; color: yellow; } +address { background: red; color: yellow; } +address.t5.t5 { background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14d.0.scss new file mode 100644 index 0000000000..3432db6913 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14d.0.scss @@ -0,0 +1,8 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-14d.html */ + +p { background: green; color: white; } +.t1:not(.t2) { background: red; color: yellow; } +:not(.t2).t1 { background: red; color: yellow; } +.t2:not(.t1) { background: red; color: yellow; } +:not(.t1).t2 { background: red; color: yellow; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14e.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14e.0.scss new file mode 100644 index 0000000000..979edeed91 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-14e.0.scss @@ -0,0 +1,9 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-14e.html */ + +p { background: green; color: white; } +p:not(.t1):not(.t2) { background: red; color: yellow; } +div { background: red; color: yellow; } +div:not(.t1) { background: green; color: white; } +address { background: green; color: white; } +address:not(.t5):not(.t5) { background: red; color: yellow; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-15.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-15.0.scss new file mode 100644 index 0000000000..ff1d3a2d9b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-15.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-15.html */ +li { background-color : red } +#t1 { background-color : lime } +li#t2 { background-color : lime } +li#t3 { background-color : lime } +#t4 { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-150.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-150.0.scss new file mode 100644 index 0000000000..bb9cc2cb7c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-150.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-150.html */ + + address:empty { background: lime; } + address { background: red; margin: 0; height: 1em; } + .text { margin: -1em 0 0 0; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-151.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-151.0.scss new file mode 100644 index 0000000000..ec229bdd33 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-151.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-151.html */ + + address { background: lime; margin: 0; height: 1em; } + address:empty { background: red; } + .text { margin: -1em 0 0 0; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-152.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-152.0.scss new file mode 100644 index 0000000000..bf765f8b5d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-152.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-152.html */ + + address { background: lime; margin: 0; height: 1em; } + address:empty { background: red; } + .text { margin: -1em 0 0 0; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155.0.scss new file mode 100644 index 0000000000..1f073c35b4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-155.html */ + + p { background: lime; } + .5cm { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155a.0.scss new file mode 100644 index 0000000000..9ce3a19428 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-155a.html */ + + p { background: lime; } + .\5cm { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155b.0.scss new file mode 100644 index 0000000000..83340f5351 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155b.0.scss @@ -0,0 +1,10 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-155b.html */ + + p { background: lime; } + .two\ words { background: red; } + + /* the "." and "~=" forms match on a space separated list of words. + In such a list, a word containing a space can never match, since it + would by definition be two words. */ + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155c.0.scss new file mode 100644 index 0000000000..516c8de4e0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-155c.html */ + + p { background: lime; } + .one.word { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155d.0.scss new file mode 100644 index 0000000000..6930469379 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-155d.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-155d.html */ + + .one\.word { background: lime; } + p { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156.0.scss new file mode 100644 index 0000000000..058b6b4290 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-156.html */ + + p { background: lime; } + foo & address, p { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156b.0.scss new file mode 100644 index 0000000000..033b8f59a9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-156b.html */ + + foo & address, p { background: red; } + p { background: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156c.0.scss new file mode 100644 index 0000000000..62d2a7ceb6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-156c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-156c.html */ + + foo & address, p { background: red ! important; } + p { background: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-159.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-159.0.scss new file mode 100644 index 0000000000..6f85988756 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-159.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-159.html */ + + ::selection { background: lime; } + :selection { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-15b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-15b.0.scss new file mode 100644 index 0000000000..b2fb3ac6ae --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-15b.0.scss @@ -0,0 +1,9 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-15b.html */ + +p { background: green; color: white; } +#test#fail { background: red; color: yellow; } +#fail#test { background: red; color: yellow; } +#fail { background: red; color: yellow; } +div { background: red; color: yellow; } +#pass#pass { background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-16.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-16.0.scss new file mode 100644 index 0000000000..7b909a1ac1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-16.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-16.html */ +p.test a { background-color : red } +p.test *:link { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-160.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-160.0.scss new file mode 100644 index 0000000000..45c7c74e02 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-160.0.scss @@ -0,0 +1,7 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-160.html */ + + p { background: lime; } + p:subject { background: red; } /* this is not valid CSS, and if UAs + implemented the experimental :subject pseudo-class they should have + used the :-vnd-ident syntax. */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-161.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-161.0.scss new file mode 100644 index 0000000000..c10cdd2dfd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-161.0.scss @@ -0,0 +1,26 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-161.html */ + + p { background: lime; } + p * { background: lime; } + p > * { background: lime; } + p + * { background: lime; } + p ~ * { background: lime; } + + /* let's try some pseudos that are not valid CSS but are likely to + be implemented as extensions in some UAs. These should not be + recognised, as UAs implementing such extensions should use the + :-vnd-ident syntax. */ + + :canvas { background: red; } + :viewport { background: red; } + :window { background: red; } + :menu { background: red; } + :table { background: red; } + :select { background: red; } + ::canvas { background: red; } + ::viewport { background: red; } + ::window { background: red; } + ::menu { background: red; } + ::table { background: red; } + ::select { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-166.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-166.0.scss new file mode 100644 index 0000000000..de27d9ffd2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-166.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-166.html */ + + p:first-letter { background-color: red; } + p::first-letter { background-color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-166a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-166a.0.scss new file mode 100644 index 0000000000..ed465fe93b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-166a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-166a.html */ + + p::first-letter { background-color: red; } + p:first-letter { background-color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-167.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-167.0.scss new file mode 100644 index 0000000000..5aad6a87bd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-167.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-167.html */ + + p:first-line { background-color: red; } + p::first-line { background-color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-167a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-167a.0.scss new file mode 100644 index 0000000000..109defc654 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-167a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-167a.html */ + + p::first-line { background-color: red; } + p:first-line { background-color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-168.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-168.0.scss new file mode 100644 index 0000000000..81f5c1e9b1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-168.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-168.html */ + + span:before { background-color: red; content: 'FAILED'; } + span::before { background-color: lime; content: 'PASSED'; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-168a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-168a.0.scss new file mode 100644 index 0000000000..0898dd7d8c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-168a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-168a.html */ + + span::before { background-color: red; content: 'FAILED'; } + span:before { background-color: lime; content: 'PASSED'; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-169.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-169.0.scss new file mode 100644 index 0000000000..69ddf7fccc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-169.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-169.html */ + + span:after { background-color: red; content: 'FAILED'; } + span::after { background-color: lime; content: 'PASSED'; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-169a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-169a.0.scss new file mode 100644 index 0000000000..efb74238ec --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-169a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-169a.html */ + + span::after { background-color: red; content: 'FAILED'; } + span:after { background-color: lime; content: 'PASSED'; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-17.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-17.0.scss new file mode 100644 index 0000000000..2b881ad09d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-17.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-17.html */ +p.test a { background-color : red } +p.test *:visited { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170.0.scss new file mode 100644 index 0000000000..e33d2f5b12 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-170.html */ + + span { color: red; } + span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span, span { color: green } /* 2049 */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170a.0.scss new file mode 100644 index 0000000000..7d09cee5ee --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-170a.html */ + + .span { color: red; } + .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span, .span { color: green } /* 2049 */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170b.0.scss new file mode 100644 index 0000000000..9144c18516 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-170b.html */ + + .span { color: red; } + .span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span.span { color: green } /* 2049 */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170c.0.scss new file mode 100644 index 0000000000..adcf326e76 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-170c.html */ + + p.span { color: red; } + p:not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span):not(.span) { color: green } /* 2049 */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170d.0.scss new file mode 100644 index 0000000000..1ace26ae1f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-170d.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-170d.html */ + + p { color: red; } + p:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child:first-child { color: green } /* 2049 */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175a.0.scss new file mode 100644 index 0000000000..eb61d12ff2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-175a.html */ + + p { color: green; } + .13 { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175b.0.scss new file mode 100644 index 0000000000..91066d4671 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-175b.html */ + + p { color: green; } + .\13 { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175c.0.scss new file mode 100644 index 0000000000..d7555e9fa0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-175c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-175c.html */ + + p { color: red; } + .\31 \33 { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-176.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-176.0.scss new file mode 100644 index 0000000000..474be8d9e8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-176.0.scss @@ -0,0 +1,11 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-176.html */ + +p { background: red; color: yellow; } +p:not(#other).class:not(.fail).test#id#id { background: green; color: white; } +div { background: green; color: white; } +div:not(#theid).class:not(.fail).test#theid#theid { background: red; color: yellow; } +div:not(#other).notclass:not(.fail).test#theid#theid { background: red; color: yellow; } +div:not(#other).class:not(.test).test#theid#theid { background: red; color: yellow; } +div:not(#other).class:not(.fail).nottest#theid#theid { background: red; color: yellow; } +div:not(#other).class:not(.fail).nottest#theid#other { background: red; color: yellow; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-177a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-177a.0.scss new file mode 100644 index 0000000000..29359bcba2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-177a.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-177a.html */ + + p:selection { color: yellow; background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-177b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-177b.0.scss new file mode 100644 index 0000000000..64f2c84901 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-177b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-177b.html */ + + div { color: green; } + p::first-child { color: yellow; background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-178.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-178.0.scss new file mode 100644 index 0000000000..92b765dff4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-178.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-178.html */ + + div { color: green; } + p:not(:first-line) { color: yellow; background: red; } + p:not(:after) { color: yellow; background: red; content: ' THIS TEST HAS FAILED! '; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-179.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-179.0.scss new file mode 100644 index 0000000000..ce5e3a8630 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-179.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-179.html */ + + p { color: green; } + span:first-line { background: red; color: yellow; font-size: 4em; } + span::first-line { background: red; color: yellow; font-size: 4em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-179a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-179a.0.scss new file mode 100644 index 0000000000..660e7508dc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-179a.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-179a.html */ + + p { color: green; } + p:first-line { background: red; color: yellow; font-size: 4em; } + p::first-line { background: red; color: yellow; font-size: 4em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18.0.scss new file mode 100644 index 0000000000..33067afba0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18.0.scss @@ -0,0 +1,8 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-18.html */ +p:hover { background-color : lime } +a:hover { background-color : lime } + +tr:hover { background-color : green } +td:hover { background-color : lime } + +table { border-spacing: 5px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-180a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-180a.0.scss new file mode 100644 index 0000000000..a7a641bcb6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-180a.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-180a.html */ + + p { color: green; } + p:first-letter { background: red; color: yellow; font-size: 4em; } + p::first-letter { background: red; color: yellow; font-size: 4em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-181.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-181.0.scss new file mode 100644 index 0000000000..24dbd1031d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-181.0.scss @@ -0,0 +1,15 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-181.html */ + + .cs { color: green; } + .cs P { background: red; color: yellow; } + .cs .a { background: red; color: yellow; } + .cs .span1 span { background: red; color: yellow; } + .cs .span2 { color: red; } + .cs .span2 SPAN { color: green; } + .cs .span2 span { background: red; color: yellow; } + .ci { color: red; } + .ci P { background: green; color: white; } + .ci .a { background: green; color: white; } + .ci .span1 span { background: green; color: white; } + .ci .span2 SPAN { background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184a.0.scss new file mode 100644 index 0000000000..7d5c5fd2d4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-184a.html */ + +p { color: lime; } +p[class$=""] { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184b.0.scss new file mode 100644 index 0000000000..f0e5f98b15 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-184b.html */ + +p { color: lime; } +p[class^=""] { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184c.0.scss new file mode 100644 index 0000000000..892f85f7f3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-184c.html */ + +p { color: lime; } +p[class*=""] { color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184d.0.scss new file mode 100644 index 0000000000..ad721d0131 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184d.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-184d.html */ + +p { color: red; } +p:not([class$=""]) { color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184e.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184e.0.scss new file mode 100644 index 0000000000..b1ae45984c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184e.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-184e.html */ + +p { color: red; } +p:not([class^=""]) { color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184f.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184f.0.scss new file mode 100644 index 0000000000..8d461ff6d6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-184f.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-184f.html */ + +p { color: red; } +p:not([class*=""]) { color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18a.0.scss new file mode 100644 index 0000000000..ccd04a2cef --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18a.0.scss @@ -0,0 +1,12 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-18a.html */ + +p { color: navy; } + +.a a:hover { background: green; color: white; } + +.b a:hover { background: red; color: yellow; } +.b a:link { background: green; color: white; } + +.c :link { background: green; color: white; } +.c :visited:hover { background: red; color: yellow; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18b.0.scss new file mode 100644 index 0000000000..87405f66f8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-18b.html */ +div:hover > p:first-child { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18c.0.scss new file mode 100644 index 0000000000..519cbce0ee --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-18c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-18c.html */ + +:link, :visited { color: navy; text-decoration: none; } +:link:hover span { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-19.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-19.0.scss new file mode 100644 index 0000000000..8b13ef8766 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-19.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-19.html */ +a:active { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-19b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-19b.0.scss new file mode 100644 index 0000000000..c5ddec6c1d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-19b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-19b.html */ +button:active { background: green; color: white; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-2.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-2.0.scss new file mode 100644 index 0000000000..ae64542b1c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-2.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-2.html */ +address { background-color: lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-20.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-20.0.scss new file mode 100644 index 0000000000..5a2ef60ca9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-20.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-20.html */ +a:focus { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21.0.scss new file mode 100644 index 0000000000..c391cb4d6f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-21.html */ +p:target { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21b.0.scss new file mode 100644 index 0000000000..ef7b904578 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21b.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-21b.html */ +p { background-color: lime; } +p:target { background-color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21c.0.scss new file mode 100644 index 0000000000..842e11db74 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-21c.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-21c.html */ +:root { background-color: green; } +:target { background-color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-22.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-22.0.scss new file mode 100644 index 0000000000..62a0370b78 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-22.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-22.html */ +ul > li { background-color : red } +li:lang(en-GB) { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-23.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-23.0.scss new file mode 100644 index 0000000000..4415be07a9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-23.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-23.html */ +button { background-color : red } +input { background-color : red } +button:enabled { background-color : lime } +input:enabled { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-24.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-24.0.scss new file mode 100644 index 0000000000..40f518adc3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-24.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-24.html */ +button { background-color : red } +input { background-color : red } +button:disabled { background-color : lime } +input:disabled { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-25.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-25.0.scss new file mode 100644 index 0000000000..a9d194c71e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-25.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-25.html */ +input, span { background-color : red } +input:checked, input:checked + span { background-color : lime} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27.0.scss new file mode 100644 index 0000000000..6451254f09 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-27.html */ +html { background-color : red } +*:root { background-color: lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27a.0.scss new file mode 100644 index 0000000000..4482386911 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27a.0.scss @@ -0,0 +1,17 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-27a.html */ + +:root:first-child { background-color: red; } +:root:last-child { background-color: red; } +:root:only-child { background-color: red; } +:root:nth-child(1) { background-color: red; } +:root:nth-child(n) { background-color: red; } +:root:nth-last-child(1) { background-color: red; } +:root:nth-last-child(n) { background-color: red; } +:root:first-of-type { background-color: red; } +:root:last-of-type { background-color: red; } +:root:only-of-type { background-color: red; } +:root:nth-of-type(1) { background-color: red; } +:root:nth-of-type(n) { background-color: red; } +:root:nth-last-of-type(1) { background-color: red; } +:root:nth-last-of-type(n) { background-color: red; } +p { color: green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27b.0.scss new file mode 100644 index 0000000000..a21c7dbf6d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-27b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-27b.html */ +* html { background-color: red; } +* :root { background-color: red; } +p { color: green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-28.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-28.0.scss new file mode 100644 index 0000000000..3546bfc898 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-28.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-28.html */ +.red { background-color : red } +ul > li:nth-child(odd) { background-color : lime } +ol > li:nth-child(even) { background-color : lime } +table.t1 tr:nth-child(-n+4) { background-color : lime } +table.t2 td:nth-child(3n+1) { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-28b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-28b.0.scss new file mode 100644 index 0000000000..a91ad30283 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-28b.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-28b.html */ +.green { background-color : lime ! important } +ul > li:nth-child(odd) { background-color : red } +ol > li:nth-child(even) { background-color : red } +table.t1 tr:nth-child(-n+4) { background-color : red } +table.t2 td:nth-child(3n+1) { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-29.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-29.0.scss new file mode 100644 index 0000000000..0860aa4956 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-29.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-29.html */ +.red { background-color : red } +ul > li:nth-last-child(odd) { background-color : green } +ol > li:nth-last-child(even) { background-color : green } +table.t1 tr:nth-last-child(-n+4) { background-color : green } +table.t2 td:nth-last-child(3n+1) { background-color : green } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-29b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-29b.0.scss new file mode 100644 index 0000000000..eb55cc8de4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-29b.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-29b.html */ +.green { background-color : lime ! important } +ul > li:nth-last-child(odd) { background-color : red } +ol > li:nth-last-child(even) { background-color : red } +table.t1 tr:nth-last-child(-n+4) { background-color : red } +table.t2 td:nth-last-child(3n+1) { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-30.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-30.0.scss new file mode 100644 index 0000000000..46d21fae2a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-30.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-30.html */ +.red { background-color : red } +p:nth-of-type(3) { background-color : lime } +dl > :nth-of-type(3n+1) { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-31.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-31.0.scss new file mode 100644 index 0000000000..de45ba5eb1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-31.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-31.html */ +.red { background-color : red } +p:nth-last-of-type(3) { background-color : lime } +dl > :nth-last-of-type(3n+1) { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-32.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-32.0.scss new file mode 100644 index 0000000000..5fbf5c2b5e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-32.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-32.html */ +.red { background-color : red } +.t1 td:first-child { background-color : lime } +p > *:first-child { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-33.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-33.0.scss new file mode 100644 index 0000000000..507ac1b3cb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-33.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-33.html */ +.red { background-color : red } +.t1 td:last-child { background-color : lime } +p > *:last-child { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-34.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-34.0.scss new file mode 100644 index 0000000000..697d635940 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-34.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-34.html */ +.red { background-color : red } +address { margin-bottom : 1em ; margin-left : 1em } +address:first-of-type { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-35.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-35.0.scss new file mode 100644 index 0000000000..0fee4326d0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-35.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-35.html */ +.red { background-color : red } +address { margin-bottom : 1em ; margin-left : 1em } +address:last-of-type { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-36.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-36.0.scss new file mode 100644 index 0000000000..5190600df7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-36.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-36.html */ +.red { background-color : red } +p:only-child { background-color : lime } +div.testText > div > p { margin-left : 1em } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-37.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-37.0.scss new file mode 100644 index 0000000000..37d2a23b4c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-37.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-37.html */ +.red { background-color : red } +.t1 :only-of-type { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-38.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-38.0.scss new file mode 100644 index 0000000000..9a039639b1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-38.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-38.html */ +p:first-line { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39.0.scss new file mode 100644 index 0000000000..5243f7505a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-39.html */ +p:first-letter { font-size : xx-large ; background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39a.0.scss new file mode 100644 index 0000000000..af6c66bd8a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39a.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-39a.html */ +p:first-letter { color: lime; font-size: xx-large; } +p:before { color: red; content: 'T'; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39b.0.scss new file mode 100644 index 0000000000..38ff4ba000 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39b.0.scss @@ -0,0 +1,2 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-39b.html */ +p::first-letter { font-size : xx-large ; background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39c.0.scss new file mode 100644 index 0000000000..f49d085ddb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-39c.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-39c.html */ +p::first-letter { color: lime; font-size: xx-large; } + p::before { color: red; content: 'T'; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-3a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-3a.0.scss new file mode 100644 index 0000000000..a53bb65f46 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-3a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-3a.html */ +* { color : lime } +ul, p { color : red } +*.t1 { color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-4.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-4.0.scss new file mode 100644 index 0000000000..232286f470 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-4.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-4.html */ +#foo { background-color : lime } +p { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-41.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-41.0.scss new file mode 100644 index 0000000000..12049ebc09 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-41.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-41.html */ +p::before { background-color : lime ; content : "GENERATED CONTENT "} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-41a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-41a.0.scss new file mode 100644 index 0000000000..9092fb307f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-41a.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-41a.html */ +p:before { background-color : lime ; content : "GENERATED CONTENT "} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-42.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-42.0.scss new file mode 100644 index 0000000000..2c7b3c5930 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-42.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-42.html */ +p::after { background-color : lime ; content : "GENERATED CONTENT "} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-42a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-42a.0.scss new file mode 100644 index 0000000000..319f9620b6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-42a.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-42a.html */ +p:after { background-color : lime ; content : "GENERATED CONTENT "} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-43.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-43.0.scss new file mode 100644 index 0000000000..6bac1431f1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-43.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-43.html */ +.white { background-color: transparent ! important; } +.red { background-color: red; } +div.t1 p { background-color: lime; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-43b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-43b.0.scss new file mode 100644 index 0000000000..57d2e390f0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-43b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-43b.html */ +.white { background-color: transparent ! important; } +.green { background-color: lime; } +div.t1 p { background-color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44.0.scss new file mode 100644 index 0000000000..909bbca20e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-44.html */ +.white { background-color: transparent ! important; } +.red { background-color: red; } +div > p.test { background-color: lime; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44b.0.scss new file mode 100644 index 0000000000..b26c14087f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-44b.html */ +.white { background-color: transparent ! important; } +.green { background-color: lime; } +div > p.test { background-color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44c.0.scss new file mode 100644 index 0000000000..9279385479 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-44c.html */ + + .fail > div { background: red; color: yellow; } + .control { background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44d.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44d.0.scss new file mode 100644 index 0000000000..a8ed5ed793 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-44d.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-44d.html */ + + #fail > div { background: red; } + p { background: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45.0.scss new file mode 100644 index 0000000000..3de4e06318 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-45.html */ +.red { background-color : red } +div.stub > p + p { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45b.0.scss new file mode 100644 index 0000000000..02ddbde845 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-45b.html */ +.green { background-color: lime; } +.white { background-color: transparent ! important; } +div.stub > p + p { background-color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45c.0.scss new file mode 100644 index 0000000000..6ed552f04e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-45c.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-45c.html */ + + .fail + div { background: red; } + .control { background: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-46.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-46.0.scss new file mode 100644 index 0000000000..be3866cefe --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-46.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-46.html */ +.red { background-color : red } +div.stub > p ~ p { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-46b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-46b.0.scss new file mode 100644 index 0000000000..4de9c09290 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-46b.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-46b.html */ +.green { background-color : lime ! important } +div.stub > p ~ p { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-5.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-5.0.scss new file mode 100644 index 0000000000..acf0689798 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-5.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-5.html */ +p { background-color : red } +p[title] { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-54.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-54.0.scss new file mode 100644 index 0000000000..4be84ca7f0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-54.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-54.html */ +div.stub > * { color : red } +div.stub *:not([title^="si on"]) { color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-55.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-55.0.scss new file mode 100644 index 0000000000..eb3a0e6341 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-55.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-55.html */ +div.stub > * { color : red } +div.stub *:not([title$="tait"]) { color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-56.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-56.0.scss new file mode 100644 index 0000000000..e9a01bdad8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-56.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-56.html */ +div.stub > * { color : red } +div.stub *:not([title*=" on"]) { color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-59.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-59.0.scss new file mode 100644 index 0000000000..8c8d5d061c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-59.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-59.html */ +div.stub > * { color : red } +div.stub *:not(.foo) { color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-6.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-6.0.scss new file mode 100644 index 0000000000..514e4c3a8c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-6.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-6.html */ +address { background-color : red } +address[title="foo"] { background-color : lime } +span[title="a"] { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-60.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-60.0.scss new file mode 100644 index 0000000000..726b9f378b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-60.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-60.html */ +div.stub > * { color : red } +div.stub *:not(#foo) { color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-61.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-61.0.scss new file mode 100644 index 0000000000..2b346351b6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-61.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-61.html */ +div.stub > * { background-color : red } +div.stub *:not(:link) { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-62.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-62.0.scss new file mode 100644 index 0000000000..4181d2eec7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-62.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-62.html */ +div.stub > * { background-color : red } +div.stub *:not(:visited) { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-63.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-63.0.scss new file mode 100644 index 0000000000..24d4e99c5d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-63.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-63.html */ +div.stub * { color: lime; text-decoration: none; } +div.stub > * > *:not(:hover) { color: black } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-64.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-64.0.scss new file mode 100644 index 0000000000..480b30d221 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-64.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-64.html */ +div.stub * { color : lime } +div.stub > * > *:not(:active) { color : black } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-65.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-65.0.scss new file mode 100644 index 0000000000..30615dc8ef --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-65.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-65.html */ +a:not(:focus) { background-color: transparent; } +a { background-color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-66.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-66.0.scss new file mode 100644 index 0000000000..6532029b34 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-66.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-66.html */ +p { background-color: navy; color: white; } +p:not(:target) { background-color: white; color: black; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-66b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-66b.0.scss new file mode 100644 index 0000000000..6323784598 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-66b.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-66b.html */ +p { background-color: red; } +p:not(:target) { background-color: lime; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-67.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-67.0.scss new file mode 100644 index 0000000000..4e177b1149 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-67.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-67.html */ +div.stub * { background-color : red } +div.stub *:not(:lang(fr)) { background-color : green } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-68.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-68.0.scss new file mode 100644 index 0000000000..b6f16cb7a8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-68.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-68.html */ +button { background-color : red } +input { background-color : red } +button:not(:enabled) { background-color : lime } +input:not(:enabled) { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-69.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-69.0.scss new file mode 100644 index 0000000000..9f407b8406 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-69.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-69.html */ +button { background-color : red } +input { background-color : red } +button:not(:disabled) { background-color : lime } +input:not(:disabled) { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-7.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-7.0.scss new file mode 100644 index 0000000000..8f1a711e3e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-7.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-7.html */ +p { background-color : red } +p[class~="b"] { background-color : lime } +address { background-color : red } +address[title~="foo"] { background-color : lime } +span[class~="b"] { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-70.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-70.0.scss new file mode 100644 index 0000000000..23ec933cc2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-70.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-70.html */ +input, span { background-color : red } +input:not(:checked), input:not(:checked) + span { background-color : lime} diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-72.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-72.0.scss new file mode 100644 index 0000000000..ee7aae040e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-72.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-72.html */ +p:not(:root) { background-color: lime; } +div * { background-color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-72b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-72b.0.scss new file mode 100644 index 0000000000..2e52ad5595 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-72b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-72b.html */ +html:not(:root), test:not(:root) { background-color: red; } +p { background-color: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-77.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-77.0.scss new file mode 100644 index 0000000000..43036386f6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-77.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-77.html */ +.red { background-color : red } +.t1 td:not(:first-child) { background-color : lime } +p > *:not(:first-child) { background-color : lime } +table.t1 td { border : thin black solid } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-77b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-77b.0.scss new file mode 100644 index 0000000000..fd95f40ed5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-77b.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-77b.html */ +.green { background-color : lime ! important } +.t1 td:not(:first-child) { background-color : red } +p > *:not(:first-child) { background-color : red } +table.t1 td { border : thin black solid } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-78.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-78.0.scss new file mode 100644 index 0000000000..4d99f1ceca --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-78.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-78.html */ +.red { background-color : red } +.t1 td:not(:last-child) { background-color : lime } +p > *:not(:last-child) { background-color : lime } +table.t1 td { border : thin black solid } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-78b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-78b.0.scss new file mode 100644 index 0000000000..8e3c173b9c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-78b.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-78b.html */ +.green { background-color : lime ! important } +.t1 td:not(:last-child) { background-color : red } +p > *:not(:last-child) { background-color : red } +table.t1 td { border : thin black solid } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-79.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-79.0.scss new file mode 100644 index 0000000000..1d1ff21830 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-79.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-79.html */ +.red { background-color : red } +address { margin-bottom : 1em ; margin-left : 1em } +address:not(:first-of-type) { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-7b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-7b.0.scss new file mode 100644 index 0000000000..8043e647d2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-7b.0.scss @@ -0,0 +1,9 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-7b.html */ + +p { background: lime; } +[title~="hello world"] { background: red; } +/* Section 6.3.1: Represents the att attribute whose value is a +space-separated list of words, one of which is exactly "val". If this +selector is used, the words in the value must not contain spaces +(since they are separated by spaces). */ + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-8.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-8.0.scss new file mode 100644 index 0000000000..8afa5ca99d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-8.0.scss @@ -0,0 +1,6 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-8.html */ +p { background-color : red } +p[lang|="en"] { background-color : lime } +address { background-color : red } +address[lang="fi"] { background-color : lime } +span[lang|="fr"] { background-color : red } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-80.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-80.0.scss new file mode 100644 index 0000000000..697846a18f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-80.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-80.html */ +.red { background-color : red } +address { margin-bottom : 1em ; margin-left : 1em } +address:not(:last-of-type) { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-81.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-81.0.scss new file mode 100644 index 0000000000..7b6f700901 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-81.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-81.html */ +.red { background-color : red } +p:not(:only-child) { background-color : lime } +div.testText > div > p { margin-left : 1em } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-81b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-81b.0.scss new file mode 100644 index 0000000000..af6a6cb054 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-81b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-81b.html */ +.green { background-color : lime ! important } +p:not(:only-child) { background-color : lime } +div.testText > div > p { margin-left : 1em } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-82.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-82.0.scss new file mode 100644 index 0000000000..5869d3161a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-82.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-82.html */ +.red { background-color : red } +.t1 *:not(:only-of-type) { background-color : lime } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-82b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-82b.0.scss new file mode 100644 index 0000000000..c9e4c2cc94 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-82b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-82b.html */ +.green { background-color : lime ! important } +.t1 *:not(:only-of-type) { background-color : red } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-86.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-86.0.scss new file mode 100644 index 0000000000..7022b8c830 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-86.0.scss @@ -0,0 +1,4 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-86.html */ +p { color: red; } +blockquote > div p { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-87.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-87.0.scss new file mode 100644 index 0000000000..275d4274ca --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-87.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-87.html */ +p { color: red; } +blockquote + div ~ p { color: green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-87b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-87b.0.scss new file mode 100644 index 0000000000..1776b027f7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-87b.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-87b.html */ +p { color: green ! important; } +blockquote + div ~ p { color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-88.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-88.0.scss new file mode 100644 index 0000000000..57814ed7c0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-88.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-88.html */ +p { color: red; } +blockquote + div p { color: green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-88b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-88b.0.scss new file mode 100644 index 0000000000..2d0e34e3c8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-88b.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-88b.html */ +p { color: green ! important; } +blockquote + div p { color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-89.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-89.0.scss new file mode 100644 index 0000000000..d6c797e143 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-89.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-89.html */ +p { color: red; } +blockquote div > p { color: green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-9.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-9.0.scss new file mode 100644 index 0000000000..cba3eded20 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-9.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-9.html */ +p { background-color : red } +p[title^="foo"] { background-color : lime } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-90.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-90.0.scss new file mode 100644 index 0000000000..32175261e4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-90.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-90.html */ +p { color: red; } +blockquote ~ div + p { color: green; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-90b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-90b.0.scss new file mode 100644 index 0000000000..afcdbafe4d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-90b.0.scss @@ -0,0 +1,3 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-90b.html */ +p { color: green ! important; } +blockquote ~ div + p { color: red; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d1.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d1.0.scss new file mode 100644 index 0000000000..b669874e11 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d1.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-d1.html */ + + #test { background: red; display: block; padding: 1em; } + #test:not(:empty) { background: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d1b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d1b.0.scss new file mode 100644 index 0000000000..0ac92bcd18 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d1b.0.scss @@ -0,0 +1,7 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-d1b.html */ + + #test1 { background: red; display: block; padding: 1em; margin: 1em; } + #test1:empty { background: lime; } + #test2 { background: lime; display: block; padding: 1em; margin: 1em; } + #test2:empty { background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d2.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d2.0.scss new file mode 100644 index 0000000000..c3f0544bb5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d2.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-d2.html */ + + #test { background: red; display: block; padding: 1em; } + #stub ~ div div + div > div { background: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d4.0.scss b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d4.0.scss new file mode 100644 index 0000000000..dbf2bdda74 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/css3-modsel-d4.0.scss @@ -0,0 +1,5 @@ +/* Source: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-d4.html */ + + #two:first-child { background: red; } + #three:last-child { background: lime; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-001.0.scss new file mode 100644 index 0000000000..7e94325735 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-001.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-001.0.scss new file mode 100644 index 0000000000..3e68199d28 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-001.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-dynamic-001.htm */ + + span:before { content: open-quote; } + span:after { content: close-quote; } + span { quotes: '"' '"'; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-003a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-003a.0.scss new file mode 100644 index 0000000000..30c5445777 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-003a.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-dynamic-003a.htm */ + + div#x:first-letter { color: blue; float: left; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-003b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-003b.0.scss new file mode 100644 index 0000000000..37e3dee7fd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-dynamic-003b.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-dynamic-003b.htm */ + + div#x:first-letter { color: blue; float: none } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-inherit-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-inherit-001.0.scss new file mode 100644 index 0000000000..4aea22c740 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-inherit-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-inherit-001.htm */ + +div { float: left; overflow: scroll; font-size: 50px; width: 3em; line-height: 10px } +div:first-letter { float: inherit; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-inherit-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-inherit-001.1.scss new file mode 100644 index 0000000000..9bc48c3a71 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-inherit-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-inherit-001.htm */ +.style { font-size: 10px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-001.0.scss new file mode 100644 index 0000000000..7d79ae49d8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-nested-001.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-002.0.scss new file mode 100644 index 0000000000..8ab9328de6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-nested-002.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-003.0.scss new file mode 100644 index 0000000000..2c2b8a906f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-nested-003.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-004.0.scss new file mode 100644 index 0000000000..b568b4430b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-004.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-nested-004.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-005.0.scss new file mode 100644 index 0000000000..d5f9376161 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-005.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-nested-005.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-006.0.scss new file mode 100644 index 0000000000..fc0089ccde --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-006.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-nested-006.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-007.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-007.0.scss new file mode 100644 index 0000000000..5fbf16bc9d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-nested-007.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-nested-007.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-001.0.scss new file mode 100644 index 0000000000..ba956560c8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-quote-001.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-002.0.scss new file mode 100644 index 0000000000..a5f95536b7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-002.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-quote-002.htm */ + + div { color: black; } + div:first-letter { color: green; } + span:before { content: open-quote; } + span:after { content: close-quote; } + span { quotes: '"' '"'; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-003.0.scss new file mode 100644 index 0000000000..849c55abf5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-003.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-quote-003.htm */ + + div { color: black; } + div:first-letter { color: green; } + span:before { content: open-quote "This "; } + span:after { content: close-quote; } + span { quotes: '"' '"'; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-004.0.scss new file mode 100644 index 0000000000..96706e1f1e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-004.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-quote-004.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-005.0.scss new file mode 100644 index 0000000000..15214106ba --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-005.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-quote-005.htm */ + + div { color: black; } + div:first-letter { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-006.0.scss new file mode 100644 index 0000000000..970e5b70b0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-letter-quote-006.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-letter-quote-006.htm */ + + div { color: black; } + div:first-letter { color: green; } + span:before { content: "\"This "; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-001.0.scss new file mode 100644 index 0000000000..74973ac9a1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-001.htm */ + + body { color: red } + body:first-line { color: green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-001.0.scss new file mode 100644 index 0000000000..5cec148572 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-floats-001.htm */ + + div { color: green } + div:first-line { color: red } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-001.1.scss new file mode 100644 index 0000000000..59ddfc8476 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-floats-001.htm */ +.style { float: left } diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-002.0.scss new file mode 100644 index 0000000000..89f8cbdeda --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-002.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-floats-002.htm */ + + div { color: red } + div:first-line { color: green } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-002.1.scss new file mode 100644 index 0000000000..716528bfc2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-floats-002.htm */ +.style { float: left } diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-003.0.scss new file mode 100644 index 0000000000..8b793f90aa --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-003.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-floats-003.htm */ + + div { color: green } + div:first-line { color: red } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-003.1.scss new file mode 100644 index 0000000000..1da72d9761 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-floats-003.htm */ +.style { float: left } diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-004.0.scss new file mode 100644 index 0000000000..cade4a2861 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-floats-004.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-floats-004.htm */ + + div { color: green } + div:first-line { color: red } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-001.0.scss new file mode 100644 index 0000000000..c5e5fe5468 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-001.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-inherit-001.htm */ + + +.a:first-line { } +.a { overflow: scroll; } +.b, .c { overflow: inherit; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-002.0.scss new file mode 100644 index 0000000000..ea1027fc24 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-002.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-inherit-002.htm */ + + div { background: green; } + div:first-line { background-color: red; } + span.one { background: inherit; } + span.two { background-color: inherit; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-003.0.scss new file mode 100644 index 0000000000..f498981952 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/first-line-inherit-003.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/first-line-inherit-003.htm */ + + div, p { background: green; } + div:first-line, p:first-line { background-color: red; } + span.one { background: inherit; } + span.two { background-color: inherit; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.0.scss new file mode 100644 index 0000000000..9358f2916e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001a.htm */ + +.left { float:left; } +.right { float:right; } +.left, .right { width:50px; height:50px; background:yellow; } +p { overflow:auto; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.1.scss new file mode 100644 index 0000000000..d803b8ffd2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001a.htm */ +.style { width:400px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.2.scss new file mode 100644 index 0000000000..0a22209fb1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001a.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001a.htm */ +.style { text-align:right; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.0.scss new file mode 100644 index 0000000000..80fe2ff996 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001b.htm */ + +.left { float:left; } +.right { float:right; } +.left, .right { width:50px; height:50px; background:yellow; } +p { overflow:auto; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.1.scss new file mode 100644 index 0000000000..3992160e83 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001b.htm */ +.style { width:400px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.2.scss new file mode 100644 index 0000000000..f19a8d2088 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001b.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001b.htm */ +.style { text-align:right; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.0.scss new file mode 100644 index 0000000000..19d1d26dc5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001c.htm */ + +.left { float:left; } +.right { float:right; } +.left, .right { width:50px; height:50px; background:yellow; } +p { overflow:auto; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.1.scss new file mode 100644 index 0000000000..c3143dca78 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001c.htm */ +.style { width:400px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.2.scss new file mode 100644 index 0000000000..e52a60f4ed --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-001c.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-001c.htm */ +.style { text-align:right; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.0.scss new file mode 100644 index 0000000000..4141a2ba00 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-003.htm */ +.style { width:100px; font-size:5px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.1.scss new file mode 100644 index 0000000000..aecdad0621 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-003.htm */ +.style { background:blue; width:100px; height:100px; float:left; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.2.scss new file mode 100644 index 0000000000..2e7fc3e31e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-003.htm */ +.style { background:yellow; width:30px; height:30px; float:left; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.3.scss new file mode 100644 index 0000000000..bacc9de7c9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-003.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-003.htm */ +.style { background:yellow; width:30px; height:30px; float:right; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.0.scss new file mode 100644 index 0000000000..a1f23b9119 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-004.htm */ +.style { width:200px; font-size:5px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.1.scss new file mode 100644 index 0000000000..be86a0b01e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-004.htm */ +.style { background:green; width:100px; height:100px; float:left; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.2.scss new file mode 100644 index 0000000000..b9c4341835 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-placement-vertical-004.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-placement-vertical-004.htm */ +.style { background:blue; width:100px; height:100px; float:left; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.0.scss new file mode 100644 index 0000000000..1f12c6fb78 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-001.htm */ +.style { float: left; width: 500px; height: 500px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.1.scss new file mode 100644 index 0000000000..155ae9bb17 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-001.htm */ +.style { float: right; width: 50px; height: 300px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.2.scss new file mode 100644 index 0000000000..03921ad64e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-001.htm */ +.style { margin-right: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.3.scss new file mode 100644 index 0000000000..82327074bf --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-001.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-001.htm */ +.style { float: left; width: 425px; height: 10px; background: blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.0.scss new file mode 100644 index 0000000000..b0659ed170 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-002.htm */ +.style { float: left; width: 500px; height: 500px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.1.scss new file mode 100644 index 0000000000..51d4aae421 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-002.htm */ +.style { float: right; width: 50px; height: 300px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.2.scss new file mode 100644 index 0000000000..b64d557e23 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-002.htm */ +.style { margin-right: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.3.scss new file mode 100644 index 0000000000..667087faba --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-left-002.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-left-002.htm */ +.style { float: left; width: 475px; height: 10px; background: blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.0.scss new file mode 100644 index 0000000000..bb6604d005 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-001.htm */ +.style { float: left; width: 500px; height: 500px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.1.scss new file mode 100644 index 0000000000..7ee24227e9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-001.htm */ +.style { float: left; width: 50px; height: 300px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.2.scss new file mode 100644 index 0000000000..1d11bdf6dc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-001.htm */ +.style { margin-left: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.3.scss new file mode 100644 index 0000000000..2ce67f6358 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-001.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-001.htm */ +.style { float: right; width: 425px; height: 10px; background: blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.0.scss new file mode 100644 index 0000000000..02936f2d05 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-002.htm */ +.style { float: left; width: 500px; height: 500px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.1.scss new file mode 100644 index 0000000000..62e70dc857 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-002.htm */ +.style { float: left; width: 50px; height: 300px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.2.scss new file mode 100644 index 0000000000..33158539ba --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-002.htm */ +.style { margin-left: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.3.scss new file mode 100644 index 0000000000..b657772275 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule3-outside-right-002.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule3-outside-right-002.htm */ +.style { float: right; width: 475px; height: 10px; background: blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.0.scss new file mode 100644 index 0000000000..a0b07a7d20 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-left-001.htm */ +.style { float: left; width: 500px; height: 500px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.1.scss new file mode 100644 index 0000000000..282d40f7de --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-left-001.htm */ +.style { float: left; width: 50px; height: 300px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.2.scss new file mode 100644 index 0000000000..ab40480544 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-left-001.htm */ +.style { margin-left: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.3.scss new file mode 100644 index 0000000000..3d1bced7d2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-left-001.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-left-001.htm */ +.style { float: left; width: 425px; height: 10px; background: blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.0.scss new file mode 100644 index 0000000000..808f90847a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-right-001.htm */ +.style { float: left; width: 500px; height: 500px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.1.scss new file mode 100644 index 0000000000..2591c3de52 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-right-001.htm */ +.style { float: right; width: 50px; height: 300px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.2.scss new file mode 100644 index 0000000000..2ca9103b55 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-right-001.htm */ +.style { margin-right: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.3.scss new file mode 100644 index 0000000000..a051758341 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-rule7-outside-right-001.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-rule7-outside-right-001.htm */ +.style { float: right; width: 425px; height: 10px; background: blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.0.scss new file mode 100644 index 0000000000..55dbbeebaa --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ + + + table { margin: 0; border-spacing: 0; } + td, th { padding: 0; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.1.scss new file mode 100644 index 0000000000..59d553acc3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { background: aqua } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.12.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.12.scss new file mode 100644 index 0000000000..941f9b0c43 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.12.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { float:right; background:blue; width: 100px; height: 20px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.2.scss new file mode 100644 index 0000000000..231f1d76cf --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { float:left; background:blue; width: 100px; height: 20px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.24.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.24.scss new file mode 100644 index 0000000000..5304225969 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.24.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { overflow: hidden; background: yellow } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.3.scss new file mode 100644 index 0000000000..0ffa20c60c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { float:left; background:silver; width: 100px; height: 6px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.4.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.4.scss new file mode 100644 index 0000000000..3af0c41084 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { background: yellow } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.5.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.5.scss new file mode 100644 index 0000000000..70e5ab27a3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { width: 150px; height: 10px; background: purple } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.8.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.8.scss new file mode 100644 index 0000000000..4f0231e636 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-004.8.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-004.htm */ +.style { float:right; background:silver; width: 100px; height: 6px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.0.scss new file mode 100644 index 0000000000..87b04d41d4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.0.scss @@ -0,0 +1,9 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-005.htm */ + + + body { font-size: 10px; } + + table { margin: 0; border-spacing: 0; } + td, th { padding: 0; vertical-align: top; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.1.scss new file mode 100644 index 0000000000..4ed6811ec4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-005.htm */ +.style { background: aqua } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.2.scss new file mode 100644 index 0000000000..04ba12051e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-005.htm */ +.style { float:left; background:blue; width: 200px; height: 20px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.3.scss new file mode 100644 index 0000000000..59ff5a258e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-005.htm */ +.style { background: yellow } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.5.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.5.scss new file mode 100644 index 0000000000..1f9328855c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-005.htm */ +.style { float:right; background:blue; width: 200px; height: 20px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.9.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.9.scss new file mode 100644 index 0000000000..53a68a0469 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-005.9.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-005.htm */ +.style { overflow:hidden; background: yellow; width: 50%; height: 20px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.0.scss new file mode 100644 index 0000000000..ca6d5ed844 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.0.scss @@ -0,0 +1,12 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ + + + body { font-size: 16px; } + + table { margin: 0; border-spacing: 0; } + caption, td, th { padding: 0; vertical-align: top; text-align: left; } + + table table caption { background: yellow; } + table table { background: purple; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.1.scss new file mode 100644 index 0000000000..beba9cf330 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { background: aqua } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.10.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.10.scss new file mode 100644 index 0000000000..49c74a97d9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.10.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:110px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.11.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.11.scss new file mode 100644 index 0000000000..deee635381 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.11.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:105px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.12.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.12.scss new file mode 100644 index 0000000000..fdb260729a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.12.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:100px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.13.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.13.scss new file mode 100644 index 0000000000..4522f57cb8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.13.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:95px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.131.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.131.scss new file mode 100644 index 0000000000..a274d6ee7f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.131.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { caption-side: bottom; height:30px; width: 192px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.14.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.14.scss new file mode 100644 index 0000000000..b49fd302a9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.14.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:90px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.15.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.15.scss new file mode 100644 index 0000000000..2a29f56c3f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.15.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:85px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.16.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.16.scss new file mode 100644 index 0000000000..e8f11cc823 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.16.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:80px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.17.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.17.scss new file mode 100644 index 0000000000..231f28519c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.17.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:75px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.18.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.18.scss new file mode 100644 index 0000000000..a4f78671cb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.18.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:70px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.19.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.19.scss new file mode 100644 index 0000000000..9e9e29d19c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.19.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:65px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.2.scss new file mode 100644 index 0000000000..501590ad5d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:150px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.20.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.20.scss new file mode 100644 index 0000000000..126280a6fe --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.20.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:60px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.21.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.21.scss new file mode 100644 index 0000000000..a7228173da --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.21.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:55px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.22.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.22.scss new file mode 100644 index 0000000000..0cc681c041 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.22.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:50px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.23.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.23.scss new file mode 100644 index 0000000000..f2c07e7838 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.23.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:45px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.24.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.24.scss new file mode 100644 index 0000000000..b8e2c5796e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.24.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:40px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.25.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.25.scss new file mode 100644 index 0000000000..ce05ee6888 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.25.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:35px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.26.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.26.scss new file mode 100644 index 0000000000..d5ab773c5f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.26.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:30px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.27.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.27.scss new file mode 100644 index 0000000000..3385f4ea30 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.27.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:25px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.28.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.28.scss new file mode 100644 index 0000000000..6022a36c29 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.28.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:20px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.29.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.29.scss new file mode 100644 index 0000000000..a352e1fa56 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.29.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:15px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.3.scss new file mode 100644 index 0000000000..29eb47aa2f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:145px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.30.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.30.scss new file mode 100644 index 0000000000..5bacfae2f3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.30.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:10px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.31.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.31.scss new file mode 100644 index 0000000000..0a8445e2b0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.31.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:5px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.32.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.32.scss new file mode 100644 index 0000000000..ba50d0bd65 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.32.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { caption-side: top; height:30px; width: 100px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.33.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.33.scss new file mode 100644 index 0000000000..2dc59a3264 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.33.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { height: 30px; width: 230px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.4.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.4.scss new file mode 100644 index 0000000000..97ec1f9113 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:140px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.5.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.5.scss new file mode 100644 index 0000000000..0778fc55c9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:135px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.6.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.6.scss new file mode 100644 index 0000000000..eee0117225 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.6.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:130px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.65.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.65.scss new file mode 100644 index 0000000000..7c9e6eda76 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.65.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { caption-side: top; height:30px; width: 190px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.66.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.66.scss new file mode 100644 index 0000000000..bb41e0cbaf --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.66.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { height: 30px; width: 100px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.7.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.7.scss new file mode 100644 index 0000000000..764745abb1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.7.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:125px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.8.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.8.scss new file mode 100644 index 0000000000..ae65d3d2e4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.8.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:120px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.9.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.9.scss new file mode 100644 index 0000000000..c86cc30a7c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.9.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { float:left; clear:left; background:blue; width:115px; height:1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.98.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.98.scss new file mode 100644 index 0000000000..9cd7749821 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.98.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { caption-side: bottom; height:30px; width: 100px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.99.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.99.scss new file mode 100644 index 0000000000..eabd2b81b7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-006.99.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-006.htm */ +.style { height: 30px; width: 227px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.0.scss new file mode 100644 index 0000000000..fe79ead93b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ + + + table { margin: 0; border-spacing: 0; } + td, th { padding: 0; vertical-align: top; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.1.scss new file mode 100644 index 0000000000..da32416752 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { background: aqua } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.15.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.15.scss new file mode 100644 index 0000000000..dc37b6963d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.15.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: 5px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.16.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.16.scss new file mode 100644 index 0000000000..c2fed6240b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.16.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: 5px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.19.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.19.scss new file mode 100644 index 0000000000..a656c57cf1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.19.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: 10px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.2.scss new file mode 100644 index 0000000000..bcd2f016b0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { float: left; height: 10px; width: 150px; background: blue } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.20.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.20.scss new file mode 100644 index 0000000000..64956d2143 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.20.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: -5px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.23.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.23.scss new file mode 100644 index 0000000000..9796be893b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.23.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: -5px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.24.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.24.scss new file mode 100644 index 0000000000..7842444780 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.24.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: 10px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.27.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.27.scss new file mode 100644 index 0000000000..d2e20e04cc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.27.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: 4px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.28.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.28.scss new file mode 100644 index 0000000000..74db9f2d40 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.28.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: 4px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.3.scss new file mode 100644 index 0000000000..b50e1429ae --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: 6px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.31.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.31.scss new file mode 100644 index 0000000000..f09ed11cee --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.31.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: -1px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.39.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.39.scss new file mode 100644 index 0000000000..8dcb8d161c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.39.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: -4px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.4.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.4.scss new file mode 100644 index 0000000000..3a4a85219f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.40.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.40.scss new file mode 100644 index 0000000000..bfdf7db3b4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.40.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: 0px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.43.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.43.scss new file mode 100644 index 0000000000..6f0581a068 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.43.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; margin-bottom: 0px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.44.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.44.scss new file mode 100644 index 0000000000..186f24937b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.44.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: -4px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.48.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.48.scss new file mode 100644 index 0000000000..489890f8bd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.48.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: -1px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.7.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.7.scss new file mode 100644 index 0000000000..0ee68c91ce --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.7.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { height: 5px; background: purple; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.8.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.8.scss new file mode 100644 index 0000000000..5c131b1a4d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-007.8.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-007.htm */ +.style { overflow: hidden; width: 200px; height: 5px; background: yellow; margin-top: 6px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-outside-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-outside-001.0.scss new file mode 100644 index 0000000000..c7fdc4f3ba --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-bfc-outside-001.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-bfc-outside-001.htm */ + +#wrap {width:600px; border:1px solid;} +.a {background:lime; color:#fff; width:80%;} +.b {float:right; width:18%; background: cyan; color: #000; height:10em;} +textarea {width: 100%; height:10em;} + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.0.scss new file mode 100644 index 0000000000..f780444dc2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-001l.htm */ + + +body { width: 400px; border: medium solid; } +div { float: left; clear: left; } +span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; margin-right: auto; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.1.scss new file mode 100644 index 0000000000..a695061dc6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-001l.htm */ +.style { width: 50px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.2.scss new file mode 100644 index 0000000000..94b3728f3d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001l.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-001l.htm */ +.style { width: 100px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.0.scss new file mode 100644 index 0000000000..c665929221 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-001r.htm */ + + +body { width: 400px; border: medium solid; } +div { float: right; clear: right; } +span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; margin-left: auto; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.1.scss new file mode 100644 index 0000000000..2775ef585f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-001r.htm */ +.style { width: 50px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.2.scss new file mode 100644 index 0000000000..3c9ab6d376 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-001r.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-001r.htm */ +.style { width: 100px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.0.scss new file mode 100644 index 0000000000..48cf6ec53a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-002l.htm */ + + +body { width: 400px; border: medium solid; } +span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.1.scss new file mode 100644 index 0000000000..10ffd0fc80 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-002l.htm */ +.style { float: left; width: 150px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.2.scss new file mode 100644 index 0000000000..3a572e8b03 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002l.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-002l.htm */ +.style { float: right; width: 300px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.0.scss new file mode 100644 index 0000000000..fe457370c1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-002r.htm */ + + +body { width: 400px; border: medium solid; } +span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.1.scss new file mode 100644 index 0000000000..4e2081dba9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-002r.htm */ +.style { float: right; width: 150px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.2.scss new file mode 100644 index 0000000000..1055fac5ff --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-002r.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-002r.htm */ +.style { float: left; width: 300px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.0.scss new file mode 100644 index 0000000000..ef1a96a2bf --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-003l.htm */ + + +body { width: 400px; border: medium solid; } +span { display: block; overflow: hidden; width: 100px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.1.scss new file mode 100644 index 0000000000..1c57064ba3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-003l.htm */ +.style { float: left; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.2.scss new file mode 100644 index 0000000000..2e90f18734 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003l.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-003l.htm */ +.style { float: right; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.0.scss new file mode 100644 index 0000000000..d2971cb795 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-003r.htm */ + + +body { width: 400px; border: medium solid; } +span { display: block; overflow: hidden; width: 100px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.1.scss new file mode 100644 index 0000000000..f6306c31aa --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-003r.htm */ +.style { float: right; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.2.scss new file mode 100644 index 0000000000..3b63ad756d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-bfc-003r.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-bfc-003r.htm */ +.style { float: left; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.0.scss new file mode 100644 index 0000000000..6119b6895a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-001l.htm */ + + +body { width: 400px; border: medium solid; text-align: left; } +div { float: left; clear: left; } +span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.1.scss new file mode 100644 index 0000000000..60abfaa89f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-001l.htm */ +.style { width: 50px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.2.scss new file mode 100644 index 0000000000..bb8f7d8585 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001l.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-001l.htm */ +.style { width: 100px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.0.scss new file mode 100644 index 0000000000..3c674d4165 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-001r.htm */ + + +body { width: 400px; border: medium solid; text-align: right; } +div { float: right; clear: right; } +span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.1.scss new file mode 100644 index 0000000000..254cceff5d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-001r.htm */ +.style { width: 50px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.2.scss new file mode 100644 index 0000000000..f9da61827d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-001r.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-001r.htm */ +.style { width: 100px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.0.scss new file mode 100644 index 0000000000..d391fc5bb6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-002l.htm */ + + +body { width: 400px; border: medium solid; } +span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.1.scss new file mode 100644 index 0000000000..b8b4e306b2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-002l.htm */ +.style { float: left; width: 150px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.2.scss new file mode 100644 index 0000000000..4fe3554d42 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002l.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-002l.htm */ +.style { float: right; width: 300px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.0.scss new file mode 100644 index 0000000000..278a0b20d1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-002r.htm */ + + +body { width: 400px; border: medium solid; } +span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.1.scss new file mode 100644 index 0000000000..24fc0000cb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-002r.htm */ +.style { float: right; width: 150px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.2.scss new file mode 100644 index 0000000000..5aba32ba55 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-002r.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-002r.htm */ +.style { float: left; width: 300px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.0.scss new file mode 100644 index 0000000000..5af166b155 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-003l.htm */ + + +body { width: 400px; border: medium solid; } +span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.1.scss new file mode 100644 index 0000000000..ae6e0a84ea --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-003l.htm */ +.style { float: left; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.2.scss new file mode 100644 index 0000000000..f6a110f660 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003l.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-003l.htm */ +.style { float: right; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.0.scss new file mode 100644 index 0000000000..573684a70a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-003r.htm */ + + +body { width: 400px; border: medium solid; } +span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.1.scss new file mode 100644 index 0000000000..ed8f4d939a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-003r.htm */ +.style { float: right; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.2.scss new file mode 100644 index 0000000000..3156752c2e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-wrap-top-below-inline-003r.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-wrap-top-below-inline-003r.htm */ +.style { float: left; width: 250px; height: 75px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.0.scss new file mode 100644 index 0000000000..4cb8f644c2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-001.htm */ +.style { width: 500px; height: 500px; float: left; font-size: 12px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.1.scss new file mode 100644 index 0000000000..c1ed4bbe00 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-001.htm */ +.style { float: left; width: 10px; height: 30px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.2.scss new file mode 100644 index 0000000000..b3891027db --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-001.htm */ +.style { float: left; clear: left; width: 100px; height: 1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.3.scss new file mode 100644 index 0000000000..92c36c2b4b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-001.htm */ +.style { display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.4.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.4.scss new file mode 100644 index 0000000000..7a4a377d29 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-001.htm */ +.style { display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.5.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.5.scss new file mode 100644 index 0000000000..30b08ae999 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-001.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-001.htm */ +.style { display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.0.scss new file mode 100644 index 0000000000..c718bdcd07 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-002.htm */ +.style { width: 500px; height: 500px; float: left; font-size: 12px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.1.scss new file mode 100644 index 0000000000..fa43435f50 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-002.htm */ +.style { float: left; width: 10px; height: 30px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.2.scss new file mode 100644 index 0000000000..302c91ab56 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-002.htm */ +.style { float: left; clear: left; width: 100px; height: 0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.3.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.3.scss new file mode 100644 index 0000000000..d90881ad6d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-002.htm */ +.style { display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.4.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.4.scss new file mode 100644 index 0000000000..1f403a2ed2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-002.htm */ +.style { display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.5.scss b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.5.scss new file mode 100644 index 0000000000..901a27fe9d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/floats-zero-height-wrap-002.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/floats-zero-height-wrap-002.htm */ +.style { display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia } diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-001.0.scss new file mode 100644 index 0000000000..f70698a920 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-001.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-001.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: CSSTest FamilyName, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-002.0.scss new file mode 100644 index 0000000000..f1cfd976b2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-002.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-002.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: csstest familyname, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-003.0.scss new file mode 100644 index 0000000000..55ae604a48 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-003.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-003.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: cssTest familyName, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-004.0.scss new file mode 100644 index 0000000000..b95f2e94bf --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-004.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-004.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: "CSSTest FamilyName", CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-005.0.scss new file mode 100644 index 0000000000..3a5f916cce --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-005.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-005.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: 'CSSTest FamilyName', CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-006.0.scss new file mode 100644 index 0000000000..312f9c8948 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-006.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-006.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: CSSTest FamilyName, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-007.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-007.0.scss new file mode 100644 index 0000000000..d6f61aa0da --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-007.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-007.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: "CSSTest FamilyName", CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-008.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-008.0.scss new file mode 100644 index 0000000000..b0f025d6f0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-008.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-008.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: 'CSSTest FamilyName', CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-009.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-009.0.scss new file mode 100644 index 0000000000..f6ed3eea3d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-009.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-009.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: CSSTest \000046amilyName, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-012.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-012.0.scss new file mode 100644 index 0000000000..ff9c919acd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-012.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-012.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: "CSSTest Family\Name", CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-013.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-013.0.scss new file mode 100644 index 0000000000..04100a1326 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-013.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-013.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: CSSTest FamilyName Bold, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-014.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-014.0.scss new file mode 100644 index 0000000000..d98252d89d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-014.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-014.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: CSSTestFamilyNameBold, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-016.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-016.0.scss new file mode 100644 index 0000000000..11566bc342 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-016.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-016.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + p { + font-family: CSSTest Weights 400; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-017.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-017.0.scss new file mode 100644 index 0000000000..ea2b2110b0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-017.0.scss @@ -0,0 +1,9 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-017.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + body { font-family: CSSTest Fallback; } + p, div { + font-family: CSSTest Unknown; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-018.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-018.0.scss new file mode 100644 index 0000000000..81e90cee9c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-018.0.scss @@ -0,0 +1,9 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-018.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + body { font-family: CSSTest Fallback; } + p, div { + font-family: "CSSTest Unknown"; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-019.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-019.0.scss new file mode 100644 index 0000000000..ad32f6351b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-019.0.scss @@ -0,0 +1,9 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-019.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + div#test { font-family: CSSTest Fallback; } + p { + font-family: CSSTest Unknown; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-020.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-020.0.scss new file mode 100644 index 0000000000..0d66b81154 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-020.0.scss @@ -0,0 +1,9 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-020.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + div#test { font-family: CSSTest Fallback; } + p { + font-family: "CSSTest Unknown"; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-021.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-021.0.scss new file mode 100644 index 0000000000..592d994b47 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-021.0.scss @@ -0,0 +1,10 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-021.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + body { font-family: "CSSTest FamilyName"; } + div { font-family: "CSSTest Unknown"; } + p { + font-family: "CSSTest" Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-022.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-022.0.scss new file mode 100644 index 0000000000..dc737140a8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-022.0.scss @@ -0,0 +1,14 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-022.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + div { font-family: "CSSTest Unknown"; } + p { + } + p#test1 { + font-family: x-large CSSTest Fallback; + } + p#test4 { + font-family: caption CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-023.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-023.0.scss new file mode 100644 index 0000000000..4c4dc9c7f3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-023.0.scss @@ -0,0 +1,20 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-023.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + div.test { font-family: CSSTest Fallback; } + p { + } + p#test1a { + font-family: "small-caps 1in CSSTest FamilyName Funky", CSSTest Fallback; + } + p#test2 { + font-family: x-large CSSTest FamilyName Funky, CSSTest Fallback; + } + p#test2a { + font-family: "x-large CSSTest FamilyName Funky", CSSTest Fallback; + } + p#test3a { + font-family: "12px CSSTest FamilyName Funky", CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-family-name-024.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-024.0.scss new file mode 100644 index 0000000000..79ac477f2c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-family-name-024.0.scss @@ -0,0 +1,26 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-024.htm */ + + body { font-size: 36px; } + span#verify { font-family: CSSTest Verify; } + div.test { font-family: CSSTest Fallback; } + p { + } + p#test1 { + font-family: caption, CSSTest Fallback; + } + p#test2 { + font-family: icon, CSSTest Fallback; + } + p#test3 { + font-family: menu, CSSTest Fallback; + } + p#test4 { + font-family: message-box, CSSTest Fallback; + } + p#test5 { + font-family: small-caption, CSSTest Fallback; + } + p#test6 { + font-family: status-bar, CSSTest Fallback; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-weight-bolder-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-weight-bolder-001.0.scss new file mode 100644 index 0000000000..e1334dbe2f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-weight-bolder-001.0.scss @@ -0,0 +1,43 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-weight-bolder-001.htm */ + + span#verify { font-family: CSSTest Verify; font-weight: normal; } + div { margin-bottom: 1em; } + body { margin: 50px; } + table { + border-collapse: collapse; + } + th { + font-weight: normal; + text-align: left; + padding-right: 1em; + } + span { font-weight: bolder; } + thead th { text-align: center; padding-bottom: 1em; } + td { width: 5em; text-align: center; } + td.f1 { font-family: CSSTest Weights Full; } + td.f2 { font-family: CSSTest Weights W1479; } + td.f3 { font-family: CSSTest Weights W15; } + td.f4 { font-family: CSSTest Weights W24; } + td.f5 { font-family: CSSTest Weights W2569; } + td.f6 { font-family: CSSTest Weights W258; } + td.f7 { font-family: CSSTest Weights W3589; } + td.f8 { font-family: CSSTest Weights W47; } + th.f1 { display: table-cell; } + th.f2 { display: table-cell; } + th.f3 { display: table-cell; } + th.f4 { display: table-cell; } + th.f5 { display: table-cell; } + th.f6 { display: table-cell; } + th.f7 { display: table-cell; } + th.f8 { display: table-cell; } + + tr.w1 td { font-weight: 100; } + tr.w2 td { font-weight: 200; } + tr.w3 td { font-weight: 300; } + tr.w4 td { font-weight: 400; } + tr.w5 td { font-weight: 500; } + tr.w6 td { font-weight: 600; } + tr.w7 td { font-weight: 700; } + tr.w8 td { font-weight: 800; } + tr.w9 td { font-weight: 900; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-weight-lighter-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-weight-lighter-001.0.scss new file mode 100644 index 0000000000..1840142b38 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-weight-lighter-001.0.scss @@ -0,0 +1,43 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-weight-lighter-001.htm */ + + span#verify { font-family: CSSTest Verify; font-weight: normal; } + div { margin-bottom: 1em; } + body { margin: 50px; } + table { + border-collapse: collapse; + } + th { + font-weight: normal; + text-align: left; + padding-right: 1em; + } + span { font-weight: lighter; } + thead th { text-align: center; padding-bottom: 1em; } + td { width: 5em; text-align: center; } + td.f1 { font-family: CSSTest Weights Full; } + td.f2 { font-family: CSSTest Weights W1479; } + td.f3 { font-family: CSSTest Weights W15; } + td.f4 { font-family: CSSTest Weights W24; } + td.f5 { font-family: CSSTest Weights W2569; } + td.f6 { font-family: CSSTest Weights W258; } + td.f7 { font-family: CSSTest Weights W3589; } + td.f8 { font-family: CSSTest Weights W47; } + th.f1 { display: table-cell; } + th.f2 { display: table-cell; } + th.f3 { display: table-cell; } + th.f4 { display: table-cell; } + th.f5 { display: table-cell; } + th.f6 { display: table-cell; } + th.f7 { display: table-cell; } + th.f8 { display: table-cell; } + + tr.w1 td { font-weight: 100; } + tr.w2 td { font-weight: 200; } + tr.w3 td { font-weight: 300; } + tr.w4 td { font-weight: 400; } + tr.w5 td { font-weight: 500; } + tr.w6 td { font-weight: 600; } + tr.w7 td { font-weight: 700; } + tr.w8 td { font-weight: 800; } + tr.w9 td { font-weight: 900; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/font-weight-normal-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/font-weight-normal-001.0.scss new file mode 100644 index 0000000000..29a665ee9a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/font-weight-normal-001.0.scss @@ -0,0 +1,43 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/font-weight-normal-001.htm */ + + span#verify { font-family: CSSTest Verify; font-weight: normal; } + div { margin-bottom: 1em; } + body { margin: 50px; } + table { + border-collapse: collapse; + } + th { + font-weight: normal; + text-align: left; + padding-right: 1em; + } + span { } + thead th { text-align: center; padding-bottom: 1em; } + td { width: 5em; text-align: center; } + td.f1 { font-family: CSSTest Weights Full; } + td.f2 { font-family: CSSTest Weights W1479; } + td.f3 { font-family: CSSTest Weights W15; } + td.f4 { font-family: CSSTest Weights W24; } + td.f5 { font-family: CSSTest Weights W2569; } + td.f6 { font-family: CSSTest Weights W258; } + td.f7 { font-family: CSSTest Weights W3589; } + td.f8 { font-family: CSSTest Weights W47; } + th.f1 { display: table-cell; } + th.f2 { display: table-cell; } + th.f3 { display: table-cell; } + th.f4 { display: table-cell; } + th.f5 { display: table-cell; } + th.f6 { display: table-cell; } + th.f7 { display: table-cell; } + th.f8 { display: table-cell; } + + tr.w1 td { font-weight: 100; } + tr.w2 td { font-weight: 200; } + tr.w3 td { font-weight: 300; } + tr.w4 td { font-weight: 400; } + tr.w5 td { font-weight: 500; } + tr.w6 td { font-weight: 600; } + tr.w7 td { font-weight: 700; } + tr.w8 td { font-weight: 800; } + tr.w9 td { font-weight: 900; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-000.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-000.0.scss new file mode 100644 index 0000000000..9ddf923d46 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-000.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-000.htm */ + +span { display: inline-block; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-height-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-height-001.0.scss new file mode 100644 index 0000000000..595b0fef80 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-height-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-height-001.htm */ + +div { display: inline-block; width: 10em; background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-height-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-height-002.0.scss new file mode 100644 index 0000000000..2876e73ab5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-height-002.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-height-002.htm */ + +div { display: inline-block; height: 5em; width:10em; vertical-align: baseline; background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-valign-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-valign-001.0.scss new file mode 100644 index 0000000000..5d2446d71f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-valign-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-valign-001.htm */ + +span { display: inline-block; } +span > span { display: block; visibility: hidden; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-valign-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-valign-002.0.scss new file mode 100644 index 0000000000..f262046c2b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-valign-002.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-valign-002.htm */ + +body { background: white; color: black; } +span { display: inline-block; margin: 3px 0; border: 4px solid white; border-width: 4px 0; padding: 9px 0; } +span > span { display: block; visibility: hidden; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-001a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-001a.0.scss new file mode 100644 index 0000000000..18c2f89059 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-001a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-width-001a.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-block; background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-001b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-001b.0.scss new file mode 100644 index 0000000000..438331f06c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-001b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-width-001b.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-block; background: green; color: white; width: 10em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-002a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-002a.0.scss new file mode 100644 index 0000000000..851a3e0556 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-002a.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-width-002a.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-block; background: green; color: white; } +body > div > div > div { width: 20em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-002b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-002b.0.scss new file mode 100644 index 0000000000..652628c616 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-width-002b.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-width-002b.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-block; background: green; color: white; width: 20em; } +body > div > div > div { width: 20em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-001.0.scss new file mode 100644 index 0000000000..b04dd45c9a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-001.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-zorder-001.htm */ + +div { width: 2em; height: 1em; } +span { display:inline-block; vertical-align: top; width: 2em; height: 1em; background: green; } +div#after { margin-top:-1em; background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-002.0.scss new file mode 100644 index 0000000000..f888f84439 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-002.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-zorder-002.htm */ + +div { width: 2em; height: 1em; } +span { display:inline-block; vertical-align: top; width: 2em; height: 1em; } +span span { display: block; background: green; } +div#after { margin-top: -1em; background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-003.0.scss new file mode 100644 index 0000000000..902c10615b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-003.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-zorder-003.htm */ + +div { height: 1em; } +div#test span { display:inline-block; vertical-align: top; height: 1em; background: red; color: red; } +div#after { margin-top:-1em; } +div#after span { display: inline; vertical-align: top; background: green; color: green; border-bottom: 0.25em solid green; border-top: 0.25em solid green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-004.0.scss new file mode 100644 index 0000000000..2a326680b7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-004.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-zorder-004.htm */ + +div#test span { display:inline-block; vertical-align: top; background: green; color: green; border-bottom: 0.25em solid green; border-top: 0.25em solid green; } +div#before { height: 1em; margin-bottom:-1em; } +div#before span { display: inline; vertical-align: top; background: red; color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-005.0.scss new file mode 100644 index 0000000000..7831203024 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-block-zorder-005.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-block-zorder-005.htm */ + +div#test > span { display:inline-block; vertical-align: top; } +div#test > span > span { display: block; background: green; color: green; border-bottom: 0.25em solid green; border-top: 0.25em solid green; } +div#before { height: 1em; margin-bottom:-1em; } +div#before > span { display: inline; vertical-align: top; background: red; color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-002a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-002a.0.scss new file mode 100644 index 0000000000..bbb79e3952 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-002a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-002a.htm */ + +span { display: inline-table; } +span > span { display: block; visibility: hidden; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-002b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-002b.0.scss new file mode 100644 index 0000000000..085e0301ae --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-002b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-002b.htm */ + +span > span { display: table-cell; } +span > span > span { display: block; visibility: hidden; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-003.0.scss new file mode 100644 index 0000000000..ced4d93ae8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-003.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-003.htm */ + +span { display: inline-table; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-height-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-height-001.0.scss new file mode 100644 index 0000000000..76cf9d68e4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-height-001.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-height-001.htm */ + +div { display: inline-table; width: 10em; background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-height-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-height-002.0.scss new file mode 100644 index 0000000000..ee38aae8ea --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-height-002.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-height-002.htm */ + +div { display: inline-table; height: 5em; vertical-align: baseline; background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-valign-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-valign-001.0.scss new file mode 100644 index 0000000000..73e683bbcd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-valign-001.0.scss @@ -0,0 +1,15 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-valign-001.htm */ + +span#table { display: inline-table; } +span#rowgroup { display: table-row-group; } +span#row { display: table-row; } +span#cell { display: table-cell; } +span#table, span#rowgroup, span#row, span#cell { + border: 4px solid white; + margin: 3px 0; + border-width: 4px 0; + padding: 9px 0; + border-spacing: 0 5px; +} +span#block { display: block; visibility: hidden; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-001a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-001a.0.scss new file mode 100644 index 0000000000..78e2c1ecab --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-001a.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-width-001a.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-table; background: green; color: white; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-001b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-001b.0.scss new file mode 100644 index 0000000000..3a7ba0f225 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-001b.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-width-001b.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-table; background: green; color: white; width: 10em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-002a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-002a.0.scss new file mode 100644 index 0000000000..686714f14a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-002a.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-width-002a.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-table; background: green; color: white; } +body > div > div > div { width: 20em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-002b.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-002b.0.scss new file mode 100644 index 0000000000..c363def1ac --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-width-002b.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-width-002b.htm */ + +body > div { width: 10em; } +body > div > div { display: inline-table; background: green; color: white; width: 20em; } +body > div > div > div { width: 20em; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-001.0.scss new file mode 100644 index 0000000000..79c11c95e5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-001.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-zorder-001.htm */ + +div { width: 2em; height: 2em; } +span { display:inline-table; vertical-align: top; width: 2em; height: 2em; background: green; } +div#after { margin-top:-2em; background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-002.0.scss new file mode 100644 index 0000000000..6e208ec410 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-002.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-zorder-002.htm */ + +div { width: 2em; height: 2em; } +span { display:inline-table; vertical-align: top; width: 2em; height: 2em; } +span span { display: block; background: green; } +div#after { margin-top: -2em; background: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-003.0.scss new file mode 100644 index 0000000000..8722af2fb2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-003.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-zorder-003.htm */ + +div { height: 1em; } +div#test > span { display:inline-table; vertical-align: top; height: 1em; background: red; color: red; } +div#after { margin-top:-1em; } +div#after > span { display: inline; vertical-align: top; background: green; color: green; border-bottom: 0.25em solid green; border-top: 0.25em solid green; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-004.0.scss new file mode 100644 index 0000000000..344d56ff21 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-004.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-zorder-004.htm */ + +div#test > span { display:inline-table; vertical-align: top; background: green; color: green; border-bottom: 0.25em solid green; border-top: 0.25em solid green; } +div#before { height: 1em; margin-bottom:-1em; } +div#before > span { display: inline; vertical-align: top; background: red; color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-005.0.scss new file mode 100644 index 0000000000..de883783f6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/inline-table-zorder-005.0.scss @@ -0,0 +1,7 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/inline-table-zorder-005.htm */ + +div#test > span { display:inline-table; vertical-align: top; } +div#test > span > span { display: block; background: green; color: green; border-bottom: 0.25em solid green; border-top: 0.25em solid green; } +div#before { height: 1em; margin-bottom:-1em; } +div#before > span { display: inline; vertical-align: top; background: red; color: red; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/quotes-035.0.scss b/theme-compiler/tests/resources/w3ctests/scss/quotes-035.0.scss new file mode 100644 index 0000000000..7e8809a736 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/quotes-035.0.scss @@ -0,0 +1,29 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/quotes-035.htm */ + + + .party1 * { display: inline; } + .party1 .a { quotes: "Isn" "'" + "t" "FAIL!" + "FAIL!" " i"; } + .party1 .b { quotes: "" "FAIL!!" + " wonderful" "!!!" + " to " " work" + "see " " [FAIL to]" + "C" "quotes" + "S" " "; } + .party1 .c { quotes: none; } + .party1 .d { quotes: "FAIL!" "FAIL!" + "FAIL!" "FAIL!" + "" ""; } + .test { margin-left: 2em; } + .test .no-open:before { content: no-open-quote; } + .test .open:before { content: open-quote; } + .test .triple-open:before { content: open-quote open-quote open-quote; } + .test .no-close:after { content: no-close-quote; } + .test .triple-no-close:after { content: no-close-quote no-close-quote no-close-quote; } + .test .close:after { content: close-quote; } + .test .triple-close:after { content: close-quote close-quote close-quote; } + .test .no-close-open:before { content: no-close-quote open-quote; } + + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/quotes-035a.0.scss b/theme-compiler/tests/resources/w3ctests/scss/quotes-035a.0.scss new file mode 100644 index 0000000000..e4e3d17658 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/quotes-035a.0.scss @@ -0,0 +1,31 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/quotes-035a.htm */ + + + .party1 * { display: inline; } + .party1 .a { quotes: "Isn" "'" + "t" "FAIL!" + "FAIL!" " i"; } + .party1 .b { quotes: "" "FAIL!!" + " wonderful" "!!!" + " to " " work" + "see " " [FAIL to]" + "C" "quotes" + "S" " " + "S" " "; } + .party1 .c { quotes: none; } + .party1 .d { quotes: "FAIL!" "FAIL!" + "FAIL!" "FAIL!" + "" "" + "" ""; } + .test { margin-left: 2em; } + .test .no-open:before { content: no-open-quote; } + .test .open:before { content: open-quote; } + .test .triple-open:before { content: open-quote open-quote open-quote; } + .test .no-close:after { content: no-close-quote; } + .test .triple-no-close:after { content: no-close-quote no-close-quote no-close-quote; } + .test .close:after { content: close-quote; } + .test .triple-close:after { content: close-quote close-quote close-quote; } + .test .no-close-open:before { content: no-close-quote open-quote; } + + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/quotes-036.0.scss b/theme-compiler/tests/resources/w3ctests/scss/quotes-036.0.scss new file mode 100644 index 0000000000..2d2927c254 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/quotes-036.0.scss @@ -0,0 +1,35 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/quotes-036.htm */ + + + .party1 * { display: inline; } + .party1 .a { quotes: "Isn" "'" + "t" "FAIL!" + "FAIL!" " i"; } + .party1 .b { quotes: "" "FAIL!!" + " wonderful" "!!!" + " to " " work" + "see " " [FAIL to]" + "C" "quotes" + "S" " "; } + .party1 .c { quotes: none; } + .party1 .d { quotes: "FAIL!" "FAIL!" + "FAIL!" "FAIL!" + "" ""; } + .test { margin-left: 2em; } + .test .no-open:before { content: no-open-quote; } + .test .open:before { content: open-quote; } + .test .triple-open:before { content: open-quote open-quote open-quote; } + .test .no-close:after { content: no-close-quote; } + .test .triple-no-close:after { content: no-close-quote no-close-quote no-close-quote; } + .test .close:after { content: close-quote; } + .test .triple-close:after { content: close-quote close-quote close-quote; } + .test .no-close-open:before { content: no-close-quote open-quote; } + + /* hr br */ + .test hr, .test br { display: inline; margin: 0; padding: 0; + height: auto; width: auto; border: none; color: inherit; + background: transparent; } + .test br:before { content: "" } + .test br:after { content: "" } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/ref-green-box-100x100.0.scss b/theme-compiler/tests/resources/w3ctests/scss/ref-green-box-100x100.0.scss new file mode 100644 index 0000000000..6ee83f95d6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/ref-green-box-100x100.0.scss @@ -0,0 +1,8 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/support/ref-green-box-100x100.htm */ + + div { + width: 100px; + height: 100px; + background: green; + } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-cell-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-cell-001.0.scss new file mode 100644 index 0000000000..c03a4049a6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-cell-001.0.scss @@ -0,0 +1,33 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bc-cell-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 8px 6px; /* collapsed */ + padding: 3px 7px 8px 6px; /* ignored */ + border-collapse: collapse; + } + + td { + border: transparent solid; + border-width: 2px 0 4px 2px; /* collapsed */ + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color td.t { background-color: aqua; } + + table.imagetl td.t, table.imagebr td.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl td.t { background-position: top left; /* default */ } + table.imagebr td.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-colgroup-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-colgroup-001.0.scss new file mode 100644 index 0000000000..d0ce72d0e0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-colgroup-001.0.scss @@ -0,0 +1,33 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bc-colgroup-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 8px 6px; /* collapsed */ + padding: 3px 7px 8px 6px; /* ignored */ + border-collapse: collapse; + } + + td { + border: transparent solid; + border-width: 2px 0 4px 2px; /* collapsed */ + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color colgroup.t { background-color: aqua; } + + table.imagetl colgroup.t, table.imagebr colgroup.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl colgroup.t { background-position: top left; /* default */ } + table.imagebr colgroup.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-column-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-column-001.0.scss new file mode 100644 index 0000000000..c3d2bd0503 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-column-001.0.scss @@ -0,0 +1,33 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bc-column-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 8px 6px; /* collapsed */ + padding: 3px 7px 8px 6px; /* ignored */ + border-collapse: collapse; + } + + td { + border: transparent solid; + border-width: 2px 0 4px 2px; /* collapsed */ + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color col.t { background-color: aqua; } + + table.imagetl col.t, table.imagebr col.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl col.t { background-position: top left; /* default */ } + table.imagebr col.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-row-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-row-001.0.scss new file mode 100644 index 0000000000..1a7049fba8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-row-001.0.scss @@ -0,0 +1,33 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bc-row-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 8px 6px; /* collapsed */ + padding: 3px 7px 8px 6px; /* ignored */ + border-collapse: collapse; + } + + td { + border: transparent solid; + border-width: 2px 0 4px 2px; /* collapsed */ + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color tr.t { background-color: aqua; } + + table.imagetl tr.t, table.imagebr tr.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl tr.t { background-position: top left; /* default */ } + table.imagebr tr.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-rowgroup-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-rowgroup-001.0.scss new file mode 100644 index 0000000000..69c10cca9f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-rowgroup-001.0.scss @@ -0,0 +1,33 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bc-rowgroup-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 8px 6px; /* collapsed */ + padding: 3px 7px 8px 6px; /* ignored */ + border-collapse: collapse; + } + + td { + border: transparent solid; + border-width: 2px 0 4px 2px; /* collapsed */ + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color tbody.t { background-color: aqua; } + + table.imagetl tbody.t, table.imagebr tbody.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl tbody.t { background-position: top left; /* default */ } + table.imagebr tbody.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-table-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-table-001.0.scss new file mode 100644 index 0000000000..b6a8f27ab2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bc-table-001.0.scss @@ -0,0 +1,33 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bc-table-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 8px 6px; /* collapsed */ + padding: 3px 7px 8px 6px; /* ignored */ + border-collapse: collapse; + } + + td { + border: transparent solid; + border-width: 2px 0 4px 2px; /* collapsed */ + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color { background-color: aqua; } + + table.imagetl, table.imagebr { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl { background-position: top left; /* default */ } + table.imagebr { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-cell-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-cell-001.0.scss new file mode 100644 index 0000000000..02289c80e2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-cell-001.0.scss @@ -0,0 +1,34 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bs-cell-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 7px 3px; + padding: 3px 7px 8px 6px; + border-collapse: separate; + border-spacing: 2px 3px; + } + + td { + border: transparent solid; + border-width: 2px 1px 4px 3px; + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color td.t { background-color: aqua; } + + table.imagetl td.t, table.imagebr td.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl td.t { background-position: top left; /* default */ } + table.imagebr td.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-colgroup-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-colgroup-001.0.scss new file mode 100644 index 0000000000..dae2af72ae --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-colgroup-001.0.scss @@ -0,0 +1,34 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bs-colgroup-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 7px 3px; + padding: 3px 7px 8px 6px; + border-collapse: separate; + border-spacing: 2px 3px; + } + + td { + border: transparent solid; + border-width: 2px 1px 4px 3px; + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color colgroup.t { background-color: aqua; } + + table.imagetl colgroup.t, table.imagebr colgroup.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl colgroup.t { background-position: top left; /* default */ } + table.imagebr colgroup.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-column-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-column-001.0.scss new file mode 100644 index 0000000000..8289f3a4bb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-column-001.0.scss @@ -0,0 +1,34 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bs-column-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 7px 3px; + padding: 3px 7px 8px 6px; + border-collapse: separate; + border-spacing: 2px 3px; + } + + td { + border: transparent solid; + border-width: 2px 1px 4px 3px; + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color col.t { background-color: aqua; } + + table.imagetl col.t, table.imagebr col.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl col.t { background-position: top left; /* default */ } + table.imagebr col.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-row-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-row-001.0.scss new file mode 100644 index 0000000000..f2ec27e38b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-row-001.0.scss @@ -0,0 +1,34 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bs-row-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 7px 3px; + padding: 3px 7px 8px 6px; + border-collapse: separate; + border-spacing: 2px 3px; + } + + td { + border: transparent solid; + border-width: 2px 1px 4px 3px; + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color tr.t { background-color: aqua; } + + table.imagetl tr.t, table.imagebr tr.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl tr.t { background-position: top left; /* default */ } + table.imagebr tr.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-rowgroup-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-rowgroup-001.0.scss new file mode 100644 index 0000000000..cb5b8f79a6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-rowgroup-001.0.scss @@ -0,0 +1,34 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bs-rowgroup-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 7px 3px; + padding: 3px 7px 8px 6px; + border-collapse: separate; + border-spacing: 2px 3px; + } + + td { + border: transparent solid; + border-width: 2px 1px 4px 3px; + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color tbody.t { background-color: aqua; } + + table.imagetl tbody.t, table.imagebr tbody.t { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl tbody.t { background-position: top left; /* default */ } + table.imagebr tbody.t { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-table-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-table-001.0.scss new file mode 100644 index 0000000000..6d1eabb6a8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-backgrounds-bs-table-001.0.scss @@ -0,0 +1,34 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-backgrounds-bs-table-001.htm */ + + + html, body { margin: 0; padding: 0; border: 0; font-size: 16px; } + body { padding: 15px; } + + table { + margin: 0 3px 2px 4px; /* zero top to work around collapsing bug */ + border: transparent solid; + border-width: 4px 2px 7px 3px; + padding: 3px 7px 8px 6px; + border-collapse: separate; + border-spacing: 2px 3px; + } + + td { + border: transparent solid; + border-width: 2px 1px 4px 3px; + padding: 1px 2px 4px 3px; + empty-cells: show; + } + + div { height: 10px; width: 50px; } + + table.color { background-color: aqua; } + + table.imagetl, table.imagebr { + background-image: url(support/repeatable-diagonal-gradient-with-ticks.png); + } + + table.imagetl { background-position: top left; /* default */ } + table.imagebr { background-position: bottom right; /* default */ } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.0.scss new file mode 100644 index 0000000000..bc5733aedd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-in-inline-001.htm */ +.style { display: table-row } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.1.scss new file mode 100644 index 0000000000..a4d01762bd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-in-inline-001.htm */ +.style { display: block } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.2.scss new file mode 100644 index 0000000000..fe13eb4cbb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-in-inline-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-in-inline-001.htm */ +.style { display: table-cell } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.0.scss new file mode 100644 index 0000000000..15d24294d1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-001.htm */ + + +td { vertical-align: baseline; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.1.scss new file mode 100644 index 0000000000..c93d980b57 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-001.htm */ +.style { padding-top: 40px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.2.scss new file mode 100644 index 0000000000..8c98e302cc --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-001.htm */ +.style { padding-top: 20px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.3.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.3.scss new file mode 100644 index 0000000000..90b0e303b2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-001.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-001.htm */ +.style { padding-top: 0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.0.scss new file mode 100644 index 0000000000..9e8fc17d73 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-002.htm */ + + +td { vertical-align: baseline; padding-top: 0; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.1.scss new file mode 100644 index 0000000000..c8a265b2e4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-002.htm */ +.style { padding-top: 40px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.2.scss new file mode 100644 index 0000000000..84c4a43819 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-002.htm */ +.style { padding-top: 20px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.3.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.3.scss new file mode 100644 index 0000000000..b212fc065f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-002.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-002.htm */ +.style { padding-top: 0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.0.scss new file mode 100644 index 0000000000..b623b103e4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-003.htm */ + + +td { vertical-align: baseline; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.1.scss new file mode 100644 index 0000000000..646c3603f7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-003.htm */ +.style { padding-top: 0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.2.scss new file mode 100644 index 0000000000..c461bdba34 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-003.htm */ +.style { padding-top: 40px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.3.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.3.scss new file mode 100644 index 0000000000..3b0a262d34 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-003.htm */ +.style { padding-top: 12px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.4.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.4.scss new file mode 100644 index 0000000000..055905d9d7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-003.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-003.htm */ +.style { padding-top: 3px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.0.scss new file mode 100644 index 0000000000..3563cde096 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-004.htm */ + + +td { vertical-align: baseline; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.1.scss new file mode 100644 index 0000000000..eac995c41d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-004.htm */ +.style { padding-top: 12px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.2.scss new file mode 100644 index 0000000000..b2745143e2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-004.htm */ +.style { padding-top: 3px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.3.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.3.scss new file mode 100644 index 0000000000..15214ad16a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-004.htm */ +.style { padding-top: 40px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.4.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.4.scss new file mode 100644 index 0000000000..4b93164a1b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-004.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-004.htm */ +.style { padding-top: 0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.0.scss new file mode 100644 index 0000000000..49e4923cc8 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-005.htm */ + + +td { vertical-align: baseline; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.1.scss new file mode 100644 index 0000000000..7896c6342c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-005.htm */ +.style { padding-top: 0; height: 80px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.2.scss new file mode 100644 index 0000000000..e000d2e340 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-005.htm */ +.style { padding-top: 40px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.3.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.3.scss new file mode 100644 index 0000000000..0a30e0d376 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-005.htm */ +.style { padding-top: 12px; height: 120px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.4.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.4.scss new file mode 100644 index 0000000000..c4152587ea --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-005.htm */ +.style { padding-top: 3px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.5.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.5.scss new file mode 100644 index 0000000000..ec44e94e6d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-005.htm */ +.style { padding-top: 40px; height: 160px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.6.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.6.scss new file mode 100644 index 0000000000..3a3990256c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-005.6.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-005.htm */ +.style { padding-top: 0 } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.0.scss new file mode 100644 index 0000000000..3f56772677 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-006.htm */ + + +td { vertical-align: baseline; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.1.scss new file mode 100644 index 0000000000..4b20736354 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-006.htm */ +.style { padding-top: 0; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.2.scss new file mode 100644 index 0000000000..9f71b57dd9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-006.htm */ +.style { padding-top: 40px; height: 80px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.3.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.3.scss new file mode 100644 index 0000000000..dd8cd111f5 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-006.htm */ +.style { padding-top: 12px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.4.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.4.scss new file mode 100644 index 0000000000..90ef71d106 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-006.htm */ +.style { padding-top: 3px; height: 120px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.5.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.5.scss new file mode 100644 index 0000000000..6d33486f7c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-006.htm */ +.style { padding-top: 40px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.6.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.6.scss new file mode 100644 index 0000000000..0bec2dee1a --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-006.6.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-006.htm */ +.style { padding-top: 0; height: 160px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.0.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.0.scss new file mode 100644 index 0000000000..6c11f1b90f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.0.scss @@ -0,0 +1,6 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-007.htm */ + + +td { vertical-align: baseline; } + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.1.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.1.scss new file mode 100644 index 0000000000..4863e1df5b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-007.htm */ +.style { padding-top: 0; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.2.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.2.scss new file mode 100644 index 0000000000..d32301afb9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-007.htm */ +.style { padding-top: 40px; height: 80px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.3.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.3.scss new file mode 100644 index 0000000000..b25a964d73 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-007.htm */ +.style { padding-top: 12px; height: 160px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.4.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.4.scss new file mode 100644 index 0000000000..98808066f1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-007.htm */ +.style { padding-top: 3px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.5.scss b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.5.scss new file mode 100644 index 0000000000..8a366d4df2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/table-vertical-align-baseline-007.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/table-vertical-align-baseline-007.htm */ +.style { padding-top: 40px; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-113.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-113.0.scss new file mode 100644 index 0000000000..01e37d208c --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-113.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-113.htm */ + +p { text-indent: 100px } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-114.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-114.0.scss new file mode 100644 index 0000000000..ec19eb2816 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-114.0.scss @@ -0,0 +1,4 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-114.htm */ + +p { text-indent: 0px } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-115.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-115.0.scss new file mode 100644 index 0000000000..569f033276 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-115.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-115.htm */ + +p { text-indent: 100px } +span { background: yellow } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.0.scss new file mode 100644 index 0000000000..6ed93593e9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.0.scss @@ -0,0 +1,17 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-001.htm */ + + +body { font-size: 12px; width: 1px; } + +body > div, body > pre { + float: left; clear: left; margin: 1px; height: 2em; + border: medium solid; +} + +span { + display: inline-block; + height: 1em; + width: 1em; +} + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.1.scss new file mode 100644 index 0000000000..c71814945e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-001.htm */ +.style { text-indent: 3em; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.11.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.11.scss new file mode 100644 index 0000000000..d43af6804b --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.11.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-001.htm */ +.style { width: 6em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.4.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.4.scss new file mode 100644 index 0000000000..aecf9b104d --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-001.htm */ +.style { text-indent: 3em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.5.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.5.scss new file mode 100644 index 0000000000..4d3f04cdf4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-001.htm */ +.style { width: 1em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.8.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.8.scss new file mode 100644 index 0000000000..11f2a1b4c7 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-001.8.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-001.htm */ +.style { width: 2em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.0.scss new file mode 100644 index 0000000000..7dcafd1001 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.0.scss @@ -0,0 +1,17 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-002.htm */ + + +body { font-size: 12px; } + +body > div, body > pre { + float: left; clear: left; margin: 1px; height: 2em; + border: medium solid; +} + +span { + display: inline-block; + height: 1em; + width: 1em; +} + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.1.scss new file mode 100644 index 0000000000..fb9ad27680 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-002.htm */ +.style { text-indent: 3em; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.11.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.11.scss new file mode 100644 index 0000000000..9783ca14ac --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.11.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-002.htm */ +.style { width: 6em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.4.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.4.scss new file mode 100644 index 0000000000..dc20dd4b85 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-002.htm */ +.style { text-indent: 3em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.5.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.5.scss new file mode 100644 index 0000000000..41cee98d11 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-002.htm */ +.style { width: 1em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.8.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.8.scss new file mode 100644 index 0000000000..49161e2910 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-002.8.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-002.htm */ +.style { width: 2em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.0.scss new file mode 100644 index 0000000000..98f79df5fd --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.0.scss @@ -0,0 +1,17 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ + + +body { font-size: 12px; } + +body > div, body > pre { + float: left; clear: left; margin: 1px; height: 2em; + border: medium solid; +} + +span { + display: inline-block; + height: 1em; + width: 1em; +} + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.1.scss new file mode 100644 index 0000000000..ef4f538864 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ +.style { width: 1px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.11.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.11.scss new file mode 100644 index 0000000000..29d824d66e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.11.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ +.style { width: 3em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.17.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.17.scss new file mode 100644 index 0000000000..ce29a677f1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.17.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ +.style { width: 4em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.2.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.2.scss new file mode 100644 index 0000000000..d9169cf13e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ +.style { text-indent: -3em; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.25.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.25.scss new file mode 100644 index 0000000000..575d7393f2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.25.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ +.style { text-indent: -3em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.3.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.3.scss new file mode 100644 index 0000000000..44021e266f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.3.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ +.style { width: 1em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.5.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.5.scss new file mode 100644 index 0000000000..0b02a652f9 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-003.5.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-003.htm */ +.style { width: 5em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.0.scss new file mode 100644 index 0000000000..4fcfac5be6 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.0.scss @@ -0,0 +1,17 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-004.htm */ + + +body { font-size: 12px; } + +body > div, body > pre { + float: left; clear: left; margin: 1px; height: 2em; + border: medium solid; +} + +span { + display: inline-block; + height: 1em; + width: 1em; +} + + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.1.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.1.scss new file mode 100644 index 0000000000..a8cd2367c3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-004.htm */ +.style { text-indent: -3em; } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.10.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.10.scss new file mode 100644 index 0000000000..549eca8142 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.10.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-004.htm */ +.style { width: 3em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.16.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.16.scss new file mode 100644 index 0000000000..d97bdc5805 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.16.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-004.htm */ +.style { width: 4em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.2.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.2.scss new file mode 100644 index 0000000000..645265fcee --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.2.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-004.htm */ +.style { width: 1em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.24.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.24.scss new file mode 100644 index 0000000000..a43261231e --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.24.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-004.htm */ +.style { text-indent: -3em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.4.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.4.scss new file mode 100644 index 0000000000..60d30f9cdb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-intrinsic-004.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-intrinsic-004.htm */ +.style { width: 5em } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-percent-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-percent-001.0.scss new file mode 100644 index 0000000000..2204bedfe4 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-percent-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-percent-001.htm */ + +div { width: 500px; } +p { width: 300px; text-indent: 10%; } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-indent-wrap-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-indent-wrap-001.0.scss new file mode 100644 index 0000000000..fc5dab0d52 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-indent-wrap-001.0.scss @@ -0,0 +1,5 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-indent-wrap-001.htm */ + +p { text-indent: 100px } +span { background: yellow } + diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-001.0.scss new file mode 100644 index 0000000000..515fa762c3 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-001.htm */ +.style { letter-spacing:2px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-001.1.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-001.1.scss new file mode 100644 index 0000000000..69ff275066 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-001.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-001.htm */ +.style { text-transform:capitalize } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-002.0.scss new file mode 100644 index 0000000000..4d744e17b1 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-002.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-002.htm */ +.style { letter-spacing:2px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-002.1.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-002.1.scss new file mode 100644 index 0000000000..c6bb7e4bef --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-002.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-002.htm */ +.style { text-transform:capitalize } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.0.scss new file mode 100644 index 0000000000..0ba48a86c0 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-003.htm */ +.style { letter-spacing:2px } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.1.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.1.scss new file mode 100644 index 0000000000..e1cb8d6745 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.1.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-003.htm */ +.style { text-transform:capitalize } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.4.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.4.scss new file mode 100644 index 0000000000..a0d1d9a606 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.4.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-003.htm */ +.style { text-transform:none } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.7.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.7.scss new file mode 100644 index 0000000000..438a1e4be2 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-capitalize-003.7.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-capitalize-003.htm */ +.style { white-space:nowrap } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-lowercase-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-lowercase-001.0.scss new file mode 100644 index 0000000000..fe6e97e39f --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-lowercase-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-lowercase-001.htm */ +.style { text-transform:lowercase } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-uppercase-001.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-uppercase-001.0.scss new file mode 100644 index 0000000000..7dc1c293cb --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-uppercase-001.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-uppercase-001.htm */ +.style { text-transform:uppercase } diff --git a/theme-compiler/tests/resources/w3ctests/scss/text-transform-uppercase-002.0.scss b/theme-compiler/tests/resources/w3ctests/scss/text-transform-uppercase-002.0.scss new file mode 100644 index 0000000000..c18eff8824 --- /dev/null +++ b/theme-compiler/tests/resources/w3ctests/scss/text-transform-uppercase-002.0.scss @@ -0,0 +1,2 @@ +/* Source: http://test.csswg.org/suites/css2.1/20110323/html4/text-transform-uppercase-002.htm */ +.style { text-transform:uppercase } diff --git a/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java b/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java index d867e6ccd0..01187b4502 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java +++ b/theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java @@ -30,6 +30,8 @@ import com.vaadin.sass.internal.ScssStylesheet; public abstract class AbstractTestBase { + public static final String CR = "\r"; + protected ScssStylesheet stylesheet; protected String originalScss; protected String parsedScss; @@ -69,17 +71,21 @@ public abstract class AbstractTestBase { public void testParser(String file) throws CSSException, IOException, URISyntaxException { originalScss = getFileContent(file); + originalScss = originalScss.replaceAll(CR, ""); ScssStylesheet sheet = getStyleSheet(file); parsedScss = sheet.toString(); + parsedScss = parsedScss.replace(CR, ""); Assert.assertEquals("Original CSS and parsed CSS do not match", originalScss, parsedScss); } public void testCompiler(String scss, String css) throws Exception { comparisonCss = getFileContent(css); + comparisonCss = comparisonCss.replaceAll(CR, ""); ScssStylesheet sheet = getStyleSheet(scss); sheet.compile(); parsedScss = sheet.toString(); + parsedScss = parsedScss.replaceAll(CR, ""); Assert.assertEquals("Original CSS and parsed CSS do not match", comparisonCss, parsedScss); } diff --git a/theme-compiler/tests/src/com/vaadin/sass/resolvers/VaadinResolverTest.java b/theme-compiler/tests/src/com/vaadin/sass/resolvers/VaadinResolverTest.java index 59b49888c2..0183142747 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/resolvers/VaadinResolverTest.java +++ b/theme-compiler/tests/src/com/vaadin/sass/resolvers/VaadinResolverTest.java @@ -40,16 +40,26 @@ import java.lang.reflect.Method; import org.junit.Assert; import org.junit.Test; -import com.vaadin.sass.internal.resolver.VaadinResolver; +import com.vaadin.sass.internal.resolver.AbstractResolver; +import com.vaadin.sass.internal.resolver.ClassloaderResolver; +import com.vaadin.sass.internal.resolver.FilesystemResolver; public class VaadinResolverTest { @Test - public void testPathNormalization() throws Exception { + public void testFilesystemResolverPathNormalization() throws Exception { + testPathNormalization(new FilesystemResolver()); + } + + @Test + public void testClassloaderResolverPathNormalization() throws Exception { + testPathNormalization(new ClassloaderResolver()); + } - VaadinResolver resolver = new VaadinResolver(); + public void testPathNormalization(AbstractResolver resolver) + throws Exception { - Method normalizeMethod = VaadinResolver.class.getDeclaredMethod( + Method normalizeMethod = AbstractResolver.class.getDeclaredMethod( "normalize", String.class); normalizeMethod.setAccessible(true); diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/css/Media.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/css/Media.java index 1c84bf8c49..b7ca325aa7 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/css/Media.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/css/Media.java @@ -33,4 +33,5 @@ public class Media extends AbstractTestBase { IOException { testParser(css); } + } diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java index 21edde0c17..6a5f8db73d 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java @@ -28,8 +28,13 @@ import java.util.List; import org.apache.commons.io.IOUtils; import org.junit.Assert; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CSSParseException; import com.vaadin.sass.internal.ScssStylesheet; +import com.vaadin.sass.internal.handler.SCSSDocumentHandler; +import com.vaadin.sass.internal.handler.SCSSDocumentHandlerImpl; +import com.vaadin.sass.internal.handler.SCSSErrorHandler; import com.vaadin.sass.testcases.scss.SassTestRunner.FactoryTest; public abstract class AbstractDirectoryScanningSassTests { @@ -78,19 +83,38 @@ public abstract class AbstractDirectoryScanningSassTests { @FactoryTest public void compareScssWithCss(String scssResourceName) throws Exception { - String referenceCss; File scssFile = getSassLangResourceFile(scssResourceName); - File cssFile = getCssFile(scssFile); - referenceCss = IOUtils.toString(new FileInputStream(cssFile)); - ScssStylesheet scssStylesheet = ScssStylesheet.get(scssFile - .getCanonicalPath()); + + SCSSDocumentHandler documentHandler = new SCSSDocumentHandlerImpl(); + SCSSErrorHandler errorHandler = new SCSSErrorHandler() { + @Override + public void error(CSSParseException arg0) throws CSSException { + super.error(arg0); + Assert.fail(arg0.getMessage()); + } + + @Override + public void fatalError(CSSParseException arg0) throws CSSException { + super.error(arg0); + Assert.fail(arg0.getMessage()); + } + }; + + ScssStylesheet scssStylesheet = ScssStylesheet.get( + scssFile.getCanonicalPath(), null, documentHandler, + errorHandler); scssStylesheet.compile(); String parsedCss = scssStylesheet.toString(); - String normalizedReference = normalize(referenceCss); - String normalizedParsed = normalize(parsedCss); - Assert.assertEquals("Original CSS and parsed CSS do not match for " - + scssResourceName, normalizedReference, normalizedParsed); + if (getCssFile(scssFile) != null) { + String referenceCss = IOUtils.toString(new FileInputStream( + getCssFile(scssFile))); + String normalizedReference = normalize(referenceCss); + String normalizedParsed = normalize(parsedCss); + + Assert.assertEquals("Original CSS and parsed CSS do not match for " + + scssResourceName, normalizedReference, normalizedParsed); + } } private String normalize(String css) { @@ -120,7 +144,7 @@ public abstract class AbstractDirectoryScanningSassTests { return new File(res.toURI()); } - private File getCssFile(File scssFile) throws IOException { + protected File getCssFile(File scssFile) throws IOException { return new File(scssFile.getCanonicalPath().replace("scss", "css")); } } diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/CompassImports.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/CompassImports.java new file mode 100644 index 0000000000..4e87eb2197 --- /dev/null +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/CompassImports.java @@ -0,0 +1,82 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.sass.testcases.scss; + +import java.io.File; +import java.io.IOException; + +import junit.framework.Assert; + +import org.junit.Test; +import org.w3c.css.sac.CSSException; + +import com.vaadin.sass.AbstractTestBase; +import com.vaadin.sass.internal.ScssStylesheet; +import com.vaadin.sass.internal.handler.SCSSDocumentHandler; +import com.vaadin.sass.internal.handler.SCSSDocumentHandlerImpl; +import com.vaadin.sass.internal.parser.Parser; +import com.vaadin.sass.internal.resolver.FilesystemResolver; +import com.vaadin.sass.internal.tree.ImportNode; + +public class CompassImports extends AbstractTestBase { + + String scssOtherDirectory = "/scss/compass-test/compass-import.scss"; + String scssSameDirectory = "/scss/compass-test2/compass-import2.scss"; + String css = "/css/compass-import.css"; + + String compassPath = "/scss/compass-test2"; + + @Test + public void testParser() throws CSSException, IOException { + Parser parser = new Parser(); + SCSSDocumentHandler handler = new SCSSDocumentHandlerImpl(); + parser.setDocumentHandler(handler); + parser.parseStyleSheet(getClass().getResource(scssOtherDirectory) + .getPath()); + ScssStylesheet root = handler.getStyleSheet(); + ImportNode importVariableNode = (ImportNode) root.getChildren().get(0); + Assert.assertEquals("compass", importVariableNode.getUri()); + Assert.assertFalse(importVariableNode.isPureCssImport()); + } + + @Test + public void testCompiler() throws Exception { + testCompiler(scssSameDirectory, css, null); + } + + @Test + public void testCompilerWithCustomPath() throws Exception { + File rootPath = new File(getClass().getResource(compassPath).toURI()); + + testCompiler(scssOtherDirectory, css, rootPath.getPath()); + } + + public void testCompiler(String scss, String css, String additionalPath) + throws Exception { + comparisonCss = getFileContent(css); + comparisonCss = comparisonCss.replaceAll(CR, ""); + ScssStylesheet sheet = getStyleSheet(scss); + Assert.assertNotNull(sheet); + sheet.addResolver(new FilesystemResolver(additionalPath)); + + sheet.compile(); + parsedScss = sheet.toString(); + parsedScss = parsedScss.replaceAll(CR, ""); + Assert.assertEquals("Original CSS and parsed CSS do not match", + comparisonCss, parsedScss); + } +} diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/W3ConformanceTests.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/W3ConformanceTests.java new file mode 100644 index 0000000000..8dbc6345d6 --- /dev/null +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/W3ConformanceTests.java @@ -0,0 +1,236 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.sass.testcases.scss; + +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; + +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; +import org.junit.runner.RunWith; + +import com.vaadin.sass.testcases.scss.SassTestRunner.TestFactory; + +@RunWith(SassTestRunner.class) +public class W3ConformanceTests extends AbstractDirectoryScanningSassTests { + + @Override + protected URL getResourceURL(String path) { + return getResourceURLInternal(path); + } + + private static URL getResourceURLInternal(String path) { + return AutomaticSassTests.class.getResource("/w3ctests" + path); + } + + @TestFactory + public static Collection<String> getScssResourceNames() + throws URISyntaxException, IOException { + return getScssResourceNames(getResourceURLInternal("")); + } + + @Override + protected File getCssFile(File scssFile) throws IOException { + /* + * We should really compare the result of unparse(parse(css)) to css, + * but the comparator routine is currently too primitive. + */ + // return scssFile; + + // no comparison step, just parse, in this test + return null; + } + + /* + * Download W3C conformance tests for CSS 2.1 and CSS 3 (selectors), + * extracts all CSS (style tags, inline styles, and linked stylesheets), + * then tries to parse them. Since each CSS is valid SCSS, the parser should + * accept them. As these are browser tests, some are intentionally + * malformed, and must be excluded from the test suite. + */ + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.err.println("Target directory not provided"); + return; + } + File targetDir = new File(args[0]); + for (URI url : CSS21()) { + extractCSS(url, targetDir); + } + for (URI url : CSS3Selectors()) { + extractCSS(url, targetDir); + } + + } + + public static Collection<URI> CSS21() throws Exception { + /* + * Tests explicitly excluded are listed below---case by case motivation + * required! + */ + final String[] excludelist = new String[] { + // Unsupported character encoding UTF-16 + "http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-utf16-be-002.htm", + "http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-utf16-be-003.htm", + "http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-utf16-le-002.htm", + "http://test.csswg.org/suites/css2.1/20110323/html4/at-charset-utf16-le-003.htm", + + // Font family name contains (Asian?) cryptoglyphs + "http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-010.htm", + "http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-011.htm", + "http://test.csswg.org/suites/css2.1/20110323/html4/font-family-name-015.htm", + + // Contains syntactically illegal CSS + "http://test.csswg.org/suites/css2.1/20110323/html4/uri-013.htm", + + // Missing semicolon on line 29 + "http://test.csswg.org/suites/css2.1/20110323/html4/z-index-020.htm", }; + + // Note: W3C test reference files also not included! + return scrapeIndexForTests( + "http://test.csswg.org/suites/css2.1/20110323/html4/reftest-toc.html", + ".*[0-9][0-9][0-9][a-z]?\\.htm", Integer.MAX_VALUE, + new LinkedHashSet<URI>() { + { + for (String s : excludelist) { + add(new URI(s)); + } + } + }); + } + + public static Collection<URI> CSS3Selectors() throws Exception { + /* + * Tests explicitly excluded are listed below---case by case motivation + * required! + */ + final String[] excludelist = new String[] { + + // Probable bug/limitation (filed as #12834) + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-73.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-73b.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-74.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-74b.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-75.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-75b.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-76.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-76b.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-83.html", + + // Invalid CSS, although sass-lang compiler accepts (see #12835) + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-154.html", + + // Invalid CSS? sass-lang compiler fails + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-157.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-158.html", + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/css3-modsel-183.html", }; + + return scrapeIndexForTests( + "http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/", + "css3-.*\\.html", Integer.MAX_VALUE, new LinkedHashSet<URI>() { + { + for (String s : excludelist) { + add(new URI(s)); + } + } + }); + } + + /* + * Loads up to maxTest tests, excluding any URL in excludeUrls. + */ + protected static Collection<URI> scrapeIndexForTests(String url, + String regexp, int maxTests, Collection<URI> excludeUrls) + throws Exception { + + URI baseUrl = new URI(url); + Document doc = Jsoup.connect(url).timeout(10000).get(); + Elements elems = doc.select(String.format("a[href~=%s]", regexp)); + LinkedHashSet<URI> tests = new LinkedHashSet<URI>(); + for (Element e : elems) { + URI testUrl = new URI(e.attr("href")); + if (!testUrl.isAbsolute()) { + testUrl = baseUrl.resolve(testUrl); + } + if (tests.size() < maxTests) { + if (!excludeUrls.contains(testUrl)) { + tests.add(testUrl); + } + } else { + break; + } + } + + return tests; + } + + public static void extractCSS(final URI url, File targetdir) + throws Exception { + /* + * For each test URL: 1) extract <style> tag contents 2) extract from + * <link rel="stylesheet"> files 3) extract inline style attributes from + * all elements and wrap the result in .style {} + */ + + Document doc = Jsoup.connect(url.toString()).timeout(20000).get(); + + List<String> tests = new ArrayList<String>(); + + for (Element e : doc.select("style[type=text/css]")) { + tests.add(e.data()); + } + + for (Element e : doc + .select("link[rel=stylesheet][href][type=text/css]")) { + URI cssUri = new URI(e.attr("href")); + if (!cssUri.isAbsolute()) { + cssUri = url.resolve(cssUri); + } + String encoding = doc.outputSettings().charset().name(); + tests.add(IOUtils.toString(cssUri, encoding)); + } + + for (Element e : doc.select("*[style]")) { + tests.add(String.format(".style { %s }", e.attr("style"))); + } + + for (final String test : tests) { + targetdir.mkdirs(); + String logfile = String.format("%s.%d.scss", + FilenameUtils.getBaseName(url.toString()), + tests.indexOf(test)); + PrintStream dataLogger = new PrintStream(new File(targetdir, + logfile)); + + dataLogger.println("/* Source: " + url + " */"); + dataLogger.println(test); + + } + } +} diff --git a/uitest/ivy.xml b/uitest/ivy.xml index 352cd89f2e..6270ec54de 100644 --- a/uitest/ivy.xml +++ b/uitest/ivy.xml @@ -84,6 +84,9 @@ conf="build,ide -> default" /> <dependency org="com.vaadin" name="vaadin-testbench" rev="3.1.2" conf="build-provided,ide -> default" /> + <!-- This should be removed once tests have been updated to use lang3 --> + <dependency org="commons-lang" name="commons-lang" + rev="2.6" conf="build,ide -> default" /> </dependencies> </ivy-module> diff --git a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java index a8d639cbc8..20e187c187 100644 --- a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -217,7 +217,6 @@ public class DevelopmentServerLauncher { Socket accept = serverSocket.accept(); // First stop listening to the port serverSocket.close(); - final Thread stopThread = Thread.currentThread(); // Start a thread that kills the JVM if // server.stop() doesn't have any effect diff --git a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.html b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.html new file mode 100644 index 0000000000..33fc46f060 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.html @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.application.DetachOldUIOnReload?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 0</td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.application.DetachOldUIOnReload</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::PID_SLog_row_0</td> + <td>1. UI 0 has been detached</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 1</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::PID_SLog_row_0</td> + <td>2. UI 1 has been detached</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 2</td> +</tr> +<tr> + <td>open</td> + <td>/</td> + <td></td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.application.DetachOldUIOnReload</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::PID_SLog_row_0</td> + <td>3. UI 2 has been detached</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 3</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java new file mode 100644 index 0000000000..154c84b4f5 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java @@ -0,0 +1,85 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.application; + +import java.util.ArrayList; +import java.util.List; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; + +public class DetachOldUIOnReload extends AbstractTestUIWithLog { + private static final String PERSISTENT_MESSAGES_ATTRIBUTE = DetachOldUIOnReload.class + .getName() + ".sessionMessages"; + + @Override + protected void setup(VaadinRequest request) { + addComponent(new Label("This is UI " + getUIId())); + addComponent(new Button("Reload page", new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + getPage().reload(); + } + })); + addComponent(new Button("Read log messages from session", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + for (String message : getSessionMessages(false)) { + log(message); + } + } + })); + } + + private List<String> getSessionMessages(boolean storeIfNeeded) { + List<String> messages = (List<String>) getSession().getAttribute( + PERSISTENT_MESSAGES_ATTRIBUTE); + if (messages == null) { + messages = new ArrayList<String>(); + if (storeIfNeeded) { + getSession().setAttribute(PERSISTENT_MESSAGES_ATTRIBUTE, + messages); + } + } + return messages; + } + + private void logToSession(String message) { + getSessionMessages(true).add(message); + } + + @Override + public void detach() { + super.detach(); + logToSession("UI " + getUIId() + " has been detached"); + } + + @Override + protected String getTestDescription() { + return "Tests that the previous UI gets cleaned immediately when refreshing."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(10338); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionTooltip.html b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html index 4f574a92c7..f366054f45 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionTooltip.html +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> +<link rel="selenium.base" href="http://localhost:8888/run/com.vaadin.tests.application.RefreshStatePreserveTitle?restartApplication" /> <title>New Test</title> </head> <body> @@ -13,19 +13,22 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.applicationcontext.CloseSession?restartApplication&debug</td> + <td>/run/com.vaadin.tests.application.RefreshStatePreserveTitle?restartApplication</td> <td></td> </tr> -<!-- Show tooltip for the Events caption --> <tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-4']/span</td> + <td>assertTitle</td> + <td>TEST</td> <td></td> </tr> -<!-- Verify that there's no error notification --> <tr> - <td>assertElementNotPresent</td> - <td>vaadin=runcomvaadintestsapplicationcontextCloseSession::Root/VNotification[0]</td> + <td>open</td> + <td>/run/com.vaadin.tests.application.RefreshStatePreserveTitle</td> + <td></td> +</tr> +<tr> + <td>assertTitle</td> + <td>TEST</td> <td></td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java new file mode 100644 index 0000000000..88b3a9b9f4 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java @@ -0,0 +1,30 @@ +package com.vaadin.tests.application; + +import com.vaadin.annotations.PreserveOnRefresh; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.Label; + +@PreserveOnRefresh +public class RefreshStatePreserveTitle extends AbstractTestUI { + + private Log log = new Log(5); + + @Override + protected void setup(VaadinRequest request) { + getPage().setTitle("TEST"); + addComponent(new Label( + "Refresh the page and observe that window title 'TEST' is lost.")); + } + + @Override + protected String getTestDescription() { + return "Refreshing the browser window should preserve the window title"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(11054); + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html index f20967c8de..e7d437eeca 100644 --- a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html +++ b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html @@ -28,7 +28,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationTerminalErrorNotification::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestsapplicationTerminalErrorNotification::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>Got an exception: You asked for it</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html index e03027f308..150ab3ff3d 100644 --- a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html +++ b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html @@ -23,7 +23,7 @@ </tr> <tr> <td>assertText</td> - <td>//body/div[2]</td> + <td>//body/div[2]//h1</td> <td>42 & 84</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java index 6213993257..5c7076c07e 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestUI.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestUI.java @@ -113,27 +113,27 @@ public abstract class AbstractTestUI extends UI { protected void setTransport(VaadinRequest request) { String transport = request.getParameter("transport"); PushConfiguration config = getPushConfiguration(); - PushMode mode = config.getPushMode(); if ("xhr".equals(transport)) { config.setPushMode(PushMode.DISABLED); } else if ("websocket".equals(transport)) { - if (!mode.isEnabled()) { - config.setPushMode(PushMode.AUTOMATIC); - } - config.setTransport(Transport.WEBSOCKET); - // Ensure no fallback is used - getPushConfiguration().setParameter( - PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + enablePush(Transport.WEBSOCKET); } else if ("streaming".equals(transport)) { - if (!mode.isEnabled()) { - config.setPushMode(PushMode.AUTOMATIC); - } - config.setTransport(Transport.STREAMING); - // Ensure no fallback is used - getPushConfiguration().setParameter( - PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + enablePush(Transport.STREAMING); + } else if ("long-polling".equals(transport)) { + enablePush(Transport.LONG_POLLING); + } + } + + protected void enablePush(Transport transport) { + PushConfiguration config = getPushConfiguration(); + if (!config.getPushMode().isEnabled()) { + config.setPushMode(PushMode.AUTOMATIC); } + config.setTransport(transport); + // Ensure no fallback is used + getPushConfiguration().setParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); } private VerticalLayout layout; diff --git a/uitest/src/com/vaadin/tests/components/ErrorMessages.html b/uitest/src/com/vaadin/tests/components/ErrorMessages.html index 5379ff59e0..2b7032ea79 100644 --- a/uitest/src/com/vaadin/tests/components/ErrorMessages.html +++ b/uitest/src/com/vaadin/tests/components/ErrorMessages.html @@ -3,17 +3,17 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://artur-laptop.office.itmill.com:8888/" /> -<title>New Test</title> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>ErrorMessages</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">ErrorMessages</td></tr> </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.ErrorMessages</td> + <td>/run/com.vaadin.tests.components.ErrorMessages?restartApplication</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java index 1208b8be3b..24dc942171 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java @@ -22,6 +22,7 @@ public class ButtonsWaiAria extends ComponentTestCase<Button> { l = createButton("Icon Button, empty alt", nat); l.setIcon(ICON_16_USER_PNG_CACHEABLE); + l.setDescription("Empty alt text"); addTestComponent(l); l = createButton("Icon Button with alt", nat); @@ -31,6 +32,10 @@ public class ButtonsWaiAria extends ComponentTestCase<Button> { l = createButton("Tooltip Button", nat); l.setDescription("Tooltip"); addTestComponent(l); + + l = createButton("Another tooltip", nat); + l.setDescription("Another"); + addTestComponent(l); } private Button createButton(String text, boolean nativeButton) { diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html b/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html index fd51a0daad..6add1deba5 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html @@ -313,7 +313,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,9</td> </tr> <!--Edit previously created events and change properties--> @@ -438,7 +438,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,8</td> </tr> <tr> @@ -558,7 +558,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>7,8</td> </tr> <tr> @@ -583,7 +583,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>12,10</td> </tr> <!--Go to monthly view and assert inserted events--> diff --git a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java new file mode 100644 index 0000000000..a3e19513b0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.customfield; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Component; +import com.vaadin.ui.CustomField; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class CustomFieldSize extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + VerticalLayout layout = new VerticalLayout(); + setContent(layout); + layout.setWidth("50px"); + + layout.addComponent(new TextField()); + + layout.addComponent(new CustomField<String>() { + + @Override + protected Component initContent() { + return new TextField(); + } + + @Override + public Class<? extends String> getType() { + return String.class; + } + + }); + } + + @Override + protected String getTestDescription() { + return "Any part of a TextField wrapped in a CustomField should not be cut off even when the dimensions of the TextField exceed those of the CustomField"; + } + + @Override + protected Integer getTicketNumber() { + return 12482; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java new file mode 100644 index 0000000000..c47ec0b792 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java @@ -0,0 +1,36 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.customfield; + +import java.io.IOException; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class CustomFieldSizeTest extends MultiBrowserTest { + + @Test + public void checkScreenshot() throws IOException { + openTestURL(); + compareScreen("size"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html index 03ec163e40..3c91c8b24f 100644 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html @@ -18,7 +18,7 @@ </tr> <tr> <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper3</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper3/VLabel[0]</td> <td>0,0</td> </tr> <tr> @@ -26,9 +26,10 @@ <td></td> <td>tooltip-initial</td> </tr> +<!--Drag Block 4 between Block 1 and Block 2--> <tr> <td>drag</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper4</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper4/VLabel[0]</td> <td>30,41</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html b/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html index 2dcd1b5071..ae81cfe61c 100644 --- a/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html +++ b/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html @@ -23,7 +23,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>41, 22</td> </tr> <tr> @@ -33,7 +33,7 @@ </tr> <tr> <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td></td> </tr> <tr> @@ -43,7 +43,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>0, 0</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/form/FormTooltips.html b/uitest/src/com/vaadin/tests/components/form/FormTooltips.html index ee693fd4be..5e412c3aad 100644 --- a/uitest/src/com/vaadin/tests/components/form/FormTooltips.html +++ b/uitest/src/com/vaadin/tests/components/form/FormTooltips.html @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:8070" /> +<link rel="selenium.base" href="http://localhost:8888" /> <title>FormTooltips</title> </head> <body> @@ -38,10 +38,15 @@ <td></td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>-1000</td> +</tr> <!--first name caption tooltip--> <tr> <td>showTooltip</td> @@ -64,10 +69,15 @@ <td></td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>-1000</td> +</tr> <!--Form should not have a description tooltip--> <tr> <td>showTooltip</td> @@ -80,9 +90,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]</td> - <td></td> + <td>-1000</td> </tr> <!--Form error message should not have a tooltip--> <tr> @@ -96,9 +106,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]</td> - <td></td> + <td>-1000</td> </tr> <!--last name should have no tooltip--> <tr> @@ -112,9 +122,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> + <td>-1000</td> </tr> <!--last name caption should have no tooltip--> <tr> @@ -128,9 +138,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> + <td>-1000</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java new file mode 100644 index 0000000000..fdeed316ba --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java @@ -0,0 +1,124 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.nativebutton; + +import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.NativeButton; + +public class NativeButtonIconAndText extends AbstractTestUI implements + ClickListener { + + static final String UPDATED_ALTERNATE_TEXT = "Now has alternate text"; + static final String INITIAL_ALTERNATE_TEXT = "Initial alternate text"; + static final String BUTTON_TEXT = "buttonText"; + static final String BUTTON_TEXT_ICON = "buttonTextIcon"; + static final String BUTTON_TEXT_ICON_ALT = "buttonTextIconAlt"; + static final String NATIVE_BUTTON_TEXT = "nativeButtonText"; + static final String NATIVE_BUTTON_TEXT_ICON = "nativeButtonTextIcon"; + static final String NATIVE_BUTTON_TEXT_ICON_ALT = "nativeButtonTextIconAlt"; + + @Override + protected void setup(VaadinRequest request) { + Button buttonText = new Button("Only text"); + + Button buttonTextIcon = new Button("Text icon"); + buttonTextIcon.setIcon(new ThemeResource("../runo/icons/64/ok.png")); + + Button buttonTextIconAlt = new Button("Text icon alt"); + buttonTextIconAlt.setIcon(new ThemeResource( + "../runo/icons/64/cancel.png")); + buttonTextIconAlt.setIconAlternateText(INITIAL_ALTERNATE_TEXT); + + buttonText.addClickListener(this); + buttonTextIcon.addClickListener(this); + buttonTextIconAlt.addClickListener(this); + + buttonText.setId(BUTTON_TEXT); + buttonTextIcon.setId(BUTTON_TEXT_ICON); + buttonTextIconAlt.setId(BUTTON_TEXT_ICON_ALT); + + addComponent(buttonText); + addComponent(buttonTextIcon); + addComponent(buttonTextIconAlt); + + NativeButton nativeButtonText = new NativeButton("Only text"); + + NativeButton nativeButtonTextIcon = new NativeButton("Text icon"); + nativeButtonTextIcon.setIcon(new ThemeResource( + "../runo/icons/64/ok.png")); + + NativeButton nativeButtonTextIconAlt = new NativeButton("Text icon alt"); + nativeButtonTextIconAlt.setIcon(new ThemeResource( + "../runo/icons/64/cancel.png")); + nativeButtonTextIconAlt.setIconAlternateText(INITIAL_ALTERNATE_TEXT); + + nativeButtonText.addClickListener(this); + nativeButtonTextIcon.addClickListener(this); + nativeButtonTextIconAlt.addClickListener(this); + + nativeButtonText.setId(NATIVE_BUTTON_TEXT); + nativeButtonTextIcon.setId(NATIVE_BUTTON_TEXT_ICON); + nativeButtonTextIconAlt.setId(NATIVE_BUTTON_TEXT_ICON_ALT); + + addComponent(nativeButtonText); + addComponent(nativeButtonTextIcon); + addComponent(nativeButtonTextIconAlt); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Click the buttons to toggle icon alternate text"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 12780; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.Button. + * ClickEvent) + */ + @Override + public void buttonClick(ClickEvent event) { + Button b = event.getButton(); + String was = b.getIconAlternateText(); + if (was == null || was.isEmpty()) { + b.setIconAlternateText(UPDATED_ALTERNATE_TEXT); + } else { + b.setIconAlternateText(null); + } + + } + +} diff --git a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java new file mode 100644 index 0000000000..2cb294de77 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java @@ -0,0 +1,94 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.nativebutton; + +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.BUTTON_TEXT; +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.BUTTON_TEXT_ICON; +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.BUTTON_TEXT_ICON_ALT; +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.INITIAL_ALTERNATE_TEXT; +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.NATIVE_BUTTON_TEXT; +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.NATIVE_BUTTON_TEXT_ICON; +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.NATIVE_BUTTON_TEXT_ICON_ALT; +import static com.vaadin.tests.components.nativebutton.NativeButtonIconAndText.UPDATED_ALTERNATE_TEXT; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class NativeButtonIconAndTextTest extends MultiBrowserTest { + + @Test + public void testNativeButtonIconAltText() { + openTestURL(); + assertAltText(BUTTON_TEXT, ""); + assertAltText(BUTTON_TEXT_ICON, ""); + assertAltText(BUTTON_TEXT_ICON_ALT, INITIAL_ALTERNATE_TEXT); + assertAltText(NATIVE_BUTTON_TEXT, ""); + assertAltText(NATIVE_BUTTON_TEXT_ICON, ""); + assertAltText(NATIVE_BUTTON_TEXT_ICON_ALT, INITIAL_ALTERNATE_TEXT); + + clickElements(BUTTON_TEXT, BUTTON_TEXT_ICON, BUTTON_TEXT_ICON_ALT, + NATIVE_BUTTON_TEXT, NATIVE_BUTTON_TEXT_ICON, + NATIVE_BUTTON_TEXT_ICON_ALT); + + // Button without icon - should not get alt text + assertAltText(BUTTON_TEXT, ""); + assertAltText(BUTTON_TEXT_ICON, UPDATED_ALTERNATE_TEXT); + assertAltText(BUTTON_TEXT_ICON_ALT, ""); + // Button without icon - should not get alt text + assertAltText(NATIVE_BUTTON_TEXT, ""); + assertAltText(NATIVE_BUTTON_TEXT_ICON, UPDATED_ALTERNATE_TEXT); + assertAltText(NATIVE_BUTTON_TEXT_ICON_ALT, ""); + + } + + private void clickElements(String... ids) { + for (String id : ids) { + vaadinElementById(id).click(); + } + } + + /** + * If the button identified by 'buttonId' has an icon, asserts that the + * alternate text of the icon matches 'expected'. "" and null are considered + * equivalent. + * + * @param buttonId + * the id of the button who possibly contains an icon + * @param expected + * the expected alternate text, cannot be null + */ + private void assertAltText(String buttonId, String expected) { + WebElement button = vaadinElementById(buttonId); + List<WebElement> imgList = button.findElements(By.xpath(".//img")); + if (imgList.isEmpty()) { + return; + } + WebElement img = imgList.get(0); + String alt = img.getAttribute("alt"); + if (alt == null) { + alt = ""; + } + + Assert.assertEquals(expected, alt); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html b/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html index 1ab75e1176..c9d9e186bc 100644 --- a/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html +++ b/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html @@ -28,12 +28,12 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>Hello world</td> </tr> <tr> <td>keyDown</td> - <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>\27</td> </tr> <!-- Fade delay is 400 ms by default - VNotification --> diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.html b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.html new file mode 100644 index 0000000000..fb00953e48 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.html @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>NotificationsWaiAria</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">NotificationsWaiAria</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.NotificationsWaiAria?restartApplication</td> + <td></td> +</tr> +<tr> + <td>enterCharacter</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTextField[0]</td> + <td>Prefix:</td> +</tr> +<tr> + <td>enterCharacter</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VTextField[0]</td> + <td>- press ESC to close</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VNativeSelect[0]/domChild[0]</td> + <td>label=ALERT</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]@role</td> + <td>alert</td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-Notification humanized v-Notification-humanized']//span[@class='v-assistive-device-only'][1]</td> + <td>Prefix:</td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-Notification humanized v-Notification-humanized']//span[@class='v-assistive-device-only'][2]</td> + <td>- press ESC to close</td> +</tr> +<tr> + <td>closeNotification</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VNativeSelect[0]/domChild[0]</td> + <td>label=STATUS</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>xpath=/html/body/div[2]/div@role</td> + <td>status</td> +</tr> +<tr> + <td>closeNotification</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]</td> + <td>0,0</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTextField[0]</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VTextField[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java new file mode 100644 index 0000000000..27af49a397 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java @@ -0,0 +1,116 @@ +package com.vaadin.tests.components.notification; + +import com.vaadin.data.Item; +import com.vaadin.server.Page; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.NativeSelect; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; + +public class NotificationsWaiAria extends TestBase { + + private static final String CAPTION = "CAPTION"; + private static final String ROLE = "ROLE"; + + private TextField prefix; + private TextField postfix; + private NativeSelect role; + + private TextArea tf; + private ComboBox type; + + @SuppressWarnings("deprecation") + @Override + protected void setup() { + prefix = new TextField("Prefix", "Info"); + addComponent(prefix); + + postfix = new TextField("Postfix", + " - closes automatically after 10 seconds"); + addComponent(postfix); + + role = new NativeSelect("Role"); + role.addItem(Role.ALERT); + role.addItem(Role.STATUS); + role.setValue(role.getItemIds().iterator().next()); + addComponent(role); + + tf = new TextArea("Text", "Hello world"); + tf.setRows(10); + addComponent(tf); + type = new ComboBox(); + type.setNullSelectionAllowed(false); + type.addContainerProperty(CAPTION, String.class, ""); + + type.setItemCaptionPropertyId(CAPTION); + + Item item = type.addItem(Notification.TYPE_HUMANIZED_MESSAGE); + item.getItemProperty(CAPTION).setValue("Humanized"); + + item = type.addItem(Notification.TYPE_ERROR_MESSAGE); + item.getItemProperty(CAPTION).setValue("Error"); + + item = type.addItem(Notification.TYPE_WARNING_MESSAGE); + item.getItemProperty(CAPTION).setValue("Warning"); + + item = type.addItem(Notification.TYPE_TRAY_NOTIFICATION); + item.getItemProperty(CAPTION).setValue("Tray"); + + item = type.addItem(Notification.Type.ASSISTIVE_NOTIFICATION); + item.getItemProperty(CAPTION).setValue("Assistive"); + + type.setValue(type.getItemIds().iterator().next()); + addComponent(type); + + Button showNotification = new Button("Show notification", + new SettingHandler()); + addComponent(showNotification); + + Button showDefaultNotification = new Button("Default notification", + new DefaultHandler()); + addComponent(showDefaultNotification); + } + + @Override + protected String getDescription() { + return "Generic test case for notifications"; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + + private class SettingHandler implements ClickListener { + @Override + public void buttonClick(ClickEvent event) { + Type typeValue = (Type) type.getValue(); + + Notification n = new Notification(tf.getValue(), typeValue); + n.setHtmlContentAllowed(true); + n.setAssistivePrefixForType(typeValue, prefix.getValue()); + n.setAssistivePostfixForType(typeValue, postfix.getValue()); + n.setAssistiveRoleForType(typeValue, (Role) role.getValue()); + + n.show(Page.getCurrent()); + } + } + + private class DefaultHandler implements ClickListener { + @Override + public void buttonClick(ClickEvent event) { + Notification n = new Notification(tf.getValue(), + (Type) type.getValue()); + n.setHtmlContentAllowed(true); + n.show(Page.getCurrent()); + } + } +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java new file mode 100644 index 0000000000..e9b022eac2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.orderedlayout; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.VerticalLayout; + +/** + * Test hovering over nested layout caption + * + * @author Vaadin Ltd + */ +public class NestedLayoutCaptionHover extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + VerticalLayout test = new VerticalLayout(); + test.setCaption("inner layout"); + addComponent(new VerticalLayout(new VerticalLayout(new VerticalLayout( + test)))); + } + + @Override + protected String getTestDescription() { + return "Hovering over nested layout caption should not freeze the browser"; + } + + @Override + protected Integer getTicketNumber() { + return 12469; + } +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java new file mode 100644 index 0000000000..95a2c9f493 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.orderedlayout; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.HasInputDevices; +import org.openqa.selenium.interactions.internal.Coordinates; +import org.openqa.selenium.internal.Locatable; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests hovering over caption in nested layout + */ +public class NestedLayoutCaptionHoverTest extends MultiBrowserTest { + + @Test + public void testTooltipInNestedLayout() throws Exception { + openTestURL(); + + WebElement caption = getDriver().findElement( + By.className("v-captiontext")); + + assertEquals("inner layout", caption.getText()); + + // Hover over the caption + Coordinates coords = ((Locatable) caption).getCoordinates(); + ((HasInputDevices) getDriver()).getMouse().mouseMove(coords); + sleep(1000); + + // Verify that there's no error notification + WebElement error = vaadinElement("Root/VNotification[0]"); + assertNull("No error should be found", error); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html b/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html index 4e8296050f..806e7d1b44 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html +++ b/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://arturwin.office.itmill.com:9999/" /> -<title>New Test</title> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>SliderTooltip</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">SliderTooltip</td></tr> </thead><tbody> <tr> <td>open</td> @@ -57,9 +57,14 @@ <td>40,16</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>pause</td> <td></td> + <td>1000</td> +</tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>-1000</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java b/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java index 355cd43d37..4cf2506eeb 100644 --- a/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java +++ b/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java @@ -9,7 +9,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.data.util.converter.Converter; -import com.vaadin.data.util.converter.StringToNumberConverter; +import com.vaadin.data.util.converter.StringToDoubleConverter; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; @@ -276,7 +276,7 @@ public class DoublesInTable extends TestBase { }); - t.setConverter("rent", new StringToNumberConverter() { + t.setConverter("rent", new StringToDoubleConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getCurrencyInstance(locale); diff --git a/uitest/src/com/vaadin/tests/components/table/TableDragColumnFloatingElementStyles.html b/uitest/src/com/vaadin/tests/components/table/TableDragColumnFloatingElementStyles.html new file mode 100644 index 0000000000..e225091b5f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableDragColumnFloatingElementStyles.html @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>TableDragColumn</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">TableDragColumn</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.table.Tables?restartApplication</td> + <td></td> +</tr> +<tr> + <td>drag</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>51,6</td> +</tr> +<tr> + <td>mouseMoveAt</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[3]</td> + <td>70,10</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>1 basic ghost element</td> +</tr> +<tr> + <td>drop</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>10,10</td> +</tr> +<!--Add style name "red-border-1px" to table--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>24,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item1</td> + <td>18,10</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item4</td> + <td>19,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item2</td> + <td>75,7</td> +</tr> +<!-- Drag and drop column 1 to the left of column 4 --> +<tr> + <td>drag</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>51,6</td> +</tr> +<tr> + <td>mouseMoveAt</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[3]</td> + <td>70,10</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>2 themed ghost element should have red borders</td> +</tr> +<tr> + <td>drop</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>10,10</td> +</tr> +<!--Add style name "red-border-1px" to table--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>24,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item1</td> + <td>18,10</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item4</td> + <td>19,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item3</td> + <td>164,10</td> +</tr> +<tr> + <td>drag</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>51,6</td> +</tr> +<tr> + <td>mouseMoveAt</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[3]</td> + <td>70,10</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>3 themed ghost element should have 2px blue borders</td> +</tr> +<tr> + <td>drop</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>10,10</td> +</tr> +</tbody></table> +</body> +</html>
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html index eb3efc28fd..2df9fb678c 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html +++ b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://arturwin.office.itmill.com:8888/" /> -<title>New Test</title> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>TableItemDescriptionGeneratorTest</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">TableItemDescriptionGeneratorTest</td></tr> </thead><tbody> <tr> <td>open</td> @@ -39,10 +39,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -65,10 +70,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -91,10 +101,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Cell and row tooltips--> <tr> <td>mouseClick</td> @@ -123,10 +138,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -149,10 +169,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -175,10 +200,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Row and Component tooltips--> <tr> <td>mouseClick</td> @@ -212,10 +242,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -238,10 +273,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -264,10 +304,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Row tooltips--> <tr> <td>mouseClick</td> @@ -296,10 +341,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -322,10 +372,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -348,10 +403,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> </tbody></table> </body> diff --git a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java new file mode 100644 index 0000000000..6e4b62e4f7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java @@ -0,0 +1,107 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.components.table; + +import com.vaadin.annotations.Push; +import com.vaadin.event.ItemClickEvent; +import com.vaadin.event.ItemClickEvent.ItemClickListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Table; + +@Push +public class TableRemovedQuicklySendsInvalidRpcCalls extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + addComponent(new Button("Blink a table", new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + blinkTable(); + } + })); + } + + private void blinkTable() { + final Table table = new Table(); + table.setPageLength(5); + table.addContainerProperty(new Object(), String.class, null); + + for (int i = 0; i < 50; i++) { + table.addItem(new Object[] { "Row" }, new Object()); + } + + table.addItemClickListener(new ItemClickListener() { + private int i; + + @Override + public void itemClick(ItemClickEvent event) { + /* + * Ignore implementation. This is only an easy way to make the + * client-side update table's variables (by furiously clicking + * on the table row. + * + * This way, we get variable changes queued. The push call will + * then remove the Table, while the variable changes being still + * in the queue, leading to the issue as described in the + * ticket. + */ + System.out.println("clicky " + (++i)); + } + }); + + System.out.println("adding component"); + addComponent(table); + + new Thread() { + @Override + public void run() { + getSession().lock(); + try { + Thread.sleep(500); + access(new Runnable() { + @Override + public void run() { + System.out.println("removing component"); + removeComponent(table); + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + getSession().unlock(); + } + }; + }.start(); + } + + @Override + protected String getTestDescription() { + return "Adding and subsequently quickly removing a table " + + "should not leave any pending RPC calls waiting " + + "in a Timer. Issue can be reproduced by " + + "1) pressing the button 2) clicking furiously " + + "on a row in the table."; + } + + @Override + protected Integer getTicketNumber() { + return 12337; + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html b/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html index bab6c8dc16..e24f4ddca4 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html +++ b/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html @@ -33,7 +33,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>TF Value on the server:fooo</td> </tr> <tr> @@ -63,7 +63,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>TF Value on the server:baar</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html index c2481e6be6..441324bb6a 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html +++ b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html @@ -3,7 +3,6 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:9999/" /> <title>TableWithBrokenGeneratorAndContainer</title> </head> <body> @@ -163,7 +162,7 @@ <!--error notification--> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableWithBrokenGeneratorAndContainer::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableWithBrokenGeneratorAndContainer::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>Problem updating table. Please try again later</td> </tr> <!--table should be empty--> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html index 4b2ad890c3..825988173a 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html @@ -33,6 +33,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 1</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 2</td> </tr> <tr> @@ -58,6 +68,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[3]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 2</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[3]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 5</td> </tr> <tr> @@ -83,6 +103,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[4]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 5</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[4]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 6</td> </tr> <tr> @@ -143,6 +173,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[8]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 9</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[10]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[8]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 12</td> </tr> <tr> @@ -178,6 +218,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 5</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 1</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigationWaiAria.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigationWaiAria.java new file mode 100644 index 0000000000..e394594176 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigationWaiAria.java @@ -0,0 +1,86 @@ +package com.vaadin.tests.components.tabsheet; + +import java.util.ArrayList; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Component; +import com.vaadin.ui.Layout; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TabSheet.Tab; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +public class TabKeyboardNavigationWaiAria extends AbstractTestUI { + + int index = 1; + ArrayList<Component> tabs = new ArrayList<Component>(); + TabSheet ts = new TabSheet(); + + @Override + protected void setup(VaadinRequest request) { + ts.setWidth("500px"); + ts.setHeight("500px"); + + for (int i = 0; i < 5; ++i) { + addTab(); + } + + Button addTab = new Button("Add a tab", new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + addTab(); + } + }); + Button focus = new Button("Focus tabsheet", new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + ts.focus(); + } + }); + + addComponent(addTab); + addComponent(focus); + + addComponent(ts); + } + + @Override + protected String getTestDescription() { + return "The tab bar should be focusable and arrow keys should change focus for tabs. Space key selects a focused tab. The del key should close a tab if closable."; + } + + @Override + protected Integer getTicketNumber() { + return 11827; + } + + private Tab addTab() { + Layout content = new VerticalLayout(); + tabs.add(content); + + TextField field = new TextField("Tab " + index + " label"); + content.addComponent(field); + + Tab tab = ts.addTab(content, "Tab " + index, null); + + if (index == 2) { + tab.setClosable(true); + tab.setDescription("Tab 2 Tooltip"); + } + + if (index == 4) { + tab.setEnabled(false); + } + + if (index == 5) { + tab.setDefaultFocusComponent(field); + } + + index++; + return tab; + } +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java new file mode 100644 index 0000000000..81648c1b52 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.tabsheet; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class TabSheetFocusedTabTest extends MultiBrowserTest { + + @Override + protected Class<?> getUIClass() { + return TabsheetScrolling.class; + } + + @Test + public void clickingChangesFocusedTab() throws Exception { + openTestURL(); + + getTab(1).click(); + + assertTrue(isFocused(getTab(1))); + + new Actions(getDriver()).sendKeys(Keys.RIGHT).perform(); + + assertFalse(isFocused(getTab(1))); + assertTrue(isFocused(getTab(3))); + + getTab(5).click(); + + assertFalse(isFocused(getTab(3))); + assertTrue(isFocused(getTab(5))); + + getTab(1).click(); + + assertFalse(isFocused(getTab(5))); + assertTrue(isFocused(getTab(1))); + } + + private WebElement getTab(int index) { + return getDriver() + .findElement( + By.xpath("(//table[contains(@class, 'v-tabsheet-tabs')])[1]/tbody/tr/td[" + + (index + 1) + "]/div")); + } + + private boolean isFocused(WebElement tab) { + return tab.getAttribute("class").contains("v-tabsheet-tabitem-focus"); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html index 425da11af4..6876497a1f 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html @@ -21,6 +21,16 @@ <td></td> <td></td> </tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetIcons::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]@alt</td> + <td>iconalt1</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetIcons::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]@alt</td> + <td>iconalt3</td> +</tr> </tbody></table> </body> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java index 5d814ec48f..ccdc4ecb38 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java @@ -46,6 +46,8 @@ public class TabSheetIcons extends TestBase { for (Component c : tab) { tabsheet.addTab(c); + tabsheet.getTab(c).setIconAltText( + "iconalt" + tabsheet.getComponentCount()); } return tabsheet; diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java index 6c39cdab73..56836037b7 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java @@ -26,7 +26,7 @@ public class TabSheetTest<T extends TabSheet> extends @Override public void execute(T c, Integer value, Object data) { - c.getTab(value).setIcon((Resource) data); + c.getTab(value).setIcon((Resource) data, "tabicon"); } }; diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.html new file mode 100644 index 0000000000..64e85f55e3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.html @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>TabSheetWithTabIds</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">TabSheetWithTabIds</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.tabsheet.TabSheetWithTabIds</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab1</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab2</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab3</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithTabIds::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>tab1</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>tab2</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>tab3</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithTabIds::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab1</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab2</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab3</td> + <td></td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java new file mode 100644 index 0000000000..ae5adea45e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java @@ -0,0 +1,77 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * + */ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TabSheet.Tab; + +public class TabSheetWithTabIds extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + TabSheet tabSheet = new TabSheet(); + + final Tab tab1 = tabSheet.addTab(new Label("Label 1"), "Tab 1", null); + + final Tab tab2 = tabSheet.addTab(new Label("Label 2"), "Tab 2", null); + + final Tab tab3 = tabSheet.addTab(new Label("Label 3"), "Tab 3", null); + + addComponent(tabSheet); + + Button b = new Button("Set ids", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + tab1.setId("tab1"); + tab2.setId("tab2"); + tab3.setId("tab3"); + } + }); + addComponent(b); + + Button b2 = new Button("Clear ids", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + tab1.setId(null); + tab2.setId(null); + tab3.setId(null); + } + }); + addComponent(b2); + } + + @Override + protected String getTestDescription() { + return "Add support for setId to TabSheet.Tab"; + } + + @Override + protected Integer getTicketNumber() { + return 12064; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java index 1670963b9b..b55f1057b5 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java @@ -33,6 +33,7 @@ public class TabsheetScrollingTest extends MultiBrowserTest { for (int i = 0; i < 10; i++) { sendKey(Keys.ARROW_RIGHT); } + sendKey(Keys.SPACE); Assert.assertEquals("Hide this tab (21)", getHideButtonText()); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html index d133ab9937..38ff6ab8ca 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html @@ -13,7 +13,7 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.tabsheet.TabsheetTooltip</td> + <td>/run/com.vaadin.tests.components.tabsheet.TabsheetTooltip?restartApplication</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java new file mode 100644 index 0000000000..26716846fc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java @@ -0,0 +1,147 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.textfield; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.TextField; + +/** + * Test to verify fields become implicitly "immediate" when adding value change + * listener to them. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class AutomaticImmediate extends AbstractTestUIWithLog { + + /** + * + */ + static final String BUTTON = "button"; + /** + * + */ + static final String EXPLICIT_FALSE = "explicit-false"; + /** + * + */ + static final String FIELD = "field"; + /** + * + */ + static final String LISTENER_TOGGLE = "listener-toggle"; + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + + final TextField textField = new TextField() { + + /* + * (non-Javadoc) + * + * @see com.vaadin.ui.AbstractField#fireValueChange(boolean) + */ + @Override + protected void fireValueChange(boolean repaintIsNotNeeded) { + log("fireValueChange"); + super.fireValueChange(repaintIsNotNeeded); + } + }; + textField.setId(FIELD); + + final ValueChangeListener listener = new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + log("Value changed: " + event.getProperty().getValue()); + } + }; + + final CheckBox checkBox = new CheckBox("Toggle listener"); + checkBox.addValueChangeListener(new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + if (checkBox.getValue()) { + textField.addValueChangeListener(listener); + } else { + textField.removeValueChangeListener(listener); + } + } + }); + checkBox.setId(LISTENER_TOGGLE); + + Button b = new Button( + "setImmediate(false), sets explicitly false and causes server roundtrip", + new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + textField.setImmediate(false); + } + }); + b.setId(EXPLICIT_FALSE); + + Button b2 = new Button("Hit server, causes server roundtrip", + new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + } + }); + b2.setId(BUTTON); + + addComponent(textField); + addComponent(checkBox); + addComponent(b); + addComponent(b2); + + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Field should be immediate automatically if it has value change listener"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 8029; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java new file mode 100644 index 0000000000..4b522a1f37 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java @@ -0,0 +1,109 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.textfield; + +import org.apache.commons.lang.RandomStringUtils; +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class AutomaticImmediateTest extends MultiBrowserTest { + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.tb3.AbstractTB3Test#getUIClass() + */ + @Override + protected Class<?> getUIClass() { + return AutomaticImmediate.class; + } + + @Test + public void test() { + openTestURL(); + + WebElement field = getDriver().findElement( + By.id(AutomaticImmediate.FIELD)); + + WebElement toggle = getDriver().findElement( + By.xpath("//input[@type = 'checkbox']")); + + WebElement explicitFalseButton = getDriver().findElement( + By.id(AutomaticImmediate.EXPLICIT_FALSE)); + + WebElement hitServerButton = getDriver().findElement( + By.id(AutomaticImmediate.BUTTON)); + + String string = getRandomString(); + field.sendKeys(string + Keys.ENTER); + + // Non immediate, just the initial server side valuechange + assertLastLog("1. fireValueChange"); + + hitServerButton.click(); + + // No value change, but value sent to server + assertLastLog("2. fireValueChange"); + + // listener on -> immediate on + toggle.click(); + + string = getRandomString(); + String delSequence = "" + Keys.BACK_SPACE + Keys.BACK_SPACE; + field.sendKeys(delSequence + string + Keys.ENTER); + assertLastLog("4. Value changed: " + string); + + // listener off -> immediate off + String lastvalue = string; + toggle.click(); + string = getRandomString(); + field.sendKeys(delSequence + string + Keys.ENTER); + // No new value change should happen... + assertLastLog("4. Value changed: " + lastvalue); + hitServerButton.click(); + // ... but server should receive value with roundtrip + assertLastLog("5. fireValueChange"); + + // explicitly non immediate, but with listener + explicitFalseButton.click(); + toggle.click(); + + string = getRandomString(); + field.sendKeys(delSequence + string + Keys.ENTER); + // non immediate, no change... + assertLastLog("5. fireValueChange"); + // ... until server round trip + hitServerButton.click(); + assertLastLog("7. Value changed: " + string); + + } + + private String getRandomString() { + String string = RandomStringUtils.randomAlphanumeric(2); + return string; + } + + private void assertLastLog(String string) { + String text = getDriver().findElement(By.id("Log_row_0")).getText(); + Assert.assertEquals(string, text); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.html b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.html new file mode 100644 index 0000000000..2428e8b4bb --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.html @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.textfield.BigDecimalTextField?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertValue</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>15,2</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>1. Commit ok. Property value: 15.2</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>70,12</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>130</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::</td> + <td>160,327</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>2. Commit ok. Property value: 130</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>75,16</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>130abc</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::</td> + <td>96,280</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>3. Commit failed: Commit failed</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> + <td>v-errorindicator</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>71,12</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>130,130</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::</td> + <td>118,280</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<!--The converter automatically removes trailing zeros--> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>4. Commit ok. Property value: 130.13</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java new file mode 100644 index 0000000000..18d8679c2f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java @@ -0,0 +1,123 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.textfield; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Locale; + +import com.vaadin.data.fieldgroup.FieldGroup; +import com.vaadin.data.util.BeanItem; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +/** + * @since 7.2 + * @author Vaadin Ltd + */ +public class BigDecimalTextField extends AbstractTestUIWithLog { + + @Override + protected void setup(VaadinRequest request) { + final VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + setLocale(new Locale("fi", "FI")); + + BeanBigDecimal beanBigDecimal = new BeanBigDecimal(); + BeanItem<BeanBigDecimal> beanItem = new BeanItem<BeanBigDecimal>( + beanBigDecimal); + + FormLayout formLayout = new FormLayout(); + TextField textField = new TextField("BigDecimal field"); + textField.setImmediate(true); + textField.setValue("12"); + formLayout.addComponent(textField); + + final FieldGroup fieldGroup = new FieldGroup(beanItem); + fieldGroup.bind(textField, "decimal"); + + Button setValue = new Button("Set value to 15,2", new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + ((TextField) fieldGroup.getField("decimal")).setValue("15,2"); + } + }); + + Button button = new Button("Commit"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + try { + fieldGroup.commit(); + log("Commit ok. Property value: " + + fieldGroup.getItemDataSource() + .getItemProperty("decimal").getValue()); + } catch (FieldGroup.CommitException e) { + log("Commit failed: " + e.getMessage()); + } + } + }); + + layout.addComponent(formLayout); + layout.addComponent(setValue); + layout.addComponent(button); + + setContent(layout); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Tests that BigDecimals work correctly with TextFields"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 9997; + } + + public static class BeanBigDecimal implements Serializable { + BigDecimal decimal; + + public BeanBigDecimal() { + + } + + public BigDecimal getDecimal() { + return decimal; + } + + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + } + +} diff --git a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java index 2fd3f05dbb..06b8af1ec6 100644 --- a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java +++ b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java @@ -8,6 +8,8 @@ import com.vaadin.event.Action; import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractSelect; +import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator; +import com.vaadin.ui.Component; import com.vaadin.ui.Tree; public class SimpleTree extends TestBase implements Action.Handler { @@ -53,6 +55,17 @@ public class SimpleTree extends TestBase implements Action.Handler { tree.setItemIcon(9, notCachedFolderIconLargeOther, "First Choice"); tree.setItemIcon(11, notCachedFolderIconLarge); + tree.setItemDescriptionGenerator(new ItemDescriptionGenerator() { + @Override + public String generateDescription(Component source, Object itemId, + Object propertyId) { + if ((Integer) itemId == 3) { + return "tree item tooltip"; + } + return ""; + } + }); + // Expand whole tree for (Object id : tree.rootItemIds()) { tree.expandItemsRecursively(id); diff --git a/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.html b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.html new file mode 100644 index 0000000000..ac39d1f03c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.html @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>PollListenerTest</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">PollListenerTest</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.ui.PollListenerTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>pause</td> + <td>5000</td> + <td></td> +</tr> +<tr> + <td>verifyTextPresent</td> + <td>PollEvent received</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java new file mode 100644 index 0000000000..0e5ddaab87 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.components.ui; + +import com.vaadin.event.UIEvents.PollEvent; +import com.vaadin.event.UIEvents.PollListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; + +public class PollListenerTest extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Label statusLabel = new Label("Default Label"); + addComponent(statusLabel); + + setPollInterval(2000); + addPollListener(new PollListener() { + @Override + public void poll(PollEvent event) { + setPollInterval(-1); + statusLabel.setValue(event.getClass().getSimpleName() + + " received"); + removePollListener(this); + } + }); + } + + @Override + protected String getTestDescription() { + return "Polling should fire a PollEvent on the server-side"; + } + + @Override + protected Integer getTicketNumber() { + return 12466; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html b/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html index e41cf5e176..338e4a2c5b 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html +++ b/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html @@ -4,12 +4,12 @@ <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="selenium.base" href="http://localhost:8888/" /> -<title>New Test</title> +<title>TooltipConfiguration</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">TooltipConfiguration</td></tr> </thead><tbody> <tr> <td>open</td> @@ -43,9 +43,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsuiTooltipConfiguration::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> + <td>-1000</td> </tr> <!--Long close delay--> <tr> @@ -140,6 +140,7 @@ <td>vaadin=runcomvaadintestscomponentsuiTooltipConfiguration::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> <td>100</td> </tr> + </tbody></table> </body> </html> diff --git a/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html index b5326e4660..acbe30c5d2 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html +++ b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html @@ -43,7 +43,7 @@ </tr> <tr> <td>assertText</td> - <td>//div[@id='runcomvaadintestscomponentsuitestUIScrollTest-1797389287-overlays']/div</td> + <td>//div[@id='runcomvaadintestscomponentsuitestUIScrollTest-1797389287-overlays']//h1</td> <td>Scrolled to 1020 px</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html index 614ae7bcda..cdbcf8bacc 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html index 7d9ffc65b8..d5d70a62d2 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html index d0ee96c7ef..783784e993 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html index a330f5bf61..175def94d3 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html index 61ba58a0e6..0db6614a9c 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html b/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html index ac81dfdefb..ae77628bff 100644 --- a/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html +++ b/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html @@ -40,7 +40,7 @@ <!--Click close in title bar--> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html new file mode 100644 index 0000000000..f5f89d13ef --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>ExtraWindowShownWaiAria</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">ExtraWindowShownWaiAria</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.window.ExtraWindowShownWaiAria?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@role</td> + <td>dialog</td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]@id</td> + <td>headerid</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-labelledby</td> + <td>${headerid}</td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[0]@id</td> + <td>descriptionid</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-describedby</td> + <td>${descriptionid}</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]@role</td> + <td>button</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]@role</td> + <td>button</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VCheckBox[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[0]@id</td> + <td>descriptionid</td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[1]@id</td> + <td>description2id</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-describedby</td> + <td>${descriptionid} ${description2id}</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[6]/VTextField[0]</td> + <td>Important</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[7]/VTextField[0]</td> + <td> - do ASAP</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-window-header']/span[@class='v-assistive-device-only'][1]</td> + <td>Important</td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-window-header']/span[@class='v-assistive-device-only'][2]</td> + <td>- do ASAP</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java new file mode 100644 index 0000000000..39989926e7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java @@ -0,0 +1,172 @@ +package com.vaadin.tests.components.window; + +import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.window.WindowState.WindowRole; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.TextField; +import com.vaadin.ui.Window; + +public class ExtraWindowShownWaiAria extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final CheckBox modal = new CheckBox("Modal dialog"); + modal.setTabIndex(7); + final CheckBox additionalDescription = new CheckBox( + "Additional Description"); + final CheckBox tabStop = new CheckBox( + "Prevent leaving window with Tab key"); + final CheckBox tabOrder = new CheckBox("Change Taborder"); + final TextField prefix = new TextField("Prefix: "); + final TextField postfix = new TextField("Postfix: "); + + final TextField topTabStopMessage = new TextField( + "Top Tab Stop Message"); + final TextField bottomTabStopMessage = new TextField( + "Bottom Tab Stop Message"); + + Button simple = new Button("Open Alert Dialog", + new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + CssLayout layout = new CssLayout(); + + final Window w = new Window("Sub window", layout); + w.center(); + w.setModal(modal.getValue()); + w.setAssistiveRole(WindowRole.ALERTDIALOG); + w.setAssistivePrefix(prefix.getValue()); + w.setAssistivePostfix(postfix.getValue()); + + Label description1 = new Label("Simple alert dialog."); + layout.addComponent(description1); + + if (!additionalDescription.getValue()) { + w.setAssistiveDescription(description1); + } else { + Label description2 = new Label( + "Please select what to do!"); + layout.addComponent(description2); + + w.setAssistiveDescription(description1, + description2); + } + + w.setTabStopEnabled(tabStop.getValue()); + w.setTabStopTopAssistiveText(topTabStopMessage + .getValue()); + w.setTabStopBottomAssistiveText(bottomTabStopMessage + .getValue()); + + Button close = new Button("Close", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + w.close(); + } + }); + layout.addComponent(close); + Button iconButton = new Button("A button with icon"); + iconButton.setIcon(new ThemeResource( + "../runo/icons/16/ok.png")); + layout.addComponent(iconButton); + + event.getButton().getUI().addWindow(w); + iconButton.focus(); + + if (tabOrder.getValue()) { + close.setTabIndex(5); + } + } + + }); + getLayout().addComponent(simple); + + Button complex = new Button("Open Entry Dialog", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + FormLayout form = new FormLayout(); + + final Window w = new Window("Form Window", form); + w.center(); + w.setModal(modal.getValue()); + w.setAssistivePrefix(prefix.getValue()); + w.setAssistivePostfix(postfix.getValue()); + + Label description1 = new Label( + "Please fill in your data"); + form.addComponent(description1); + + if (!additionalDescription.getValue()) { + w.setAssistiveDescription(description1); + } else { + Label description2 = new Label( + "and press the button save."); + form.addComponent(description2); + + w.setAssistiveDescription(description1, + description2); + } + + w.setTabStopEnabled(tabStop.getValue()); + w.setTabStopTopAssistiveText(topTabStopMessage + .getValue()); + w.setTabStopBottomAssistiveText(bottomTabStopMessage + .getValue()); + + TextField name = new TextField("Name:"); + form.addComponent(name); + + form.addComponent(new TextField("Address")); + + Button saveButton = new Button("Save", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + w.close(); + } + }); + form.addComponent(saveButton); + + event.getButton().getUI().addWindow(w); + name.focus(); + + if (tabOrder.getValue()) { + name.setTabIndex(5); + } + } + }); + getLayout().addComponent(complex); + + getLayout().addComponent(modal); + getLayout().addComponent(additionalDescription); + getLayout().addComponent(tabStop); + getLayout().addComponent(tabOrder); + + getLayout().addComponent(prefix); + getLayout().addComponent(postfix); + + getLayout().addComponent(topTabStopMessage); + getLayout().addComponent(bottomTabStopMessage); + + } + + @Override + protected String getTestDescription() { + return "Test for WAI-ARIA implementation"; + } + + @Override + protected Integer getTicketNumber() { + return 11821; + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html b/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html index 8374a90b52..6fd99caa19 100644 --- a/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html +++ b/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html @@ -90,7 +90,7 @@ <!--Close window 4, which is the topmost window--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,15</td> </tr> <tr> @@ -101,7 +101,7 @@ <!--Close Dialog 3 (topmost)--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[3]</td> <td>6,8</td> </tr> <!--Make Dialog 5 (topmost) non-modal--> @@ -139,7 +139,7 @@ <!--Close dialog 5--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,5</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html deleted file mode 100644 index 63e371e379..0000000000 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>TooltipInWindow</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">TooltipInWindow</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.window.TooltipInWindow?restartApplication</td> - <td></td> -</tr> -<!--Show tooltip in Root--> -<tr> - <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VVerticalLayout[0]/VVerticalLayout[0]/VTextField[0]</td> - <td>5,5</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>My tooltip</td> -</tr> -<!--Hide the tooltip--> -<tr> - <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VVerticalLayout[0]</td> - <td>0,0</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]</td> - <td></td> -</tr> -<!--Show tooltip in Window--> -<tr> - <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VTextField[0]</td> - <td>5,5</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td>My tooltip</td> -</tr> -<!-- Hide tooltip in Window --> -<tr> - <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]</td> - <td>0,0</td> -</tr> -<tr> - <td>pause</td> - <td>1000</td> - <td></td> -</tr> -<tr> - <td>assertElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java index d3c7a616cd..02ec0c047b 100644 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java @@ -31,15 +31,16 @@ public class TooltipInWindow extends AbstractTestUI { Window window = new Window("Window", layout); layout.setSizeUndefined(); window.center(); - layout.addComponent(createTextField()); + layout.addComponent(createTextField("tf1")); addWindow(window); - addComponent(createTextField()); + addComponent(createTextField("tf2")); } - private TextField createTextField() { + private TextField createTextField(String id) { TextField tf = new TextField("TextField with a tooltip"); tf.setDescription("My tooltip"); + tf.setId(id); return tf; } diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java b/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java new file mode 100644 index 0000000000..0e11041e3b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java @@ -0,0 +1,98 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.window; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.HasInputDevices; +import org.openqa.selenium.interactions.Mouse; +import org.openqa.selenium.interactions.internal.Coordinates; +import org.openqa.selenium.internal.Locatable; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class TooltipInWindowTest extends MultiBrowserTest { + + @Test + public void testTooltipsInSubWindow() throws Exception { + openTestURL(); + + WebElement textfield = vaadinElementById("tf1"); + Coordinates textfieldCoordinates = ((Locatable) textfield) + .getCoordinates(); + + Mouse mouse = ((HasInputDevices) getDriver()).getMouse(); + + // Show tooltip + mouse.mouseMove(textfieldCoordinates, 10, 10); + sleep(1000); + + ensureVisibleTooltipPositionedCorrectly(); + assertEquals("My tooltip", getTooltipElement().getText()); + + // Hide tooltip + mouse.mouseMove(textfieldCoordinates, -100, -100); + sleep(1000); + + ensureHiddenTooltipPositionedCorrectly(); + assertEquals("", getTooltipElement().getText()); + + // Show tooltip again + mouse.mouseMove(textfieldCoordinates, 10, 10); + sleep(1000); + + ensureVisibleTooltipPositionedCorrectly(); + assertEquals("My tooltip", getTooltipElement().getText()); + + // Hide tooltip + mouse.mouseMove(textfieldCoordinates, -100, -100); + sleep(1000); + + ensureHiddenTooltipPositionedCorrectly(); + assertEquals("", getTooltipElement().getText()); + } + + private WebElement getTooltipElement() { + return getDriver().findElement(By.className("v-tooltip-text")); + } + + private WebElement getTooltipContainerElement() { + return getDriver().findElement(By.className("v-tooltip")); + } + + private void ensureVisibleTooltipPositionedCorrectly() { + WebElement textfield = vaadinElementById("tf1"); + int tooltipX = getTooltipContainerElement().getLocation().getX(); + int textfieldX = textfield.getLocation().getX(); + assertGreaterOrEqual("Tooltip should be positioned on the textfield (" + + tooltipX + " < " + textfieldX + ")", tooltipX, textfieldX); + } + + private void ensureHiddenTooltipPositionedCorrectly() { + int tooltipX = getTooltipContainerElement().getLocation().getX(); + assertLessThanOrEqual( + "Tooltip should be positioned outside of viewport (was at " + + tooltipX + ")", tooltipX, -1000); + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html b/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html index a9a6fd621e..85ab67e4f6 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html +++ b/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html @@ -3,7 +3,6 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://arturwin.office.itmill.com:8888/" /> <title>New Test</title> </head> <body> @@ -18,7 +17,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>Short</td> </tr> <tr> @@ -43,7 +42,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>This is a semi-long text that might wrap.</td> </tr> <tr> @@ -68,7 +67,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> diff --git a/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html b/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html index dcdfa05687..a27963a066 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html +++ b/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html @@ -3,7 +3,6 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:8888/run/" /> <title>WindowMaximizeRestoreTest</title> </head> <body> @@ -19,59 +18,59 @@ <!--Test maximize-restore button--> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>Window 1</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>7,8</td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-restorebox</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>9,7</td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <!--test double click on header--> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-restorebox</td> </tr> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <!--Resizable = false should hide max-restore button--> <tr> <td>assertVisible</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td></td> </tr> <tr> @@ -81,7 +80,7 @@ </tr> <tr> <td>assertNotVisible</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td></td> </tr> <!--Test server side max-restore--> @@ -92,7 +91,7 @@ </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-restorebox</td> </tr> <tr> @@ -102,28 +101,28 @@ </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <!--test double click on header doesn't work--> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <tr> @@ -149,7 +148,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>10,8</td> </tr> <tr> @@ -175,7 +174,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[2]</td> <td>6,11</td> </tr> <tr> @@ -185,7 +184,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[3]</td> <td>7,5</td> </tr> <tr> @@ -210,12 +209,12 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[2]</td> <td>6,11</td> </tr> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>113,10</td> </tr> <tr> @@ -226,27 +225,27 @@ <!--Test that size and position is preserved when maximizing and restoring--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>8,4</td> </tr> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>-200,-200</td> </tr> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[4]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[5]/domChild[0]</td> <td>+100,+100</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>6,5</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>5,8</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html index fa63e5e1e6..3ea1f8f732 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html +++ b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html @@ -18,7 +18,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>6,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java b/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java index 4f83f5d0fd..2c202af02b 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java +++ b/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java @@ -7,7 +7,6 @@ import com.vaadin.data.util.BeanItem; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; -import com.vaadin.tests.data.bean.Person; import com.vaadin.tests.data.bean.PersonWithBeanValidationAnnotations; import com.vaadin.tests.data.bean.Sex; import com.vaadin.tests.util.Log; @@ -90,8 +89,10 @@ public class FieldBinderWithBeanValidation extends TestBase { p)); } - public static Person getPerson(FieldGroup binder) { - return ((BeanItem<Person>) binder.getItemDataSource()).getBean(); + public static PersonWithBeanValidationAnnotations getPerson( + FieldGroup binder) { + return ((BeanItem<PersonWithBeanValidationAnnotations>) binder + .getItemDataSource()).getBean(); } @Override diff --git a/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html b/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html index b7c40b4d9e..7c6f9ceb39 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html +++ b/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html @@ -1,17 +1,17 @@ - <?xml version="1.0" encoding="UTF-8"?> - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head profile="http://selenium-ide.openqa.org/profiles/test-case"> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <link rel="selenium.base" href="" /> - <title>New Test</title> - </head> - <body> - <table cellpadding="1" cellspacing="1" border="1"> - <thead> - <tr><td rowspan="1" colspan="3">New Test</td></tr> - </thead><tbody> - <tr> +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:88888/" /> +<title>IntegerRangeValidator</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">IntegerRangeValidator</td></tr> +</thead><tbody> +<tr> <td>open</td> <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td> <td></td> @@ -82,12 +82,7 @@ </tr> <tr> <td>showTooltip</td> - <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]</td> + <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VTextField[0]</td> <td></td> </tr> <tr> @@ -95,7 +90,7 @@ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td> <td>Must be between 0 and 150, -1 is not</td> </tr> -</tbody></table> - </body> - </html> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java new file mode 100644 index 0000000000..c5d6a65d87 --- /dev/null +++ b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java @@ -0,0 +1,100 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.integration; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.PrivateTB3Configuration; + +public class JSPIntegrationTest extends PrivateTB3Configuration { + + final String appRunnerTestUrl = getBaseURL() + "/run/Buttons"; + final String jspUrl = getBaseURL() + "/statictestfiles/vaadinsessions.jsp"; + final String integrationUrl = getBaseURL() + "/integration"; + + @Test + public void listVaadinSessions() { + + assertUICount(0); + + // Open a new UI + getDriver().get(integrationUrl); + assertUICount(1); + + // Open a new UI + getDriver().get(integrationUrl); + + // Should now have two UIs for the same service with different uiIds + List<UIData> twoUIs = getUIs(); + assertEquals(2, twoUIs.size()); + assertNotEquals(twoUIs.get(0).uiId, twoUIs.get(1).uiId); + assertEquals(twoUIs.get(0).serviceName, twoUIs.get(1).serviceName); + + getDriver().get(appRunnerTestUrl); + // Should now have two services with 2 + 1 UIs + List<UIData> threeUIs = getUIs(); + assertEquals(3, threeUIs.size()); + Set<String> serviceNames = new HashSet<String>(); + Set<Integer> uiIds = new HashSet<Integer>(); + for (UIData uiData : threeUIs) { + serviceNames.add(uiData.serviceName); + uiIds.add(uiData.uiId); + } + assertGreaterOrEqual( + "There should be at least two unique service names", + serviceNames.size(), 2); + assertGreaterOrEqual("There should be at least two unique ui ids", + uiIds.size(), 2); + } + + private static class UIData { + private String serviceName; + private int uiId; + } + + private List<UIData> getUIs() { + List<UIData> uis = new ArrayList<UIData>(); + + getDriver().get(jspUrl); + List<WebElement> rows = getDriver().findElements( + By.xpath("//tr[@class='uirow']")); + for (WebElement row : rows) { + UIData data = new UIData(); + List<WebElement> tds = row.findElements(By.xpath("./td")); + + data.serviceName = tds.get(0).getText(); + data.uiId = Integer.parseInt(tds.get(2).getText()); + + uis.add(data); + } + + return uis; + } + + private void assertUICount(int i) { + assertEquals(i, getUIs().size()); + } +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java index be2768a5f7..8485bba499 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java @@ -3,7 +3,7 @@ package com.vaadin.tests.minitutorials.v7a1; import java.text.NumberFormat; import java.util.Locale; -import com.vaadin.data.util.converter.StringToNumberConverter; +import com.vaadin.data.util.converter.StringToDoubleConverter; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Table; @@ -30,14 +30,14 @@ public class FormatTableValue extends AbstractTestUI { table.getItem(itemId).getItemProperty(DEFAULT_PROPERTY) .setValue(3.1415); - table.setConverter(PERCENT_PROPERTY, new StringToNumberConverter() { + table.setConverter(PERCENT_PROPERTY, new StringToDoubleConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getPercentInstance(locale); } }); - table.setConverter(CURRENCY_PROPERTY, new StringToNumberConverter() { + table.setConverter(CURRENCY_PROPERTY, new StringToDoubleConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getCurrencyInstance(locale); diff --git a/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java b/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java new file mode 100644 index 0000000000..bbb7895f20 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java @@ -0,0 +1,34 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.push; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.ui.Transport; +import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; + +@Push(transport = Transport.LONG_POLLING) +public class BasicPushLongPolling extends BasicPush { + + @Override + public void init(VaadinRequest request) { + super.init(request); + // Don't use fallback so we can easier detect if long polling fails + getPushConfiguration().setParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + } + +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java b/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java new file mode 100644 index 0000000000..b526a11d38 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java @@ -0,0 +1,19 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.push; + +public class BasicPushLongPollingTest extends BasicPushTest { +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/push/LongPollingReconnectTest.java b/uitest/src/com/vaadin/tests/push/LongPollingReconnectTest.java new file mode 100644 index 0000000000..81c974e1e5 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/LongPollingReconnectTest.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.push; + +public class LongPollingReconnectTest extends PushReconnectTest { + + @Override + protected Class<?> getUIClass() { + return BasicPushLongPolling.class; + } + +} diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java new file mode 100644 index 0000000000..52a647115a --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java @@ -0,0 +1,32 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.push; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.ui.Transport; +import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; + +@Push(transport = Transport.LONG_POLLING) +public class PushLargeDataLongPolling extends PushLargeData { + + @Override + protected void setup(VaadinRequest request) { + super.setup(request); + getPushConfiguration().setParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + } +} diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java new file mode 100644 index 0000000000..534c5287bb --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.push; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class PushLargeDataLongPollingTest extends MultiBrowserTest { + + @Test + public void testLongPollingLargeData() throws Exception { + openTestURL(); + + // Without this there is a large chance that we will wait for all pushes + // to complete before moving on + testBench(driver).disableWaitForVaadin(); + + push(); + // Push complete. Browser will reconnect now as > 10MB has been sent + // Push again to ensure push still works + push(); + + } + + private void push() throws InterruptedException { + // Wait for startButton to be present + waitForElementToBePresent(vaadinLocatorById("startButton")); + + String logRow0Id = "Log_row_0"; + By logRow0 = vaadinLocatorById(logRow0Id); + + vaadinElementById("startButton").click(); + // Wait for push to start + waitUntil(ExpectedConditions.textToBePresentInElement(logRow0, + "Package ")); + + // Wait for until push should be done + sleep(PushLargeData.DEFAULT_DURATION_MS); + + // Wait until push is actually done + waitUntil(ExpectedConditions.textToBePresentInElement(logRow0, + "Push complete")); + } + +} diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.html b/uitest/src/com/vaadin/tests/serialization/SerializerTest.html deleted file mode 100644 index 63219de5c2..0000000000 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.html +++ /dev/null @@ -1,116 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:8888/" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.serialization.SerializerTest?restartApplication</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[18]</td> - <td>sendBeanSubclass: 43</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[17]</td> - <td>sendBoolean: false, false, [false, false, true, false, true, true]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[16]</td> - <td>sendByte: 5, -12, [3, 1, 2]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[15]</td> - <td>sendChar: Å, ∫, [a, b, c, d]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[14]</td> - <td>sendInt: 2, 5, [2147483647, 0]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[13]</td> - <td>sendLong: -57841235865, 577431841358, [57, 0]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[12]</td> - <td>sendFloat: 1.0000001, 3.14159, [-12.0, 0.0, 57.0]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[11]</td> - <td>sendDouble: 0.423310825130748, 5.859874482048838, [2.0, 1.7976931348623157E308, 4.9E-324]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[10]</td> - <td>sendString: Taegghiiiinnrsssstt‡</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[9]</td> - <td>sendConnector: com.vaadin.tests.widgetset.server.SerializerTestExtension</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[8]</td> - <td>sendBean: ComplexTestBean [innerBean1=SimpleTestBean(1), innerBean2=SimpleTestBean(3), innerBeanCollection=[SimpleTestBean(6), SimpleTestBean(0)], privimite=6], SimpleTestBean(0), [SimpleTestBean(7)]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[7]</td> - <td>sendNull: null, Not null</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[6]</td> - <td>sendNestedArray: [[7, 5]], [[SimpleTestBean(2)], [SimpleTestBean(4)]]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[5]</td> - <td>sendList: [-234, 5, 8], class com.vaadin.tests.widgetset.server.SerializerTestExtension, class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(-568), SimpleTestBean(234)]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[4]</td> - <td>sendArrayList: [[2], [2]], [[2, 1], [2, 3]], [[SimpleTestBean(7)]]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[3]</td> - <td>sendSet: [-12, -7, -4], class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(2), SimpleTestBean(3)]</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[2]</td> - <td>sendMap: {a=SimpleTestBean(1)}, [com.vaadin.tests.widgetset.server.SerializerTestExtension=SimpleTestBean(4)], [2=com.vaadin.tests.widgetset.server.SerializerTestExtension], {SimpleTestBean(4)=SimpleTestBean(-4), SimpleTestBean(-5)=SimpleTestBean(5)}</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td> - <td>sendWrappedGenerics: {[SimpleTestBean(1)]={1=[SimpleTestBean(42)]}}</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td> - <td>sendEnum: PREFORMATTED, [HTML, RAW], [PREFORMATTED, XML]</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index 0561f73b21..1184be79d4 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java @@ -19,6 +19,7 @@ package com.vaadin.tests.serialization; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -137,6 +138,8 @@ public class SerializerTest extends AbstractTestUI { ContentMode.PREFORMATTED, ContentMode.XML }, Arrays.asList(ContentMode.HTML, ContentMode.RAW)); + rpc.sendDate(new Date(1)); + rpc.sendDate(new Date(2013 - 1900, 5 - 1, 31, 11, 12, 13)); testExtension.registerRpc(new SerializerTestRpc() { @Override public void sendBoolean(boolean value, Boolean boxedValue, @@ -316,6 +319,11 @@ public class SerializerTest extends AbstractTestUI { log.log("sendBeanSubclass: " + bean.getValue()); } + @Override + public void sendDate(Date date) { + log.log("sendDate: " + date.toString()); + } + }); } diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java new file mode 100644 index 0000000000..518c222bc3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java @@ -0,0 +1,81 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.serialization; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class SerializerTestTest extends MultiBrowserTest { + + @Test + public void testSerialization() { + openTestURL(); + int logRow = 0; + + Assert.assertEquals("sendDate: Fri May 31 11:12:13 CEST 2013", + getLogRow(logRow++)); + Assert.assertEquals("sendDate: Thu Jan 01 01:00:00 CET 1970", + getLogRow(logRow++)); + Assert.assertEquals( + "sendEnum: PREFORMATTED, [HTML, RAW], [PREFORMATTED, XML]", + getLogRow(logRow++)); + Assert.assertEquals( + "sendWrappedGenerics: {[SimpleTestBean(1)]={1=[SimpleTestBean(42)]}}", + getLogRow(logRow++)); + Assert.assertEquals( + "sendMap: {a=SimpleTestBean(1)}, [com.vaadin.tests.widgetset.server.SerializerTestExtension=SimpleTestBean(4)], [2=com.vaadin.tests.widgetset.server.SerializerTestExtension], {SimpleTestBean(4)=SimpleTestBean(-4), SimpleTestBean(-5)=SimpleTestBean(5)}", + getLogRow(logRow++)); + Assert.assertEquals( + "sendSet: [-12, -7, -4], class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(2), SimpleTestBean(3)]", + getLogRow(logRow++)); + Assert.assertEquals( + "sendArrayList: [[2], [2]], [[2, 1], [2, 3]], [[SimpleTestBean(7)]]", + getLogRow(logRow++)); + Assert.assertEquals( + "sendList: [-234, 5, 8], class com.vaadin.tests.widgetset.server.SerializerTestExtension, class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(-568), SimpleTestBean(234)]", + getLogRow(logRow++)); + Assert.assertEquals( + "sendNestedArray: [[7, 5]], [[SimpleTestBean(2)], [SimpleTestBean(4)]]", + getLogRow(logRow++)); + Assert.assertEquals("sendNull: null, Not null", getLogRow(logRow++)); + Assert.assertEquals( + "sendBean: ComplexTestBean [innerBean1=SimpleTestBean(1), innerBean2=SimpleTestBean(3), innerBeanCollection=[SimpleTestBean(6), SimpleTestBean(0)], privimite=6], SimpleTestBean(0), [SimpleTestBean(7)]", + getLogRow(logRow++)); + Assert.assertEquals( + "sendConnector: com.vaadin.tests.widgetset.server.SerializerTestExtension", + getLogRow(logRow++)); + Assert.assertEquals("sendString: Taegghiiiinnrsssstt‡", + getLogRow(logRow++)); + Assert.assertEquals( + "sendDouble: 0.423310825130748, 5.859874482048838, [2.0, 1.7976931348623157E308, 4.9E-324]", + getLogRow(logRow++)); + Assert.assertEquals( + "sendFloat: 1.0000001, 3.14159, [-12.0, 0.0, 57.0]", + getLogRow(logRow++)); + Assert.assertEquals("sendLong: -57841235865, 577431841358, [57, 0]", + getLogRow(logRow++)); + Assert.assertEquals("sendInt: 2, 5, [2147483647, 0]", + getLogRow(logRow++)); + Assert.assertEquals("sendChar: Å, ∫, [a, b, c, d]", getLogRow(logRow++)); + Assert.assertEquals("sendByte: 5, -12, [3, 1, 2]", getLogRow(logRow++)); + Assert.assertEquals( + "sendBoolean: false, false, [false, false, true, false, true, true]", + getLogRow(logRow++)); + Assert.assertEquals("sendBeanSubclass: 43", getLogRow(logRow++)); + } +} diff --git a/uitest/src/com/vaadin/tests/util/TestUtils.java b/uitest/src/com/vaadin/tests/util/TestUtils.java index 5c6315a23a..dcd28c3413 100644 --- a/uitest/src/com/vaadin/tests/util/TestUtils.java +++ b/uitest/src/com/vaadin/tests/util/TestUtils.java @@ -99,22 +99,13 @@ public class TestUtils { "YE", "ZAMBIA", "ZM", "ZIMBABWE", "ZW" }; /** - * Crossbrowser hack to dynamically add css current window. Can be used to - * keep tests css in source files. + * Injects css into the current window. Can be used to keep tests css in + * source files. * * @param cssString */ public static void injectCSS(UI w, String cssString) { - String script = "if ('\\v'=='v') /* ie only */ {\n" - + " document.createStyleSheet().cssText = '" - + cssString - + "';\n" - + " } else {var tag = document.createElement('style'); tag.type = 'text/css';" - + " document.getElementsByTagName('head')[0].appendChild(tag);tag[ (typeof " - + "document.body.style.WebkitAppearance=='string') /* webkit only */ ? 'innerText' " - + ": 'innerHTML'] = '" + cssString + "';}"; - - w.getPage().getJavaScript().execute(script); + w.getPage().getStyles().add(cssString); } public static void installPerformanceReporting(TextArea targetTextArea) { diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java index 0f6ad577ed..01ec6cc4bb 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java @@ -19,6 +19,7 @@ package com.vaadin.tests.widgetset.client; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -251,6 +252,11 @@ public class SerializerTestConnector extends AbstractExtensionConnector { } }); } + + @Override + public void sendDate(Date date) { + rpc.sendDate(date); + } }); } diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java index 4bda067242..fb5b6a1980 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java @@ -16,6 +16,7 @@ package com.vaadin.tests.widgetset.client; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; @@ -79,4 +80,5 @@ public interface SerializerTestRpc extends ServerRpc, ClientRpc { public void sendBeanSubclass(SimpleTestBean bean); + public void sendDate(Date date); } |