Bug 1258789 - Add div* token for WhitespaceAround. r=grisha

Fix some cast issues while I was at it.

MozReview-Commit-ID: 53ANWpnIGwk

--HG--
extra : rebase_source : 57c8e8c764f5f8fc4f0eb3e2880d741904f34a0d
This commit is contained in:
Michael Comella 2016-04-13 11:15:00 -07:00
parent e2389005e3
commit f28c02b827
13 changed files with 23 additions and 23 deletions

View File

@ -61,7 +61,7 @@
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN,
LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE,
LOR, LT, NOT_EQUAL, QUESTION, SL, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND,
PLUS, PLUS_ASSIGN, MOD, MOD_ASSIGN, LE, LAND, GT, GE, RCURLY"/>
PLUS, PLUS_ASSIGN, MOD, MOD_ASSIGN, LE, LAND, GT, GE, RCURLY, DIV, DIV_ASSIGN"/>
</module>
</module>

View File

@ -514,7 +514,7 @@ public class GeckoAppShell
getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
// AlarmManager only supports millisecond precision
long time = ((long)aSeconds * 1000) + ((long)aNanoSeconds/1_000_000L);
long time = ((long) aSeconds * 1000) + ((long) aNanoSeconds / 1_000_000L);
am.setExact(AlarmManager.RTC_WAKEUP, time, pi);
return true;

View File

