Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IE and Firefox #65

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6509f1a
[maven-release-plugin] prepare release 2.0.0-rc2
dankurka Aug 30, 2014
13d22a9
[maven-release-plugin] prepare for next development iteration
dankurka Aug 30, 2014
68362f7
Add more editor support
kfa Aug 31, 2014
e3df001
Merge pull request #198 from kfa/editor
dankurka Aug 31, 2014
a64ba6d
[maven-release-plugin] prepare release 2.0.0
dankurka Sep 1, 2014
70bcba3
Merge branch 'master' of github.com:mgwt/mgwt
dankurka Sep 1, 2014
7e46ed4
[maven-release-plugin] rollback the release of 2.0.0
dankurka Sep 1, 2014
f6f11ea
[maven-release-plugin] prepare release 2.0.0
dankurka Sep 1, 2014
933f1c8
[maven-release-plugin] prepare for next development iteration
dankurka Sep 1, 2014
4b207e2
Fixed spelling error in the word "appearance".
Sep 2, 2014
782a3bc
Merge pull request #199 from volgin/master
dankurka Sep 2, 2014
30c78c0
Added "space-around" option to Justification. I see no reason to leave
Sep 4, 2014
eaf7215
Merge pull request #202 from volgin/master
dankurka Sep 4, 2014
5075c0a
Fixed spelling error.
Sep 6, 2014
f1ddcce
Merge pull request #203 from volgin/master
dankurka Sep 7, 2014
87b6344
Fixed CSS typos in FlexPropertyHelper.
kfa Sep 17, 2014
ca2b6ed
Merge pull request #206 from kfa/fix_css_property_typo
dankurka Sep 17, 2014
772855d
Added missing ensureInjected calls.
kfa Sep 19, 2014
daaad59
Merge pull request #207 from kfa/add_missing_ensureInjected
kfa Sep 19, 2014
3fd1752
Changed mgwt to work with GWT 2.7
kfa Sep 30, 2014
8189238
Merge pull request #210 from kfa/update_mgwt_to_run_with_gwt2.7
dankurka Sep 30, 2014
791d238
Replaced flex-flow with flex-direction to avoid conflicts when
Oct 24, 2014
fa17fbf
Merge pull request #215 from volgin/master
kfa Oct 29, 2014
de4deab
Add HasText to the implemented interfaces of MValueBoxBase
ankon Oct 30, 2014
096c6a3
Merge pull request #216 from ankon/gwt27-hastext
dankurka Nov 4, 2014
500875e
First draft of WP8/WP8.1 (desktop IE10, mobile IE10) support. Includes
Nov 28, 2014
57c9cd2
Capture pointer events by default so we get the same behaviour as IOS.
Dec 3, 2014
0a6c6f3
do not blurBeforeAnimation if the node is the body element since this
Dec 4, 2014
c14b79f
on going fixes. For ie10 use -ms-flex: 1 1 instead of -ms-flex: 1 since
Dec 5, 2014
ada6a14
for ie10/ie11 desktop needed to add a focus fix where when using pointer
Dec 8, 2014
7851c24
capturing pointer events on input or textarea elements causes many
Dec 9, 2014
3cbd91a
remove drop down arrow on select
Dec 9, 2014
64d970f
fixed issue where scroll panel did not work on windows phone 8.1 update
Dec 11, 2014
b203691
added flexwrap to FlexInputHelper, corrected name of MozAlignSelf in
Dec 19, 2014
b449d58
Need access to ButtonBaseAppearance so subclass can override the default
Jan 6, 2015
b7066e4
Added correct orientation support for windows phone 8.1
Jan 15, 2015
8854416
In IEOrientationHandler removed window.alert left in by mistake. Added
Jan 16, 2015
468769b
Avoid long emulation in ScrollPanel
Jan 22, 2015
8455a9f
fix minor bug when specifying ie10 compatibility. Does not seem to make
Jan 22, 2015
a0ef769
due to poor performance of ScrollPanel in IE10/11 when a reasonable
Jan 22, 2015
3ed8944
removed -ms-touch-action: none, which is applied to elements since need
Jan 22, 2015
b741698
Only apply ios71 body bug fix when ios71. Also stop possible re-creation
Jan 23, 2015
e7a3bee
Added more position information to the TapEvent via the Touch object.
Mar 10, 2015
d2c974c
Updated to use GWT 2.7
Jun 5, 2015
f547166
Support for IE and Firefox
Maurycy-Sokolowski Sep 12, 2015
96037de
Modified snapshot name
Maurycy-Sokolowski Sep 12, 2015
306012f
Merge branch 'wp8-mgwt-2' of https://github.com/paulfrench/mgwt
Maurycy-Sokolowski Sep 21, 2015
8aa21fd
Fixes for IEEdge
Maurycy-Sokolowski Dec 7, 2015
b9f2aea
Added print button
Maurycy-Sokolowski Jan 28, 2016
fa5423e
Corrected edge stuff
Maurycy-Sokolowski May 7, 2016
d857ea6
Updated some dependencies
Maurycy-Sokolowski May 9, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ mgwt.iml
gwt-unitCache
war/
www-test/
/bin
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

<groupId>com.googlecode.mgwt</groupId>
<artifactId>mgwt</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mgwt</name>

<properties>
<gwtversion>2.6.1</gwtversion>
<gwtversion>2.7.0</gwtversion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down Expand Up @@ -53,10 +53,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

Expand Down Expand Up @@ -111,7 +111,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<version>2.19.1</version>
<configuration>
<includes>
<include>**/*Test.java</include>
Expand All @@ -127,7 +127,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.6.1</version>
<version>2.7.0</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -166,7 +166,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<version>4.12</version>
<type>jar</type>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -198,13 +198,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.gwt.gwtmockito</groupId>
<artifactId>gwtmockito</artifactId>
<version>1.1.3</version>
<version>1.1.6</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
67 changes: 67 additions & 0 deletions src/main/java/com/google/gwt/user/client/impl/DOMImplIE10.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2013 Google Inc.
*
* 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.google.gwt.user.client.impl;

import com.google.gwt.core.client.JavaScriptObject;


/**
* IE10 implementation of {@link com.google.gwt.user.client.impl.DOMImplStandard}.
*/
public class DOMImplIE10 extends DOMImplIE9 {

static
{
DOMImplStandard.addCaptureEventDispatchers(getCaptureEventDispatchers());
DOMImplStandard.addBitlessEventDispatchers(getBitlessEventDispatchers());
capturePointerEvents();
}

/**
* Lets have the same behaviour as IOS where the target element continues to receive Pointer events
* even when the pointer has moved off the element up until MSPointerUp has occurred.
*
* Do not do pointer capture on input or textarea elements, all sorts of problems arise if you do!
*/
private native static void capturePointerEvents() /*-{
$wnd.addEventListener('MSPointerDown',
$entry(function(evt) {
if ((evt.target.tagName !== 'INPUT') && (evt.target.tagName !== 'TEXTAREA')) {
evt.target.msSetPointerCapture(evt.pointerId);
}
}), true);
}-*/;


public static native JavaScriptObject getCaptureEventDispatchers() /*-{
return {
MSPointerDown: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*),
MSPointerUp: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*),
MSPointerMove: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*),
MSPointerCancel: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*)
};
}-*/;

public static native JavaScriptObject getBitlessEventDispatchers() /*-{
return {
MSPointerDown: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*),
MSPointerUp: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*),
MSPointerMove: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*),
MSPointerCancel: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*)
};
}-*/;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

package com.google.gwt.useragent.rebind;

import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.linker.ConfigurationProperty;
import com.google.gwt.core.ext.linker.PropertyProviderGenerator;
import com.google.gwt.user.rebind.SourceWriter;
import com.google.gwt.user.rebind.StringSourceWriter;

import java.util.HashSet;
import java.util.Set;
import java.util.SortedSet;

/**
* Generator which writes out the JavaScript for determining the value of the
* <code>user.agent</code> selection property.
*/
public class UserAgentPropertyGenerator implements PropertyProviderGenerator {

/**
* The list of {@code user.agent} values listed here should be kept in sync with
* {@code UserAgent.gwt.xml}.
* <p>Note that the order of enums matter as the script selection is based on running
* these predicates in order and matching the first one that returns {@code true}.
* <p> Also note that, {@code docMode < 11} in predicates for older IEs exists to
* ensures we never choose them for IE11 (we know that they will not work for IE11).
*/
private enum UserAgent {
safari("return ((ua.indexOf('webkit') != -1) && !(ua.indexOf('trident') != -1));"),
ie10("return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11)) || "
+ "(ua.indexOf('iemobile') != -1 && (docMode >= 10 && docMode < 11))"),
ie9("return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));"),
ie8("return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));"),
gecko1_8("return (ua.indexOf('gecko') != -1 || docMode >= 11);");

private final String predicateBlock;

private UserAgent(String predicateBlock) {
this.predicateBlock = predicateBlock;
}

private static Set<String> getKnownAgents() {
HashSet<String> userAgents = new HashSet<String>();
for (UserAgent userAgent : values()) {
userAgents.add(userAgent.name());
}
return userAgents;
}
}

/**
* Writes out the JavaScript function body for determining the value of the
* <code>user.agent</code> selection property. This method is used to create
* the selection script and by {@link UserAgentGenerator} to assert at runtime
* that the correct user agent permutation is executing.
*/
static void writeUserAgentPropertyJavaScript(SourceWriter body,
SortedSet<String> possibleValues, String fallback) {

// write preamble
body.println("var ua = navigator.userAgent.toLowerCase();");
body.println("var docMode = $doc.documentMode;");

for (UserAgent userAgent : UserAgent.values()) {
// write only selected user agents
if (possibleValues.contains(userAgent.name())) {
body.println("if ((function() { ");
body.indentln(userAgent.predicateBlock);
body.println("})()) return '%s';", userAgent.name());
}
}

// default return
if (fallback == null) {
fallback = "unknown";
}
body.println("return '" + fallback + "';");
}

@Override
public String generate(TreeLogger logger, SortedSet<String> possibleValues, String fallback,
SortedSet<ConfigurationProperty> configProperties) {
assertUserAgents(logger, possibleValues);

StringSourceWriter body = new StringSourceWriter();
body.println("{");
body.indent();
writeUserAgentPropertyJavaScript(body, possibleValues, fallback);
body.outdent();
body.println("}");

return body.toString();
}

private static void assertUserAgents(TreeLogger logger, SortedSet<String> possibleValues) {
HashSet<String> unknownValues = new HashSet<String>(possibleValues);
unknownValues.removeAll(UserAgent.getKnownAgents());
if (!unknownValues.isEmpty()) {
logger.log(TreeLogger.WARN, "Unrecognized " + UserAgentGenerator.PROPERTY_USER_AGENT
+ " values " + unknownValues + ", possibly due to UserAgent.gwt.xml and "
+ UserAgentPropertyGenerator.class.getName() + " being out of sync.");
}
}
}
28 changes: 27 additions & 1 deletion src/main/java/com/googlecode/mgwt/dom/DOM.gwt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@

// Detect form factor from user agent.
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) {
if (ua.indexOf("windows phone 8") != -1) {
// windows phone 8/8.1
return "phone";
} else if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) {
// iphone and ipod.
return "phone";
} else if (ua.indexOf("ipad") != -1) {
Expand All @@ -57,6 +60,14 @@
]]></property-provider>
<define-property name="mgwt.density" values="mid, high, xhigh" />
<property-provider name="mgwt.density"><![CDATA[
if (!window.devicePixelRatio) {
try {
if ('deviceXDPI' in screen) {
window.devicePixelRatio = screen.deviceXDPI / screen.logicalXDPI;
}
}
catch(e) {}
}
if (!window.devicePixelRatio) {
return 'mid';
}
Expand All @@ -78,4 +89,19 @@
<replace-with class="com.googlecode.mgwt.dom.client.recognizer.EventPropagatorMobileImpl">
<when-type-is class="com.googlecode.mgwt.dom.client.recognizer.EventPropagator"/>
</replace-with>

<replace-with class="com.googlecode.mgwt.dom.client.recognizer.EventPropagatorStandardImpl">
<when-type-is class="com.googlecode.mgwt.dom.client.recognizer.EventPropagator"/>
<all>
<when-property-is name="user.agent" value="ie10" />
</all>
</replace-with>

<replace-with class="com.google.gwt.user.client.impl.DOMImplIE10">
<when-type-is class="com.google.gwt.user.client.impl.DOMImpl"/>
<all>
<when-property-is name="user.agent" value="ie10"/>
</all>
</replace-with>

</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 2013 Google Inc.
*
* 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.googlecode.mgwt.dom.client.event.pointer;

import com.google.gwt.event.dom.client.DomEvent;

/**
* Represents a native MsPointerCancelEvent.
*/
public class MsPointerCancelEvent extends MsPointerEvent<MsPointerCancelHandler> {

/**
* Event type for MsPointerCancelEvent. Represents the meta-data associated with
* this event.
*/
private static final Type<MsPointerCancelHandler> TYPE = new Type<MsPointerCancelHandler>(
MsPointerEvent.MSPOINTERCANCEL, new MsPointerCancelEvent());

/**
* Gets the event type associated with pointer cancel events.
*
* @return the handler type
*/
public static Type<MsPointerCancelHandler> getType() {
return TYPE;
}

/**
* Protected constructor, use
* {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)}
* to fire pointer up events.
*/
protected MsPointerCancelEvent() {
}

@Override
public final Type<MsPointerCancelHandler> getAssociatedType() {
return TYPE;
}

@Override
protected void dispatch(MsPointerCancelHandler handler) {
handler.onPointerCancel(this);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2013 Google Inc.
*
* 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.googlecode.mgwt.dom.client.event.pointer;

import com.google.gwt.event.shared.EventHandler;

/**
* Handler interface for {@link MsPointerCancelEvent} events.
*/
public interface MsPointerCancelHandler extends EventHandler {

/**
* Called when MsPointerCancelEvent is fired.
*
* @param event the {@link MsPointerCancelEvent} that was fired
*/
void onPointerCancel(MsPointerCancelEvent event);
}
Loading