Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
42 changes: 1 addition & 41 deletions user/src/com/google/gwt/dom/client/DOMImplMozilla.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,47 +46,7 @@ private static native int getNativeGeckoVersion() /*-{
*/
private static boolean isGecko19() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion >= 1009000);
}

/**
* Return true if using Gecko 1.9.0 (Firefox 3) or earlier.
*
* @return true if using Gecko 1.9.0 (Firefox 3) or earlier
*/
private static boolean isGecko190OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion <= 1009000);
}

/**
* Return true if using Gecko 1.9.1 (Firefox 3.5) or earlier.
*
* @return true if using Gecko 1.9.1 (Firefox 3.5) or earlier
*/
private static boolean isGecko191OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion <= 1009001);
}

/**
* Return true if using Gecko 1.9.2 (Firefox 3.6) or earlier.
*
* @return true if using Gecko 1.9.2 (Firefox 3.6) or earlier
*/
private static boolean isGecko192OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion <= 1009002);
}

/**
* Return true if using Gecko 2.0.0 (Firefox 4.0) or earlier.
*
* @return true if using Gecko 2.0.0 (Firefox 4.0) or earlier
*/
private static boolean isGecko2OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion < 2000000);
return geckoVersion >= 1009000;
Comment thread
zbynek marked this conversation as resolved.
Outdated
}

@Override
Expand Down
8 changes: 0 additions & 8 deletions user/src/com/google/gwt/user/cellview/CellView.gwt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,4 @@
<when-property-is name="user.agent" value="safari"/>
</any>
</replace-with>

<!-- Mozilla-specific CellTable implementation. -->
<replace-with class="com.google.gwt.user.cellview.client.AbstractCellTable.ImplMozilla">
<when-type-is class="com.google.gwt.user.cellview.client.AbstractCellTable.Impl"/>
<any>
<when-property-is name="user.agent" value="gecko1_8"/>
</any>
</replace-with>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -638,40 +638,6 @@ protected void replaceAllRowsImpl(AbstractCellTable<?> table, TableSectionElemen
}
}

/**
* Implementation of {@link CellTable} used by Firefox.
*/
@SuppressWarnings("unused")
private static class ImplMozilla extends Impl {
Comment on lines -641 to -645
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking more carefully, maybe we should keep the class with no contents, as the Trident classes, just in case someone has a custom replace-with

/**
* Firefox 3.6 and earlier convert td elements to divs if the tbody is
* removed from the table element.
*/
@Override
protected void detachSectionElement(TableSectionElement section) {
if (isGecko192OrBefore()) {
return;
}
super.detachSectionElement(section);
}

@Override
protected void reattachSectionElement(Element parent, TableSectionElement section,
Element nextSection) {
if (isGecko192OrBefore()) {
return;
}
super.reattachSectionElement(parent, section, nextSection);
}

/**
* Return true if using Gecko 1.9.2 (Firefox 3.6) or earlier.
*/
private native boolean isGecko192OrBefore() /*-{
return @com.google.gwt.dom.client.DOMImplMozilla::isGecko192OrBefore()();
}-*/;
}

/**
* Implementation of {@link AbstractCellTable} used by IE.
*/
Expand Down Expand Up @@ -1664,7 +1630,7 @@ public void setSkipRowHoverFloatElementCheck(boolean skipRowHoverFloatElementChe
* Sets the skipRowHoverStyleUpdate flag. If set, the CellTable will not update
* the row's style on row-level hover events (MOUSEOVER and MOUSEOUT).
*
* @param skipRowHoverCheck the new flag value
* @param skipRowHoverStyleUpdate the new flag value
*/
public void setSkipRowHoverStyleUpdate(boolean skipRowHoverStyleUpdate) {
this.skipRowHoverStyleUpdate = skipRowHoverStyleUpdate;
Expand Down Expand Up @@ -1949,8 +1915,8 @@ protected void onBrowserEvent2(Event event) {
boolean unhover = true;
if (!skipRowHoverFloatElementCheck) {
// Ignore events happening directly over the hovering row. If there are floating element
// on top of the row, mouseout event should not be triggered. This is to avoid the flickring
// effect if the floating element is shown/hide based on hover event.
// on top of the row, mouseout event should not be triggered. This is to avoid the
// flickring effect if the floating element is shown/hide based on hover event.
Comment thread
zbynek marked this conversation as resolved.
Outdated
int clientX = event.getClientX() + Window.getScrollLeft();
int clientY = event.getClientY() + Window.getScrollTop();
int rowLeft = hoveringRow.getAbsoluteLeft();
Expand All @@ -1959,7 +1925,8 @@ protected void onBrowserEvent2(Event event) {
int rowHeight = hoveringRow.getOffsetHeight();
int rowBottom = rowTop + rowHeight;
int rowRight = rowLeft + rowWidth;
unhover = clientX < rowLeft || clientX > rowRight || clientY < rowTop || clientY > rowBottom;
unhover = clientX < rowLeft || clientX > rowRight
|| clientY < rowTop || clientY > rowBottom;
}
if (unhover) {
setRowHover(hoveringRow, event, false, isRowChange);
Expand Down Expand Up @@ -2587,7 +2554,7 @@ private <C> boolean resetFocusOnCellImpl(Context context, T value, HasCell<T, C>
}

/**
* Set a row's hovering style and fire a {@link RowHoverEvent}
* Set a row's hovering style and fire a {@link RowHoverEvent}.
*
* @param tr the row element
* @param event the original event
Expand Down
76 changes: 0 additions & 76 deletions user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
*/
package com.google.gwt.user.client.ui.impl;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.user.client.DOM;

/**
* Implementation class used by {@link com.google.gwt.user.client.ui.PopupPanel}.
Expand All @@ -47,78 +43,6 @@
*/
public class PopupImplMozilla extends PopupImpl {

/**
* Cache the value to avoid repeated calls.
*/
private static boolean isFF2Mac = isFF2Mac();

private static native boolean isFF2Mac() /*-{
function makeVersion(result) {
return (parseInt(result[1]) * 1000) + parseInt(result[2]);
}

var ua = navigator.userAgent;
if (ua.indexOf("Macintosh") != -1) {
// Version logic taken from UserAgentPropertyGenerator
var result = /rv:([0-9]+)\.([0-9]+)/.exec(ua);
if (result && result.length == 3) {
// Gecko 1.8 and earlier had the scrollbar bug on OS X.
// (Firefox3 == Gecko 1.9)
if (makeVersion(result) <= 1008) {
return true;
}
}
}

return false;
}-*/;

@Override
public Element createElement() {
final Element outerElem = DOM.createDiv();

if (isFF2Mac) {
// To solve the scrollbar rendering problem on the Mac, we have to make
// the PopupPanel a 'heavyweight' element by setting a style of
// 'overflow:auto' on the outermost div. This ensures that all of the
// elements that are children of this div will be rendered on top of
// any underlying scrollbars.

// Unfortunately, if we add a border to the outer div (which has
// a style of 'overflow:auto'), the border will not be rendered on top
// of underlying scrollbars. To get around this problem, we introduce an
// inner div which acts as the new containing element for the PopupPanel,
// and this element is the one to which all styling is applied to.
outerElem.setInnerHTML("<div></div>");

// Mozilla determines the default stacking order for heavyweight elements
// by their order on the page. If the PopupPanel is declared before
// another
// heavyweight element on the page, then the scrollbars of the heavyweight
// element will still shine through the PopupPanel. By setting
// 'overflow:auto' after all of the elements on the page have been
// rendered,
// the PopupPanel becomes the highest element in the stacking order.
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
outerElem.getStyle().setOverflow(Overflow.AUTO);
}
});
}

return outerElem;
}

@Override
public Element getContainerElement(Element outerElem) {
return isFF2Mac ? outerElem.getFirstChildElement() : outerElem;
}

@Override
public Element getStyleElement(Element outerElem) {
return isFF2Mac ? outerElem : super.getStyleElement(outerElem);
}

@Override
public void setClip(Element popup, String rect) {
super.setClip(popup, rect);
Expand Down
7 changes: 0 additions & 7 deletions user/test/com/google/gwt/core/client/JsonUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public String getModuleName() {
}

public void testStringify() throws Exception {
if (isFirefox40OrEarlier()) {
return;
}
assertEquals("{\"a\":2}", JsonUtils.stringify(createJson()));
assertEquals("{\n\t\"a\": 2\n}", JsonUtils.stringify(createJson(), "\t"));
assertEquals("{\nXYZ\"a\": 2\n}", JsonUtils.stringify(createJson(), "XYZ"));
Expand All @@ -38,8 +35,4 @@ public void testStringify() throws Exception {
private native JavaScriptObject createJson() /*-{
return { a: 2 };
}-*/;

private static native boolean isFirefox40OrEarlier() /*-{
return @com.google.gwt.dom.client.DOMImplMozilla::isGecko2OrBefore()();
}-*/;
}
8 changes: 0 additions & 8 deletions user/test/com/google/gwt/media/client/MediaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,12 @@ static native boolean isFirefox35OrLater() /*-{
return (geckoVersion != -1) && (geckoVersion >= 1009001);
}-*/;

static native boolean isFirefox40OrEarlier() /*-{
return @com.google.gwt.dom.client.DOMImplMozilla::isGecko2OrBefore()();
}-*/;

public void disabled_testPreload() {
final MediaBase media = getMedia();
if (media == null) {
return; // don't continue if not supported
}

if (isFirefox40OrEarlier()) {
return; // don't continue on older versions of Firefox.
}

String state = media.getPreload();
assertNotNull(state);
assertTrue("Illegal preload state", state.equals(MediaElement.PRELOAD_AUTO)
Expand Down