Convert UiBinder files to support gss. This patch extract inline style containing special rule that aren't compatible with gss in a separate CssResource interface so that we can provide the GSS version of the style. Change-Id: I89bc1c807fc1e4fb00af073d14f89b43555792ed
diff --git a/user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.ui.xml b/user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.ui.xml index 3eb8b1d..53d0846 100644 --- a/user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.ui.xml +++ b/user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.ui.xml
@@ -8,7 +8,6 @@ display: none; white-space: pre; } - </ui:style> <g:HTMLPanel> <div class="{style.errorLabel}" ui:field="errorLabel" />
diff --git a/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.css b/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.css index 25c04f5..7e6fdce 100644 --- a/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.css +++ b/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.css
@@ -1,3 +1,2 @@ .nativeHorizontalScrollbar { - -} \ No newline at end of file +}
diff --git a/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.ui.xml b/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.ui.xml index 54858d9..13eb5c6 100644 --- a/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.ui.xml +++ b/user/src/com/google/gwt/user/client/ui/NativeHorizontalScrollbar.ui.xml
@@ -1,7 +1,6 @@ <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder - xmlns:ui="urn:ui:com.google.gwt.uibinder" - xmlns:g="urn:import:com.google.gwt.user.client.ui"> + xmlns:ui="urn:ui:com.google.gwt.uibinder"> <ui:style> .viewport { @@ -23,7 +22,6 @@ .content { height: 1px; } - </ui:style> <!-- Viewport: reveals only the scrollbar from the scrollable div. -->
diff --git a/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.java b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.java index e4743b1..409d9c1 100644 --- a/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.java +++ b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.java
@@ -83,6 +83,24 @@ String DEFAULT_CSS = "com/google/gwt/user/client/ui/NativeVerticalScrollbarTransparent.css"; } + /** + * Client bundle used in the uibinder template. + */ + interface UiBinderBundle extends ClientBundle { + UiBinderBundle INSTANCE = GWT.create(UiBinderBundle.class); + + UiStyle nativeVerticalScrollbarUi(); + } + + /** + * Style used in uibinder template. These styles aren't intended to be extended. + */ + interface UiStyle extends CssResource { + String viewport(); + + String scrollable(); + } + private static Resources DEFAULT_RESOURCES; private static NativeVerticalScrollbarUiBinder uiBinder = GWT .create(NativeVerticalScrollbarUiBinder.class); @@ -131,6 +149,9 @@ style.ensureInjected(); getScrollableElement().addClassName(style.nativeVerticalScrollbar()); + // inject style used in uibinder + UiBinderBundle.INSTANCE.nativeVerticalScrollbarUi().ensureInjected(); + // Initialize the implementation. ScrollImpl.get().initialize(scrollable, contentDiv); }
diff --git a/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.ui.xml b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.ui.xml index bbb4a77..6902780 100644 --- a/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.ui.xml +++ b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbar.ui.xml
@@ -3,40 +3,17 @@ xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"> - <ui:style> - .viewport { - position: relative; - overflow: hidden; - /* Force the scrollbar into LTR mode so it is reliably aligned to the left. */ - direction: ltr; - } - /* scrollable is in LTR mode even if the body is in RTL mode. */ - @noflip { - .scrollable { - position: absolute; - top: 0; - right: 0; - height: 100%; - width: 100px; - overflow-y: scroll; - overflow-x: hidden; - } - } - - </ui:style> + <ui:with field="res" type="com.google.gwt.user.client.ui.NativeVerticalScrollbar.UiBinderBundle"/> <!-- Viewport: reveals only the scrollbar from the scrollable div. --> - <div - class="{style.viewport}"> + <div class="{res.nativeVerticalScrollbarUi.viewport}"> <!-- Scrollable: a scrollable div. --> - <div - ui:field="scrollable" - class="{style.scrollable}"> + <div ui:field="scrollable" class="{res.nativeVerticalScrollbarUi.scrollable}"> <!-- Content: controls how far the div can be scrolled. --> <div ui:field="contentDiv" /> </div> </div> -</ui:UiBinder> +</ui:UiBinder>
diff --git a/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbarUi.css b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbarUi.css new file mode 100644 index 0000000..029215b --- /dev/null +++ b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbarUi.css
@@ -0,0 +1,19 @@ +.viewport { + position: relative; + overflow: hidden; + /* Force the scrollbar into LTR mode so it is reliably aligned to the left. */ + direction: ltr; +} + +/* scrollable is in LTR mode even if the body is in RTL mode. */ +@noflip { + .scrollable { + position: absolute; + top: 0; + right: 0; + height: 100%; + width: 100px; + overflow-y: scroll; + overflow-x: hidden; + } +}
diff --git a/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbarUi.gss b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbarUi.gss new file mode 100644 index 0000000..25e3d4a --- /dev/null +++ b/user/src/com/google/gwt/user/client/ui/NativeVerticalScrollbarUi.gss
@@ -0,0 +1,17 @@ +.viewport { + position: relative; + overflow: hidden; + /* Force the scrollbar into LTR mode so it is reliably aligned to the left. */ + direction: ltr; +} + +/* scrollable is in LTR mode even if the body is in RTL mode. */ +.scrollable { + position: absolute; + top: 0; + /* @noflip */ right: 0; + height: 100%; + width: 100px; + overflow-y: scroll; + overflow-x: hidden; +}
diff --git a/user/src/com/google/gwt/user/client/ui/NotificationMole.ui.xml b/user/src/com/google/gwt/user/client/ui/NotificationMole.ui.xml index a075b0b..e5e6d3a 100644 --- a/user/src/com/google/gwt/user/client/ui/NotificationMole.ui.xml +++ b/user/src/com/google/gwt/user/client/ui/NotificationMole.ui.xml
@@ -25,7 +25,6 @@ font-family: Helvetica; font-size: 1em; } - </ui:style> <g:HTMLPanel styleName='{style.container}'> <div class='{style.centered}' style='display:none' ui:field='borderElement'>