This commit is contained in:
Ryan VanderMeulen 2013-06-10 15:43:58 -04:00
Родитель bbda2b807d a21068fb85
Коммит 88cfb34510
258 изменённых файлов: 2196 добавлений и 704 удалений

Просмотреть файл

@ -18,8 +18,10 @@ FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/rules.mk
CFLAGS += $(MOZ_GTK2_CFLAGS)
CXXFLAGS += $(MOZ_GTK2_CFLAGS)
ifdef MOZ_ENABLE_GTK
CFLAGS += $(TK_CFLAGS)
CXXFLAGS += $(TK_CFLAGS)
endif
ifdef MOZ_ENABLE_DBUS
CXXFLAGS += $(MOZ_DBUS_CFLAGS)

Просмотреть файл

@ -61,7 +61,7 @@ struct AtkStateMap {
};
// Map array from cross platform roles to ATK roles
// Map array from cross platform states to ATK states
static const AtkStateMap gAtkStateMap[] = { // Cross Platform States
{ kNone, kMapOpposite }, // states::UNAVAILABLE = 1 << 0
{ ATK_STATE_SELECTED, kMapDirectly }, // states::SELECTED = 1 << 1

Просмотреть файл

@ -28,9 +28,11 @@ LOCAL_INCLUDES += \
-I$(srcdir)/../../../layout/svg \
-I$(srcdir)/../../../layout/xul/base/src \
-I$(srcdir)/../../../layout/xul/tree/ \
-I$(srcdir)/../../../ipc/chromium/src \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
ifdef MOZ_ENABLE_GTK
CXXFLAGS += $(MOZ_CAIRO_CFLAGS)
LOCAL_INCLUDES += \
-I$(srcdir)/../atk \
$(NULL)

Просмотреть файл

@ -28,7 +28,7 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../../../layout/xul/base/src \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
ifdef MOZ_ENABLE_GTK
LOCAL_INCLUDES += \
-I$(srcdir)/../atk \
$(NULL)

Просмотреть файл

@ -29,7 +29,7 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../../../layout/xul/base/src \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
ifdef MOZ_ENABLE_GTK
LOCAL_INCLUDES += \
-I$(srcdir)/../atk \
$(NULL)

Просмотреть файл

@ -412,7 +412,7 @@ var Output = {
{
let highlightBox = this.highlightBox ? this.highlightBox.get() : null;
if (highlightBox)
highlightBox.get().style.display = 'none';
highlightBox.style.display = 'none';
break;
}
case 'showAnnouncement':

Просмотреть файл

@ -6,7 +6,7 @@
toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
if toolkit == 'gtk2':
if CONFIG['MOZ_ENABLE_GTK']:
DIRS += ['atk']
elif toolkit == 'windows':
DIRS += ['windows']

Просмотреть файл

@ -25,7 +25,7 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../generic \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
ifdef MOZ_ENABLE_GTK
LOCAL_INCLUDES += \
-I$(srcdir)/../atk \
$(NULL)

Просмотреть файл

@ -29,7 +29,7 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../../../layout/xul/tree// \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
ifdef MOZ_ENABLE_GTK
LOCAL_INCLUDES += \
-I$(srcdir)/../atk \
$(NULL)

Просмотреть файл

@ -90,10 +90,10 @@ XULTabAccessible::NativeState()
if (NS_SUCCEEDED(tab->GetSelected(&selected)) && selected)
state |= states::SELECTED;
if (mContent && mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::pinned) &&
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::pinned,
if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::pinned,
nsGkAtoms::_true, eCaseMatters))
state |= states::PINNED;
}
return state;

Просмотреть файл

@ -9,7 +9,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
BrowserComponents.manifest \
$(NULL)

Просмотреть файл