@ -322,11 +322,11 @@ public class GeckoEvent {
// reverse which radius is major and minor
if (mOrientations[index] < 0) {
mOrientations[index] += 90;
mPointRadii[index] = new Point((int)event.getToolMajor(eventIndex)/2,
(int)event.getToolMinor(eventIndex)/2);
mPointRadii[index] = new Point((int) event.getToolMajor(eventIndex) / 2,
(int) event.getToolMinor(eventIndex) / 2);
} else {
mPointRadii[index] = new Point((int)event.getToolMinor(eventIndex)/2,
(int)event.getToolMajor(eventIndex)/2);
mPointRadii[index] = new Point((int) event.getToolMinor(eventIndex) / 2,
(int) event.getToolMajor(eventIndex) / 2);
}
if (!keepInViewCoordinates) {

View File

@ -135,7 +135,7 @@ abstract class Axis {
static final float MS_PER_FRAME = 1000.0f / 60.0f;
static final long NS_PER_FRAME = Math.round(1000000000f / 60f);
private static final float FRAMERATE_MULTIPLIER = (1000f/60f) / MS_PER_FRAME;
private static final float FRAMERATE_MULTIPLIER = (1000f / 60f) / MS_PER_FRAME;
private static final int FLING_VELOCITY_POINTS = 8;
// The values we use for friction are based on a 16.6ms frame, adjust them to currentNsPerFrame:

View File

@ -334,9 +334,9 @@ public final class BitmapUtils {
return Color.argb(255, 255, 255, 255);
// Return a color with the average hue/saturation/value of the bin with the most colors.
hsv[0] = sumHue[maxBin]/colorBins[maxBin];
hsv[1] = sumSat[maxBin]/colorBins[maxBin];
hsv[2] = sumVal[maxBin]/colorBins[maxBin];
hsv[0] = sumHue[maxBin] / colorBins[maxBin];
hsv[1] = sumSat[maxBin] / colorBins[maxBin];
hsv[2] = sumVal[maxBin] / colorBins[maxBin];
return Color.HSVToColor(hsv);
}

View File

@ -119,7 +119,7 @@ public class ImmutableViewportMetrics {
}
public RectF getCssViewport() {
return RectUtils.scale(getViewport(), 1/zoomFactor);
return RectUtils.scale(getViewport(), 1 / zoomFactor);
}
public RectF getPageRect() {

View File

@ -57,7 +57,7 @@ class JavaPanZoomController
private static final double AXIS_BREAKOUT_ANGLE = Math.PI / 8.0;
// The distance the user has to pan before we consider breaking out of a locked axis
public static final float AXIS_BREAKOUT_THRESHOLD = 1/32f * GeckoAppShell.getDpi();
public static final float AXIS_BREAKOUT_THRESHOLD = 1 / 32f * GeckoAppShell.getDpi();
// The maximum amount we allow you to zoom into a page
private static final float MAX_ZOOM = 4.0f;
@ -266,9 +266,9 @@ class JavaPanZoomController
float newHeight = viewableRect.height() * cssPageRect.width() / viewableRect.width();
float dh = viewableRect.height() - newHeight; // increase in the height
final RectF r = new RectF(0.0f,
y + dh/2,
y + dh / 2,
cssPageRect.width(),
y + dh/2 + newHeight);
y + dh / 2 + newHeight);
if (message.optBoolean("animate", true)) {
mTarget.post(new Runnable() {
@Override

View File

@ -16,10 +16,10 @@ import android.view.View;
public interface PanZoomController {
// The distance the user has to pan before we recognize it as such (e.g. to avoid 1-pixel pans
// between the touch-down and touch-up of a click). In units of density-independent pixels.
public static final float PAN_THRESHOLD = 1/16f * GeckoAppShell.getDpi();
public static final float PAN_THRESHOLD = 1 / 16f * GeckoAppShell.getDpi();
// Threshold for sending touch move events to content
public static final float CLICK_THRESHOLD = 1/50f * GeckoAppShell.getDpi();
public static final float CLICK_THRESHOLD = 1 / 50f * GeckoAppShell.getDpi();
static class Factory {
static PanZoomController create(PanZoomTarget target, View view, EventDispatcher dispatcher) {

View File

@ -135,10 +135,10 @@ public class PluginLayer extends Layer {
private void clampToMaxSize() {
if (width > mMaxDimension || height > mMaxDimension) {
if (width > height) {
height = Math.round(((float)height/ width) * mMaxDimension);
height = Math.round(((float) height / width) * mMaxDimension);
width = mMaxDimension;
} else {
width = Math.round(((float)width/ height) * mMaxDimension);
width = Math.round(((float) width / height) * mMaxDimension);
height = mMaxDimension;
}
}

View File

@ -72,7 +72,7 @@ public class MenuPopup extends PopupWindow {
// Attempt to align the center of the popup with the center of the anchor. If the anchor is
// near the edge of the screen, the popup will just align with the edge of the screen.
final int xOffset = anchor.getWidth()/2 - mPopupWidth/2;
final int xOffset = anchor.getWidth() / 2 - mPopupWidth / 2;
showAsDropDown(anchor, xOffset, -mYOffset);
}
}

View File

@ -18,9 +18,9 @@ public class BackButton extends NavButton {
super.onSizeChanged(width, height, oldWidth, oldHeight);
mPath.reset();
mPath.addCircle(width/2, height/2, width/2, Path.Direction.CW);
mPath.addCircle(width / 2, height / 2, width / 2, Path.Direction.CW);
mBorderPath.reset();
mBorderPath.addCircle(width/2, height/2, (width/2) - (mBorderWidth/2), Path.Direction.CW);
mBorderPath.addCircle(width / 2, height / 2, (width / 2) - (mBorderWidth / 2), Path.Direction.CW);
}
}

View File

@ -389,7 +389,7 @@ public class SiteIdentityPopup extends AnchoredPopup implements GeckoEventListen
private void setSecurityStateIcon(int resource, int factor) {
final Drawable stateIcon = ContextCompat.getDrawable(mContext, resource);
stateIcon.setBounds(0, 0, stateIcon.getIntrinsicWidth()/factor, stateIcon.getIntrinsicHeight()/factor);
stateIcon.setBounds(0, 0, stateIcon.getIntrinsicWidth() / factor, stateIcon.getIntrinsicHeight() / factor);
mSecurityState.setCompoundDrawables(stateIcon, null, null, null);
mSecurityState.setCompoundDrawablePadding((int) mResources.getDimension(R.dimen.doorhanger_drawable_padding));
}

View File

@ -47,7 +47,7 @@ public class ThumbnailView extends ThemedImageView {
int w2 = getWidth();
int h2 = getHeight();
float scale = (w2/h2 < w1/h1) ? (float)h2/h1 : (float)w2/w1;
float scale = ((w2 / h2) < (w1 / h1)) ? (float) h2 / h1 : (float) w2 / w1;
mMatrix.setScale(scale, scale);
}