Browse Source

Merge commit 'feb9a8c3510afc76c079fafcd9e507205bde139c'

Conflicts:
	WebContent/release-notes.html
	theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java

Change-Id: Iad9ee95b2f399ff93f0e426a0810b18d923f8ff6
tags/7.1.0.beta1
Artur Signell 11 years ago
parent
commit
ed79188e0d
25 changed files with 13507 additions and 13008 deletions
  1. 5
    0
      WebContent/VAADIN/themes/base/layout/layout.scss
  2. 2
    1
      client/src/com/vaadin/client/ui/AbstractClickEventHandler.java
  3. 6
    0
      client/src/com/vaadin/client/ui/VAbstractSplitPanel.java
  4. 32
    0
      client/src/com/vaadin/client/ui/VAccordion.java
  5. 28
    3
      client/src/com/vaadin/client/ui/VNativeButton.java
  6. 7
    1
      client/src/com/vaadin/client/ui/VUI.java
  7. 13
    3
      client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java
  8. 4
    2
      client/src/com/vaadin/client/ui/ui/UIConnector.java
  9. 6
    1
      server/src/com/vaadin/ui/DateField.java
  10. 7649
    7601
      theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
  11. 1
    1
      theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
  12. 379
    379
      theme-compiler/src/com/vaadin/sass/internal/parser/ParserConstants.java
  13. 4985
    4985
      theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java
  14. 17
    0
      theme-compiler/tests/resources/automatic/css/gradient.css
  15. 17
    0
      theme-compiler/tests/resources/automatic/scss/gradient.scss
  16. 0
    0
      theme-compiler/tests/resources/sasslang/css/385-test_newlines_removed_from_selectors_when_compressed.css
  17. 0
    0
      theme-compiler/tests/resources/sasslang/scss/385-test_newlines_removed_from_selectors_when_compressed.scss
  18. 8
    3
      theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java
  19. 41
    0
      uitest/src/com/vaadin/tests/components/accordion/AccordionTabStylenames.html
  20. 32
    0
      uitest/src/com/vaadin/tests/components/accordion/AccordionTabStylenames.java
  21. 55
    0
      uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java
  22. 26
    0
      uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.html
  23. 45
    0
      uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java
  24. 124
    21
      uitest/src/com/vaadin/tests/navigator/NavigatorTest.html
  25. 25
    7
      uitest/src/com/vaadin/tests/navigator/NavigatorTest.java

+ 5
- 0
WebContent/VAADIN/themes/base/layout/layout.scss View File

@@ -105,6 +105,11 @@ div.v-layout.v-horizontal.v-widget {
height: 100%;
}

/* Workaround for IE8+IE9 bug where clicking inside an input area which is inside a div with negative margin causes cursor position to jump to wrong position. See #11152 */
.v-horizontal > .v-expand > .v-slot {
position: relative;
}

.v-vertical > .v-spacing,
.v-vertical > .v-expand > .v-spacing {
width: 0;

+ 2
- 1
client/src/com/vaadin/client/ui/AbstractClickEventHandler.java View File

@@ -33,6 +33,7 @@ import com.google.gwt.user.client.Event.NativePreviewEvent;
import com.google.gwt.user.client.Event.NativePreviewHandler;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;

public abstract class AbstractClickEventHandler implements MouseDownHandler,
MouseUpHandler, DoubleClickHandler, ContextMenuHandler {
@@ -77,7 +78,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler,
&& elementUnderMouse == lastMouseDownTarget) {
mouseUpPreviewMatched = true;
} else {
System.out.println("Ignoring mouseup from "
VConsole.log("Ignoring mouseup from "
+ elementUnderMouse + " when mousedown was on "
+ lastMouseDownTarget);
}

+ 6
- 0
client/src/com/vaadin/client/ui/VAbstractSplitPanel.java View File

@@ -499,6 +499,9 @@ public class VAbstractSplitPanel extends ComplexPanel {

/** For internal use only. May be removed or replaced in the future. */
public void setFirstWidget(Widget w) {
if (firstChild == w) {
return;
}
if (firstChild != null) {
firstChild.removeFromParent();
}
@@ -510,6 +513,9 @@ public class VAbstractSplitPanel extends ComplexPanel {

/** For internal use only. May be removed or replaced in the future. */
public void setSecondWidget(Widget w) {
if (secondChild == w) {
return;
}
if (secondChild != null) {
secondChild.removeFromParent();
}

+ 32
- 0
client/src/com/vaadin/client/ui/VAccordion.java View File

@@ -34,6 +34,7 @@ import com.vaadin.client.Util;
import com.vaadin.client.VCaption;
import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler;
import com.vaadin.shared.ui.tabsheet.TabsheetBaseConstants;
import com.vaadin.shared.ui.tabsheet.TabsheetConstants;

public class VAccordion extends VTabsheetBase {

@@ -76,6 +77,9 @@ public class VAccordion extends VTabsheetBase {
}
item.updateCaption(tabUidl);

item.updateTabStyleName(tabUidl
.getStringAttribute(TabsheetConstants.TAB_STYLE_NAME));

item.setVisible(!hidden);

if (selected) {
@@ -290,6 +294,7 @@ public class VAccordion extends VTabsheetBase {
private boolean open = false;
private Element content = DOM.createDiv();
private Element captionNode = DOM.createDiv();
private String styleName;

public StackItem(UIDL tabUidl) {
setElement(DOM.createDiv());
@@ -312,6 +317,7 @@ public class VAccordion extends VTabsheetBase {
captionNode.removeClassName(getStylePrimaryName() + "-caption");

setStylePrimaryName(primaryStyleName + "-item");
updateTabStyleName(getStylePrimaryName());

captionNode.addClassName(getStylePrimaryName() + "-caption");
content.addClassName(getStylePrimaryName() + "-content");
@@ -399,6 +405,32 @@ public class VAccordion extends VTabsheetBase {
uidl.getStringAttribute(TabsheetBaseConstants.ATTRIBUTE_TAB_ICON));
}

/**
* Updates a tabs stylename from the child UIDL
*
* @param uidl
* The child uidl of the tab
*/
private void updateTabStyleName(String newStyleName) {
if (newStyleName != null && newStyleName.length() != 0) {
if (!newStyleName.equals(styleName)) {
// If we have a new style name
if (styleName != null && styleName.length() != 0) {
// Remove old style name if present
removeStyleDependentName(styleName);
}
// Set new style name
addStyleDependentName(newStyleName);
styleName = newStyleName;
}
} else if (styleName != null) {
// Remove the set stylename if no stylename is present in the
// uidl
removeStyleDependentName(styleName);
styleName = null;
}
}

public int getWidgetWidth() {
return DOM.getFirstChild(content).getOffsetWidth();
}

+ 28
- 3
client/src/com/vaadin/client/ui/VNativeButton.java View File

@@ -16,9 +16,14 @@

package com.vaadin.client.ui;

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.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.MouseEvent;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Button;
@@ -26,6 +31,7 @@ import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.MouseEventDetailsBuilder;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.button.ButtonServerRpc;

@@ -60,6 +66,8 @@ public class VNativeButton extends Button implements ClickHandler {
*/
private boolean clickPending;

private boolean cancelNextClick = false;

/** For internal use only. May be removed or replaced in the future. */
public boolean disableOnClick = false;

@@ -71,8 +79,8 @@ public class VNativeButton extends Button implements ClickHandler {

addClickHandler(this);

sinkEvents(Event.ONMOUSEDOWN);
sinkEvents(Event.ONMOUSEUP);
sinkEvents(Event.ONMOUSEDOWN | Event.ONLOAD | Event.ONMOUSEMOVE
| Event.ONFOCUS);
}

@Override
@@ -95,6 +103,7 @@ public class VNativeButton extends Button implements ClickHandler {
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN
&& event.getButton() == Event.BUTTON_LEFT) {
clickPending = true;

} else if (DOM.eventGetType(event) == Event.ONMOUSEMOVE) {
clickPending = false;
} else if (DOM.eventGetType(event) == Event.ONMOUSEOUT) {
@@ -102,6 +111,21 @@ public class VNativeButton extends Button implements ClickHandler {
click();
}
clickPending = false;
} else if (event.getTypeInt() == Event.ONFOCUS) {
if (BrowserInfo.get().isIE() && clickPending) {
/*
* The focus event will mess up IE and IE will not trigger the
* mouse up event (which in turn triggers the click event) until
* the mouse is moved. This will result in it appearing as a
* native button not triggering the event. So we manually
* trigger the click here and cancel the next original event
* which will occur on the next mouse move. See ticket #11094
* for details.
*/
click();
clickPending = false;
cancelNextClick = true;
}
}
}

@@ -120,7 +144,8 @@ public class VNativeButton extends Button implements ClickHandler {
*/
@Override
public void onClick(ClickEvent event) {
if (paintableId == null || client == null) {
if (paintableId == null || client == null || cancelNextClick) {
cancelNextClick = false;
return;
}


+ 7
- 1
client/src/com/vaadin/client/ui/VUI.java View File

@@ -133,10 +133,16 @@ public class VUI extends SimplePanel implements ResizeHandler,
// Send the location to the server if the fragment has changed
// and flush active connectors in UI.
if (!newFragment.equals(currentFragment) && connection != null) {

// Ensure the fragment is properly encoded in all browsers
// (#10769)
String location = Window.Location.createUrlBuilder()
.buildString();

currentFragment = newFragment;
connection.flushActiveConnector();
connection.updateVariable(id, UIConstants.LOCATION_VARIABLE,
Window.Location.getHref(), true);
location, true);
}
}
};

+ 13
- 3
client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java View File

@@ -29,6 +29,7 @@ import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.RequiresResize;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.LayoutManager;
import com.vaadin.client.Util;
import com.vaadin.shared.ui.MarginInfo;
@@ -411,10 +412,19 @@ public class VAbstractOrderedLayout extends FlowPanel {

} else {
// Non-relative child without expansion should be unconstrained
if (vertical) {
slotStyle.clearHeight();
if (BrowserInfo.get().isIE8()) {
// unconstrained in IE8 is auto
if (vertical) {
slot.setHeight("auto");
} else {
slot.setWidth("auto");
}
} else {
slotStyle.clearWidth();
if (vertical) {
slotStyle.clearHeight();
} else {
slotStyle.clearWidth();
}
}
}
}

+ 4
- 2
client/src/com/vaadin/client/ui/ui/UIConnector.java View File

@@ -32,6 +32,7 @@ import com.google.gwt.event.dom.client.ScrollEvent;
import com.google.gwt.event.dom.client.ScrollHandler;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
@@ -317,8 +318,9 @@ public class UIConnector extends AbstractSingleComponentContainerConnector
.getStringAttribute(UIConstants.LOCATION_VARIABLE);
int fragmentIndex = location.indexOf('#');
if (fragmentIndex >= 0) {
getWidget().currentFragment = location
.substring(fragmentIndex + 1);
// Decode fragment to avoid double encoding (#10769)
getWidget().currentFragment = URL.decodePathSegment(location
.substring(fragmentIndex + 1));
}
if (!getWidget().currentFragment.equals(History.getToken())) {
History.newItem(getWidget().currentFragment, true);

+ 6
- 1
server/src/com/vaadin/ui/DateField.java View File

@@ -19,8 +19,10 @@ package com.vaadin.ui;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
@@ -769,8 +771,11 @@ public class DateField extends AbstractField<Date> implements
calendar = Calendar.getInstance();
// Start by a zeroed calendar to avoid having values for lower
// resolution variables e.g. time when resolution is day
int min, field;
for (Resolution r : Resolution.getResolutionsLowerThan(resolution)) {
calendar.set(r.getCalendarField(), 0);
field = r.getCalendarField();
min = calendar.getActualMinimum(field);
calendar.set(field, min);
}
calendar.set(Calendar.MILLISECOND, 0);
}

+ 7649
- 7601
theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
File diff suppressed because it is too large
View File


+ 1
- 1
theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj View File

@@ -2375,7 +2375,7 @@ LexicalUnitImpl nonVariableTerm(LexicalUnitImpl prev) : { LexicalUnitImpl result
LexicalUnitImpl.createString(n.beginLine, n.beginColumn, prev,
convertStringIndex(n.image, 1,
n.image.length() -1));}
| (< DOT >{ s+="."; })?n=<IDENT>
| (< DOT >{ s+="."; })?(n=<IDENT> | n=<TO> | n=<THROUGH> | n=<FROM>)
{ s += convertIdent(n.image);
if ("inherit".equals(s)) {
result = LexicalUnitImpl.createInherit(n.beginLine, n.beginColumn,

+ 379
- 379
theme-compiler/src/com/vaadin/sass/internal/parser/ParserConstants.java View File

@@ -1,379 +1,379 @@
/* Generated By:JavaCC: Do not edit this line. ParserConstants.java */
package com.vaadin.sass.internal.parser;
/**
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
public interface ParserConstants {
/** End of File. */
int EOF = 0;
/** RegularExpression Id. */
int S = 1;
/** RegularExpression Id. */
int FORMAL_COMMENT = 7;
/** RegularExpression Id. */
int MULTI_LINE_COMMENT = 8;
/** RegularExpression Id. */
int CDO = 10;
/** RegularExpression Id. */
int CDC = 11;
/** RegularExpression Id. */
int LBRACE = 12;
/** RegularExpression Id. */
int RBRACE = 13;
/** RegularExpression Id. */
int DASHMATCH = 14;
/** RegularExpression Id. */
int CARETMATCH = 15;
/** RegularExpression Id. */
int DOLLARMATCH = 16;
/** RegularExpression Id. */
int STARMATCH = 17;
/** RegularExpression Id. */
int INCLUDES = 18;
/** RegularExpression Id. */
int EQ = 19;
/** RegularExpression Id. */
int PLUS = 20;
/** RegularExpression Id. */
int MINUS = 21;
/** RegularExpression Id. */
int COMMA = 22;
/** RegularExpression Id. */
int SEMICOLON = 23;
/** RegularExpression Id. */
int PRECEDES = 24;
/** RegularExpression Id. */
int SIBLING = 25;
/** RegularExpression Id. */
int SUCCEEDS = 26;
/** RegularExpression Id. */
int DIV = 27;
/** RegularExpression Id. */
int LBRACKET = 28;
/** RegularExpression Id. */
int RBRACKET = 29;
/** RegularExpression Id. */
int ANY = 30;
/** RegularExpression Id. */
int MOD = 31;
/** RegularExpression Id. */
int PARENT = 32;
/** RegularExpression Id. */
int DOT = 33;
/** RegularExpression Id. */
int LPARAN = 34;
/** RegularExpression Id. */
int RPARAN = 35;
/** RegularExpression Id. */
int COMPARE = 36;
/** RegularExpression Id. */
int OR = 37;
/** RegularExpression Id. */
int AND = 38;
/** RegularExpression Id. */
int NOT_EQ = 39;
/** RegularExpression Id. */
int COLON = 40;
/** RegularExpression Id. */
int INTERPOLATION = 41;
/** RegularExpression Id. */
int NONASCII = 42;
/** RegularExpression Id. */
int H = 43;
/** RegularExpression Id. */
int UNICODE = 44;
/** RegularExpression Id. */
int ESCAPE = 45;
/** RegularExpression Id. */
int NMSTART = 46;
/** RegularExpression Id. */
int NMCHAR = 47;
/** RegularExpression Id. */
int STRINGCHAR = 48;
/** RegularExpression Id. */
int D = 49;
/** RegularExpression Id. */
int NAME = 50;
/** RegularExpression Id. */
int TO = 51;
/** RegularExpression Id. */
int THROUGH = 52;
/** RegularExpression Id. */
int EACH_IN = 53;
/** RegularExpression Id. */
int FROM = 54;
/** RegularExpression Id. */
int MIXIN_SYM = 55;
/** RegularExpression Id. */
int INCLUDE_SYM = 56;
/** RegularExpression Id. */
int FUNCTION_SYM = 57;
/** RegularExpression Id. */
int RETURN_SYM = 58;
/** RegularExpression Id. */
int DEBUG_SYM = 59;
/** RegularExpression Id. */
int WARN_SYM = 60;
/** RegularExpression Id. */
int FOR_SYM = 61;
/** RegularExpression Id. */
int EACH_SYM = 62;
/** RegularExpression Id. */
int WHILE_SYM = 63;
/** RegularExpression Id. */
int IF_SYM = 64;
/** RegularExpression Id. */
int ELSE_SYM = 65;
/** RegularExpression Id. */
int EXTEND_SYM = 66;
/** RegularExpression Id. */
int MOZ_DOCUMENT_SYM = 67;
/** RegularExpression Id. */
int SUPPORTS_SYM = 68;
/** RegularExpression Id. */
int CONTENT_SYM = 69;
/** RegularExpression Id. */
int MICROSOFT_RULE = 70;
/** RegularExpression Id. */
int IF = 71;
/** RegularExpression Id. */
int GUARDED_SYM = 72;
/** RegularExpression Id. */
int STRING = 73;
/** RegularExpression Id. */
int IDENT = 74;
/** RegularExpression Id. */
int NUMBER = 75;
/** RegularExpression Id. */
int _URL = 76;
/** RegularExpression Id. */
int URL = 77;
/** RegularExpression Id. */
int VARIABLE = 78;
/** RegularExpression Id. */
int PERCENTAGE = 79;
/** RegularExpression Id. */
int PT = 80;
/** RegularExpression Id. */
int MM = 81;
/** RegularExpression Id. */
int CM = 82;
/** RegularExpression Id. */
int PC = 83;
/** RegularExpression Id. */
int IN = 84;
/** RegularExpression Id. */
int PX = 85;
/** RegularExpression Id. */
int EMS = 86;
/** RegularExpression Id. */
int LEM = 87;
/** RegularExpression Id. */
int REM = 88;
/** RegularExpression Id. */
int EXS = 89;
/** RegularExpression Id. */
int DEG = 90;
/** RegularExpression Id. */
int RAD = 91;
/** RegularExpression Id. */
int GRAD = 92;
/** RegularExpression Id. */
int MS = 93;
/** RegularExpression Id. */
int SECOND = 94;
/** RegularExpression Id. */
int HZ = 95;
/** RegularExpression Id. */
int KHZ = 96;
/** RegularExpression Id. */
int DIMEN = 97;
/** RegularExpression Id. */
int HASH = 98;
/** RegularExpression Id. */
int IMPORT_SYM = 99;
/** RegularExpression Id. */
int MEDIA_SYM = 100;
/** RegularExpression Id. */
int CHARSET_SYM = 101;
/** RegularExpression Id. */
int PAGE_SYM = 102;
/** RegularExpression Id. */
int FONT_FACE_SYM = 103;
/** RegularExpression Id. */
int KEY_FRAME_SYM = 104;
/** RegularExpression Id. */
int ATKEYWORD = 105;
/** RegularExpression Id. */
int IMPORTANT_SYM = 106;
/** RegularExpression Id. */
int RANGE0 = 107;
/** RegularExpression Id. */
int RANGE1 = 108;
/** RegularExpression Id. */
int RANGE2 = 109;
/** RegularExpression Id. */
int RANGE3 = 110;
/** RegularExpression Id. */
int RANGE4 = 111;
/** RegularExpression Id. */
int RANGE5 = 112;
/** RegularExpression Id. */
int RANGE6 = 113;
/** RegularExpression Id. */
int RANGE = 114;
/** RegularExpression Id. */
int UNI = 115;
/** RegularExpression Id. */
int UNICODERANGE = 116;
/** RegularExpression Id. */
int REMOVE = 117;
/** RegularExpression Id. */
int APPEND = 118;
/** RegularExpression Id. */
int CONTAINS = 119;
/** RegularExpression Id. */
int FUNCTION = 120;
/** RegularExpression Id. */
int UNKNOWN = 121;
/** Lexical state. */
int DEFAULT = 0;
/** Lexical state. */
int IN_SINGLE_LINE_COMMENT = 1;
/** Lexical state. */
int IN_FORMAL_COMMENT = 2;
/** Lexical state. */
int IN_MULTI_LINE_COMMENT = 3;
/** Literal token values. */
String[] tokenImage = {
"<EOF>",
"<S>",
"\"//\"",
"<token of kind 3>",
"<token of kind 4>",
"<token of kind 5>",
"\"/*\"",
"\"*/\"",
"\"*/\"",
"<token of kind 9>",
"\"<!--\"",
"\"-->\"",
"\"{\"",
"\"}\"",
"\"|=\"",
"\"^=\"",
"\"$=\"",
"\"*=\"",
"\"~=\"",
"\"=\"",
"\"+\"",
"\"-\"",
"\",\"",
"\";\"",
"\">\"",
"\"~\"",
"\"<\"",
"\"/\"",
"\"[\"",
"\"]\"",
"\"*\"",
"\"%\"",
"\"&\"",
"\".\"",
"\"(\"",
"\")\"",
"\"==\"",
"\"||\"",
"\"&&\"",
"\"!=\"",
"\":\"",
"<INTERPOLATION>",
"<NONASCII>",
"<H>",
"<UNICODE>",
"<ESCAPE>",
"<NMSTART>",
"<NMCHAR>",
"<STRINGCHAR>",
"<D>",
"<NAME>",
"\"to\"",
"\"through\"",
"\"in\"",
"\"from\"",
"\"@mixin\"",
"\"@include\"",
"\"@function\"",
"\"@return\"",
"\"@debug\"",
"\"@warn\"",
"\"@for\"",
"\"@each\"",
"\"@while\"",
"\"@if\"",
"\"@else\"",
"\"@extend\"",
"\"@-moz-document\"",
"\"@supports\"",
"\"@content\"",
"<MICROSOFT_RULE>",
"\"if\"",
"<GUARDED_SYM>",
"<STRING>",
"<IDENT>",
"<NUMBER>",
"<_URL>",
"<URL>",
"<VARIABLE>",
"<PERCENTAGE>",
"<PT>",
"<MM>",
"<CM>",
"<PC>",
"<IN>",
"<PX>",
"<EMS>",
"<LEM>",
"<REM>",
"<EXS>",
"<DEG>",
"<RAD>",
"<GRAD>",
"<MS>",
"<SECOND>",
"<HZ>",
"<KHZ>",
"<DIMEN>",
"<HASH>",
"\"@import\"",
"\"@media\"",
"\"@charset\"",
"\"@page\"",
"\"@font-face\"",
"<KEY_FRAME_SYM>",
"<ATKEYWORD>",
"<IMPORTANT_SYM>",
"<RANGE0>",
"<RANGE1>",
"<RANGE2>",
"<RANGE3>",
"<RANGE4>",
"<RANGE5>",
"<RANGE6>",
"<RANGE>",
"<UNI>",
"<UNICODERANGE>",
"<REMOVE>",
"<APPEND>",
"<CONTAINS>",
"<FUNCTION>",
"<UNKNOWN>",
};
}
/* Generated By:JavaCC: Do not edit this line. ParserConstants.java */
package com.vaadin.sass.internal.parser;
/**
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
public interface ParserConstants {
/** End of File. */
int EOF = 0;
/** RegularExpression Id. */
int S = 1;
/** RegularExpression Id. */
int FORMAL_COMMENT = 7;
/** RegularExpression Id. */
int MULTI_LINE_COMMENT = 8;
/** RegularExpression Id. */
int CDO = 10;
/** RegularExpression Id. */
int CDC = 11;
/** RegularExpression Id. */
int LBRACE = 12;
/** RegularExpression Id. */
int RBRACE = 13;
/** RegularExpression Id. */
int DASHMATCH = 14;
/** RegularExpression Id. */
int CARETMATCH = 15;
/** RegularExpression Id. */
int DOLLARMATCH = 16;
/** RegularExpression Id. */
int STARMATCH = 17;
/** RegularExpression Id. */
int INCLUDES = 18;
/** RegularExpression Id. */
int EQ = 19;
/** RegularExpression Id. */
int PLUS = 20;
/** RegularExpression Id. */
int MINUS = 21;
/** RegularExpression Id. */
int COMMA = 22;
/** RegularExpression Id. */
int SEMICOLON = 23;
/** RegularExpression Id. */
int PRECEDES = 24;
/** RegularExpression Id. */
int SIBLING = 25;
/** RegularExpression Id. */
int SUCCEEDS = 26;
/** RegularExpression Id. */
int DIV = 27;
/** RegularExpression Id. */
int LBRACKET = 28;
/** RegularExpression Id. */
int RBRACKET = 29;
/** RegularExpression Id. */
int ANY = 30;
/** RegularExpression Id. */
int MOD = 31;
/** RegularExpression Id. */
int PARENT = 32;
/** RegularExpression Id. */
int DOT = 33;
/** RegularExpression Id. */
int LPARAN = 34;
/** RegularExpression Id. */
int RPARAN = 35;
/** RegularExpression Id. */
int COMPARE = 36;
/** RegularExpression Id. */
int OR = 37;
/** RegularExpression Id. */
int AND = 38;
/** RegularExpression Id. */
int NOT_EQ = 39;
/** RegularExpression Id. */
int COLON = 40;
/** RegularExpression Id. */
int INTERPOLATION = 41;
/** RegularExpression Id. */
int NONASCII = 42;
/** RegularExpression Id. */
int H = 43;
/** RegularExpression Id. */
int UNICODE = 44;
/** RegularExpression Id. */
int ESCAPE = 45;
/** RegularExpression Id. */
int NMSTART = 46;
/** RegularExpression Id. */
int NMCHAR = 47;
/** RegularExpression Id. */
int STRINGCHAR = 48;
/** RegularExpression Id. */
int D = 49;
/** RegularExpression Id. */
int NAME = 50;
/** RegularExpression Id. */
int TO = 51;
/** RegularExpression Id. */
int THROUGH = 52;
/** RegularExpression Id. */
int EACH_IN = 53;
/** RegularExpression Id. */
int FROM = 54;
/** RegularExpression Id. */
int MIXIN_SYM = 55;
/** RegularExpression Id. */
int INCLUDE_SYM = 56;
/** RegularExpression Id. */
int FUNCTION_SYM = 57;
/** RegularExpression Id. */
int RETURN_SYM = 58;
/** RegularExpression Id. */
int DEBUG_SYM = 59;
/** RegularExpression Id. */
int WARN_SYM = 60;
/** RegularExpression Id. */
int FOR_SYM = 61;
/** RegularExpression Id. */
int EACH_SYM = 62;
/** RegularExpression Id. */
int WHILE_SYM = 63;
/** RegularExpression Id. */
int IF_SYM = 64;
/** RegularExpression Id. */
int ELSE_SYM = 65;
/** RegularExpression Id. */
int EXTEND_SYM = 66;
/** RegularExpression Id. */
int MOZ_DOCUMENT_SYM = 67;
/** RegularExpression Id. */
int SUPPORTS_SYM = 68;
/** RegularExpression Id. */
int CONTENT_SYM = 69;
/** RegularExpression Id. */
int MICROSOFT_RULE = 70;
/** RegularExpression Id. */
int IF = 71;
/** RegularExpression Id. */
int GUARDED_SYM = 72;
/** RegularExpression Id. */
int STRING = 73;
/** RegularExpression Id. */
int IDENT = 74;
/** RegularExpression Id. */
int NUMBER = 75;
/** RegularExpression Id. */
int _URL = 76;
/** RegularExpression Id. */
int URL = 77;
/** RegularExpression Id. */
int VARIABLE = 78;
/** RegularExpression Id. */
int PERCENTAGE = 79;
/** RegularExpression Id. */
int PT = 80;
/** RegularExpression Id. */
int MM = 81;
/** RegularExpression Id. */
int CM = 82;
/** RegularExpression Id. */
int PC = 83;
/** RegularExpression Id. */
int IN = 84;
/** RegularExpression Id. */
int PX = 85;
/** RegularExpression Id. */
int EMS = 86;
/** RegularExpression Id. */
int LEM = 87;
/** RegularExpression Id. */
int REM = 88;
/** RegularExpression Id. */
int EXS = 89;
/** RegularExpression Id. */
int DEG = 90;
/** RegularExpression Id. */
int RAD = 91;
/** RegularExpression Id. */
int GRAD = 92;
/** RegularExpression Id. */
int MS = 93;
/** RegularExpression Id. */
int SECOND = 94;
/** RegularExpression Id. */
int HZ = 95;
/** RegularExpression Id. */
int KHZ = 96;
/** RegularExpression Id. */
int DIMEN = 97;
/** RegularExpression Id. */
int HASH = 98;
/** RegularExpression Id. */
int IMPORT_SYM = 99;
/** RegularExpression Id. */
int MEDIA_SYM = 100;
/** RegularExpression Id. */
int CHARSET_SYM = 101;
/** RegularExpression Id. */
int PAGE_SYM = 102;
/** RegularExpression Id. */
int FONT_FACE_SYM = 103;
/** RegularExpression Id. */
int KEY_FRAME_SYM = 104;
/** RegularExpression Id. */
int ATKEYWORD = 105;
/** RegularExpression Id. */
int IMPORTANT_SYM = 106;
/** RegularExpression Id. */
int RANGE0 = 107;
/** RegularExpression Id. */
int RANGE1 = 108;
/** RegularExpression Id. */
int RANGE2 = 109;
/** RegularExpression Id. */
int RANGE3 = 110;
/** RegularExpression Id. */
int RANGE4 = 111;
/** RegularExpression Id. */
int RANGE5 = 112;
/** RegularExpression Id. */
int RANGE6 = 113;
/** RegularExpression Id. */
int RANGE = 114;
/** RegularExpression Id. */
int UNI = 115;
/** RegularExpression Id. */
int UNICODERANGE = 116;
/** RegularExpression Id. */
int REMOVE = 117;
/** RegularExpression Id. */
int APPEND = 118;
/** RegularExpression Id. */
int CONTAINS = 119;
/** RegularExpression Id. */
int FUNCTION = 120;
/** RegularExpression Id. */
int UNKNOWN = 121;
/** Lexical state. */
int DEFAULT = 0;
/** Lexical state. */
int IN_SINGLE_LINE_COMMENT = 1;
/** Lexical state. */
int IN_FORMAL_COMMENT = 2;
/** Lexical state. */
int IN_MULTI_LINE_COMMENT = 3;
/** Literal token values. */
String[] tokenImage = {
"<EOF>",
"<S>",
"\"//\"",
"<token of kind 3>",
"<token of kind 4>",
"<token of kind 5>",
"\"/*\"",
"\"*/\"",
"\"*/\"",
"<token of kind 9>",
"\"<!--\"",
"\"-->\"",
"\"{\"",
"\"}\"",
"\"|=\"",
"\"^=\"",
"\"$=\"",
"\"*=\"",
"\"~=\"",
"\"=\"",
"\"+\"",
"\"-\"",
"\",\"",
"\";\"",
"\">\"",
"\"~\"",
"\"<\"",
"\"/\"",
"\"[\"",
"\"]\"",
"\"*\"",
"\"%\"",
"\"&\"",
"\".\"",
"\"(\"",
"\")\"",
"\"==\"",
"\"||\"",
"\"&&\"",
"\"!=\"",
"\":\"",
"<INTERPOLATION>",
"<NONASCII>",
"<H>",
"<UNICODE>",
"<ESCAPE>",
"<NMSTART>",
"<NMCHAR>",
"<STRINGCHAR>",
"<D>",
"<NAME>",
"\"to\"",
"\"through\"",
"\"in\"",
"\"from\"",
"\"@mixin\"",
"\"@include\"",
"\"@function\"",
"\"@return\"",
"\"@debug\"",
"\"@warn\"",
"\"@for\"",
"\"@each\"",
"\"@while\"",
"\"@if\"",
"\"@else\"",
"\"@extend\"",
"\"@-moz-document\"",
"\"@supports\"",
"\"@content\"",
"<MICROSOFT_RULE>",
"\"if\"",
"<GUARDED_SYM>",
"<STRING>",
"<IDENT>",
"<NUMBER>",
"<_URL>",
"<URL>",
"<VARIABLE>",
"<PERCENTAGE>",
"<PT>",
"<MM>",
"<CM>",
"<PC>",
"<IN>",
"<PX>",
"<EMS>",
"<LEM>",
"<REM>",
"<EXS>",
"<DEG>",
"<RAD>",
"<GRAD>",
"<MS>",
"<SECOND>",
"<HZ>",
"<KHZ>",
"<DIMEN>",
"<HASH>",
"\"@import\"",
"\"@media\"",
"\"@charset\"",
"\"@page\"",
"\"@font-face\"",
"<KEY_FRAME_SYM>",
"<ATKEYWORD>",
"<IMPORTANT_SYM>",
"<RANGE0>",
"<RANGE1>",
"<RANGE2>",
"<RANGE3>",
"<RANGE4>",
"<RANGE5>",
"<RANGE6>",
"<RANGE>",
"<UNI>",
"<UNICODERANGE>",
"<REMOVE>",
"<APPEND>",
"<CONTAINS>",
"<FUNCTION>",
"<UNKNOWN>",
};
}

+ 4985
- 4985
theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java
File diff suppressed because it is too large
View File


+ 17
- 0
theme-compiler/tests/resources/automatic/css/gradient.css View File

@@ -0,0 +1,17 @@
.top-gradient {
background: -moz-linear-gradient(
top,
rgb(216,220,225) 0,
rgb(255,255,255) 1em,
rgb(255,255,255) 100%);
background: -webkit-linear-gradient(
top,
rgb(216,220,225) 0,
rgb(255,255,255) 1em,
rgb(255,255,255) 100%);
background: linear-gradient(
to bottom,
rgb(216,220,225) 0%,
rgb(255,255,255) 5%,
rgb(255,255,255) 100%);
}

+ 17
- 0
theme-compiler/tests/resources/automatic/scss/gradient.scss View File

@@ -0,0 +1,17 @@
.top-gradient {
background: -moz-linear-gradient(
top,
rgb(216,220,225) 0,
rgb(255,255,255) 1em,
rgb(255,255,255) 100%);
background: -webkit-linear-gradient(
top,
rgb(216,220,225) 0,
rgb(255,255,255) 1em,
rgb(255,255,255) 100%);
background: linear-gradient(
to bottom,
rgb(216,220,225) 0%,
rgb(255,255,255) 5%,
rgb(255,255,255) 100%);
}

theme-compiler/tests/resources/sasslangbroken/css/385-test_newlines_removed_from_selectors_when_compressed.css → theme-compiler/tests/resources/sasslang/css/385-test_newlines_removed_from_selectors_when_compressed.css View File


theme-compiler/tests/resources/sasslangbroken/scss/385-test_newlines_removed_from_selectors_when_compressed.scss → theme-compiler/tests/resources/sasslang/scss/385-test_newlines_removed_from_selectors_when_compressed.scss View File


+ 8
- 3
theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java View File

@@ -73,14 +73,19 @@ public abstract class AbstractDirectoryScanningSassTests {
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, normalize(referenceCss),
normalize(parsedCss));
+ scssResourceName, normalizedReference, normalizedParsed);
}

private String normalize(String css) {
// Replace all whitespace characters with a single space
// Insert whitespace at each point
css = css.replaceAll("[\n\r\t ]*", " ");
// Replace multiple whitespace characters with a single space to compact
css = css.replaceAll("[\n\r\t ]+", " ");
// remove initial whitespace
css = css.replaceAll("^[\n\r\t ]*", "");
// remove trailing whitespace
css = css.replaceAll("[\n\r\t ]*$", "");
return css;

+ 41
- 0
uitest/src/com/vaadin/tests/components/accordion/AccordionTabStylenames.html View File

@@ -0,0 +1,41 @@
<?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.accordion.AccordionTabStylenames?restartApplication</td>
<td></td>
</tr>
<tr>
<td>assertCSSClass</td>
<td>vaadin=runcomvaadintestscomponentsaccordionAccordionTabStylenames::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VAccordion[0]/domChild[0]</td>
<td>v-accordion-item-tab0</td>
</tr>
<tr>
<td>assertCSSClass</td>
<td>vaadin=runcomvaadintestscomponentsaccordionAccordionTabStylenames::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VAccordion[0]/domChild[1]</td>
<td>v-accordion-item-tab1</td>
</tr>
<tr>
<td>assertCSSClass</td>
<td>vaadin=runcomvaadintestscomponentsaccordionAccordionTabStylenames::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VAccordion[0]/domChild[2]</td>
<td>v-accordion-item-tab2</td>
</tr>
<tr>
<td>assertCSSClass</td>
<td>vaadin=runcomvaadintestscomponentsaccordionAccordionTabStylenames::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VAccordion[0]/domChild[3]</td>
<td>v-accordion-item-tab3</td>
</tr>
</tbody></table>
</body>
</html>

+ 32
- 0
uitest/src/com/vaadin/tests/components/accordion/AccordionTabStylenames.java View File

@@ -0,0 +1,32 @@
package com.vaadin.tests.components.accordion;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet.Tab;

public class AccordionTabStylenames extends TestBase {

@Override
protected void setup() {
Accordion acc = new Accordion();
addComponent(acc);

for (int tabIndex = 0; tabIndex < 5; tabIndex++) {
Tab tab = acc.addTab(new Label("Tab " + tabIndex));
tab.setCaption("Tab " + tabIndex);
tab.setStyleName("tab" + tabIndex);
}
}

@Override
protected String getDescription() {
return null;
}

@Override
protected Integer getTicketNumber() {
return 10605;
}

}

+ 55
- 0
uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java View File

@@ -0,0 +1,55 @@
/*
* 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.combobox;

import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;

public class ComboBoxCursorPositionReset extends AbstractTestUI {

@Override
protected void setup(VaadinRequest request) {
final HorizontalLayout root = new HorizontalLayout();
root.setSizeFull();
setContent(root);

ComboBox combo = new ComboBox();
combo.setImmediate(true);
root.addComponent(combo);
combo.addItem("Hello World");
combo.addItem("Please click on the text");

combo.setValue("Please click on the text");
Label gap = new Label();
root.addComponent(gap);
root.setExpandRatio(gap, 1);

}

@Override
protected String getTestDescription() {
return "Clicking on the text in the ComboBox should position the caret where you clicked, not cause it to jump to the start or the end";
}

@Override
protected Integer getTicketNumber() {
return 11152;
}

}

+ 26
- 0
uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.html View File

@@ -0,0 +1,26 @@
<?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:7070" />
<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.layouts.VerticalLayoutSlotExpansionAndAlignment?restartApplication</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>no-scrollbars</td>
</tr>
</tbody></table>
</body>
</html>

+ 45
- 0
uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java View File

@@ -0,0 +1,45 @@
package com.vaadin.tests.layouts;

import com.vaadin.annotations.Theme;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;

@SuppressWarnings("serial")
public class VerticalLayoutSlotExpansionAndAlignment extends UI {

@Override
protected void init(VaadinRequest request) {

VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
setContent(layout);

HorizontalLayout header = new HorizontalLayout(new Label("HEADER"));
header.setHeight("100px");
header.setWidth("100%");
header.setStyleName(Reindeer.LAYOUT_WHITE);
layout.addComponent(header);

HorizontalLayout content = new HorizontalLayout(new Label("CONTENT"));
content.setSizeFull();
content.setStyleName(Reindeer.LAYOUT_BLUE);
layout.addComponent(content);

HorizontalLayout footer = new HorizontalLayout(new Label("FOOTER"));
footer.setHeight("150px");
footer.setWidth("100%");
footer.setStyleName(Reindeer.LAYOUT_BLACK);
layout.addComponent(footer);

// This break things
layout.setComponentAlignment(footer, Alignment.BOTTOM_LEFT);
layout.setExpandRatio(content, 1);

}

}

+ 124
- 21
uitest/src/com/vaadin/tests/navigator/NavigatorTest.html View File

@@ -18,8 +18,13 @@
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>1. Navigated to DefaultView with params</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>1. Navigated to DefaultView without params</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
<td>Default view:</td>
</tr>
<tr>
<td>click</td>
@@ -28,8 +33,13 @@
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>2. Navigated to ListView with params</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>2. Navigated to ListView without params</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]</td>
<td></td>
</tr>
<tr>
<td>assertLocation</td>
@@ -43,8 +53,13 @@
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>3. Navigated to EditView with params</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>3. Navigated to EditView without params</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VRichTextArea[0]</td>
<td></td>
</tr>
<tr>
<td>assertLocation</td>
@@ -53,12 +68,12 @@
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VTextField[0]</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[4]/VTextField[0]</td>
<td>56,6</td>
</tr>
<tr>
<td>enterCharacter</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VTextField[0]</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[4]/VTextField[0]</td>
<td>param=value</td>
</tr>
<tr>
@@ -68,9 +83,19 @@
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>4. Navigated to ListView with params param=value</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>param</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
<td>value</td>
</tr>
<tr>
<td>assertLocation</td>
<td>*#!list/param=value</td>
@@ -83,7 +108,7 @@
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>5. Navigated to EditView with params param=value</td>
</tr>
<tr>
@@ -98,7 +123,7 @@
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>6. Prevent navigation to ForbiddenView</td>
</tr>
<tr>
@@ -106,46 +131,124 @@
<td>*#!edit/param=value</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>7. Navigated to SpecialCharsView: öääö !%&amp;/()=; fragment: !öääö !%&amp;/()=/param=value</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
<td>öääö !%&amp;/()=</td>
</tr>
<tr>
<td>assertLocation</td>
<td>*#!%C3%B6%C3%A4%C3%A4%C3%B6%20!%25&amp;/()=/param=value</td>
<td></td>
</tr>
<tr>
<td>runScript</td>
<td>window.location.hash='!foo bar'</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>8. View 'foo bar' not found!</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
<td>Tried to navigate to foo bar but such a view could not be found :(</td>
</tr>
<tr>
<td>assertLocation</td>
<td>regex:.*#!foo( |%20)bar</td>
<td></td>
</tr>
<tr>
<td>runScript</td>
<td>window.location.hash='!/foo=bar'</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>9. Navigated to DefaultView with params foo=bar</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
<td>Default view: foo=bar</td>
</tr>
<tr>
<td>assertLocation</td>
<td>*#!/foo=bar</td>
<td></td>
</tr>
<tr>
<td>runScript</td>
<td>window.location.hash='!foo'</td>
<td>window.location.hash='foo bar'</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>7. View 'foo' not found!</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>10. Navigated to DefaultView without params</td>
</tr>
<tr>
<td>assertLocation</td>
<td>*#!foo</td>
<td>regex:.*#foo( |%20)bar</td>
<td></td>
</tr>
<!--
This test is broken in Safari 5; doing the same manually works fine
<tr>
<td>runScript</td>
<td>window.location.hash='foo'</td>
<td>window.location.hash='!öääö !%25&amp;/()='</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>8. Navigated to DefaultView with params</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::PID_SLog_row_0</td>
<td>10. Navigated to SpecialCharsView: öääö !%&amp;/()=; fragment: !öääö !%&amp;/()=</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestsnavigatorNavigatorTest::/VVerticalLayout[0]/Slot[6]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
<td>öääö !%&amp;/()=</td>
</tr>
<tr>
<td>assertLocation</td>
<td>*#foo</td>
<td>regex:.*#!(öääö !%|öääö !%25|%C3%B6%C3%A4%C3%A4%C3%B6%20!%25)&amp;/\(\)=</td>
<td></td>
</tr>
-->

</tbody></table>
</body>

+ 25
- 7
uitest/src/com/vaadin/tests/navigator/NavigatorTest.java View File

@@ -37,7 +37,9 @@ public class NavigatorTest extends UI {
@Override
public void enter(ViewChangeEvent event) {
String params = event.getParameters();
log.log("Navigated to ListView with params " + params);
log.log("Navigated to ListView "
+ (params.isEmpty() ? "without params" : "with params "
+ params));
removeAllItems();
for (String arg : params.split(",")) {
addItem(arg.split("=|$", 2), arg);
@@ -49,19 +51,33 @@ public class NavigatorTest extends UI {

@Override
public void enter(ViewChangeEvent event) {
log.log("Navigated to EditView with params "
+ event.getParameters());
setValue("Displaying edit view with parameters "
+ event.getParameters());
String params = event.getParameters();
log.log("Navigated to EditView "
+ (params.isEmpty() ? "without params" : "with params "
+ params));
setValue("Displaying edit view with parameters " + params);
}
}

class SpecialCharsView extends Label implements View {

@Override
public void enter(ViewChangeEvent event) {
log.log("Navigated to SpecialCharsView: " + event.getViewName()
+ "; fragment: " + getPage().getUriFragment());
setValue(event.getViewName());
}

}

class DefaultView extends Label implements View {

@Override
public void enter(ViewChangeEvent event) {
log.log("Navigated to DefaultView with params "
+ event.getParameters());
String params = event.getParameters();
log.log("Navigated to DefaultView "
+ (params.isEmpty() ? "without params" : "with params "
+ params));
setValue("Default view: " + event.getParameters());
}
}
@@ -123,6 +139,7 @@ public class NavigatorTest extends UI {

navi.addView("list", new ListView());
navi.addView("edit", new EditView());
navi.addView("öääö !%&/()=", new SpecialCharsView());
navi.addView("forbidden", new ForbiddenView());

navi.addViewChangeListener(new NaviListener());
@@ -132,6 +149,7 @@ public class NavigatorTest extends UI {
layout.addComponent(new NaviButton("list"));
layout.addComponent(new NaviButton("edit"));
layout.addComponent(new NaviButton("forbidden"));
layout.addComponent(new NaviButton("öääö !%&/()="));

layout.addComponent(params);
layout.addComponent(log);

Loading…
Cancel
Save