@ -359,6 +359,10 @@ const DownloadsIndicatorView = {
return;
}
if (!DownloadsCommon.animateNotifications) {
return;
}
// No need to show visual notification if the panel is visible.
if (DownloadsPanel.isPanelShowing) {
return;

Просмотреть файл

@ -92,19 +92,41 @@ XPCOMUtils.defineLazyGetter(this, "DownloadsLocalFileCtor", function () {
const kPartialDownloadSuffix = ".part";
const kPrefDebug = "browser.download.debug";
const kPrefBranch = Services.prefs.getBranch("browser.download.");
let DebugPrefObserver = {
let PrefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
observe: function PDO_observe(aSubject, aTopic, aData) {
this.debugEnabled = Services.prefs.getBoolPref(kPrefDebug);
}
}
getPref: function PO_getPref(name) {
try {
switch (typeof this.prefs[name]) {
case "boolean":
return kPrefBranch.getBoolPref(name);
}
} catch (ex) { }
return this.prefs[name];
},
observe: function PO_observe(aSubject, aTopic, aData) {
if (this.prefs.hasOwnProperty(aData)) {
return this[aData] = this.getPref(aData);
}
},
register: function PO_register(prefs) {
this.prefs = prefs;
kPrefBranch.addObserver("", this, true);
for (let key in prefs) {
let name = key;
XPCOMUtils.defineLazyGetter(this, name, function () {
return PrefObserver.getPref(name);
});
}
},
};
XPCOMUtils.defineLazyGetter(DebugPrefObserver, "debugEnabled", function () {
Services.prefs.addObserver(kPrefDebug, DebugPrefObserver, true);
return Services.prefs.getBoolPref(kPrefDebug);
PrefObserver.register({
// prefName: defaultValue
debug: false,
animateNotifications: true
});
@ -119,7 +141,7 @@ this.DownloadsCommon = {
log: function DC_log(...aMessageArgs) {
delete this.log;
this.log = function DC_log(...aMessageArgs) {
if (!DebugPrefObserver.debugEnabled) {
if (!PrefObserver.debug) {
return;
}
DownloadsLogger.log.apply(DownloadsLogger, aMessageArgs);
@ -130,7 +152,7 @@ this.DownloadsCommon = {
error: function DC_error(...aMessageArgs) {
delete this.error;
this.error = function DC_error(...aMessageArgs) {
if (!DebugPrefObserver.debugEnabled) {
if (!PrefObserver.debug) {
return;
}
DownloadsLogger.reportError.apply(DownloadsLogger, aMessageArgs);
@ -217,6 +239,15 @@ this.DownloadsCommon = {
return false;
},
/**
* Indicates whether we should show visual notification on the indicator
* when a download event is triggered.
*/
get animateNotifications()
{
return PrefObserver.animateNotifications;
},
/**
* Get access to one of the DownloadsData or PrivateDownloadsData objects,
* depending on the privacy status of the window in question.

Просмотреть файл

@ -9,7 +9,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
BrowserDownloads.manifest \
DownloadsUI.js \
DownloadsStartup.js \

Просмотреть файл

@ -4,3 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_COMPONENTS += [
'BrowserDownloads.manifest',
'DownloadsStartup.js',
'DownloadsUI.js',
]

Просмотреть файл

@ -19,7 +19,7 @@ DEFINES += \
-DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
$(NULL)
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
BrowserFeeds.manifest \
FeedConverter.js \
WebContentConverter.js \

Просмотреть файл

@ -10,3 +10,8 @@ CPP_SOURCES += [
'nsFeedSniffer.cpp',
]
EXTRA_COMPONENTS += [
'BrowserFeeds.manifest',
'FeedConverter.js',
'WebContentConverter.js',
]

Просмотреть файл

@ -14,7 +14,7 @@ LIBRARY_NAME = migration_s
FORCE_STATIC_LIB = 1
USE_STATIC_LIBS = 1
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
ProfileMigrator.js \
FirefoxProfileMigrator.js \
$(NULL)
@ -24,7 +24,7 @@ EXTRA_PP_COMPONENTS = \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
EXTRA_COMPONENTS += IEProfileMigrator.js \
DISABLED_EXTRA_COMPONENTS += IEProfileMigrator.js \
$(NULL)
EXTRA_PP_COMPONENTS += SafariProfileMigrator.js \

Просмотреть файл

@ -10,3 +10,13 @@ if CONFIG['OS_ARCH'] == 'WINNT':
CPP_SOURCES += [
'nsIEHistoryEnumerator.cpp',
]
EXTRA_COMPONENTS += [
'FirefoxProfileMigrator.js',
'ProfileMigrator.js',
]
if CONFIG['OS_ARCH'] == 'WINNT':
EXTRA_COMPONENTS += [
'IEProfileMigrator.js',
]

Просмотреть файл

@ -36,3 +36,6 @@ XPIDL_MODULE = 'browsercompsbase'
MODULE = 'browsercomps'
EXTRA_COMPONENTS += [
'BrowserComponents.manifest',
]

Просмотреть файл

@ -10,7 +10,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
BrowserPlaces.manifest \
PlacesProtocolHandler.js \
$(NULL)

Просмотреть файл

@ -8,3 +8,7 @@ XPIDL_FLAGS += [
'-I$(topsrcdir)/browser/components',
]
EXTRA_COMPONENTS += [
'BrowserPlaces.manifest',
'PlacesProtocolHandler.js',
]

Просмотреть файл

@ -10,7 +10,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
nsSessionStore.manifest \
nsSessionStore.js \
nsSessionStartup.js \

Просмотреть файл

@ -4,3 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_COMPONENTS += [
'nsSessionStartup.js',
'nsSessionStore.js',
'nsSessionStore.manifest',
]

Просмотреть файл

@ -32,7 +32,7 @@ endif
endif
endif
EXTRA_COMPONENTS = nsSetDefaultBrowser.js nsSetDefaultBrowser.manifest
DISABLED_EXTRA_COMPONENTS = nsSetDefaultBrowser.js nsSetDefaultBrowser.manifest
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -18,3 +18,8 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
CPP_SOURCES += [
'nsGNOMEShellService.cpp',
]
EXTRA_COMPONENTS += [
'nsSetDefaultBrowser.js',
'nsSetDefaultBrowser.manifest',
]

Просмотреть файл

@ -10,7 +10,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
nsSidebar.manifest \
nsSidebar.js \
$(NULL)

Просмотреть файл

@ -4,3 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_COMPONENTS += [
'nsSidebar.js',
'nsSidebar.manifest',
]

Просмотреть файл

@ -25,5 +25,5 @@
}).call(this);
/*
//@ sourceMappingURL=binary_search.map
//# sourceMappingURL=binary_search.map
*/

Просмотреть файл

@ -9,7 +9,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = fuelApplication.manifest
DISABLED_EXTRA_COMPONENTS = fuelApplication.manifest
EXTRA_PP_COMPONENTS = fuelApplication.js
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -6,3 +6,6 @@
MODULE = 'fuel'
EXTRA_COMPONENTS += [
'fuelApplication.manifest',
]

Просмотреть файл

@ -49,6 +49,40 @@ Hello there. <a id="rlink1" href="#hello">hello there.</a>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</body></html>

Просмотреть файл

@ -10,7 +10,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = stdc++compat
HOST_LIBRARY_NAME = host_stdc++compat
DISABLED_HOST_LIBRARY_NAME = host_stdc++compat
FORCE_STATIC_LIB= 1
STL_FLAGS =
NO_EXPAND_LIBS = 1

Просмотреть файл

@ -10,3 +10,4 @@ CPP_SOURCES += [
'stdc++compat.cpp',
]
HOST_LIBRARY_NAME = 'host_stdc++compat'

Просмотреть файл

@ -16,7 +16,7 @@ FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
ActivityOptions.js \
ActivityProxy.js \
ActivityRequestHandler.js \

Просмотреть файл

@ -14,3 +14,10 @@ CPP_SOURCES += [
'Activity.cpp',
]
EXTRA_COMPONENTS += [
'Activities.manifest',
'ActivityOptions.js',
'ActivityProxy.js',
'ActivityRequestHandler.js',
'ActivityWrapper.js',
]

Просмотреть файл

@ -16,7 +16,7 @@ FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
AlarmsManager.js \
AlarmsManager.manifest \
$(NULL)

Просмотреть файл

@ -27,3 +27,7 @@ CPP_SOURCES += [
'AlarmHalService.cpp',
]
EXTRA_COMPONENTS += [
'AlarmsManager.js',
'AlarmsManager.manifest',
]

Просмотреть файл

@ -9,7 +9,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
AppsService.js \
AppsService.manifest \
Webapps.manifest \

Просмотреть файл

@ -4,3 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_COMPONENTS += [
'AppsService.js',
'AppsService.manifest',
'Webapps.manifest',
]

Просмотреть файл

@ -15,7 +15,7 @@ LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
SiteSpecificUserAgent.js \
SiteSpecificUserAgent.manifest \
ConsoleAPI.js \

Просмотреть файл

@ -97,3 +97,9 @@ CPP_SOURCES += [
'nsWindowRoot.cpp',
]
EXTRA_COMPONENTS += [
'ConsoleAPI.js',
'ConsoleAPI.manifest',
'SiteSpecificUserAgent.js',
'SiteSpecificUserAgent.manifest',
]

Просмотреть файл

@ -245,8 +245,8 @@ class DispatchAsyncScrollEventRunnable : public nsRunnable
{
public:
DispatchAsyncScrollEventRunnable(TabParent* aTabParent,
const gfx::Rect& aContentRect,
const gfx::Size& aContentSize)
const CSSRect& aContentRect,
const CSSSize& aContentSize)
: mTabParent(aTabParent)
, mContentRect(aContentRect)
, mContentSize(aContentSize)
@ -256,8 +256,8 @@ public:
private:
nsRefPtr<TabParent> mTabParent;
const gfx::Rect mContentRect;
const gfx::Size mContentSize;
const CSSRect mContentRect;
const CSSSize mContentSize;
};
NS_IMETHODIMP DispatchAsyncScrollEventRunnable::Run()
@ -277,8 +277,8 @@ NS_IMETHODIMP DispatchAsyncScrollEventRunnable::Run()
bool
BrowserElementParent::DispatchAsyncScrollEvent(TabParent* aTabParent,
const gfx::Rect& aContentRect,
const gfx::Size& aContentSize)
const CSSRect& aContentRect,
const CSSSize& aContentSize)
{
nsRefPtr<DispatchAsyncScrollEventRunnable> runnable =
new DispatchAsyncScrollEventRunnable(aTabParent, aContentRect,

Просмотреть файл

@ -8,6 +8,7 @@
#include "nsAString.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/gfx/Rect.h"
#include "Units.h"
class nsIDOMWindow;
class nsIURI;
@ -106,8 +107,8 @@ public:
*/
static bool
DispatchAsyncScrollEvent(dom::TabParent* aTabParent,
const gfx::Rect& aContentRect,
const gfx::Size& aContentSize);
const CSSRect& aContentRect,
const CSSSize& aContentSize);
};
} // namespace mozilla

Просмотреть файл

@ -16,7 +16,7 @@ FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
BrowserElementParent.js \
BrowserElementParent.manifest \
$(NULL)

Просмотреть файл

@ -30,3 +30,7 @@ CPP_SOURCES += [
'nsOpenWindowEventDetail.cpp',
]
EXTRA_COMPONENTS += [
'BrowserElementParent.js',
'BrowserElementParent.manifest',
]

Просмотреть файл

@ -11,7 +11,7 @@ include $(DEPTH)/config/autoconf.mk
VPATH += $(srcdir)/fallback
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
ContactManager.js \
ContactManager.manifest \
$(NULL)

Просмотреть файл

@ -5,3 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
TEST_DIRS += ['tests']
EXTRA_COMPONENTS += [
'ContactManager.js',
'ContactManager.manifest',
]

Просмотреть файл

@ -11,7 +11,7 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
nsDOMIdentity.js \
nsIDService.js \
Identity.manifest \

Просмотреть файл

@ -5,3 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
TEST_DIRS += ['tests']
EXTRA_COMPONENTS += [
'Identity.manifest',
'nsDOMIdentity.js',
'nsIDService.js',
]

Просмотреть файл

@ -51,6 +51,7 @@ using nsTouchEvent;
using RemoteDOMEvent;
using mozilla::dom::ScreenOrientation;
using mozilla::layers::TextureFactoryIdentifier;
using mozilla::CSSIntPoint;
namespace mozilla {
namespace dom {
@ -307,21 +308,21 @@ child:
* the scroll offset. This message is expected to round-trip back to
* ZoomToRect() with a rect indicating where we should zoom to.
*/
HandleDoubleTap(nsIntPoint point);
HandleDoubleTap(CSSIntPoint point);
/**
* Requests handling of a single tap. |point| is in CSS pixels, relative to
* the scroll offset. This message is expected to send a "mousedown" and
* "mouseup" series of events at this point.
*/
HandleSingleTap(nsIntPoint point);
HandleSingleTap(CSSIntPoint point);
/**
* Requests handling of a long tap. |point| is in CSS pixels, relative to
* the scroll offset. This message is expected to send a "contextmenu"
* events at this point.
*/
HandleLongTap(nsIntPoint point);
HandleLongTap(CSSIntPoint point);
/**
* Sending an activate message moves focus to the child.

Просмотреть файл

@ -98,7 +98,7 @@ using namespace mozilla::widget;
NS_IMPL_ISUPPORTS1(ContentListener, nsIDOMEventListener)
static const nsIntSize kDefaultViewportSize(980, 480);
static const CSSSize kDefaultViewportSize(980, 480);
static const char CANCEL_DEFAULT_PAN_ZOOM[] = "cancel-default-pan-zoom";
static const char BROWSER_ZOOM_TO_RECT[] = "browser-zoom-to-rect";
@ -341,15 +341,13 @@ TabChild::Observe(nsISupports *aSubject,
// Reset CSS viewport and zoom to default on new page, then
// calculate them properly using the actual metadata from the
// page.
SetCSSViewport(kDefaultViewportSize.width, kDefaultViewportSize.height);
SetCSSViewport(kDefaultViewportSize);
// Calculate a really simple resolution that we probably won't
// be keeping, as well as putting the scroll offset back to
// the top-left of the page.
mLastMetrics.mZoom = gfxSize(1.0, 1.0);
mLastMetrics.mViewport =
gfx::Rect(0, 0,
kDefaultViewportSize.width, kDefaultViewportSize.height);
mLastMetrics.mViewport = CSSRect(CSSPoint(), kDefaultViewportSize);
// I don't know what units mInnerSize is in, hence FromUnknownRect
mLastMetrics.mCompositionBounds = LayerIntRect::FromUnknownRect(
gfx::IntRect(0, 0, mInnerSize.width, mInnerSize.height));
@ -471,13 +469,13 @@ TabChild::OnSecurityChange(nsIWebProgress* aWebProgress,
}
void
TabChild::SetCSSViewport(float aWidth, float aHeight)
TabChild::SetCSSViewport(const CSSSize& aSize)
{
mOldViewportWidth = aWidth;
mOldViewportWidth = aSize.width;
if (mContentDocumentIsDisplayed) {
nsCOMPtr<nsIDOMWindowUtils> utils(GetDOMWindowUtils());
utils->SetCSSViewport(aWidth, aHeight);
utils->SetCSSViewport(aSize.width, aSize.height);
}
}
@ -502,8 +500,7 @@ TabChild::HandlePossibleViewportChange()
float screenW = mInnerSize.width;
float screenH = mInnerSize.height;
float viewportW = viewportInfo.GetWidth();
float viewportH = viewportInfo.GetHeight();
CSSSize viewport(viewportInfo.GetWidth(), viewportInfo.GetHeight());
// We're not being displayed in any way; don't bother doing anything because
// that will just confuse future adjustments.
@ -517,12 +514,11 @@ TabChild::HandlePossibleViewportChange()
// we have to call SetCSSViewport twice - once to set the width, and the
// second time to figure out the height based on the layout at that width.
float oldBrowserWidth = mOldViewportWidth;
mLastMetrics.mViewport.width = viewportW;
mLastMetrics.mViewport.height = viewportH;
mLastMetrics.mViewport.SizeTo(viewport);
if (!oldBrowserWidth) {
oldBrowserWidth = kDefaultViewportSize.width;
}
SetCSSViewport(viewportW, viewportH);
SetCSSViewport(viewport);
// If this page has not been painted yet, then this must be getting run
// because a meta-viewport element was added (via the DOMMetaAdded handler).
@ -553,24 +549,26 @@ TabChild::HandlePossibleViewportChange()
bodyHeight = bodyDOMElement->ScrollHeight();
}
float pageWidth, pageHeight;
CSSSize pageSize;
if (htmlDOMElement || bodyDOMElement) {
pageWidth = std::max(htmlWidth, bodyWidth);
pageHeight = std::max(htmlHeight, bodyHeight);
pageSize = CSSSize(std::max(htmlWidth, bodyWidth),
std::max(htmlHeight, bodyHeight));
} else {
// For non-HTML content (e.g. SVG), just assume page size == viewport size.
pageWidth = viewportW;
pageHeight = viewportH;
pageSize = viewport;
}
if (!pageSize.width) {
// Return early rather than divide by 0.
return;
}
NS_ENSURE_TRUE_VOID(pageWidth); // (return early rather than divide by 0)
minScale = mInnerSize.width / pageWidth;
minScale = mInnerSize.width / pageSize.width;
minScale = clamped((double)minScale, viewportInfo.GetMinZoom(),
viewportInfo.GetMaxZoom());
NS_ENSURE_TRUE_VOID(minScale); // (return early rather than divide by 0)
viewportH = std::max(viewportH, screenH / minScale);
SetCSSViewport(viewportW, viewportH);
viewport.height = std::max(viewport.height, screenH / minScale);
SetCSSViewport(viewport);
// This change to the zoom accounts for all types of changes I can conceive:
// 1. screen size changes, CSS viewport does not (pages with no meta viewport
@ -590,8 +588,8 @@ TabChild::HandlePossibleViewportChange()
}
FrameMetrics metrics(mLastMetrics);
metrics.mViewport = gfx::Rect(0.0f, 0.0f, viewportW, viewportH);
metrics.mScrollableRect = CSSRect(0.0f, 0.0f, pageWidth, pageHeight);
metrics.mViewport = CSSRect(CSSPoint(), viewport);
metrics.mScrollableRect = CSSRect(CSSPoint(), pageSize);
// I don't know what units mInnerSize is in, hence FromUnknownRect
metrics.mCompositionBounds = LayerIntRect::FromUnknownRect(
gfx::IntRect(0, 0, mInnerSize.width, mInnerSize.height));
@ -1552,7 +1550,7 @@ TabChild::ProcessUpdateFrame(const FrameMetrics& aFrameMetrics)
}
bool
TabChild::RecvHandleDoubleTap(const nsIntPoint& aPoint)
TabChild::RecvHandleDoubleTap(const CSSIntPoint& aPoint)
{
if (!mCx || !mTabChildGlobal) {
return true;
@ -1569,7 +1567,7 @@ TabChild::RecvHandleDoubleTap(const nsIntPoint& aPoint)
}
bool
TabChild::RecvHandleSingleTap(const nsIntPoint& aPoint)
TabChild::RecvHandleSingleTap(const CSSIntPoint& aPoint)
{
if (!mCx || !mTabChildGlobal) {
return true;
@ -1583,7 +1581,7 @@ TabChild::RecvHandleSingleTap(const nsIntPoint& aPoint)
}
bool
TabChild::RecvHandleLongTap(const nsIntPoint& aPoint)
TabChild::RecvHandleLongTap(const CSSIntPoint& aPoint)
{
if (!mCx || !mTabChildGlobal) {
return true;

Просмотреть файл

@ -205,9 +205,9 @@ public:
virtual bool RecvShow(const nsIntSize& size);
virtual bool RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const ScreenOrientation& orientation);
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
virtual bool RecvHandleDoubleTap(const nsIntPoint& aPoint);
virtual bool RecvHandleSingleTap(const nsIntPoint& aPoint);
virtual bool RecvHandleLongTap(const nsIntPoint& aPoint);
virtual bool RecvHandleDoubleTap(const CSSIntPoint& aPoint);
virtual bool RecvHandleSingleTap(const CSSIntPoint& aPoint);
virtual bool RecvHandleLongTap(const CSSIntPoint& aPoint);
virtual bool RecvActivate();
virtual bool RecvDeactivate();
virtual bool RecvMouseEvent(const nsString& aType,
@ -384,7 +384,7 @@ private:
// Wrapper for nsIDOMWindowUtils.setCSSViewport(). This updates some state
// variables local to this class before setting it.
void SetCSSViewport(float aX, float aY);
void SetCSSViewport(const CSSSize& aSize);
// Recalculates the display state, including the CSS
// viewport. This should be called whenever we believe the

Просмотреть файл

@ -477,21 +477,21 @@ TabParent::UpdateFrame(const FrameMetrics& aFrameMetrics)
}
}
void TabParent::HandleDoubleTap(const nsIntPoint& aPoint)
void TabParent::HandleDoubleTap(const CSSIntPoint& aPoint)
{
if (!mIsDestroyed) {
unused << SendHandleDoubleTap(aPoint);
}
}
void TabParent::HandleSingleTap(const nsIntPoint& aPoint)
void TabParent::HandleSingleTap(const CSSIntPoint& aPoint)
{
if (!mIsDestroyed) {
unused << SendHandleSingleTap(aPoint);
}
}
void TabParent::HandleLongTap(const nsIntPoint& aPoint)
void TabParent::HandleLongTap(const CSSIntPoint& aPoint)
{
if (!mIsDestroyed) {
unused << SendHandleLongTap(aPoint);

Просмотреть файл

@ -175,9 +175,9 @@ public:
void Show(const nsIntSize& size);
void UpdateDimensions(const nsRect& rect, const nsIntSize& size);
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
void HandleDoubleTap(const nsIntPoint& aPoint);
void HandleSingleTap(const nsIntPoint& aPoint);
void HandleLongTap(const nsIntPoint& aPoint);
void HandleDoubleTap(const CSSIntPoint& aPoint);
void HandleSingleTap(const CSSIntPoint& aPoint);
void HandleLongTap(const CSSIntPoint& aPoint);
void Activate();
void Deactivate();

Просмотреть файл

@ -17,7 +17,7 @@ FAIL_ON_WARNINGS := 1
include $(topsrcdir)/dom/dom-config.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
PeerConnection.js \
PeerConnection.manifest \
$(NULL)

Просмотреть файл

@ -27,3 +27,7 @@ CPP_SOURCES += [
'MediaManager.cpp',
]
EXTRA_COMPONENTS += [
'PeerConnection.js',
'PeerConnection.manifest',
]

Просмотреть файл

@ -11,7 +11,7 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
SystemMessageManager.js \
SystemMessageInternal.js \
SystemMessageManager.manifest \

Просмотреть файл

@ -5,3 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
PARALLEL_DIRS += ['interfaces']
EXTRA_COMPONENTS += [
'SystemMessageInternal.js',
'SystemMessageManager.js',
'SystemMessageManager.manifest',
]

Просмотреть файл

@ -14,14 +14,14 @@ LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
FAIL_ON_WARNINGS := 1
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
TCPSocket.js \
TCPSocketParentIntermediary.js \
TCPSocket.manifest \
$(NULL)
ifdef MOZ_B2G_RIL
EXTRA_COMPONENTS += \
DISABLED_EXTRA_COMPONENTS += \
NetworkStatsManager.manifest \
NetworkStatsManager.js \
$(NULL)

Просмотреть файл

@ -23,3 +23,15 @@ if CONFIG['MOZ_B2G_RIL']:
CPP_SOURCES += [
'MobileConnection.cpp',
]
EXTRA_COMPONENTS += [
'TCPSocket.js',
'TCPSocket.manifest',
'TCPSocketParentIntermediary.js',
]
if CONFIG['MOZ_B2G_RIL']:
EXTRA_COMPONENTS += [
'NetworkStatsManager.js',
'NetworkStatsManager.manifest',
]

Просмотреть файл

@ -9,7 +9,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
PermissionSettings.js \
PermissionSettings.manifest \
PermissionPromptService.js \

Просмотреть файл

@ -5,3 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
TEST_DIRS += ['tests']
EXTRA_COMPONENTS += [
'PermissionPromptService.js',
'PermissionPromptService.manifest',
'PermissionSettings.js',
'PermissionSettings.manifest',
]

Просмотреть файл

@ -54,7 +54,9 @@ using namespace std;
#endif
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#if (MOZ_WIDGET_GTK == 2)
#include "gtk2xtbin.h"
#endif
#elif defined(MOZ_WIDGET_QT)
#undef KeyPress
@ -113,7 +115,7 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
, mAsyncInvalidateTask(0)
, mCachedWindowActor(nullptr)
, mCachedElementActor(nullptr)
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
, mXEmbed(false)
#endif // MOZ_WIDGET_GTK
#if defined(OS_WIN)
@ -161,7 +163,7 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
mWindow.ws_info = &mWsInfo;
memset(&mWsInfo, 0, sizeof(mWsInfo));
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
mWsInfo.display = NULL;
mXtClient.top_widget = NULL;
#else
@ -503,7 +505,7 @@ PluginInstanceChild::NPN_SetValue(NPPVariable aVar, void* aValue)
return NPERR_GENERIC_ERROR;
NPWindowType newWindowType = windowed ? NPWindowTypeWindow : NPWindowTypeDrawable;
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mWindow.type != newWindowType && mWsInfo.display) {
// plugin type has been changed but we already have a valid display
// so update it for the recent plugin mode
@ -1047,7 +1049,7 @@ bool PluginInstanceChild::CreateWindow(const NPRemoteWindow& aWindow)
aWindow.x, aWindow.y,
aWindow.width, aWindow.height));
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mXEmbed) {
mWindow.window = reinterpret_cast<void*>(aWindow.window);
}
@ -1076,7 +1078,7 @@ void PluginInstanceChild::DeleteWindow()
if (!mWindow.window)
return;
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mXtClient.top_widget) {
xt_client_unrealize(&mXtClient);
xt_client_destroy(&mXtClient);
@ -1257,7 +1259,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
bool
PluginInstanceChild::Initialize()
{
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
NPError rv;
if (mWsInfo.display) {
@ -4147,7 +4149,7 @@ PluginInstanceChild::AnswerNPP_Destroy(NPError* aResult)
mAsyncBitmaps.Enumerate(DeleteSurface, this);
}
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
if (mWindow.type == NPWindowTypeWindow && !mXEmbed) {
xt_client_xloop_destroy();
}

Просмотреть файл

@ -34,7 +34,7 @@
#include <map>
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
#include "gtk2xtbin.h"
#endif
@ -383,7 +383,7 @@ private:
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
NPSetWindowCallbackStruct mWsInfo;
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
bool mXEmbed;
XtClient mXtClient;
#endif

Просмотреть файл

@ -1098,7 +1098,7 @@ _getvalue(NPP aNPP,
*(NPBool*)aValue = value ? true : false;
return result;
}
#if defined(MOZ_WIDGET_GTK)
#if (MOZ_WIDGET_GTK == 2)
case NPNVxDisplay: {
if (aNPP) {
return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);

Просмотреть файл

@ -163,7 +163,7 @@ MOCHITEST_FILES += \
$(NULL)
endif
ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT))
ifeq (,$(filter-out gtk2 gtk3,$(MOZ_WIDGET_TOOLKIT)))
MOCHITEST_FILES += \
test_copyText.html \
test_crash_nested_loop.html \

Просмотреть файл

@ -6,7 +6,7 @@
DIRS += ['testplugin']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'cocoa', 'windows'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'cocoa', 'windows'):
TEST_DIRS += ['mochitest']
MODULE = 'test_plugin'

Просмотреть файл

@ -9,7 +9,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
Push.js \
Push.manifest \
$(NULL)

Просмотреть файл

@ -1,5 +1,10 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_COMPONENTS += [
'Push.js',
'Push.manifest',
]

Просмотреть файл

@ -9,7 +9,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXTRA_COMPONENTS = \
DISABLED_EXTRA_COMPONENTS = \
SettingsManager.js \
SettingsManager.manifest \
SettingsService.js \

Просмотреть файл

@ -5,3 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
TEST_DIRS += ['tests']
EXTRA_COMPONENTS += [
'SettingsManager.js',
'SettingsManager.manifest',
'SettingsService.js',
'SettingsService.manifest',
]

Просмотреть файл

@ -6,7 +6,7 @@
toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
if toolkit in ('qt', 'gtk2'):
if toolkit in ('qt', 'gtk2', 'gtk3'):
DIRS += ['unix']
elif toolkit == 'windows':
DIRS += ['windows']

Просмотреть файл

@ -343,6 +343,18 @@ struct BaseRect {
height = y1 - y0;
}
// Scale 'this' by aScale without doing any rounding.
void Scale(T aScale) { Scale(aScale, aScale); }
// Scale 'this' by aXScale and aYScale, without doing any rounding.
void Scale(T aXScale, T aYScale)
{
T right = XMost() * aXScale;
T bottom = YMost() * aYScale;
x = x * aXScale;
y = y * aYScale;
width = right - x;
height = bottom - y;
}
// Scale 'this' by aScale, converting coordinates to integers so that the result is
// the smallest integer-coordinate rectangle containing the unrounded result.
// Note: this can turn an empty rectangle into a non-empty rectangle

Просмотреть файл

@ -155,7 +155,7 @@ public:
//
// This is only valid on the root layer. Nested iframes do not have a
// displayport set on them. See bug 775452.
gfx::Rect mDisplayPort;
CSSRect mDisplayPort;
// If non-empty, the area of a frame's contents that is considered critical
// to paint. Area outside of this area (i.e. area inside mDisplayPort, but
@ -163,7 +163,7 @@ public:
// painted with lower precision, or not painted at all.
//
// The same restrictions for mDisplayPort apply here.
gfx::Rect mCriticalDisplayPort;
CSSRect mCriticalDisplayPort;
// The CSS viewport, which is the dimensions we're using to constrain the
// <html> element of this frame, relative to the top-left of the layer. Note
@ -174,7 +174,7 @@ public:
// their own viewport, which will just be the size of the window of the
// iframe. For layers that don't correspond to a document, this metric is
// meaningless and invalid.
gfx::Rect mViewport;
CSSRect mViewport;
// The position of the top-left of the CSS viewport, relative to the document
// (or the document relative to the viewport, if that helps understand it).
@ -191,7 +191,7 @@ public:
//
// This is valid for any layer, but is always relative to this frame and
// not any parents, regardless of parent transforms.
mozilla::CSSPoint mScrollOffset;
CSSPoint mScrollOffset;
// A unique ID assigned to each scrollable frame (unless this is
// ROOT_SCROLL_ID, in which case it is not unique).
@ -208,7 +208,7 @@ public:
// window.scrollTo().
//
// This is valid on any layer unless it has no content.
mozilla::CSSRect mScrollableRect;
CSSRect mScrollableRect;
// ---------------------------------------------------------------------------
// The following metrics are dimensionless.

Просмотреть файл

@ -6,7 +6,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "LayersLogging.h"
#include "nsPrintfCString.h"
using namespace mozilla::gfx;
@ -95,16 +94,6 @@ AppendToString(nsACString& s, const nsIntPoint& p,
return s += sfx;
}
template<class T>
nsACString&
AppendToString(nsACString& s, const PointTyped<T>& p,
const char* pfx, const char* sfx)
{
s += pfx;
s += nsPrintfCString("(x=%f, y=%f)", p.x, p.y);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRect& r,
const char* pfx, const char* sfx)
@ -116,17 +105,6 @@ AppendToString(nsACString& s, const nsIntRect& r,
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const Rect& r,
const char* pfx, const char* sfx)
{
s += pfx;
s.AppendPrintf(
"(x=%f, y=%f, w=%f, h=%f)",
r.x, r.y, r.width, r.height);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRegion& r,
const char* pfx, const char* sfx)

Просмотреть файл

@ -16,6 +16,7 @@
#include "gfxColor.h"
#include "gfx3DMatrix.h"
#include "nsRegion.h"
#include "nsPrintfCString.h"
namespace mozilla {
namespace layers {
@ -47,15 +48,28 @@ AppendToString(nsACString& s, const nsIntPoint& p,
template<class T>
nsACString&
AppendToString(nsACString& s, const mozilla::gfx::PointTyped<T>& p,
const char* pfx="", const char* sfx="");
const char* pfx="", const char* sfx="")
{
s += pfx;
s += nsPrintfCString("(x=%f, y=%f)", p.x, p.y);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRect& r,
const char* pfx="", const char* sfx="");
template<class T>
nsACString&
AppendToString(nsACString& s, const mozilla::gfx::Rect& r,
const char* pfx="", const char* sfx="");
AppendToString(nsACString& s, const mozilla::gfx::RectTyped<T>& r,
const char* pfx="", const char* sfx="")
{
s += pfx;
s.AppendPrintf(
"(x=%f, y=%f, w=%f, h=%f)",
r.x, r.y, r.width, r.height);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRegion& r,

Просмотреть файл

@ -397,13 +397,11 @@ ClientLayerManager::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent,
const gfx3DMatrix& rootTransform = GetRoot()->GetTransform();
float devPixelRatioX = 1 / rootTransform.GetXScale();
float devPixelRatioY = 1 / rootTransform.GetYScale();
const gfx::Rect& metricsDisplayPort =
const CSSRect& metricsDisplayPort =
(aDrawingCritical && !metrics.mCriticalDisplayPort.IsEmpty()) ?
metrics.mCriticalDisplayPort : metrics.mDisplayPort;
gfx::Rect displayPort((metricsDisplayPort.x + metrics.mScrollOffset.x) * devPixelRatioX,
(metricsDisplayPort.y + metrics.mScrollOffset.y) * devPixelRatioY,
metricsDisplayPort.width * devPixelRatioX,
metricsDisplayPort.height * devPixelRatioY);
LayerRect displayPort = LayerRect::FromCSSRect(metricsDisplayPort + metrics.mScrollOffset,
devPixelRatioX, devPixelRatioY);
return AndroidBridge::Bridge()->ProgressiveUpdateCallback(
aHasPendingNewThebesContent, displayPort, devPixelRatioX, aDrawingCritical,

Просмотреть файл

@ -57,7 +57,8 @@ ClientTiledThebesLayer::BeginPaint()
// Compute the critical display port in layer space.
mPaintData.mLayerCriticalDisplayPort.SetEmpty();
const gfx::Rect& criticalDisplayPort = GetParent()->GetFrameMetrics().mCriticalDisplayPort;
const gfx::Rect& criticalDisplayPort =
GetParent()->GetFrameMetrics().mCriticalDisplayPort.ToUnknownRect();
if (!criticalDisplayPort.IsEmpty()) {
gfxRect transformedCriticalDisplayPort =
mPaintData.mTransformScreenToLayer.TransformBounds(

Просмотреть файл

@ -351,12 +351,12 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFram
const gfx3DMatrix& rootTransform = mLayerManager->GetRoot()->GetTransform();
const FrameMetrics& metrics = container->GetFrameMetrics();
gfx::Rect displayPortLayersPixels(metrics.mCriticalDisplayPort.IsEmpty() ?
metrics.mDisplayPort : metrics.mCriticalDisplayPort);
CSSRect displayPort(metrics.mCriticalDisplayPort.IsEmpty() ?
metrics.mDisplayPort : metrics.mCriticalDisplayPort);
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
ScreenPoint offset(0, 0);
SyncFrameMetrics(scrollOffset, treeTransform.mScale.width, metrics.mScrollableRect,
mLayersUpdated, displayPortLayersPixels, 1 / rootTransform.GetXScale(),
mLayersUpdated, displayPort, 1 / rootTransform.GetXScale(),
mIsFirstPaint, fixedLayerMargins, offset);
mIsFirstPaint = false;
@ -425,14 +425,12 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer, const gfx3DMatr
// We synchronise the viewport information with Java after sending the above
// notifications, so that Java can take these into account in its response.
// Calculate the absolute display port to send to Java
LayerIntRect displayPort = LayerIntRect::FromCSSRectRounded(
CSSRect::FromUnknownRect(metrics.mCriticalDisplayPort.IsEmpty()
? metrics.mDisplayPort
: metrics.mCriticalDisplayPort),
layerPixelRatioX, layerPixelRatioY);
displayPort.x += scrollOffsetLayerPixels.x;
displayPort.y += scrollOffsetLayerPixels.y;
LayerIntRect displayPort =
LayerIntRect::FromCSSRectRounded(metrics.mCriticalDisplayPort.IsEmpty()
? metrics.mDisplayPort
: metrics.mCriticalDisplayPort,
layerPixelRatioX, layerPixelRatioY);
displayPort += scrollOffsetLayerPixels;
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
ScreenPoint offset(0, 0);
@ -595,7 +593,7 @@ AsyncCompositionManager::SyncFrameMetrics(const gfx::Point& aScrollOffset,
float aZoom,
const CSSRect& aCssPageRect,
bool aLayersUpdated,
const gfx::Rect& aDisplayPort,
const CSSRect& aDisplayPort,
float aDisplayResolution,
bool aIsFirstPaint,
gfx::Margin& aFixedLayerMargins,

Просмотреть файл

@ -130,7 +130,7 @@ private:
float aZoom,
const CSSRect& aCssPageRect,
bool aLayersUpdated,
const gfx::Rect& aDisplayPort,
const CSSRect& aDisplayPort,
float aDisplayResolution,
bool aIsFirstPaint,
gfx::Margin& aFixedLayerMargins,

Просмотреть файл

@ -435,7 +435,7 @@ GetRegionArea(const nsIntRegion& aRegion)
#ifdef MOZ_ANDROID_OMTC
static float
GetDisplayportCoverage(const gfx::Rect& aDisplayPort,
GetDisplayportCoverage(const CSSRect& aDisplayPort,
const gfx3DMatrix& aTransformToScreen,
const nsIntRect& aScreenRect)
{

Просмотреть файл

@ -255,7 +255,7 @@ ThebesLayerComposite::GetCompositionBounds()
gfx::Point scrollOffset =
gfx::Point((metrics.mScrollOffset.x * metrics.LayersPixelsPerCSSPixel().width) / scaleX,
(metrics.mScrollOffset.y * metrics.LayersPixelsPerCSSPixel().height) / scaleY);
const nsIntPoint& contentOrigin = nsIntPoint(
const nsIntPoint contentOrigin(
metrics.mContentRect.x - NS_lround(scrollOffset.x),
metrics.mContentRect.y - NS_lround(scrollOffset.y));
gfxRect contentRect = gfxRect(contentOrigin.x, contentOrigin.y,

Просмотреть файл

@ -653,11 +653,11 @@ nsEventStatus AsyncPanZoomController::OnLongPress(const TapGestureInput& aEvent)
MonitorAutoLock monitor(mMonitor);
gfxFloat resolution = CalculateResolution(mFrameMetrics).width;
gfx::Point point = WidgetSpaceToCompensatedViewportSpace(
gfx::Point(aEvent.mPoint.x, aEvent.mPoint.y),
resolution);
mGeckoContentController->HandleLongTap(nsIntPoint(NS_lround(point.x),
NS_lround(point.y)));
CSSPoint point = CSSPoint::FromUnknownPoint(
WidgetSpaceToCompensatedViewportSpace(
gfx::Point(aEvent.mPoint.x, aEvent.mPoint.y),
resolution));
mGeckoContentController->HandleLongTap(CSSIntPoint::RoundToInt(point));
return nsEventStatus_eConsumeNoDefault;
}
return nsEventStatus_eIgnore;
@ -672,11 +672,11 @@ nsEventStatus AsyncPanZoomController::OnSingleTapConfirmed(const TapGestureInput
MonitorAutoLock monitor(mMonitor);
gfxFloat resolution = CalculateResolution(mFrameMetrics).width;
gfx::Point point = WidgetSpaceToCompensatedViewportSpace(
gfx::Point(aEvent.mPoint.x, aEvent.mPoint.y),
resolution);
mGeckoContentController->HandleSingleTap(nsIntPoint(NS_lround(point.x),
NS_lround(point.y)));
CSSPoint point = CSSPoint::FromUnknownPoint(
WidgetSpaceToCompensatedViewportSpace(
gfx::Point(aEvent.mPoint.x, aEvent.mPoint.y),
resolution));
mGeckoContentController->HandleSingleTap(CSSIntPoint::RoundToInt(point));
return nsEventStatus_eConsumeNoDefault;
}
return nsEventStatus_eIgnore;
@ -688,11 +688,11 @@ nsEventStatus AsyncPanZoomController::OnDoubleTap(const TapGestureInput& aEvent)
if (mAllowZoom) {
gfxFloat resolution = CalculateResolution(mFrameMetrics).width;
gfx::Point point = WidgetSpaceToCompensatedViewportSpace(
gfx::Point(aEvent.mPoint.x, aEvent.mPoint.y),
resolution);
mGeckoContentController->HandleDoubleTap(nsIntPoint(NS_lround(point.x),
NS_lround(point.y)));
CSSPoint point = CSSPoint::FromUnknownPoint(
WidgetSpaceToCompensatedViewportSpace(
gfx::Point(aEvent.mPoint.x, aEvent.mPoint.y),
resolution));
mGeckoContentController->HandleDoubleTap(CSSIntPoint::RoundToInt(point));
}
return nsEventStatus_eConsumeNoDefault;
@ -839,7 +839,7 @@ void AsyncPanZoomController::SetPageRect(const CSSRect& aCSSPageRect) {
// The page rect is the css page rect scaled by the current zoom.
// Round the page rect so we don't get any truncation, then get the nsIntRect
// from this.
metrics.mContentRect = LayerRect::FromCSSRectRoundOut(aCSSPageRect, resolution);
metrics.mContentRect = LayerRect::FromCSSRectRoundOut(aCSSPageRect, resolution, resolution);
metrics.mScrollableRect = aCSSPageRect;
mFrameMetrics = metrics;
@ -900,7 +900,7 @@ bool AsyncPanZoomController::EnlargeDisplayPortAlongAxis(float aSkateSizeMultipl
return false;
}
const gfx::Rect AsyncPanZoomController::CalculatePendingDisplayPort(
const CSSRect AsyncPanZoomController::CalculatePendingDisplayPort(
const FrameMetrics& aFrameMetrics,
const gfx::Point& aVelocity,
const gfx::Point& aAcceleration,
@ -916,8 +916,8 @@ const gfx::Rect AsyncPanZoomController::CalculatePendingDisplayPort(
gfxSize resolution = CalculateResolution(aFrameMetrics);
CSSIntRect compositionBounds = LayerIntRect::ToCSSIntRectRoundIn(
aFrameMetrics.mCompositionBounds, resolution);
gfx::Rect scrollableRect = aFrameMetrics.mScrollableRect.ToUnknownRect();
aFrameMetrics.mCompositionBounds, resolution.width, resolution.height);
CSSRect scrollableRect = aFrameMetrics.mScrollableRect;
// Ensure the scrollableRect is at least as big as the compositionBounds
// because the scrollableRect can be smaller if the content is not large
@ -938,9 +938,9 @@ const gfx::Rect AsyncPanZoomController::CalculatePendingDisplayPort(
CSSPoint scrollOffset = aFrameMetrics.mScrollOffset;
gfx::Rect displayPort(0, 0,
compositionBounds.width * gXStationarySizeMultiplier,
compositionBounds.height * gYStationarySizeMultiplier);
CSSRect displayPort = CSSRect(compositionBounds);
displayPort.MoveTo(0, 0);
displayPort.Scale(gXStationarySizeMultiplier, gYStationarySizeMultiplier);
// If there's motion along an axis of movement, and it's above a threshold,
// then we want to paint a larger area in the direction of that motion so that
@ -981,12 +981,8 @@ const gfx::Rect AsyncPanZoomController::CalculatePendingDisplayPort(
scrollOffset.y = scrollableRect.y;
}
gfx::Rect shiftedDisplayPort = displayPort;
shiftedDisplayPort.MoveBy(scrollOffset.x, scrollOffset.y);
displayPort = scrollableRect.ClampRect(shiftedDisplayPort);
displayPort.MoveBy(-scrollOffset.x, -scrollOffset.y);
return displayPort;
CSSRect shiftedDisplayPort = displayPort + scrollOffset;
return scrollableRect.ClampRect(shiftedDisplayPort) - scrollOffset;
}
/*static*/ gfxSize
@ -1011,7 +1007,7 @@ AsyncPanZoomController::CalculateCompositedRectInCssPixels(const FrameMetrics& a
{
gfxSize resolution = CalculateResolution(aMetrics);
CSSIntRect rect = LayerIntRect::ToCSSIntRectRoundIn(
aMetrics.mCompositionBounds, resolution);
aMetrics.mCompositionBounds, resolution.width, resolution.height);
return CSSRect(rect);
}
@ -1048,16 +1044,12 @@ void AsyncPanZoomController::RequestContentRepaint() {
GetAccelerationVector(),
estimatedPaintDuration);
CSSPoint oldScrollOffset = mLastPaintRequestMetrics.mScrollOffset,
newScrollOffset = mFrameMetrics.mScrollOffset;
// If we're trying to paint what we already think is painted, discard this
// request since it's a pointless paint.
gfx::Rect oldDisplayPort = mLastPaintRequestMetrics.mDisplayPort;
gfx::Rect newDisplayPort = mFrameMetrics.mDisplayPort;
oldDisplayPort.MoveBy(oldScrollOffset.x, oldScrollOffset.y);
newDisplayPort.MoveBy(newScrollOffset.x, newScrollOffset.y);
CSSRect oldDisplayPort = mLastPaintRequestMetrics.mDisplayPort
+ mLastPaintRequestMetrics.mScrollOffset;
CSSRect newDisplayPort = mFrameMetrics.mDisplayPort
+ mFrameMetrics.mScrollOffset;
if (fabsf(oldDisplayPort.x - newDisplayPort.x) < EPSILON &&
fabsf(oldDisplayPort.y - newDisplayPort.y) < EPSILON &&
@ -1184,7 +1176,7 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa
}
scrollOffset = gfxPoint(mFrameMetrics.mScrollOffset.x, mFrameMetrics.mScrollOffset.y);
mCurrentAsyncScrollOffset = mFrameMetrics.mScrollOffset.ToUnknownPoint();
mCurrentAsyncScrollOffset = mFrameMetrics.mScrollOffset;
}
// Cancel the mAsyncScrollTimeoutTask because we will fire a
@ -1372,7 +1364,7 @@ void AsyncPanZoomController::ZoomToRect(const gfxRect& aRect) {
(currentZoom.width == mMaxZoom && targetZoom >= mMaxZoom) ||
(currentZoom.width == localMinZoom && targetZoom <= localMinZoom)) {
CSSIntRect cssCompositionBounds = LayerIntRect::ToCSSIntRectRoundIn(
compositionBounds, resolution);
compositionBounds, resolution.width, resolution.height);
float y = scrollOffset.y;
float newHeight =
@ -1501,13 +1493,11 @@ void AsyncPanZoomController::SendAsyncScrollEvent() {
return;
}
gfx::Rect contentRect;
gfx::Size scrollableSize;
CSSRect contentRect;
CSSSize scrollableSize;
{
scrollableSize = gfx::Size(mFrameMetrics.mScrollableRect.width,
mFrameMetrics.mScrollableRect.height);
contentRect = AsyncPanZoomController::CalculateCompositedRectInCssPixels(mFrameMetrics)
.ToUnknownRect();
scrollableSize = mFrameMetrics.mScrollableRect.Size();
contentRect = AsyncPanZoomController::CalculateCompositedRectInCssPixels(mFrameMetrics);
contentRect.MoveTo(mCurrentAsyncScrollOffset);
}

Просмотреть файл

@ -223,7 +223,7 @@ public:
* checkerboard immediately. This includes a bunch of logic, including
* algorithms to bias painting in the direction of the velocity.
*/
static const gfx::Rect CalculatePendingDisplayPort(
static const CSSRect CalculatePendingDisplayPort(
const FrameMetrics& aFrameMetrics,
const gfx::Point& aVelocity,
const gfx::Point& aAcceleration,
@ -568,11 +568,11 @@ private:
// The last time and offset we fire the mozbrowserasyncscroll event when
// compositor has sampled the content transform for this frame.
TimeStamp mLastAsyncScrollTime;
gfx::Point mLastAsyncScrollOffset;
CSSPoint mLastAsyncScrollOffset;
// The current offset drawn on the screen, it may not be sent since we have
// throttling policy for mozbrowserasyncscroll event.
gfx::Point mCurrentAsyncScrollOffset;
CSSPoint mCurrentAsyncScrollOffset;
// The delay task triggered by the throttling mozbrowserasyncscroll event
// ensures the last mozbrowserasyncscroll event is always been fired.

Просмотреть файл

@ -318,9 +318,9 @@ bool Axis::ScaleWillOverscrollBothSides(float aScale) {
CSSRect cssContentRect = metrics.mScrollableRect;
float currentScale = metrics.mZoom.width;
float scale = metrics.mZoom.width * aScale;
CSSIntRect cssCompositionBounds = LayerIntRect::ToCSSIntRectRoundIn(
metrics.mCompositionBounds, currentScale * aScale);
metrics.mCompositionBounds, scale, scale);
return GetRectLength(cssContentRect) < GetRectLength(CSSRect(cssCompositionBounds));
}

Просмотреть файл

@ -31,28 +31,28 @@ public:
* AsyncPanZoomController::ZoomToRect with the dimensions that we want to zoom
* to.
*/
virtual void HandleDoubleTap(const nsIntPoint& aPoint) = 0;
virtual void HandleDoubleTap(const CSSIntPoint& aPoint) = 0;
/**
* Requests handling a single tap. |aPoint| is in CSS pixels, relative to the
* current scroll offset. This should simulate and send to content a mouse
* button down, then mouse button up at |aPoint|.
*/
virtual void HandleSingleTap(const nsIntPoint& aPoint) = 0;
virtual void HandleSingleTap(const CSSIntPoint& aPoint) = 0;
/**
* Requests handling a long tap. |aPoint| is in CSS pixels, relative to the
* current scroll offset.
*/
virtual void HandleLongTap(const nsIntPoint& aPoint) = 0;
virtual void HandleLongTap(const CSSIntPoint& aPoint) = 0;
/**
* Requests sending a mozbrowserasyncscroll domevent to embedder.
* |aContentRect| is in CSS pixels, relative to the current cssPage.
* |aScrollableSize| is the current content width/height in CSS pixels.
*/
virtual void SendAsyncScrollDOMEvent(const gfx::Rect &aContentRect,
const gfx::Size &aScrollableSize) = 0;
virtual void SendAsyncScrollDOMEvent(const CSSRect &aContentRect,
const CSSSize &aScrollableSize) = 0;
/**
* Schedules a runnable to run on the controller/UI thread at some time

Просмотреть файл

@ -806,6 +806,24 @@ struct ParamTraits< mozilla::gfx::PointTyped<T> >
}
};
template<class T>
struct ParamTraits< mozilla::gfx::IntPointTyped<T> >
{
typedef mozilla::gfx::IntPointTyped<T> paramType;
static void Write(Message* msg, const paramType& param)
{
WriteParam(msg, param.x);
WriteParam(msg, param.y);
}
static bool Read(const Message* msg, void** iter, paramType* result)
{
return (ReadParam(msg, iter, &result->x) &&
ReadParam(msg, iter, &result->y));
}
};
template<>
struct ParamTraits<mozilla::gfx::Size>
{

Просмотреть файл

@ -857,21 +857,24 @@ CharsMatch(const jschar *p, const char *q) {
}
bool
TokenStream::getAtSourceMappingURL(bool isMultiline)
TokenStream::getSourceMappingURL(bool isMultiline, bool shouldWarnDeprecated)
{
/* Match comments of the form "//@ sourceMappingURL=<url>" or
* "/\* //@ sourceMappingURL=<url> *\/"
/* Match comments of the form "//# sourceMappingURL=<url>" or
* "/\* //# sourceMappingURL=<url> *\/"
*
* To avoid a crashing bug in IE, several JavaScript transpilers
* wrap single line comments containing a source mapping URL
* inside a multiline comment to avoid a crashing bug in IE. To
* avoid potentially expensive lookahead and backtracking, we
* only check for this case if we encounter an '@' character.
* To avoid a crashing bug in IE, several JavaScript transpilers wrap single
* line comments containing a source mapping URL inside a multiline
* comment. To avoid potentially expensive lookahead and backtracking, we
* only check for this case if we encounter a '#' character.
*/
jschar peeked[18];
int32_t c;
if (peekChars(18, peeked) && CharsMatch(peeked, " sourceMappingURL=")) {
if (shouldWarnDeprecated && !reportWarning(JSMSG_DEPRECATED_SOURCE_MAP)) {
return false;
}
skipChars(18);
tokenbuf.clear();
@ -1600,8 +1603,11 @@ TokenStream::getTokenInternal()
* Look for a single-line comment.
*/
if (matchChar('/')) {
if (matchChar('@') && !getAtSourceMappingURL(false))
goto error;
c = peekChar();
if (c == '@' || c == '#') {
if (!getSourceMappingURL(false, getChar() == '@'))
goto error;
}
skipline:
/* Optimize line skipping if we are not in an HTML comment. */
@ -1626,8 +1632,10 @@ TokenStream::getTokenInternal()
unsigned linenoBefore = lineno;
while ((c = getChar()) != EOF &&
!(c == '*' && matchChar('/'))) {
if (c == '@' && !getAtSourceMappingURL(true))
goto error;
if (c == '@' || c == '#') {
if (!getSourceMappingURL(true, c == '@'))
goto error;
}
}
if (c == EOF) {
reportError(JSMSG_UNTERMINATED_COMMENT);

Просмотреть файл

@ -878,7 +878,7 @@ class MOZ_STACK_CLASS TokenStream
bool matchUnicodeEscapeIdStart(int32_t *c);
bool matchUnicodeEscapeIdent(int32_t *c);
bool peekChars(int n, jschar *cp);
bool getAtSourceMappingURL(bool isMultiline);
bool getSourceMappingURL(bool isMultiline, bool shouldWarnDeprecated);
// |expect| cannot be an EOL char.
bool matchChar(int32_t expect) {

Просмотреть файл

@ -102,12 +102,6 @@ struct IonOptions
// Default: 1,000
uint32_t usesBeforeCompile;
// How many invocations or loop iterations are needed before functions
// are compiled when JM is disabled.
//
// Default: 40
uint32_t usesBeforeCompileNoJaeger;
// How many invocations or loop iterations are needed before calls
// are inlined, as a fraction of usesBeforeCompile.
//
@ -183,7 +177,7 @@ struct IonOptions
void setEagerCompilation() {
eagerCompilation = true;
usesBeforeCompile = usesBeforeCompileNoJaeger = 0;
usesBeforeCompile = 0;
baselineUsesBeforeCompile = 0;
parallelCompilation = false;
@ -204,7 +198,6 @@ struct IonOptions
parallelCompilation(false),
baselineUsesBeforeCompile(10),
usesBeforeCompile(1000),
usesBeforeCompileNoJaeger(40),
usesBeforeInliningFactor(.125),
osrPcMismatchesBeforeRecompile(6000),
frequentBailoutThreshold(10),

Просмотреть файл

@ -26,15 +26,15 @@ SnapshotIterator::readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Va
else
skip();
// Skip slot for arguments object.
if (script->argumentsHasVarBinding())
skip();
if (thisv)
*thisv = read();
else
skip();
// Skip slot for arguments object.
if (script->argumentsHasVarBinding())
skip();
unsigned i = 0;
if (formalEnd < start)
i = start;
@ -159,6 +159,10 @@ InlineFrameIteratorMaybeGC<allowGC>::thisObject() const
// scopeChain
s.skip();
// Arguments object.
if (script()->argumentsHasVarBinding())
s.skip();
// In strict modes, |this| may not be an object and thus may not be
// readable which can either segv in read or trigger the assertion.
Value v = s.read();

Просмотреть файл

@ -0,0 +1,19 @@
evalcx("\
let z = 'x';\
for (var v of z) {\
y = evaluate(\"Object.defineProperty(this,\\\"y\\\",\
{get: function() {}}\
);\",\
{catchTermination: true, saveFrameChain: true}\
);\
}",
newGlobal('')
)
evalcx("\
for (x = 0; x < 1; ++x) { \
v = evaluate(\"gc\",{ \
saveFrameChain: true \
})\
}\
", newGlobal(''));

Просмотреть файл

@ -0,0 +1,70 @@
// Script.prototype.sourceMapURL can be a string or null.
let g = newGlobal('new-compartment');
let dbg = new Debugger;
let gw = dbg.addDebuggee(g);
function getSourceMapURL() {
let fw = gw.makeDebuggeeValue(g.f);
return fw.script.sourceMapURL;
}
// Without a source map
g.evaluate("function f(x) { return 2*x; }");
assertEq(getSourceMapURL(), null);
// With a source map
g.evaluate("function f(x) { return 2*x; }", {sourceMapURL: 'file:///var/foo.js.map'});
assertEq(getSourceMapURL(), 'file:///var/foo.js.map');
// Nested functions
let fired = false;
dbg.onDebuggerStatement = function (frame) {
fired = true;
assertEq(frame.script.sourceMapURL, 'file:///var/bar.js.map');
};
g.evaluate('(function () { (function () { debugger; })(); })();',
{sourceMapURL: 'file:///var/bar.js.map'});
assertEq(fired, true);
// Comment pragmas
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=file:///var/quux.js.map');
assertEq(getSourceMapURL(), 'file:///var/quux.js.map');
g.evaluate('function f() {}\n' +
'/*//@ sourceMappingURL=file:///var/quux.js.map*/');
assertEq(getSourceMapURL(), 'file:///var/quux.js.map');
g.evaluate('function f() {}\n' +
'/*\n' +
'//@ sourceMappingURL=file:///var/quux.js.map\n' +
'*/');
assertEq(getSourceMapURL(), 'file:///var/quux.js.map');
// Spaces are disallowed by the URL spec (they should have been
// percent-encoded).
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=http://example.com/has illegal spaces.map');
assertEq(getSourceMapURL(), 'http://example.com/has');
// When the URL is missing, we don't set the sourceMapURL and we don't skip the
// next line of input.
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=\n' +
'function z() {}');
assertEq(getSourceMapURL(), null);
assertEq('z' in g, true);
// The last comment pragma we see should be the one which sets the source map's
// URL.
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=http://example.com/foo.js.map\n' +
'//@ sourceMappingURL=http://example.com/bar.js.map');
assertEq(getSourceMapURL(), 'http://example.com/bar.js.map');
// With both a comment and the evaluate option.
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=http://example.com/foo.js.map',
{sourceMapURL: 'http://example.com/bar.js.map'});
assertEq(getSourceMapURL(), 'http://example.com/foo.js.map');

Просмотреть файл

@ -29,29 +29,29 @@ assertEq(fired, true);
// Comment pragmas
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=file:///var/quux.js.map');
'//# sourceMappingURL=file:///var/quux.js.map');
assertEq(getSourceMapURL(), 'file:///var/quux.js.map');
g.evaluate('function f() {}\n' +
'/*//@ sourceMappingURL=file:///var/quux.js.map*/');
'/*//# sourceMappingURL=file:///var/quux.js.map*/');
assertEq(getSourceMapURL(), 'file:///var/quux.js.map');
g.evaluate('function f() {}\n' +
'/*\n' +
'//@ sourceMappingURL=file:///var/quux.js.map\n' +
'//# sourceMappingURL=file:///var/quux.js.map\n' +
'*/');
assertEq(getSourceMapURL(), 'file:///var/quux.js.map');
// Spaces are disallowed by the URL spec (they should have been
// percent-encoded).
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=http://example.com/has illegal spaces.map');
'//# sourceMappingURL=http://example.com/has illegal spaces.map');
assertEq(getSourceMapURL(), 'http://example.com/has');
// When the URL is missing, we don't set the sourceMapURL and we don't skip the
// next line of input.
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=\n' +
'//# sourceMappingURL=\n' +
'function z() {}');
assertEq(getSourceMapURL(), null);
assertEq('z' in g, true);
@ -59,12 +59,12 @@ assertEq('z' in g, true);
// The last comment pragma we see should be the one which sets the source map's
// URL.
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=http://example.com/foo.js.map\n' +
'//@ sourceMappingURL=http://example.com/bar.js.map');
'//# sourceMappingURL=http://example.com/foo.js.map\n' +
'//# sourceMappingURL=http://example.com/bar.js.map');
assertEq(getSourceMapURL(), 'http://example.com/bar.js.map');
// With both a comment and the evaluate option.
g.evaluate('function f() {}\n' +
'//@ sourceMappingURL=http://example.com/foo.js.map',
'//# sourceMappingURL=http://example.com/foo.js.map',
{sourceMapURL: 'http://example.com/bar.js.map'});
assertEq(getSourceMapURL(), 'http://example.com/foo.js.map');

Просмотреть файл

@ -0,0 +1,20 @@
function initialize() {};
function test() {
eval("\
var Class = {\
create : function() {\
return function() {\
this.initialize.apply(this, arguments);\
}\
}\
};\
var Foo = Class.create();\
Foo.prototype = {\
initialize : function() {\
this.bar = Foo();\
}\
};\
var foo = new Foo();\
");
}
test();

Просмотреть файл

@ -400,3 +400,4 @@ MSG_DEF(JSMSG_YIELD_IN_ARROW, 346, 0, JSEXN_SYNTAXERR, "arrow function m
MSG_DEF(JSMSG_WRONG_VALUE, 347, 2, JSEXN_ERR, "expected {0} but found {1}")
MSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, "target for index {0} is not an integer")
MSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME,349, 0, JSEXN_TYPEERR, "self-hosted code may not contain unbound name lookups")
MSG_DEF(JSMSG_DEPRECATED_SOURCE_MAP, 350, 0, JSEXN_SYNTAXERR, "Using //@ to indicate source map URL pragmas is deprecated. Use //# instead")

Просмотреть файл

@ -66,8 +66,6 @@ ScriptAnalysis::addJump(JSContext *cx, unsigned offset,
code->jumpTarget = true;
if (offset < *currentOffset) {
/* Scripts containing loops are never inlined. */
isJaegerInlineable = false;
hasLoops_ = true;
if (code->analyzed) {
@ -153,13 +151,9 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
bool heavyweight = script_->function() && script_->function()->isHeavyweight();
isJaegerCompileable = true;
isJaegerInlineable = isIonInlineable = true;
isIonInlineable = true;
if (heavyweight || cx->compartment->debugMode())
isJaegerInlineable = isIonInlineable = false;
if (script_->argumentsHasVarBinding())
isJaegerInlineable = false;
isIonInlineable = false;
modifiesArguments_ = false;
if (heavyweight)
@ -248,7 +242,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
if (script_->hasBreakpointsAt(pc)) {
code->safePoint = true;
canTrackVars = false;
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
}
unsigned stackDepth = code->stackDepth;
@ -273,7 +267,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
case JSOP_SETRVAL:
case JSOP_POPV:
usesReturnValue_ = true;
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
break;
case JSOP_NAME:
@ -286,7 +280,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
case JSOP_SETALIASEDVAR:
case JSOP_LAMBDA:
usesScopeChain_ = true;
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
break;
case JSOP_DEFFUN:
@ -295,24 +289,24 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
case JSOP_SETCONST:
usesScopeChain_ = true; // Requires access to VarObj via ScopeChain.
canTrackVars = false;
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
break;
case JSOP_EVAL:
canTrackVars = false;
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
break;
case JSOP_ENTERWITH:
isJaegerCompileable = canTrackVars = false;
isJaegerInlineable = isIonInlineable = false;
canTrackVars = false;
isIonInlineable = false;
break;
case JSOP_ENTERLET0:
case JSOP_ENTERLET1:
case JSOP_ENTERBLOCK:
case JSOP_LEAVEBLOCK:
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
break;
case JSOP_THIS:
@ -326,7 +320,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
break;
case JSOP_TABLESWITCH: {
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
unsigned defaultOffset = offset + GET_JUMP_OFFSET(pc);
jsbytecode *pc2 = pc + JUMP_OFFSET_LEN;
int32_t low = GET_JUMP_OFFSET(pc2);
@ -357,7 +351,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
* exception but is not caught by a later handler in the same function:
* no more code will execute, and it does not matter what is defined.
*/
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
JSTryNote *tn = script_->trynotes()->vector;
JSTryNote *tnlimit = tn + script_->trynotes()->length;
for (; tn < tnlimit; tn++) {
@ -409,7 +403,6 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
case JSOP_SETARG:
modifiesArguments_ = true;
isJaegerInlineable = false;
break;
case JSOP_GETPROP:
@ -420,20 +413,17 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
numPropertyReads_++;
break;
/* Additional opcodes which can be compiled but which can't be inlined. */
case JSOP_ARGUMENTS:
case JSOP_FUNAPPLY:
case JSOP_CALLEE:
isJaegerInlineable = false;
break;
case JSOP_THROW:
case JSOP_EXCEPTION:
case JSOP_DEBUGGER:
case JSOP_FUNCALL:
isIonInlineable = isJaegerInlineable = false;
isIonInlineable = false;
break;
/* Additional opcodes which can be both compiled both normally and inline. */
case JSOP_ARGUMENTS:
case JSOP_FUNAPPLY:
case JSOP_CALLEE:
case JSOP_NOP:
case JSOP_UNDEFINED:
case JSOP_GOTO:
@ -530,8 +520,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
break;
default:
isJaegerCompileable = false;
isJaegerInlineable = isIonInlineable = false;
isIonInlineable = false;
break;
}

Просмотреть файл

@ -728,9 +728,7 @@ class ScriptAnalysis
bool hasFunctionCalls_:1;
bool modifiesArguments_:1;
bool localsAliasStack_:1;
bool isJaegerInlineable:1;
bool isIonInlineable:1;
bool isJaegerCompileable:1;
bool canTrackVars:1;
bool hasLoops_:1;
@ -768,9 +766,6 @@ class ScriptAnalysis
bool ionInlineable() const { return isIonInlineable; }
bool ionInlineable(uint32_t argc) const { return isIonInlineable && argc == script_->function()->nargs; }
void setIonUninlineable() { isIonInlineable = false; }
bool jaegerInlineable() const { return isJaegerInlineable; }
bool jaegerInlineable(uint32_t argc) const { return isJaegerInlineable && argc == script_->function()->nargs; }
bool jaegerCompileable() { return isJaegerCompileable; }
/* Number of property read opcodes in the script. */
uint32_t numPropertyReads() const { return numPropertyReads_; }

Просмотреть файл

@ -67,26 +67,6 @@ fun_getProperty(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValu
}
RootedFunction fun(cx, obj->toFunction());
/*
* Mark the function's script as uninlineable, to expand any of its
* frames on the stack before we go looking for them. This allows the
* below walk to only check each explicit frame rather than needing to
* check any calls that were inlined.
*/
if (fun->isInterpreted()) {
if (fun->isInterpretedLazy() && !fun->getOrCreateScript(cx))
return false;
fun->nonLazyScript()->uninlineable = true;
MarkTypeObjectFlags(cx, fun, OBJECT_FLAG_UNINLINEABLE);
/* If we're a callsite clone, mark the original as unlineable also. */
if (fun->nonLazyScript()->isCallsiteClone) {
RootedFunction original(cx, fun->nonLazyScript()->originalFunction());
original->nonLazyScript()->uninlineable = true;
MarkTypeObjectFlags(cx, original, OBJECT_FLAG_UNINLINEABLE);
}
}
/* Set to early to null in case of error */
vp.setNull();

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше