[gwt-contrib] Turn on the null groups tests, now the gwt null varargs bug is fixed. (issue1288803)
Reviewers: rchandia, Description: Turn on the null groups tests, now the gwt null varargs bug is fixed. [JSR 303 TCK Result] 64 of 257 (24.90%) Pass with 26 Failures and 4 Errors. Please review this at http://gwt-code-reviews.appspot.com/1288803/show Affected files: M user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java M user/test/org/hibernate/jsr303/tck/tests/validation/ValidateValueGwtTest.java Index: user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java === --- user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java (revision 9574) +++ user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java (working copy) @@ -30,7 +30,6 @@ delegate.testIllegalArgumentExceptionIsThrownForNullValue(); } - @Failing(issue = 5804) public void testPassingNullAsGroup() { delegate.testPassingNullAsGroup(); } Index: user/test/org/hibernate/jsr303/tck/tests/validation/ValidateValueGwtTest.java === --- user/test/org/hibernate/jsr303/tck/tests/validation/ValidateValueGwtTest.java (revision 9574) +++ user/test/org/hibernate/jsr303/tck/tests/validation/ValidateValueGwtTest.java (working copy) @@ -39,7 +39,6 @@ delegate.testValidateValueFailure(); } - @Failing(issue = 5804) public void testValidateValuePassingNullAsGroup() { delegate.testValidateValuePassingNullAsGroup(); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Add option to use JSONP in ExternalTextResource (issue1310801)
Reviewers: robertvawter, Description: Add option to use JSONP in ExternalTextResource Review by: robertvaw...@google.com Please review this at http://gwt-code-reviews.appspot.com/1310801/show Affected files: M tools/api-checker/config/gwt21_22userApi.conf M user/src/com/google/gwt/jsonp/client/JsonpRequest.java M user/src/com/google/gwt/jsonp/client/JsonpRequestBuilder.java M user/src/com/google/gwt/resources/Resources.gwt.xml M user/src/com/google/gwt/resources/client/impl/ExternalTextResourcePrototype.java M user/src/com/google/gwt/resources/rg/ExternalTextResourceGenerator.java M user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java A user/test/com/google/gwt/resources/ExternalTextResourceJsonp.gwt.xml M user/test/com/google/gwt/resources/ResourcesSuite.java A user/test/com/google/gwt/resources/client/ExternalTextResourceJsonpTest.java A user/test/com/google/gwt/resources/client/ExternalTextResourceTest.java M user/test/com/google/gwt/resources/client/TextResourceTest.java A user/test/com/google/gwt/resources/client/shouldBeEscaped.txt -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9574 committed - Fix handling of null passed into varargs....
Revision: 9574 Author: sco...@google.com Date: Wed Jan 19 14:08:56 2011 Log: Fix handling of null passed into varargs. Fixes a bug where passing null into a varargs method in web mode would create a 1-length array containing null. The correct behavior is to pass null in for the array. Found by: rchandia Review by: cromwell...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9574 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java /trunk/user/test/com/google/gwt/dev/jjs/test/VarargsTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java Tue Oct 5 11:03:13 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java Wed Jan 19 14:08:56 2011 @@ -2051,10 +2051,11 @@ } } -private void addCallArgs(Expression[] args, JMethodCall call, +private void addCallArgs(Expression[] jdtArgs, JMethodCall call, MethodBinding binding) { - if (args == null) { -args = new Expression[0]; + JExpression[] args = new JExpression[jdtArgs == null ? 0 : jdtArgs.length]; + for (int i = 0; i < args.length; ++i) { +args[i] = dispProcessExpression(jdtArgs[i]); } TypeBinding[] params = binding.parameters; @@ -2072,32 +2073,29 @@ } for (int i = 0; i < n; ++i) { -call.addArg(dispProcessExpression(args[i])); +call.addArg(args[i]); } if (binding.isVarargs()) { // Handle the last arg. -JArrayType type = (JArrayType) typeMap.get(params[n]); +JArrayType lastParamType = (JArrayType) typeMap.get(params[n]); // See if there is only one arg and it's an array of the correct dims. if (args.length == n + 1) { - JType lastArgType = (JType) typeMap.get(args[n].resolvedType); - if (lastArgType instanceof JArrayType) { -JArrayType lastArgArrayType = (JArrayType) lastArgType; -if (lastArgArrayType.getDims() == type.getDims()) { - // Looks like it's already an array. - call.addArg(dispProcessExpression(args[n])); - return; -} + if (program.typeOracle.canTriviallyCast(args[n].getType(), + lastParamType)) { +// Looks like it's already an array. +call.addArg(args[n]); +return; } } List initializers = new ArrayList(); for (int i = n; i < args.length; ++i) { - initializers.add(dispProcessExpression(args[i])); + initializers.add(args[i]); } JNewArray newArray = JNewArray.createInitializers(program, -call.getSourceInfo(), type, initializers); +call.getSourceInfo(), lastParamType, initializers); call.addArg(newArray); } } === --- /trunk/user/test/com/google/gwt/dev/jjs/test/VarargsTest.java Fri Apr 4 09:22:37 2008 +++ /trunk/user/test/com/google/gwt/dev/jjs/test/VarargsTest.java Wed Jan 19 14:08:56 2011 @@ -27,6 +27,13 @@ public String getModuleName() { return "com.google.gwt.dev.jjs.CompilerSuite"; } + + public void testNullEmpty() { +assertNotNull(vararg()); +assertNull(vararg(null)); +assertNotNull(vararg((String) null)); +assertNull(vararg((String[]) null)); + } public void testVararg() { String[] expected = new String[] {"1", "2", "3"}; -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9573 committed - Rolling back...
Revision: 9573 Author: r...@google.com Date: Wed Jan 19 12:13:57 2011 Log: Rolling back *** Reason for rollback *** Causing test failures *** Original change description *** Optimize redundant 'switch' statements Review at http://gwt-code-reviews.appspot.com/1286801 http://code.google.com/p/google-web-toolkit/source/detail?r=9573 Deleted: /trunk/dev/core/src/com/google/gwt/dev/js/JsDuplicateCaseFolder.java /trunk/dev/core/test/com/google/gwt/dev/js/JsDuplicateCaseFolderTest.java Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsBlock.java /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsBreak.java /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsIf.java === --- /trunk/dev/core/src/com/google/gwt/dev/js/JsDuplicateCaseFolder.java Tue Jan 18 10:26:55 2011 +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2011 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.dev.js; - -import com.google.gwt.dev.js.ast.JsBlock; -import com.google.gwt.dev.js.ast.JsContext; -import com.google.gwt.dev.js.ast.JsModVisitor; -import com.google.gwt.dev.js.ast.JsProgram; -import com.google.gwt.dev.js.ast.JsStatement; -import com.google.gwt.dev.js.ast.JsSwitch; -import com.google.gwt.dev.js.ast.JsSwitchMember; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * Combine case labels with identical bodies. Case bodies that may fall through - * to the following case label and case bodies following a possible fallthrough - * are left undisturbed. - * - * For example, consider the following input: - * - * - * switch (x) { - * case 0: y = 17; break; - * case 1: if (z == 0) { y = 18; break; } else { y = 19 } // fallthrough else - * case 2: return 22; - * case 3: if (z == 0) { y = 18; break; } else { y = 19 } // fallthrough else - * case 4: y = 17; break; - * case 5: y = 17; break; - * case 6: return 22; - * } - * - * - * This will be transformed into: - * - * - * switch (x) { - * case 0: y = 17; break; - * case 1: if (z == 0) { y = 18; break; } else { y = 19 } - * case 6: case 2: return 22; - * case 3: if (z == 0) { y = 18; break; } else { y = 19 } - * case 5: case 4: y = 17; break; - * } - * - * - * - * Cases (2, 6) and (4, 5) have been coalesced. Note that case 0 has not been - * combined with cases 4 and 5 since case 4 cannot be moved due to the potential - * fallthrough from case 3, and we currently only coalesce a given cases with a - * preceding case and so cannot move case 0 downward. - * - * Although this pattern is unlikely to occur frequently in hand-written code, - * it can account for a significant amount of space in generated code. - */ -public class JsDuplicateCaseFolder { - - private class DuplicateCaseFolder extends JsModVisitor { - -public DuplicateCaseFolder() { -} - -@Override -public boolean visit(JsSwitch x, JsContext ctx) { - boolean modified = false; - - // A map from case body source code to the original case label - // in which they appeared - Map seen = new HashMapJsSwitchMember>(); - - // Original list of members - List cases = x.getCases(); - // Coalesced list of members - List newCases = new LinkedList(); - - // Keep track of whether the previous case can fall through - // to the current case - boolean hasPreviousFallthrough = false; - - // Iterate over members and locate ones with bodies identical to - // previous members - for (JsSwitchMember member : cases) { -List stmts = member.getStmts(); - -// Don't rewrite any cases that might fall through -if (!unconditionalControlBreak(stmts)) { - hasPreviousFallthrough = true; - // copy the case into the output - newCases.add(member); - continue; -} - -String body = toSource(stmts); -JsSwitchMember previousCase = seen.get(body); -if (previousCase == null || hasPreviousFallthrough) { - // Don't coalesce a case that can be reached via fallthrough - // from the previous case - newCases.add(member); - seen.put(body, member); -} else { - // Locate the position of the case that this case is to be - // coalesced with. Note: linear search i
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
Added UiBinder support + tests. Also made changes to the javadoc http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
Implemented most of John's changes http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Initial version of HTML5 Storage (issue1290802)
Reviewers: drfibonacci, Description: This is the code contribution from project gwt-mobile-webkit, the 'storage API' subproject. Please review this at http://gwt-code-reviews.appspot.com/1290802/show Affected files: user/src/com/google/gwt/storage/Storage.gwt.xml user/src/com/google/gwt/storage/client/Storage.java user/src/com/google/gwt/storage/client/StorageEvent.java user/src/com/google/gwt/storage/client/StorageEventHandler.java user/src/com/google/gwt/storage/client/StorageMap.java user/src/com/google/gwt/storage/client/impl/StorageEventImpl.java user/src/com/google/gwt/storage/client/impl/StorageEventImplIE8.java user/src/com/google/gwt/storage/client/impl/StorageImpl.java user/src/com/google/gwt/storage/client/impl/StorageImplIE8.java user/src/com/google/gwt/storage/client/impl/StorageImplMozilla.java user/src/com/google/gwt/storage/client/package.html user/test/com/google/gwt/storage/StorageSuite.java user/test/com/google/gwt/storage/StorageTestModule.gwt.xml user/test/com/google/gwt/storage/client/MapInterfaceTest.java user/test/com/google/gwt/storage/client/StorageMapTest.java user/test/com/google/gwt/storage/client/StorageTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
Recreated patch from trunk http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
Addresses rjrjr's comments and fixed a bug with CustomButton in the Caption http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
http://gwt-code-reviews.appspot.com/1149803/diff/1/3 File user/src/com/google/gwt/user/client/ui/DialogBox.java (right): http://gwt-code-reviews.appspot.com/1149803/diff/1/3#newcode116 user/src/com/google/gwt/user/client/ui/DialogBox.java:116: * your own risk. On 2011/01/04 18:41:53, rjrjr wrote: Now that it's actually useful to implement the interface, I don't think we can keep this disclaimer. Done. http://gwt-code-reviews.appspot.com/1149803/diff/1/3#newcode320 user/src/com/google/gwt/user/client/ui/DialogBox.java:320: public void setCaption(Caption caption) { On 2011/01/04 18:41:53, rjrjr wrote: Your removal code here looks wrong, and I don't think it's worth making it right. Instead make the caption an optional constructor argument, not a settable property. Anyone who wants that kind of flexibility and its headaches can provide a caption that extends Panel or something. I figured that allowing the setting of the header would make it cleaner to add a custom header via ui:binder. That being said it isn't the prettiest of code. I've changed this to your suggestion and made it immutable via the constructor http://gwt-code-reviews.appspot.com/1149803/diff/1/3#newcode338 user/src/com/google/gwt/user/client/ui/DialogBox.java:338: caption.asWidget().setStyleName("Caption"); On 2011/01/04 18:41:53, rjrjr wrote: If we're accepting someone else's widget, it seems wrong to clobber their style name. Good catch. Done. http://gwt-code-reviews.appspot.com/1149803/diff/1/3#newcode343 user/src/com/google/gwt/user/client/ui/DialogBox.java:343: * Sets the html string inside the caption. On 2011/01/04 18:41:53, rjrjr wrote: " by calling its {@link #setHTML(SafeHTML)} method." Done. http://gwt-code-reviews.appspot.com/1149803/diff/1/3#newcode355 user/src/com/google/gwt/user/client/ui/DialogBox.java:355: * Sets the html string inside the caption. On 2011/01/04 18:41:53, rjrjr wrote: " by calling its {@link #setHTML(String)} method." Done. http://gwt-code-reviews.appspot.com/1149803/diff/1/3#newcode367 user/src/com/google/gwt/user/client/ui/DialogBox.java:367: * Sets the text inside the caption. On 2011/01/04 18:41:53, rjrjr wrote: " by calling its {@link #setText(SafeHTML)} method." Done. http://gwt-code-reviews.appspot.com/1149803/diff/1/3#newcode486 user/src/com/google/gwt/user/client/ui/DialogBox.java:486: protected void registerMouseHandlers() { On 2011/01/04 18:41:53, rjrjr wrote: won't need this with immutable caption Done. http://gwt-code-reviews.appspot.com/1149803/diff/1/2 File user/test/com/google/gwt/user/client/ui/DialogBoxTest.java (right): http://gwt-code-reviews.appspot.com/1149803/diff/1/2#newcode158 user/test/com/google/gwt/user/client/ui/DialogBoxTest.java:158: // TODO Auto-generated method stub On 2011/01/04 18:41:53, rjrjr wrote: snip done http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
http://gwt-code-reviews.appspot.com/1149803/show Thanks so much for reviewing this guys. @Ray, Do you want me to go back to allowing a setter for the caption? http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001 File user/src/com/google/gwt/user/client/ui/DialogBox.java (right): http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode113 user/src/com/google/gwt/user/client/ui/DialogBox.java:113: public interface Caption extends HasAllMouseHandlers, HasHTML, IsWidget { On 2011/01/18 15:59:56, jlabanca wrote: Replace HasHTML with HasSafeHtml. We're moving away from String html methods. if Caption doesn't implement HasHTML, DialogBox#getHTML() gets ugly. I've added the HasSafeHtml interface but left HasHTML there to keep getHTML() clean. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode184 user/src/com/google/gwt/user/client/ui/DialogBox.java:184: * auto-hide is set to false and It should On 2011/01/18 15:59:56, jlabanca wrote: and IT => and it Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode210 user/src/com/google/gwt/user/client/ui/DialogBox.java:210: * Creates an empty dialog box specifying its "auto-hide" property and an implementation of the {@link Caption}. It should On 2011/01/18 15:59:56, jlabanca wrote: long line Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode214 user/src/com/google/gwt/user/client/ui/DialogBox.java:214: * @param autoHide On 2011/01/18 15:59:56, jlabanca wrote: copy param descriptions from other constructors. Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode298 user/src/com/google/gwt/user/client/ui/DialogBox.java:298: // not fire its click event for example On 2011/01/18 15:59:56, jlabanca wrote: For multiline comments, use /* comments: /* * line 0 * line 1 */ Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode351 user/src/com/google/gwt/user/client/ui/DialogBox.java:351: * {@link #setHTML(SafeHTML)} method.. On 2011/01/18 15:59:56, jlabanca wrote: extra . Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode359 user/src/com/google/gwt/user/client/ui/DialogBox.java:359: setHTML(html.asString()); On 2011/01/18 15:59:56, jlabanca wrote: assuming HasSafeHtml interface: caption.setHTML(html); Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23001#newcode372 user/src/com/google/gwt/user/client/ui/DialogBox.java:372: caption.setHTML(html); On 2011/01/18 15:59:56, jlabanca wrote: caption.setHTML(SafeHtmlUtils.fromTrustedString(html)) Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23002 File user/test/com/google/gwt/user/client/ui/DialogBoxTest.java (right): http://gwt-code-reviews.appspot.com/1149803/diff/22001/23002#newcode97 user/test/com/google/gwt/user/client/ui/DialogBoxTest.java:97: assertEquals(dialogBox.getHTML(), "text"); On 2011/01/18 15:59:56, jlabanca wrote: Some browser capitalize HTML automatically. Use: dialogBox.getHTML().toLowercase(); Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23002#newcode100 user/test/com/google/gwt/user/client/ui/DialogBoxTest.java:100: assertTrue(caption.asWidget().getElement() == DOM.getChild(td, 0)); On 2011/01/18 15:59:56, jlabanca wrote: cleanup after the test: dialogBox.hide(); Done. http://gwt-code-reviews.appspot.com/1149803/diff/22001/23002#newcode103 user/test/com/google/gwt/user/client/ui/DialogBoxTest.java:103: private class CaptionForTesting extends Composite implements On 2011/01/18 15:59:56, jlabanca wrote: Move class definition to the top of the test class. Done. http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
On 2011/01/18 16:02:21, jlabanca wrote: Also, can you sign a CLA so we can accept patch. If you scroll down to the bottom of the link below, you can sign it electronically. http://code.google.com/legal/individual-cla-v1.0.html Done. http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: First pass at Issue 1405 (Dialog Box header fix) (issue1149803)
I know this isn't 100% perfect, but this was my first time looking at the ui:binder code. See comments below on some areas that I know need improvement. http://gwt-code-reviews.appspot.com/1149803/diff/40001/41002 File user/src/com/google/gwt/uibinder/elementparsers/DialogBoxParser.java (left): http://gwt-code-reviews.appspot.com/1149803/diff/40001/41002#oldcode72 user/src/com/google/gwt/uibinder/elementparsers/DialogBoxParser.java:72: DialogBox.class.getCanonicalName())); I made this a method because I'm working on ResizeDialogBox and with this as a protected method, I'll be able to reuse the handleConstructorArgs. http://gwt-code-reviews.appspot.com/1149803/diff/40001/41002 File user/src/com/google/gwt/uibinder/elementparsers/DialogBoxParser.java (right): http://gwt-code-reviews.appspot.com/1149803/diff/40001/41002#newcode80 user/src/com/google/gwt/uibinder/elementparsers/DialogBoxParser.java:80: protected String getPackage(XMLElement element) { There has to be a cleaner way of doing this... I just couldn't find the right method call. http://gwt-code-reviews.appspot.com/1149803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9572 committed - Fixing HasWidgetsTester#testAll to actually call testDoDetachChildrenW...
Revision: 9572 Author: jlaba...@google.com Date: Wed Jan 19 08:59:29 2011 Log: Fixing HasWidgetsTester#testAll to actually call testDoDetachChildrenWithError. Currently, it calls testDoAttachChildrenWithError twice. HTMLTableTestBase needs to be modified to work with the test. Review at http://gwt-code-reviews.appspot.com/1300801 Review by: p...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9572 Modified: /trunk/user/test/com/google/gwt/user/client/ui/HTMLTableTestBase.java /trunk/user/test/com/google/gwt/user/client/ui/HasWidgetsTester.java === --- /trunk/user/test/com/google/gwt/user/client/ui/HTMLTableTestBase.java Tue Sep 21 07:53:19 2010 +++ /trunk/user/test/com/google/gwt/user/client/ui/HTMLTableTestBase.java Wed Jan 19 08:59:29 2011 @@ -33,8 +33,10 @@ */ public abstract class HTMLTableTestBase extends GWTTestCase { static class Adder implements HasWidgetsTester.WidgetAdder { +private int row = -1; + public void addChild(HasWidgets container, Widget child) { - ((HTMLTable) container).setWidget(0, 0, child); + ((HTMLTable) container).setWidget(++row, 0, child); } } @@ -67,7 +69,7 @@ public abstract HTMLTable getTable(int row, int column); public void testAttachDetachOrder() { -HasWidgetsTester.testAll(getTable(1, 1), new Adder(), true); +HasWidgetsTester.testAll(getTable(25, 1), new Adder(), true); } public void testBoundsOnEmptyTable() { === --- /trunk/user/test/com/google/gwt/user/client/ui/HasWidgetsTester.java Wed Sep 23 10:15:52 2009 +++ /trunk/user/test/com/google/gwt/user/client/ui/HasWidgetsTester.java Wed Jan 19 08:59:29 2011 @@ -112,7 +112,7 @@ testAttachDetachOrder(container, adder); testRemovalOfNonExistantChild(container); testDoAttachChildrenWithError(container, adder, supportsMultipleWidgets); -testDoAttachChildrenWithError(container, adder, supportsMultipleWidgets); +testDoDetachChildrenWithError(container, adder, supportsMultipleWidgets); } /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9571 committed - Edited wiki page Editors through web user interface.
Revision: 9571 Author: b...@google.com Date: Wed Jan 19 12:01:06 2011 Log: Edited wiki page Editors through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=9571 Modified: /wiki/Editors.wiki === --- /wiki/Editors.wiki Thu Oct 14 11:10:19 2010 +++ /wiki/Editors.wiki Wed Jan 19 12:01:06 2011 @@ -122,6 +122,7 @@ Label managerName; } }}} +* The zero-length string (i.e. `@Path("")`) may be used to map the "current value" into a sub-editor. * The `@Ignored` annotation may be used on a field or accessor method to make the Editor framework ignore something that otherwise appears to be a sub-Editor. * Sub-Editors may be null. In this case, the Editor framework will ignore these sub-editors. @@ -236,11 +237,12 @@ }}} Whether or not these editors are displayed all at the same time or sequentially is a user experience issue. The Editor framework allows multiple Editors to edit the same object: {{{ -class HasBagOfStateEditor implements Editor { - @Editor.Path("state") +class BagOfStateEditor implements Editor { + // Use the zero-length string to map the peer object into the sub-editor + @Editor.Path("") BagOfStateBiographicalEditor bio; - @Editor.Path("state") + @Editor.Path("") BagOfStateUserPreferencesEditor prefs; } }}} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Optimizations for server-side invocations of CustomFieldSerializers. (issue1273801)
http://gwt-code-reviews.appspot.com/1273801/diff/1/6 File user/src/com/google/gwt/user/client/rpc/core/java/lang/Double_CustomFieldSerializer.java (right): http://gwt-code-reviews.appspot.com/1273801/diff/1/6#newcode45 user/src/com/google/gwt/user/client/rpc/core/java/lang/Double_CustomFieldSerializer.java:45: throws SerializationException { On 2011/01/17 02:05:46, Miles Chaston wrote: On 2011/01/10 20:12:52, jat wrote: > Continuation lines should be indented +4 columns. You might want to look in > eclipse/README.txt to setup eclipse so formatting/etc matches our style guide. I will do my best, but I use IntelliJ rather than eclipse. Is there a way of me testing the formatting by a command-line that understands the eclipse formatting? Will do. http://gwt-code-reviews.appspot.com/1273801/diff/1/33 File user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java (right): http://gwt-code-reviews.appspot.com/1273801/diff/1/33#newcode288 user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java:288: private static class CustomFieldSerializerHandle { On 2011/01/18 19:34:29, jat wrote: An alternative to wrapping everything would be to have a single value, like you do for EMPTY_HANDLE, to indicate that it is known not to extend CustomFieldSerializer. It could just be a private implementation of CustomFieldSerializer that does nothing and is compared against. That would keep single lookups in the map, while also avoiding wrapper objects. Good idea. I will do that. http://gwt-code-reviews.appspot.com/1273801/diff/8001/9034#newcode728 user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java:728: continue; On 2011/01/18 19:34:29, jat wrote: Won't this give a raw type warning? If so, it should be CustomFieldSerializer instead. Good catch. My IDE was not calling that out. I tried with and then the serializeInstance got upset as the second parameter is expecting but was Object. I have done what I can. Every time that I tried to make it explicit, I caused issues somewhere else. I reverted to forcing to CustomFieldSerializer and making the call @SuppressWarnings("unchecked"). If you have any better ideas I would be happy to try them. http://gwt-code-reviews.appspot.com/1273801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Optimizations for server-side invocations of CustomFieldSerializers. (issue1273801)
http://gwt-code-reviews.appspot.com/1273801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixing HasWidgetsTester#testAll to actually call testDoDetachChildrenWithError. Currently, it c... (issue1300801)
On 2011/01/18 14:46:40, jlabanca wrote: LGTM http://gwt-code-reviews.appspot.com/1300801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: [GWT Designer] Memory leak in ResourceOracleImpl (issue1308801)
LGTM -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Make production mode stack traces match JRE spec more closely (issue1295802)
Committed in r9568 http://gwt-code-reviews.appspot.com/1295802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: [GWT Designer] Memory leak in ResourceOracleImpl (issue1308801)
This is similar to Issue 1274801 as we use different class loaders per Designer Editor http://gwt-code-reviews.appspot.com/1308801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [GWT Designer] Memory leak in ResourceOracleImpl (issue1308801)
Reviewers: rdayal, scottb, zundel, Description: While using GWT Designer the class path cache in ResourceOracleImpl never gets cleared of obsolete data. Please review this at http://gwt-code-reviews.appspot.com/1308801/show Affected files: dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java ### Eclipse Workspace Patch 1.0 #P trunk Index: dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java === --- dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java (revision 9519) +++ dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java (working copy) @@ -24,6 +24,9 @@ import com.google.gwt.dev.util.msg.Message0; import com.google.gwt.dev.util.msg.Message1String; +import org.apache.commons.collections.map.AbstractReferenceMap; +import org.apache.commons.collections.map.ReferenceMap; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -141,7 +144,9 @@ } } - private static final Map> classPathCache = new HashMap>(); + @SuppressWarnings("unchecked") + private static final Map> classPathCache = new ReferenceMap( + AbstractReferenceMap.WEAK, AbstractReferenceMap.HARD); public static ClassPathEntry createEntryForUrl(TreeLogger logger, URL url) throws URISyntaxException, IOException { -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9570 committed - Implement spec section 2.2. Applying multiple constraints of the same ...
Revision: 9570 Author: ncha...@google.com Date: Wed Jan 19 06:58:02 2011 Log: Implement spec section 2.2. Applying multiple constraints of the same type. [JSR 303 TCK Result] 64 of 257 (24.90%) Pass with 26 Failures and 4 Errors. Review at http://gwt-code-reviews.appspot.com/1288802 Review by: rchan...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9570 Modified: /trunk/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/PropertyPathGwtTest.java /trunk/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java === --- /trunk/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java Wed Jan 12 17:43:21 2011 +++ /trunk/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java Wed Jan 19 06:58:02 2011 @@ -46,6 +46,7 @@ import com.google.gwt.validation.client.impl.PropertyDescriptorImpl; import java.lang.annotation.Annotation; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Collection; @@ -55,6 +56,7 @@ import java.util.Map.Entry; import java.util.Set; +import javax.validation.Constraint; import javax.validation.ConstraintValidator; import javax.validation.ConstraintViolation; import javax.validation.Payload; @@ -74,6 +76,8 @@ private static enum Stage { OBJECT, PROPERTY, VALUE } + + private static final Annotation[] NO_ANNOTATIONS = new Annotation[]{}; private static final JType[] NO_ARGS = new JType[]{}; @@ -292,13 +296,26 @@ return annotation; } - private Annotation getAnnotation(PropertyDescriptor p, boolean useField, - ConstraintDescriptor constraint) { -Class expectedAnnotationClass = -((Annotation) constraint.getAnnotation()).annotationType(); -return getAnnotation(p, useField, expectedAnnotationClass); - } - + private Annotation[] getAnnotations(PropertyDescriptor p, + boolean useField) { +Class clazz = beanHelper.getClazz(); +if (useField) { + try { +Field field = clazz.getDeclaredField(p.getPropertyName()); +return field.getAnnotations(); + } catch (NoSuchFieldException ignore) { +// Expected Case + } +} else { + try { +Method method = clazz.getMethod(asGetter(p)); +return method.getAnnotations(); + } catch (NoSuchMethodException ignore) { +// Expected Case + } +} +return NO_ANNOTATIONS; + } private JType getAssociationType(PropertyDescriptor p, boolean useField) { JType type = getElementType(p, useField); @@ -312,6 +329,7 @@ // it is either a Iterable or a Map use the last type arg. return typeArgs[typeArgs.length - 1]; } + private JType getElementType(PropertyDescriptor p, boolean useField) { if (useField) { @@ -350,6 +368,63 @@ return false; } } + + private boolean hasMatchingAnnotation(Annotation expectedAnnotation, + Annotation[] annotations) throws UnableToCompleteException { +// See spec section 2.2. Applying multiple constraints of the same type +for (Annotation annotation : annotations) { + // annotations not annotated by @Constraint + if (annotation.annotationType().getAnnotation(Constraint.class) == null) { +try { + // value element has a return type of an array of constraint + // annotations + Method valueMethod = annotation.annotationType().getMethod("value"); + Class valueType = valueMethod.getReturnType(); + if (valueType.isArray() + && Annotation.class.isAssignableFrom(valueType.getComponentType())) { +Annotation[] valueAnnotions = (Annotation[]) valueMethod.invoke(annotation); +for (Annotation annotation2 : valueAnnotions) { + if (expectedAnnotation.equals(annotation2)) { +return true; + } +} + } +} catch (NoSuchMethodException ignore) { + // Expected Case. +} catch (Exception e) { + throw error(logger, e); +} + } +} +return false; + } + + private boolean hasMatchingAnnotation(ConstraintDescriptor constraint) + throws UnableToCompleteException { +Annotation expectedAnnotation = constraint.getAnnotation(); +Class expectedAnnotationClass = expectedAnnotation.annotationType(); +if (expectedAnnotation.equals(beanHelper.getClazz().getAnnotation( +expectedAnnotationClass))) { + return true; +} + +// See spec section 2.2. Applying multiple constraints of the same type +Annotation[] annotations = beanHelper.getClazz().getAnnotations(); +return hasMatchingAnnotation(expectedAnnotation, annotations); + } + + private boolean hasMatchingAnnotation(PropertyDescriptor p, boolean useField
[gwt-contrib] [google-web-toolkit] r9569 committed - Rolling back IE bugfix for IFrames due to failed ImageTest...
Revision: 9569 Author: p...@google.com Date: Wed Jan 19 06:51:52 2011 Log: Rolling back IE bugfix for IFrames due to failed ImageTest *** Original change description *** Fix bug on IE where onload events don't fire for IFrames. This is a bugfix for http://code.google.com/p/google-web-toolkit/issues/detail?id=1720 Review at http://gwt-code-reviews.appspot.com/1294801 http://code.google.com/p/google-web-toolkit/source/detail?r=9569 Deleted: /trunk/user/test/com/google/gwt/dom/public-test/iframetest.html Modified: /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java /trunk/user/test/com/google/gwt/dom/client/FrameTests.java === --- /trunk/user/test/com/google/gwt/dom/public-test/iframetest.html Wed Jan 19 05:47:41 2011 +++ /dev/null @@ -1,5 +0,0 @@ - - -IFRAME TEST - - === --- /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java Wed Jan 19 05:47:41 2011 +++ /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java Wed Jan 19 06:51:52 2011 @@ -30,9 +30,6 @@ @SuppressWarnings("unused") private static JavaScriptObject callDispatchDblClickEvent; - @SuppressWarnings("unused") - private static JavaScriptObject callDispatchOnLoadEvent; - @SuppressWarnings("unused") private static JavaScriptObject callDispatchUnhandledEvent; @@ -171,14 +168,11 @@ $wnd['__gwt_dispatchEvent_' + moduleName] = dispatchEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent = new Function('w', 'return function() { w.__gwt_dispatchEvent_' + moduleName + '.call(this) }')($wnd); - - @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent = new Function('w', - 'return function() { w.__gwt_dispatchEvent_' + moduleName + '.call(w.event.srcElement) }')($wnd); - + $wnd['__gwt_dispatchDblClickEvent_' + moduleName] = dispatchDblClickEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchDblClickEvent = new Function('w', 'return function() { w.__gwt_dispatchDblClickEvent_' + moduleName + '.call(this)}')($wnd); - + $wnd['__gwt_dispatchUnhandledEvent_' + moduleName] = dispatchUnhandledEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchUnhandledEvent = new Function('w', 'return function() { w.__gwt_dispatchUnhandledEvent_' + moduleName + '.call(this)}')($wnd); @@ -274,13 +268,8 @@ @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; if (chMask & 0x04000) elem.onscroll = (bits & 0x04000) ? @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; -if (chMask & 0x08000) { - if (bits & 0x08000) { -elem.attachEvent('onload', @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent); - } else { -elem.detachEvent('onload', @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent); - } -} +if (chMask & 0x08000) elem.onload= (bits & 0x08000) ? + @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchUnhandledEvent : null; if (chMask & 0x1) elem.onerror = (bits & 0x1) ? @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; if (chMask & 0x2) elem.onmousewheel = (bits & 0x2) ? === --- /trunk/user/test/com/google/gwt/dom/client/FrameTests.java Wed Jan 19 05:47:41 2011 +++ /trunk/user/test/com/google/gwt/dom/client/FrameTests.java Wed Jan 19 06:51:52 2011 @@ -16,14 +16,12 @@ package com.google.gwt.dom.client; import com.google.gwt.junit.client.GWTTestCase; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.ui.Frame; -import com.google.gwt.user.client.ui.RootPanel; /** * Tests for the FrameElement and IFrameElement classes. */ public class FrameTests extends GWTTestCase { + @Override public String getModuleName() { return "com.google.gwt.dom.DOMTest"; @@ -36,23 +34,4 @@ doc.getBody().appendChild(iframe); assertNotNull(iframe.getContentDocument()); } - - public void testOnloadEventFires() { -int delayMillis = 3000; -delayTestFinish(delayMillis); - -Frame frame = new Frame() { - @Override - public void onBrowserEvent(Event event) { -if (event.getTypeInt() == Event.ONLOAD) { - super.onBrowserEvent(event); - finishTest(); -} - } -}; - -frame.sinkEvents(Event.ONLOAD); -frame.setUrl("iframetest.html"); -RootPanel.get().add(frame); - } -} +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9568 committed - Make production mode stack traces match JRE spec more closely...
Revision: 9568 Author: fre...@google.com Date: Wed Jan 19 06:45:45 2011 Log: Make production mode stack traces match JRE spec more closely - Fix StackTraceElement#getFileName(), so that it returns null instead of "Unknown Source" - Fix StackTraceElement#getLineNumber(), so that it returns -1 instead of 0 - Fix StackTraceElement#toString(), so that lineNumber is omitted when it is unknown, so that "Unknown.foo(Unknown Source:0)" becomes "Unknown.foo(Unknown Source)" Review at http://gwt-code-reviews.appspot.com/1295802 Review by: sco...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=9568 Modified: /trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java /trunk/user/super/com/google/gwt/emul/java/lang/StackTraceElement.java === --- /trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java Thu Dec 16 11:33:51 2010 +++ /trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java Wed Jan 19 06:45:45 2011 @@ -67,8 +67,8 @@ StackTraceElement[] stackTrace = new StackTraceElement[stack.length()]; for (int i = 0, j = stackTrace.length; i < j; i++) { -stackTrace[i] = new StackTraceElement("Unknown", stack.get(i), -"Unknown source", 0); +stackTrace[i] = new StackTraceElement("Unknown", stack.get(i), null, +LINE_NUMBER_UNKNOWN); } e.setStackTrace(stackTrace); } @@ -77,8 +77,8 @@ JsArrayString stack = StackTraceCreator.createStackTrace(); StackTraceElement[] stackTrace = new StackTraceElement[stack.length()]; for (int i = 0, j = stackTrace.length; i < j; i++) { -stackTrace[i] = new StackTraceElement("Unknown", stack.get(i), -"Unknown source", 0); +stackTrace[i] = new StackTraceElement("Unknown", stack.get(i), null, +LINE_NUMBER_UNKNOWN); } t.setStackTrace(stackTrace); } @@ -145,8 +145,8 @@ for (int i = 0, j = stackTrace.length; i < j; i++) { // Locations is also backwards String location = locations.get(j - i - 1); -String fileName = "Unknown source"; -int lineNumber = 0; +String fileName = null; +int lineNumber = LINE_NUMBER_UNKNOWN; if (location != null) { int idx = location.indexOf(':'); if (idx != -1) { @@ -361,6 +361,8 @@ } } + private static final int LINE_NUMBER_UNKNOWN = -1; + /** * Create a stack trace based on a JavaScriptException. This method should * only be called in Production Mode. === --- /trunk/user/super/com/google/gwt/emul/java/lang/StackTraceElement.java Tue Jul 28 09:27:08 2009 +++ /trunk/user/super/com/google/gwt/emul/java/lang/StackTraceElement.java Wed Jan 19 06:45:45 2011 @@ -60,7 +60,8 @@ } public String toString() { -return className + "." + methodName + "(" + fileName + ":" + lineNumber -+ ")"; +return className + "." + methodName + "(" ++ (fileName != null ? fileName : "Unknown Source") ++ (lineNumber >= 0 ? ":" + lineNumber : "") + ")"; } } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Implement spec section 2.2. Applying multiple constraints of the same type. (issue1288802)
http://gwt-code-reviews.appspot.com/1288802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Implement an isDirty() method for Editor framework drivers. (issue1306801)
LGTM http://gwt-code-reviews.appspot.com/1306801/diff/1/2 File user/src/com/google/gwt/editor/client/EditorDelegate.java (right): http://gwt-code-reviews.appspot.com/1306801/diff/1/2#newcode62 user/src/com/google/gwt/editor/client/EditorDelegate.java:62: * used a a supplementary signal. "...however, this calculated dirty state is overridden by explicit calls to setDirty." http://gwt-code-reviews.appspot.com/1306801/diff/1/4 File user/src/com/google/gwt/editor/client/impl/AbstractEditorDelegate.java (right): http://gwt-code-reviews.appspot.com/1306801/diff/1/4#newcode255 user/src/com/google/gwt/editor/client/impl/AbstractEditorDelegate.java:255: * Returns {@code true} if the editor contains leaf editors without delegates. shouldn't the name mention leaf editors, then? http://gwt-code-reviews.appspot.com/1306801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9567 committed - Fix bug on IE where onload events don't fire for IFrames....
Revision: 9567 Author: p...@google.com Date: Wed Jan 19 05:47:41 2011 Log: Fix bug on IE where onload events don't fire for IFrames. This is a bugfix for http://code.google.com/p/google-web-toolkit/issues/detail?id=1720 Review at http://gwt-code-reviews.appspot.com/1294801 http://code.google.com/p/google-web-toolkit/source/detail?r=9567 Added: /trunk/user/test/com/google/gwt/dom/public-test/iframetest.html Modified: /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java /trunk/user/test/com/google/gwt/dom/client/FrameTests.java === --- /dev/null +++ /trunk/user/test/com/google/gwt/dom/public-test/iframetest.html Wed Jan 19 05:47:41 2011 @@ -0,0 +1,5 @@ + + +IFRAME TEST + + === --- /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java Tue Jun 22 06:26:45 2010 +++ /trunk/user/src/com/google/gwt/user/client/impl/DOMImplTrident.java Wed Jan 19 05:47:41 2011 @@ -30,6 +30,9 @@ @SuppressWarnings("unused") private static JavaScriptObject callDispatchDblClickEvent; + @SuppressWarnings("unused") + private static JavaScriptObject callDispatchOnLoadEvent; + @SuppressWarnings("unused") private static JavaScriptObject callDispatchUnhandledEvent; @@ -168,11 +171,14 @@ $wnd['__gwt_dispatchEvent_' + moduleName] = dispatchEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent = new Function('w', 'return function() { w.__gwt_dispatchEvent_' + moduleName + '.call(this) }')($wnd); - + + @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent = new Function('w', + 'return function() { w.__gwt_dispatchEvent_' + moduleName + '.call(w.event.srcElement) }')($wnd); + $wnd['__gwt_dispatchDblClickEvent_' + moduleName] = dispatchDblClickEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchDblClickEvent = new Function('w', 'return function() { w.__gwt_dispatchDblClickEvent_' + moduleName + '.call(this)}')($wnd); - + $wnd['__gwt_dispatchUnhandledEvent_' + moduleName] = dispatchUnhandledEvent; @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchUnhandledEvent = new Function('w', 'return function() { w.__gwt_dispatchUnhandledEvent_' + moduleName + '.call(this)}')($wnd); @@ -268,8 +274,13 @@ @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; if (chMask & 0x04000) elem.onscroll = (bits & 0x04000) ? @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; -if (chMask & 0x08000) elem.onload= (bits & 0x08000) ? - @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchUnhandledEvent : null; +if (chMask & 0x08000) { + if (bits & 0x08000) { +elem.attachEvent('onload', @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent); + } else { +elem.detachEvent('onload', @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchOnLoadEvent); + } +} if (chMask & 0x1) elem.onerror = (bits & 0x1) ? @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null; if (chMask & 0x2) elem.onmousewheel = (bits & 0x2) ? === --- /trunk/user/test/com/google/gwt/dom/client/FrameTests.java Wed Oct 28 09:10:53 2009 +++ /trunk/user/test/com/google/gwt/dom/client/FrameTests.java Wed Jan 19 05:47:41 2011 @@ -16,12 +16,14 @@ package com.google.gwt.dom.client; import com.google.gwt.junit.client.GWTTestCase; +import com.google.gwt.user.client.Event; +import com.google.gwt.user.client.ui.Frame; +import com.google.gwt.user.client.ui.RootPanel; /** * Tests for the FrameElement and IFrameElement classes. */ public class FrameTests extends GWTTestCase { - @Override public String getModuleName() { return "com.google.gwt.dom.DOMTest"; @@ -34,4 +36,23 @@ doc.getBody().appendChild(iframe); assertNotNull(iframe.getContentDocument()); } -} + + public void testOnloadEventFires() { +int delayMillis = 3000; +delayTestFinish(delayMillis); + +Frame frame = new Frame() { + @Override + public void onBrowserEvent(Event event) { +if (event.getTypeInt() == Event.ONLOAD) { + super.onBrowserEvent(event); + finishTest(); +} + } +}; + +frame.sinkEvents(Event.ONLOAD); +frame.setUrl("iframetest.html"); +RootPanel.get().add(frame); + } +} -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Implement spec section 2.2. Applying multiple constraints of the same type. (issue1288802)
http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001 File user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java (right): http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode82 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:82: */ On 2011/01/19 15:49:54, rchandia wrote: Remove Done. http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode309 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:309: } catch (NoSuchFieldException ignore) { On 2011/01/19 15:49:54, rchandia wrote: Document as // Expected case Done. http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode315 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:315: } catch (NoSuchMethodException ignore) { On 2011/01/19 15:49:54, rchandia wrote: Same as above Done. http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode393 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:393: } catch (NoSuchMethodException ignore) { On 2011/01/19 15:49:54, rchandia wrote: // Expected case Done. http://gwt-code-reviews.appspot.com/1288802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Improve canvas for browsers (and permutations) with partial canvas support. (issue1296801)
http://gwt-code-reviews.appspot.com/1296801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Implement spec section 2.2. Applying multiple constraints of the same type. (issue1288802)
LGTM. With nits http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001 File user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java (right): http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode82 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:82: */ Remove http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode309 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:309: } catch (NoSuchFieldException ignore) { Document as // Expected case http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode315 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:315: } catch (NoSuchMethodException ignore) { Same as above http://gwt-code-reviews.appspot.com/1288802/diff/3001/4001#newcode393 user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java:393: } catch (NoSuchMethodException ignore) { // Expected case http://gwt-code-reviews.appspot.com/1288802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Improve canvas for browsers (and permutations) with partial canvas support. (issue1296801)
LGTM http://gwt-code-reviews.appspot.com/1296801/diff/34001/35002 File user/src/com/google/gwt/canvas/client/Canvas.java (right): http://gwt-code-reviews.appspot.com/1296801/diff/34001/35002#newcode39 user/src/com/google/gwt/canvas/client/Canvas.java:39: static CanvasElementSupportDetector detector; make private http://gwt-code-reviews.appspot.com/1296801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Improve canvas for browsers (and permutations) with partial canvas support. (issue1296801)
http://gwt-code-reviews.appspot.com/1296801/diff/28001/29002 File user/src/com/google/gwt/canvas/client/Canvas.java (right): http://gwt-code-reviews.appspot.com/1296801/diff/28001/29002#newcode64 user/src/com/google/gwt/canvas/client/Canvas.java:64: CanvasElementSupportDetector.class); On 2011/01/19 00:30:28, jlabanca wrote: You shouldn't GWT.create() on every call to isSupported. Create a static variable and do a null check here, GWT.creating only the first time. In fact, you might just cache the return value after its called once. Sorry I missed this before. Done. http://gwt-code-reviews.appspot.com/1296801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Improve canvas for browsers (and permutations) with partial canvas support. (issue1296801)
http://gwt-code-reviews.appspot.com/1296801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors