Merge last PGO-green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2012-02-11 01:49:07 +00:00
Родитель b11540684c 07729f9d3d
Коммит ebbd72c144
91 изменённых файлов: 4131 добавлений и 480 удалений

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

@ -235,8 +235,7 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
eNoValue,
eNoAction,
eNoLiveAttr,
states::READONLY,
eARIAMultiSelectable
states::READONLY
},
{
"listbox",
@ -256,9 +255,7 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
eNoValue,
eNoAction, // XXX: should depend on state, parent accessible
eNoLiveAttr,
states::READONLY,
eARIASelectable,
eARIACheckedMixed
states::READONLY
},
{
"log",

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

@ -161,12 +161,6 @@ public:
*/
virtual bool IsPrimaryForNode() const;
/**
* Return the string bundle
*/
static nsIStringBundle* GetStringBundle()
{ return gStringBundle; }
/**
* Interface methods on nsIAccessible shared with ISimpleDOM.
*/

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

@ -96,9 +96,9 @@
<a id="link" href="">link</span>
<div role="listbox" aria-activedescendant="item1" id="container" tabindex="1">
<div role="listitem" id="item1">item1</div>
<div role="listitem" id="item2">item2</div>
<div role="listitem" id="item3">item3</div>
<div role="option" id="item1">item1</div>
<div role="option" id="item2">item2</div>
<div role="option" id="item3">item3</div>
</div>
<embed id="plugin" type="application/x-test" width="200" height="200" wmode="window"></embed>

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

@ -36,25 +36,6 @@
function doTest()
{
//////////////////////////////////////////////////////////////////////////
// role="list"
var id = "list1";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
var select = getAccessible(id, [nsIAccessibleSelectable]);
select.addChildToSelection(0);
testSelectableSelection(id, [ ]);
select.removeChildFromSelection(0);
testSelectableSelection(id, [ ]);
select.selectAllSelection();
testSelectableSelection(id, [ ]);
select.clearSelection();
testSelectableSelection(id, [ ]);
//////////////////////////////////////////////////////////////////////////
// role="listbox"
@ -82,7 +63,7 @@
testSelectableSelection(id, [ "listbox2_item1", "listbox2_item2" ]);
select.clearSelection();
testSelectableSelection(id, [ ]);
//////////////////////////////////////////////////////////////////////////
// role="grid"
@ -152,19 +133,14 @@
<pre id="test">
</pre>
<div role="list" id="list1">
<div role="listitem">item1</div>
<div role="listitem">item2</div>
</div>
<div role="listbox" id="listbox1">
<div role="listitem">item1</div>
<div role="listitem">item2</div>
<div role="option">item1</div>
<div role="option">item2</div>
</div>
<div role="listbox" id="listbox2" aria-multiselectable="true">
<div role="listitem" id="listbox2_item1">item1</div>
<div role="listitem" id="listbox2_item2">item2</div>
<div role="option" id="listbox2_item1">item1</div>
<div role="option" id="listbox2_item2">item2</div>
</div>
<div role="grid" id="grid1">

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

@ -89,12 +89,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=452388
testStates("listbox_multiselectable_undefined", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
testStates("listbox_multiselectable_absent", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
// test (listitem) checkable and checked states
testStates("listitem_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
testStates("listitem_checked_false", STATE_CHECKABLE, 0, STATE_CHECKED);
testStates("listitem_checked_empty", 0 , 0, STATE_CHECKABLE | STATE_CHECKED);
testStates("listitem_checked_undefined", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
testStates("listitem_checked_absent", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
// test (option) checkable and checked states
testStates("option_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
testStates("option_checked_false", STATE_CHECKABLE, 0, STATE_CHECKED);
testStates("option_checked_empty", 0 , 0, STATE_CHECKABLE | STATE_CHECKED);
testStates("option_checked_undefined", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
testStates("option_checked_absent", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
// test (menuitem) checkable and checked states
testStates("menuitem_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
@ -239,19 +239,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=452388
<div id="checkbox_disabled_absent" role="checkbox">This checkbox has <emph>no</emph> aria-disabled attribute and should <emph>not</emph> get STATE_DISABLED.</div>
<div id="listbox_multiselectable_true" role="listbox" aria-multiselectable="true">
<div id="listitem_checked_true" role="listitem" aria-checked="true">item</div>
<div id="option_checked_true" role="option" aria-checked="true">item</div>
</div>
<div id="listbox_multiselectable_false" role="listbox" aria-multiselectable="false">
<div id="listitem_checked_false" role="listitem" aria-checked="false">item</div>
<div id="option_checked_false" role="option" aria-checked="false">item</div>
</div>
<div id="listbox_multiselectable_empty" role="listbox" aria-multiselectable="">
<div id="listitem_checked_empty" role="listitem" aria-checked="">item</div>
<div id="option_checked_empty" role="option" aria-checked="">item</div>
</div>
<div id="listbox_multiselectable_undefined" role="listbox" aria-multiselectable="undefined">
<div id="listitem_checked_undefined" role="listitem" aria-checked="undefined">item</div>
<div id="option_checked_undefined" role="option" aria-checked="undefined">item</div>
</div>
<div id="listbox_multiselectable_absent" role="listbox">
<div id="listitem_checked_absent" role="listitem">item</div>
<div id="option_checked_absent" role="option">item</div>
</div>
<div role="menu">

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

@ -68,6 +68,7 @@ config/nspr/Makefile
config/doxygen.cfg
config/expandlibs_config.py
config/tests/src-simple/Makefile
mfbt/Makefile
probes/Makefile
extensions/Makefile
"
@ -125,6 +126,11 @@ if [ "$ENABLE_TESTS" ]; then
add_makefiles "
build/autoconf/test/Makefile
"
if [ ! "$LIBXUL_SDK" ]; then
add_makefiles "
mozglue/tests/Makefile
"
fi
if [ "$_MSC_VER" -a "$OS_TEST" != "x86_64" ]; then
add_makefiles "
build/win32/vmwarerecordinghelper/Makefile
@ -137,6 +143,7 @@ if [ "$ENABLE_TESTS" ]; then
fi
if [ "$MOZ_WIDGET_TOOLKIT" = "android" ]; then
add_makefiles "
build/mobile/robocop/Makefile
build/mobile/sutagent/android/Makefile
build/mobile/sutagent/android/fencp/Makefile
build/mobile/sutagent/android/ffxcp/Makefile

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

@ -35,21 +35,13 @@
# ***** END LICENSE BLOCK *****
add_makefiles "
netwerk/locales/Makefile
dom/locales/Makefile
toolkit/locales/Makefile
security/manager/locales/Makefile
b2g/app/Makefile
$MOZ_BRANDING_DIRECTORY/Makefile
$MOZ_BRANDING_DIRECTORY/content/Makefile
$MOZ_BRANDING_DIRECTORY/locales/Makefile
b2g/chrome/Makefile
b2g/components/Makefile
b2g/installer/Makefile
b2g/locales/Makefile
b2g/Makefile
"
if test -n "$MOZ_UPDATE_PACKAGING"; then
add_makefiles "
tools/update-packaging/Makefile
"
fi

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

@ -5865,7 +5865,7 @@ function hrefAndLinkNodeForClickEvent(event)
function contentAreaClick(event, isPanelClick)
{
if (!event.isTrusted || event.defaultPrevented || event.button == 2)
return true;
return;
let [href, linkNode] = hrefAndLinkNodeForClickEvent(event);
if (!href) {
@ -5876,7 +5876,7 @@ function contentAreaClick(event, isPanelClick)
middleMousePaste(event);
event.preventDefault();
}
return true;
return;
}
// This code only applies if we have a linkNode (i.e. clicks on real anchor
@ -5893,7 +5893,7 @@ function contentAreaClick(event, isPanelClick)
if (linkNode.getAttribute("onclick") ||
href.substr(0, 11) === "javascript:" ||
href.substr(0, 5) === "data:")
return true;
return;
try {
urlSecurityCheck(href, linkNode.ownerDocument.nodePrincipal);
@ -5901,16 +5901,16 @@ function contentAreaClick(event, isPanelClick)
catch(ex) {
// Prevent loading unsecure destinations.
event.preventDefault();
return true;
return;
}
let postData = {};
let url = getShortcutOrURI(href, postData);
if (!url)
return true;
return;
loadURI(url, null, postData.value, false);
event.preventDefault();
return true;
return;
}
if (linkNode.getAttribute("rel") == "sidebar") {
@ -5927,7 +5927,7 @@ function contentAreaClick(event, isPanelClick)
, "keyword" ]
}, window);
event.preventDefault();
return true;
return;
}
}
@ -5940,8 +5940,6 @@ function contentAreaClick(event, isPanelClick)
try {
PlacesUIUtils.markPageAsFollowedLink(href);
} catch (ex) { /* Skip invalid URIs. */ }
return true;
}
/**

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

@ -966,7 +966,7 @@
tabcontainer="tabbrowser-tabs"
contentcontextmenu="contentAreaContextMenu"
autocompletepopup="PopupAutoComplete"
onclick="return contentAreaClick(event, false);"/>
onclick="contentAreaClick(event, false);"/>
<statuspanel id="statusbar-display" inactive="true"/>
</vbox>
<splitter id="devtools-side-splitter" hidden="true"/>

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

@ -232,7 +232,7 @@ let gClickHandler = {
gCurrentTest.desc + ":Handler received a click event on " + linkId);
let isPanelClick = linkId == "panellink";
let returnValue = gTestWin.contentAreaClick(event, isPanelClick);
gTestWin.contentAreaClick(event, isPanelClick);
let prevent = event.defaultPrevented;
is(prevent, gCurrentTest.preventDefault,
gCurrentTest.desc + ": event.defaultPrevented is correct (" + prevent + ")")

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

@ -98,5 +98,5 @@
<commandset id="editMenuCommands"/>
<browser id="web-panels-browser" persist="cachedurl" type="content" flex="1"
context="contentAreaContextMenu" tooltip="aHTMLTooltip"
onclick="return window.parent.contentAreaClick(event, true);"/>
onclick="window.parent.contentAreaClick(event, true);"/>
</page>

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

@ -67,6 +67,7 @@ browser/components/shell/Makefile
browser/components/shell/public/Makefile
browser/components/shell/src/Makefile
browser/components/tabview/Makefile
browser/components/thumbnails/Makefile
browser/devtools/Makefile
browser/devtools/debugger/Makefile
browser/devtools/highlighter/Makefile
@ -75,6 +76,7 @@ browser/devtools/shared/Makefile
browser/devtools/sourceeditor/Makefile
browser/devtools/styleeditor/Makefile
browser/devtools/styleinspector/Makefile
browser/devtools/tilt/Makefile
browser/devtools/webconsole/Makefile
browser/fuel/Makefile
browser/fuel/public/Makefile
@ -122,6 +124,7 @@ fi
if [ "$ENABLE_TESTS" ]; then
add_makefiles "
browser/base/content/test/Makefile
browser/base/content/test/newtab/Makefile
browser/components/certerror/test/Makefile
browser/components/dirprovider/tests/Makefile
browser/components/preferences/tests/Makefile
@ -137,6 +140,7 @@ if [ "$ENABLE_TESTS" ]; then
browser/components/privatebrowsing/test/browser/Makefile
browser/components/tabview/test/Makefile
browser/components/test/Makefile
browser/components/thumbnails/test/Makefile
browser/devtools/debugger/test/Makefile
browser/devtools/highlighter/test/Makefile
browser/devtools/scratchpad/test/Makefile
@ -144,6 +148,7 @@ if [ "$ENABLE_TESTS" ]; then
browser/devtools/sourceeditor/test/Makefile
browser/devtools/styleeditor/test/Makefile
browser/devtools/styleinspector/test/Makefile
browser/devtools/tilt/test/Makefile
browser/devtools/webconsole/test/Makefile
browser/fuel/test/Makefile
browser/modules/test/Makefile

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

@ -44,18 +44,18 @@ include $(DEPTH)/config/autoconf.mk
NO_PROFILE_GUIDED_OPTIMIZE = 1
ifdef ENABLE_TESTS
ifdef _MSC_VER
ifneq ($(OS_TEST),x86_64)
DIRS += vmwarerecordinghelper
TEST_DIRS += vmwarerecordinghelper
endif
endif
DIRS += \
TEST_DIRS += \
crashinjectdll \
$(NULL)
ifdef ENABLE_TESTS
PROGRAM = crashinject$(BIN_SUFFIX)
USE_STATIC_LIBS = 1
CPPSRCS = crashinject.cpp

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

@ -5481,7 +5481,7 @@ MOZ_ARG_DISABLE_BOOL(websms-backend,
MOZ_WEBSMS_BACKEND=,
MOZ_WEBSMS_BACKEND=1)
if test $MOZ_WEBSMS_BACKEND -eq 1; then
if test -n "$MOZ_WEBSMS_BACKEND"; then
AC_DEFINE(MOZ_WEBSMS_BACKEND)
fi
@ -9063,14 +9063,14 @@ if test -z "$MOZ_NATIVE_NSPR"; then
if test -n "$USE_ARM_KUSER"; then
ac_configure_args="$ac_configure_args --with-arm-kuser"
fi
if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a $ac_cv_func_dladdr = no ; then
if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no ; then
# dladdr is supported by the new linker, even when the system linker doesn't
# support it. Trick nspr into using dladdr when it's not supported.
_SAVE_CPPFLAGS="$CPPFLAGS"
export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
fi
AC_OUTPUT_SUBDIRS(nsprpub)
if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a $ac_cv_func_dladdr = no; then
if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no; then
unset CPPFLAGS
CPPFLAGS="$_SAVE_CFLAGS"
fi

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

@ -484,16 +484,18 @@ IsSupportedImage(const nsCString& aMimeType)
return NS_SUCCEEDED(rv) && supported;
}
static bool
IsSupportedPlugin(const nsCString& aMIMEType, bool aShouldPlay)
nsresult nsObjectLoadingContent::IsPluginEnabledForType(const nsCString& aMIMEType)
{
if (!mShouldPlay) {
return NS_ERROR_PLUGIN_CLICKTOPLAY;
}
nsCOMPtr<nsIPluginHost> pluginHostCOM(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
nsPluginHost *pluginHost = static_cast<nsPluginHost*>(pluginHostCOM.get());
if (!pluginHost) {
return false;
}
nsresult rv = pluginHost->IsPluginEnabledForType(aMIMEType.get(), aShouldPlay);
return NS_SUCCEEDED(rv);
return pluginHost->IsPluginEnabledForType(aMIMEType.get());
}
static void
@ -517,9 +519,12 @@ GetExtensionFromURI(nsIURI* uri, nsCString& ext)
* Checks whether a plugin exists and is enabled for the extension
* in the given URI. The MIME type is returned in the mimeType out parameter.
*/
static bool
IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType, bool aShouldPlay)
bool nsObjectLoadingContent::IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType)
{
if (!mShouldPlay) {
return false;
}
nsCAutoString ext;
GetExtensionFromURI(uri, ext);
@ -534,8 +539,7 @@ IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType, bool aShouldPlay)
}
const char* typeFromExt;
if (NS_SUCCEEDED(pluginHost->IsPluginEnabledForExtension(ext.get(), typeFromExt,
aShouldPlay))) {
if (NS_SUCCEEDED(pluginHost->IsPluginEnabledForExtension(ext.get(), typeFromExt))) {
mimeType = typeFromExt;
return true;
}
@ -568,6 +572,10 @@ nsObjectLoadingContent::~nsObjectLoadingContent()
nsresult
nsObjectLoadingContent::InstantiatePluginInstance(const char* aMimeType, nsIURI* aURI)
{
if (!mShouldPlay) {
return NS_ERROR_PLUGIN_CLICKTOPLAY;
}
// Don't do anything if we already have an active instance.
if (mInstanceOwner) {
return NS_OK;
@ -586,11 +594,6 @@ nsObjectLoadingContent::InstantiatePluginInstance(const char* aMimeType, nsIURI*
nsCOMPtr<nsIObjectLoadingContent> kungFuDeathGrip = this;
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
nsCString typeToUse(aMimeType);
if (typeToUse.IsEmpty() && aURI) {
IsPluginEnabledByExtension(aURI, typeToUse, mShouldPlay);
}
nsCOMPtr<nsIURI> baseURI;
if (!aURI) {
// We need some URI. If we have nothing else, use the base URI.
@ -730,10 +733,10 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
if ((channelType.EqualsASCII(APPLICATION_OCTET_STREAM) &&
!mContentType.IsEmpty() &&
GetTypeOfContent(mContentType) != eType_Document) ||
// Need to check IsSupportedPlugin() in addition to GetTypeOfContent()
// Need to check IsPluginEnabledForType() in addition to GetTypeOfContent()
// because otherwise the default plug-in's catch-all behavior would
// confuse things.
(IsSupportedPlugin(mContentType, mShouldPlay) &&
(NS_SUCCEEDED(IsPluginEnabledForType(mContentType)) &&
GetTypeOfContent(mContentType) == eType_Plugin)) {
// Set the type we'll use for dispatch on the channel. Otherwise we could
// end up trying to dispatch to a nsFrameLoader, which will complain that
@ -752,7 +755,7 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
if (mContentType.EqualsASCII(APPLICATION_OCTET_STREAM)) {
nsCAutoString extType;
if (IsPluginEnabledByExtension(uri, extType, mShouldPlay)) {
if (IsPluginEnabledByExtension(uri, extType)) {
mContentType = extType;
chan->SetContentType(extType);
}
@ -1297,8 +1300,8 @@ nsObjectLoadingContent::LoadObject(nsIURI* aURI,
nsCAutoString overrideType;
if ((caps & eOverrideServerType) &&
((!aTypeHint.IsEmpty() && IsSupportedPlugin(aTypeHint, mShouldPlay)) ||
(aURI && IsPluginEnabledByExtension(aURI, overrideType, mShouldPlay)))) {
((!aTypeHint.IsEmpty() && NS_SUCCEEDED(IsPluginEnabledForType(aTypeHint))) ||
(aURI && IsPluginEnabledByExtension(aURI, overrideType)))) {
ObjectType newType;
if (overrideType.IsEmpty()) {
newType = GetTypeOfContent(aTypeHint);
@ -1434,7 +1437,7 @@ nsObjectLoadingContent::LoadObject(nsIURI* aURI,
return NS_OK;
}
if (IsSupportedPlugin(aTypeHint, mShouldPlay)) {
if (NS_SUCCEEDED(IsPluginEnabledForType(aTypeHint))) {
mType = eType_Plugin;
} else {
rv = NS_ERROR_NOT_AVAILABLE;
@ -1744,7 +1747,7 @@ nsObjectLoadingContent::GetTypeOfContent(const nsCString& aMIMEType)
return eType_Document;
}
if ((caps & eSupportPlugins) && IsSupportedPlugin(aMIMEType, mShouldPlay)) {
if ((caps & eSupportPlugins) && NS_SUCCEEDED(IsPluginEnabledForType(aMIMEType))) {
return eType_Plugin;
}
@ -1755,16 +1758,10 @@ nsresult
nsObjectLoadingContent::TypeForClassID(const nsAString& aClassID,
nsACString& aType)
{
nsCOMPtr<nsIPluginHost> pluginHostCOM(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
nsPluginHost *pluginHost = static_cast<nsPluginHost*>(pluginHostCOM.get());
if (!pluginHost) {
return NS_ERROR_NOT_AVAILABLE;
}
if (StringBeginsWith(aClassID, NS_LITERAL_STRING("java:"))) {
// Supported if we have a java plugin
aType.AssignLiteral("application/x-java-vm");
nsresult rv = pluginHost->IsPluginEnabledForType("application/x-java-vm");
nsresult rv = IsPluginEnabledForType(NS_LITERAL_CSTRING("application/x-java-vm"));
return NS_SUCCEEDED(rv) ? NS_OK : NS_ERROR_NOT_AVAILABLE;
}
@ -1772,11 +1769,11 @@ nsObjectLoadingContent::TypeForClassID(const nsAString& aClassID,
if (StringBeginsWith(aClassID, NS_LITERAL_STRING("clsid:"), nsCaseInsensitiveStringComparator())) {
// Check if we have a plugin for that
if (NS_SUCCEEDED(pluginHost->IsPluginEnabledForType("application/x-oleobject"))) {
if (NS_SUCCEEDED(IsPluginEnabledForType(NS_LITERAL_CSTRING("application/x-oleobject")))) {
aType.AssignLiteral("application/x-oleobject");
return NS_OK;
}
if (NS_SUCCEEDED(pluginHost->IsPluginEnabledForType("application/oleobject"))) {
if (NS_SUCCEEDED(IsPluginEnabledForType(NS_LITERAL_CSTRING("application/oleobject")))) {
aType.AssignLiteral("application/oleobject");
return NS_OK;
}
@ -1832,7 +1829,7 @@ nsObjectLoadingContent::HandleBeingBlockedByContentPolicy(nsresult aStatus,
}
}
/* static */ PluginSupportState
PluginSupportState
nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
const nsCString& aContentType)
{
@ -1866,16 +1863,10 @@ nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
GetPluginDisabledState(aContentType);
}
/* static */ PluginSupportState
PluginSupportState
nsObjectLoadingContent::GetPluginDisabledState(const nsCString& aContentType)
{
nsCOMPtr<nsIPluginHost> pluginHostCOM(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
nsPluginHost *pluginHost = static_cast<nsPluginHost*>(pluginHostCOM.get());
if (!pluginHost) {
return ePluginUnsupported;
}
nsresult rv = pluginHost->IsPluginEnabledForType(aContentType.get());
nsresult rv = IsPluginEnabledForType(aContentType);
if (rv == NS_ERROR_PLUGIN_DISABLED)
return ePluginDisabled;
if (rv == NS_ERROR_PLUGIN_CLICKTOPLAY)
@ -2117,6 +2108,7 @@ nsObjectLoadingContent::PlayPlugin()
if (!nsContentUtils::IsCallerChrome())
return NS_OK;
mSrcStreamLoadInitiated = false;
mShouldPlay = true;
return LoadObject(mURI, true, mContentType, true);
}

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

@ -328,9 +328,7 @@ class nsObjectLoadingContent : public nsImageLoadingContent
*
* This should only be called if the type of this content is eType_Null.
*/
static PluginSupportState
GetPluginSupportState(nsIContent* aContent,
const nsCString& aContentType);
PluginSupportState GetPluginSupportState(nsIContent* aContent, const nsCString& aContentType);
/**
* If the plugin for aContentType is disabled, return ePluginDisabled.
@ -339,17 +337,17 @@ class nsObjectLoadingContent : public nsImageLoadingContent
*
* This should only be called if the type of this content is eType_Null.
*/
static PluginSupportState
GetPluginDisabledState(const nsCString& aContentType);
PluginSupportState GetPluginDisabledState(const nsCString& aContentType);
/**
* When there is no usable plugin available this will send UI events and
* update the AutoFallback object appropriate to the reason for there being
* no plugin available.
*/
static void
UpdateFallbackState(nsIContent* aContent, AutoFallback& fallback,
const nsCString& aTypeHint);
void UpdateFallbackState(nsIContent* aContent, AutoFallback& fallback, const nsCString& aTypeHint);
nsresult IsPluginEnabledForType(const nsCString& aMIMEType);
bool IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType);
/**
* The final listener to ship the data to (imagelib, uriloader, etc)

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

@ -35,11 +35,9 @@ Rect.prototype.roundOut = function()
this.top = Math.floor(this.top);
}
var delta = 1;
function isApproximately(a, b, message)
function isWithAbsTolerance(a, b, tolerance, message)
{
ok(delta >= Math.abs(a - b), message + " - got " + a + ", expected " + b + " ± " + delta);
ok(tolerance >= Math.abs(a - b), message + " - got " + a + ", expected " + b + " ± " + tolerance);
}
function runTest()
@ -54,7 +52,7 @@ function runTest()
var sin45 = Math.sin(Math.PI / 4);
isApproximately(text1Bounds.left, 24, "text1.getBoundingClientRect().left");
isWithAbsTolerance(text1Bounds.left, 24, 1, "text1.getBoundingClientRect().left");
is(text2Bounds.left, text1Bounds.left + 100, "text2.getBoundingClientRect().left");
is(text2Bounds.top, text1Bounds.top, "text2.getBoundingClientRect().top");
@ -62,8 +60,8 @@ function runTest()
is(text2Bounds.height, text1Bounds.height, "text2.getBoundingClientRect().height");
var r = (text1Bounds.width + text1Bounds.height) * sin45;
isApproximately(text3Bounds.width, Math.ceil(r), "text3.getBoundingClientRect().width");
isApproximately(text3Bounds.height, Math.ceil(r), "text3.getBoundingClientRect().height");
isWithAbsTolerance(text3Bounds.width, Math.ceil(r), 1, "text3.getBoundingClientRect().width");
isWithAbsTolerance(text3Bounds.height, Math.ceil(r), 1, "text3.getBoundingClientRect().height");
var rect1Bounds = doc.getElementById("rect1").getBoundingClientRect();
var rect2Bounds = doc.getElementById("rect2").getBoundingClientRect();
@ -76,11 +74,10 @@ function runTest()
is(rect1Bounds.height, 50, "rect1.getBoundingClientRect().height");
rect = new Rect(175 - 50 * sin45, 75 - 50 * sin45, 50 * sin45 * 2, 50 * sin45 * 2);
rect.roundOut();
is(rect2Bounds.left, rect.left, "rect2.getBoundingClientRect().left");
is(rect2Bounds.top, rect.top, "rect2.getBoundingClientRect().top");
is(rect2Bounds.width, rect.width, "rect2.getBoundingClientRect().width");
is(rect2Bounds.height, rect.height, "rect2.getBoundingClientRect().height");
isWithAbsTolerance(rect2Bounds.left, rect.left, 0.1, "rect2.getBoundingClientRect().left");
isWithAbsTolerance(rect2Bounds.top, rect.top, 0.1, "rect2.getBoundingClientRect().top");
isWithAbsTolerance(rect2Bounds.width, rect.width, 0.1, "rect2.getBoundingClientRect().width");
isWithAbsTolerance(rect2Bounds.height, rect.height, 0.1, "rect2.getBoundingClientRect().height");
is(rect3Bounds.left, 50, "rect3.getBoundingClientRect().left");
is(rect3Bounds.top, 160, "rect3.getBoundingClientRect().top");
@ -88,11 +85,10 @@ function runTest()
is(rect3Bounds.height, 100, "rect3.getBoundingClientRect().height");
rect = new Rect(350 - 100 * sin45, 150 - 100 * sin45, 100 * sin45 * 2, 100 * sin45 * 2);
rect.roundOut();
is(rect4Bounds.left, rect.left, "rect4.getBoundingClientRect().left");
is(rect4Bounds.top, rect.top, "rect4.getBoundingClientRect().top");
is(rect4Bounds.width, rect.width, "rect4.getBoundingClientRect().width");
is(rect4Bounds.height, rect.height, "rect4.getBoundingClientRect().height");
isWithAbsTolerance(rect4Bounds.left, rect.left, 0.1, "rect4.getBoundingClientRect().left");
isWithAbsTolerance(rect4Bounds.top, rect.top, 0.1, "rect4.getBoundingClientRect().top");
isWithAbsTolerance(rect4Bounds.width, rect.width, 0.1, "rect4.getBoundingClientRect().width");
isWithAbsTolerance(rect4Bounds.height, rect.height, 0.1, "rect4.getBoundingClientRect().height");
var rect1aBounds = doc.getElementById("rect1a").getBoundingClientRect();
var rect2aBounds = doc.getElementById("rect2a").getBoundingClientRect();
@ -105,11 +101,10 @@ function runTest()
is(rect1aBounds.height, 54, "rect1a.getBoundingClientRect().height");
rect = new Rect(175 - 54 * sin45, 75 - 54 * sin45, 54 * sin45 * 2, 54 * sin45 * 2);
rect.roundOut();
is(rect2aBounds.left, rect.left, "rect2a.getBoundingClientRect().left");
is(rect2aBounds.top, rect.top, "rect2a.getBoundingClientRect().top");
is(rect2aBounds.width, rect.width, "rect2a.getBoundingClientRect().width");
is(rect2aBounds.height, rect.height, "rect2a.getBoundingClientRect().height");
isWithAbsTolerance(rect2aBounds.left, rect.left, 0.1, "rect2a.getBoundingClientRect().left");
isWithAbsTolerance(rect2aBounds.top, rect.top, 0.1, "rect2a.getBoundingClientRect().top");
isWithAbsTolerance(rect2aBounds.width, rect.width, 0.1, "rect2a.getBoundingClientRect().width");
isWithAbsTolerance(rect2aBounds.height, rect.height, 0.1, "rect2a.getBoundingClientRect().height");
is(rect3aBounds.left, 46, "rect3a.getBoundingClientRect().left");
is(rect3aBounds.top, 156, "rect3a.getBoundingClientRect().top");
@ -117,18 +112,17 @@ function runTest()
is(rect3aBounds.height, 108, "rect3a.getBoundingClientRect().height");
rect = new Rect(350 - 108 * sin45, 150 - 108 * sin45, 108 * sin45 * 2, 108 * sin45 * 2);
rect.roundOut();
is(rect4aBounds.left, rect.left, "rect4a.getBoundingClientRect().left");
is(rect4aBounds.top, rect.top, "rect4a.getBoundingClientRect().top");
is(rect4aBounds.width, rect.width, "rect4a.getBoundingClientRect().width");
is(rect4aBounds.height, rect.height, "rect4a.getBoundingClientRect().height");
isWithAbsTolerance(rect4aBounds.left, rect.left, 0.1, "rect4a.getBoundingClientRect().left");
isWithAbsTolerance(rect4aBounds.top, rect.top, 0.1, "rect4a.getBoundingClientRect().top");
isWithAbsTolerance(rect4aBounds.width, rect.width, 0.1, "rect4a.getBoundingClientRect().width");
isWithAbsTolerance(rect4aBounds.height, rect.height, 0.1, "rect4a.getBoundingClientRect().height");
var text1a = doc.getElementById("text1a");
var text1aBounds = text1a.getBoundingClientRect();
var text2aBounds = doc.getElementById("text2a").getBoundingClientRect();
isApproximately(text1aBounds.left, 82, "text1a.getBoundingClientRect().left");
isWithAbsTolerance(text1aBounds.left, 82, 1, "text1a.getBoundingClientRect().left");
is(text1aBounds.width, text1Bounds.width + 4, "text1a.getBoundingClientRect().width");
is(text2aBounds.left, text1aBounds.left + 100 - 3, "text2a.getBoundingClientRect().left");

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

@ -1367,18 +1367,10 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType,
nsresult
nsPluginHost::IsPluginEnabledForType(const char* aMimeType)
{
// If plugins.click_to_play is false, plugins should always play
return IsPluginEnabledForType(aMimeType,
!Preferences::GetBool("plugins.click_to_play", false));
}
nsresult
nsPluginHost::IsPluginEnabledForType(const char* aMimeType, bool aShouldPlay)
{
nsPluginTag *plugin = FindPluginForType(aMimeType, true);
if (plugin)
return aShouldPlay ? NS_OK : NS_ERROR_PLUGIN_CLICKTOPLAY;
return NS_OK;
// Pass false as the second arg so we can return NS_ERROR_PLUGIN_DISABLED
// for disabled plug-ins.
@ -1393,7 +1385,7 @@ nsPluginHost::IsPluginEnabledForType(const char* aMimeType, bool aShouldPlay)
return NS_ERROR_PLUGIN_DISABLED;
}
return aShouldPlay ? NS_OK : NS_ERROR_PLUGIN_CLICKTOPLAY;
return NS_OK;
}
// check comma delimitered extensions
@ -1421,22 +1413,13 @@ static int CompareExtensions(const char *aExtensionList, const char *aExtension)
return PL_strcasecmp(pExt, aExtension);
}
nsresult
nsPluginHost::IsPluginEnabledForExtension(const char* aExtension, const char* &aMimeType)
{
// If plugins.click_to_play is false, plugins should always play
return IsPluginEnabledForExtension(aExtension, aMimeType,
!Preferences::GetBool("plugins.click_to_play", false));
}
nsresult
nsPluginHost::IsPluginEnabledForExtension(const char* aExtension,
const char* &aMimeType,
bool aShouldPlay)
const char* &aMimeType)
{
nsPluginTag *plugin = FindPluginEnabledForExtension(aExtension, aMimeType);
if (plugin)
return aShouldPlay ? NS_OK : NS_ERROR_PLUGIN_CLICKTOPLAY;
return NS_OK;
return NS_ERROR_FAILURE;
}

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

@ -120,11 +120,8 @@ public:
nsIURI *aURL,
nsIPluginInstanceOwner *aOwner);
nsresult IsPluginEnabledForType(const char* aMimeType);
nsresult IsPluginEnabledForType(const char* aMimeType,
bool aShouldPlay);
nsresult IsPluginEnabledForExtension(const char* aExtension, const char* &aMimeType);
nsresult IsPluginEnabledForExtension(const char* aExtension, const char* &aMimeType,
bool aShouldPlay);
nsresult GetPluginCount(PRUint32* aPluginCount);
nsresult GetPlugins(PRUint32 aPluginCount, nsIDOMPlugin** aPluginArray);

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

@ -45,8 +45,8 @@ include $(DEPTH)/config/autoconf.mk
PARALLEL_DIRS = interfaces src
TEST_DIRS += tests
ifdef ENABLE_TESTS
DIRS += tests
XPCSHELL_TESTS = tests
endif

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

@ -493,6 +493,7 @@ var WifiManager = (function() {
for (let i = 0; i < lines.length; ++i) {
let [key, value] = lines[i].split("=");
if (key === "wpa_state") {
notify("statechange", { state: value });
if (value === "COMPLETED")
onconnected();
}
@ -564,8 +565,8 @@ var WifiManager = (function() {
}
var supplicantStatesMap = ["DISCONNECTED", "INACTIVE", "SCANNING", "ASSOCIATING",
"FOUR_WAY_HANDSHAKE", "GROUP_HANDSHAKE", "COMPLETED",
"DORMANT", "UNINITIALIZED"];
"ASSOCIATED", "FOUR_WAY_HANDSHAKE", "GROUP_HANDSHAKE",
"COMPLETED", "DORMANT", "UNINITIALIZED"];
var driverEventMap = { STOPPED: "driverstopped", STARTED: "driverstarted", HANGED: "driverhung" };
// handle events sent to us by the event worker
@ -580,11 +581,12 @@ var WifiManager = (function() {
return true;
}
var eventData = event.substr(0, event.indexOf(" ") + 1);
var space = event.indexOf(" ");
var eventData = event.substr(0, space + 1);
if (eventData.indexOf("CTRL-EVENT-STATE-CHANGE") === 0) {
// Parse the event data
var fields = {};
var tokens = eventData.split(" ");
var tokens = event.substr(space + 1).split(" ");
for (var n = 0; n < tokens.length; ++n) {
var kv = tokens[n].split("=");
if (kv.length === 2)
@ -630,7 +632,7 @@ var WifiManager = (function() {
return true;
}
if (eventData.indexOf("CTRL-EVENT-SCAN-RESULTS") === 0) {
debug("Notifying of scn results available");
debug("Notifying of scan results available");
notify("scanresultsavailable");
return true;
}
@ -804,6 +806,47 @@ function nsWifiWorker() {
debug("Couldn't connect to supplicant");
}
var state;
WifiManager.onstatechange = function() {
debug("State change: " + state + " -> " + this.state);
if (state === "SCANNING" && this.state === "INACTIVE") {
// We're not trying to connect so try to find an open Mozilla network.
// TODO Remove me in favor of UI and a way to select a network.
debug("Haven't connected to a network, trying a default (for now)");
var name = "Mozilla";
var net = networks[name];
if (net && (net[1] && net[1] !== "[IBSS]")) {
debug("Network Mozilla exists, but is encrypted");
net = null;
}
if (!net) {
name = "Mozilla Guest";
net = networks[name];
if (!net || (net[1] && net[1] !== "[IBSS]")) {
debug("Network Mozilla Guest doesn't exist or is encrypted");
return;
}
}
var config = Object.create(null);
config["ssid"] = '"' + name + '"';
config["key_mgmt"] = "NONE";
WifiManager.addNetwork(config, function(ok) {
if (!ok) {
debug("Unable to add the network!");
return;
}
WifiManager.enableNetwork(config.netId, false, function(ok) {
debug((ok ? "Successfully enabled " : "Didn't enable ") + name);
});
});
}
state = this.state;
}
var networks = Object.create(null);
WifiManager.onscanresultsavailable = function() {
debug("Scan results are available! Asking for them.");
@ -814,7 +857,7 @@ function nsWifiWorker() {
// bssid / frequency / signal level / flags / ssid
var match = /([\S]+)\s+([\S]+)\s+([\S]+)\s+(\[[\S]+\])?\s+(.*)/.exec(lines[i])
if (match)
networks[match[5]] = match[1];
networks[match[5]] = [match[1], match[4]];
else
debug("Match didn't find anything for: " + lines[i]);
}

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

@ -48,9 +48,9 @@ MODULE = embed
DIRS = base components browser
TEST_DIRS += test
ifdef ENABLE_TESTS
XPCSHELL_TESTS = tests/unit
DIRS += test
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),android)

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

@ -603,6 +603,11 @@ public class GeckoAppShell
imm, text, start, end, newEnd);
}
public static void notifyScreenShot(ByteBuffer data, int tabId, int width, int height) {
// this stub is never called in XUL Fennec, but we need it so that the JNI code
// shared between XUL and Native Fennec doesn't die.
}
private static CountDownLatch sGeckoPendingAcks = null;
// Block the current thread until the Gecko event loop is caught up

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

@ -5,6 +5,9 @@
#include "base/file_util.h"
#include <fcntl.h>
#if defined(ANDROID) || defined(OS_POSIX)
#include <unistd.h>
#endif
#include <string>
#include <vector>

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

@ -6,6 +6,9 @@
#include <errno.h>
#include <fcntl.h>
#if defined(ANDROID) || defined(OS_POSIX)
#include <unistd.h>
#endif
#include "eintr_wrapper.h"
#include "base/logging.h"

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

@ -13,6 +13,9 @@
#else
#include <time.h>
#endif
#if defined(ANDROID) || defined(OS_POSIX)
#include <unistd.h>
#endif
#include <limits>

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

@ -1218,6 +1218,9 @@ nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame, nsIFrame *aAncestor)
nsIFrame* parent;
gfx3DMatrix ctm = aFrame->GetTransformMatrix(aAncestor, &parent);
while (parent && parent != aAncestor) {
if (!parent->Preserves3DChildren()) {
ctm.ProjectTo2D();
}
ctm = ctm * parent->GetTransformMatrix(aAncestor, &parent);
}
return ctm;

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

@ -183,6 +183,7 @@ _TEST_FILES = \
test_bug646757.html \
test_bug718809.html \
test_font_inflation_reftests.html \
test_bug725426.html \
$(NULL)
# Tests for bugs 441782, 467672 and 570378 don't pass reliably on Windows, because of bug 469208

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

@ -70,15 +70,15 @@ runtests();
function runtests() {
var style = window.getComputedStyle(document.getElementById("test1"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(0.5, 0, 0, 1, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(0.5, 0, 0, 1, 0, 0)",
"Scalex proper matrix is applied");
style = window.getComputedStyle(document.getElementById("test2"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(1, 0, 0, 0.5, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(1, 0, 0, 0.5, 0, 0)",
"Scaley proper matrix is applied");
style = window.getComputedStyle(document.getElementById("test3"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(0.5, 0, 0, 0.5, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(0.5, 0, 0, 0.5, 0, 0)",
"Scale proper matrix is applied");
style = window.getComputedStyle(document.getElementById("test4"), "");
@ -90,7 +90,7 @@ function runtests() {
"Percent values in scale should be ignored");
style = window.getComputedStyle(document.getElementById("test6"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(640000, 0, 0, 1e-19, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(640000, 0, 0, 1e-19, 0, 0)",
"Ensure wacky values are accepted");
style = window.getComputedStyle(document.getElementById("test7"), "");

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

@ -91,7 +91,7 @@ runtests();
function runtests() {
// For test 1 we need to handle the contingency that different systems may
// round differently. We will parse out the values and compare them
// individually. The matrix should be: matrix(1, 0, 0.57735, 1, 0px, 0px)
// individually. The matrix should be: matrix(1, 0, 0.57735, 1, 0, 0)
var style = window.getComputedStyle(document.getElementById("test1"), "");
var tformStyle = style.getPropertyValue("-moz-transform");
var tformValues = tformStyle.substring(tformStyle.indexOf('(') + 1,
@ -100,11 +100,11 @@ function runtests() {
is((+tformValues[1]), 0, "Test1: skewx: param 1 is 0");
ok(verifyRounded(tformValues[2], 0.57735), "Test1: skewx: Rounded param 2 is in bounds");
is((+tformValues[3]), 1, "Test1: skewx: param 3 is 1");
is(tformValues[4].trim(), "0px", "Test1: skewx: param 4 is 0px");
is(tformValues[5].trim(), "0px", "Test1: skewx: param 5 is 0px");
is((+tformValues[4]), 0, "Test1: skewx: param 4 is 0");
is((+tformValues[5]), 0, "Test1: skewx: param 5 is 0");
// Again, handle rounding for test 2, proper matrix should be:
// matrix(1, 1.73205, 0, 1, 0px, 0px)
// matrix(1, 1.73205, 0, 1, 0, 0)
style = window.getComputedStyle(document.getElementById("test2"), "");
tformStyle = style.getPropertyValue("-moz-transform");
tformValues = tformStyle.substring(tformStyle.indexOf('(') + 1,
@ -113,19 +113,19 @@ function runtests() {
ok(verifyRounded(tformValues[1], 1.73205), "Test2: skewy: Rounded param 1 is in bounds");
is((+tformValues[2]), 0, "Test2: skewy: param 2 is 0");
is((+tformValues[3]), 1, "Test2: skewy: param 3 is 1");
is(tformValues[4].trim(), "0px", "Test2: skewy: param 4 is 0px");
is(tformValues[5].trim(), "0px", "Test2: skewy: param 5 is 0px");
is((+tformValues[4]), 0, "Test2: skewy: param 4 is 0");
is((+tformValues[5]), 0, "Test2: skewy: param 5 is 0");
style = window.getComputedStyle(document.getElementById("test3"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(1, 1, 1, 1, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(1, 1, 1, 1, 0, 0)",
"Test3: Skew proper matrix is applied");
style = window.getComputedStyle(document.getElementById("test4"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(1, 1, 0, 1, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(1, 1, 0, 1, 0, 0)",
"Test4: Skew angle wrap: proper matrix is applied");
style = window.getComputedStyle(document.getElementById("test5"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(1, -1, 1, 1, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(1, -1, 1, 1, 0, 0)",
"Test5: Skew mixing deg and grad");
style = window.getComputedStyle(document.getElementById("test6"), "");
@ -137,7 +137,7 @@ function runtests() {
"Test7: Skew with more invalid units");
// Test 8: skew with negative degrees, here again we must handle rounding.
// The matrix should be: matrix(1, 3.73206, -1, 1, 0px, 0px)
// The matrix should be: matrix(1, 3.73206, -1, 1, 0, 0)
style = window.getComputedStyle(document.getElementById("test8"), "");
tformStyle = style.getPropertyValue("-moz-transform");
tformValues = tformStyle.substring(tformStyle.indexOf('(') + 1,
@ -146,19 +146,19 @@ function runtests() {
ok(verifyRounded(tformValues[1], 3.73206), "Test8: Rounded param 1 is in bounds");
is((+tformValues[2]), -1, "Test8: param 2 is -1");
is((+tformValues[3]), 1, "Test8: param 3 is 1");
is(tformValues[4].trim(), "0px", "Test8: param 4 is 0px");
is(tformValues[5].trim(), "0px", "Test8: param 5 is 0px");
is((+tformValues[4]), 0, "Test8: param 4 is 0");
is((+tformValues[5]), 0, "Test8: param 5 is 0");
style = window.getComputedStyle(document.getElementById("test9"), "");
is(style.getPropertyValue("-moz-transform"), "none",
"Test9: Skew in 3d should be ignored");
style = window.getComputedStyle(document.getElementById("test10"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(1, -10000, 1, 1, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(1, -10000, 1, 1, 0, 0)",
"Test10: Skew with nearly infinite numbers");
style = window.getComputedStyle(document.getElementById("test11"), "");
is(style.getPropertyValue("-moz-transform"), "matrix(1, -10000, 10000, 1, 0px, 0px)",
is(style.getPropertyValue("-moz-transform"), "matrix(1, -10000, 10000, 1, 0, 0)",
"Test11: Skew with more infinite numbers");
}

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

@ -0,0 +1,23 @@
<!doctype html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=725426
-->
<title>Test for bug 725426</title>
<script src=/tests/SimpleTest/SimpleTest.js></script>
<link rel=stylesheet href=/tests/SimpleTest/test.css>
<body style=margin:0>
<div style="-moz-transform: perspective(200px)">
<div style="-moz-transform: translatez(-100px);
width:100px;height:100px;background:blue">
</div></div>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=725426">
Mozilla Bug 725426</a>
<pre id=test>
<script class=testbody>
var rect = document.querySelector("div>div").getBoundingClientRect();
is(rect.top, 0, "Incorrect bounding rect top");
is(rect.right, 100, "Incorrect bounding rect top");
is(rect.bottom, 100, "Incorrect bounding rect top");
is(rect.left, 0, "Incorrect bounding rect top");
</script>
</pre>

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

@ -310,7 +310,7 @@ nsContentDLF::CreateInstance(const char* aCommand,
nsCOMPtr<nsIPluginHost> pluginHostCOM(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
nsPluginHost *pluginHost = static_cast<nsPluginHost*>(pluginHostCOM.get());
if(pluginHost &&
NS_SUCCEEDED(pluginHost->IsPluginEnabledForType(aContentType, true))) {
NS_SUCCEEDED(pluginHost->IsPluginEnabledForType(aContentType))) {
return CreateDocument(aCommand,
aChannel, aLoadGroup,
aContainer, kPluginDocumentCID,

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

@ -1083,7 +1083,11 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
CheckInvalidateSizeChange(aDesiredSize);
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
// XXXjwir3: This call should be replaced with FinishWithAbsoluteFrames
// when bug 724978 is fixed and nsColumnSetFrame is a full absolute
// container.
FinishAndStoreOverflow(&aDesiredSize);
aDesiredSize.mCarriedOutBottomMargin = carriedOutBottomMargin;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);

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

@ -13,6 +13,8 @@ fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == au
== select-1-dynamic.html select-1-ref.html
== select-2.html select-2-ref.html
== select-3.html select-3-ref.html
== multi-column-1.html multi-column-1-ref.html
# Fails due to bug 724978. Should be re-enabled once this is fixed.
fails == multi-column-1.html multi-column-1-ref.html
== button-1.html button-1-ref.html
== button-2.html button-2-ref.html

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

@ -3,15 +3,16 @@
== wide--contain--height.html ref-wide-empty.html
== wide--contain--width.html ref-wide-empty.html
# Either OS X 32-bit or 10.5, judging from imprecise Tinderbox results, renders
# these tests as empty boxes, not filled boxes. We don't really care about this
# We don't really care about the failures for this
# extreme edge case (the test exists more to test for safety against division by
# zero), so there is no bug has been filed to fix it, although a patch would
# probably be accepted.
random-if(cocoaWidget) == tall--cover--height.html ref-tall-lime.html
random-if(cocoaWidget) == tall--cover--width.html ref-tall-lime.html
random-if(cocoaWidget) == wide--cover--height.html ref-wide-lime.html
random-if(cocoaWidget) == wide--cover--width.html ref-wide-lime.html
# They're still marked as failing though, rather than 'load', since
# we want to know if they start working when we upgrade to Azure.
fails == tall--cover--height.html ref-tall-lime.html
fails == tall--cover--width.html ref-tall-lime.html
fails == wide--cover--height.html ref-wide-lime.html
fails == wide--cover--width.html ref-wide-lime.html
== zero-height-ratio-contain.html ref-tall-empty.html
== zero-height-ratio-cover.html ref-tall-empty.html

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

@ -683,11 +683,13 @@ fails-if(Android) != 376532-3.html 376532-3-ref.html
== 379316-1.html 379316-1-ref.html
fails-if(Android) random-if(cocoaWidget) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 379316-2.html 379316-2-ref.html # bug 379786
== 379328-1.html 379328-1-ref.html
== 379349-1a.xhtml 379349-1-ref.xhtml
== 379349-1b.xhtml 379349-1-ref.xhtml
== 379349-1c.xhtml 379349-1-ref.xhtml
== 379349-2a.xhtml 379349-2-ref.xhtml
== 379349-2b.xhtml 379349-2-ref.xhtml
# The next set of reftests all fail until bug 724978 has been fixed, and the
# overflow container ability of nsColumnSetFrame is restored.
fails == 379349-1a.xhtml 379349-1-ref.xhtml
fails == 379349-1b.xhtml 379349-1-ref.xhtml
fails == 379349-1c.xhtml 379349-1-ref.xhtml
fails == 379349-2a.xhtml 379349-2-ref.xhtml
fails == 379349-2b.xhtml 379349-2-ref.xhtml
== 379349-3a.xhtml 379349-3-ref.xhtml
== 379349-3b.xhtml 379349-3-ref.xhtml
== 379361-1.html 379361-1-ref.html

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

@ -0,0 +1,12 @@
<html>
<head>
</head>
<body>
<div style="width: 100px; height: 200px; -moz-transform: translate(50px, 50px); background-color: gold; display: table">
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
<div style="background-color: navy; color: gold; width: 200px; height: 100px; position: absolute; left: 50px; top: 100px;">
0 1 2 3 4 5 6 7 8 9
</div>
</div>
</body>
</html>

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

@ -0,0 +1,12 @@
<html>
<head>
</head>
<body>
<div style="width: 100px; height: 200px; -moz-transform: translate(50px, 50px) ;background-color: gold;display: inline-table">
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
<div style="background-color: navy; color: gold; width: 200px; height: 100px; position: fixed; left: 50px; top: 100px;">
0 1 2 3 4 5 6 7 8 9
</div>
</div>
</body>
</html>

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

@ -66,6 +66,8 @@ random == rotate-1f.html rotate-1-ref.html
== abspos-1c.html abspos-1-ref.html
== abspos-1d.html abspos-1-ref.html
!= abspos-1e.html abspos-1-ref.html
== abspos-1f.html abspos-1-ref.html
== abspos-1g.html abspos-1-ref.html
# Origin can use "top" "right" etc.
== origin-name-1a.html origin-name-1-ref.html
== origin-name-1b.html origin-name-1-ref.html
@ -110,3 +112,9 @@ fails-if(Android) == stresstest-1.html stresstest-1-ref.html
# Bugs
== 601894-1.html 601894-ref.html
== 601894-2.html 601894-ref.html
# Bug 722777
== table-1a.html table-1-ref.html
== table-1b.html table-1-ref.html
== table-1c.html table-1-ref.html
== table-2a.html table-2-ref.html
== table-2b.html table-2-ref.html

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

@ -0,0 +1,7 @@
<!doctype html>
<div style="-moz-transform:translate(200px) rotate(180deg);-moz-transform-origin:left">
<table>
<caption>Hello</caption>
<tr><td>there!
</table>
</div>

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

@ -0,0 +1,5 @@
<!doctype html>
<table style="-moz-transform:translate(200px) rotate(180deg);-moz-transform-origin:left">
<caption>Hello</caption>
<tr><td>there!
</table>

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

@ -0,0 +1,5 @@
<!doctype html>
<table style="display:inline-table;-moz-transform:translate(200px) rotate(180deg);-moz-transform-origin:left">
<caption>Hello</caption>
<tr><td>there!
</table>

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

@ -0,0 +1,7 @@
<!doctype html>
<div style="-moz-transform:translateX(200px) rotate(180deg) translateY(-100%);-moz-transform-origin:left">
<table style="-moz-transform:translateY(100%)">
<caption>Hello</caption>
<tr><td>there!
</table>
</div>

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

@ -0,0 +1,6 @@
<!doctype html>
<div style="-moz-transform:translate(200px) rotate(180deg);-moz-transform-origin:left">
<table>
<caption style=caption-side:bottom>there!</caption>
<tr><td>Hello
</table>

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

@ -0,0 +1,5 @@
<!doctype html>
<table style="-moz-transform:translate(200px) rotate(180deg);-moz-transform-origin:left">
<caption style=caption-side:bottom>there!</caption>
<tr><td>Hello
</table>

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

@ -0,0 +1,5 @@
<!doctype html>
<table style="display:inline-table;-moz-transform:translate(200px) rotate(180deg);-moz-transform-origin:left">
<caption style=caption-side:bottom>there!</caption>
<tr><td>Hello
</table>

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

@ -1108,13 +1108,12 @@ nsComputedDOMStyle::DoGetMozTransform()
resultString.Append(NS_LITERAL_STRING(", "));
}
resultString.AppendFloat(matrix._41);
resultString.Append(NS_LITERAL_STRING("px, "));
resultString.Append(NS_LITERAL_STRING(", "));
resultString.AppendFloat(matrix._42);
resultString.Append(NS_LITERAL_STRING("px"));
if (is3D) {
resultString.Append(NS_LITERAL_STRING(", "));
resultString.AppendFloat(matrix._43);
resultString.Append(NS_LITERAL_STRING("px, "));
resultString.Append(NS_LITERAL_STRING(", "));
resultString.AppendFloat(matrix._44);
}
resultString.Append(NS_LITERAL_STRING(")"));

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

@ -1315,41 +1315,41 @@ function test_transform_transition(prop) {
// translate
{ start: 'translate(20px)', end: 'none',
expected_uncomputed: 'translate(15px)',
expected: 'matrix(1, 0, 0, 1, 15px, 0px)' },
expected: 'matrix(1, 0, 0, 1, 15, 0)' },
{ start: 'translate(20px, 12px)', end: 'none',
expected_uncomputed: 'translate(15px, 9px)',
expected: 'matrix(1, 0, 0, 1, 15px, 9px)' },
expected: 'matrix(1, 0, 0, 1, 15, 9)' },
{ start: 'translateX(-20px)', end: 'none',
expected_uncomputed: 'translateX(-15px)',
expected: 'matrix(1, 0, 0, 1, -15px, 0px)' },
expected: 'matrix(1, 0, 0, 1, -15, 0)' },
{ start: 'translateY(-40px)', end: 'none',
expected_uncomputed: 'translateY(-30px)',
expected: 'matrix(1, 0, 0, 1, 0px, -30px)' },
expected: 'matrix(1, 0, 0, 1, 0, -30)' },
{ start: 'translateZ(40px)', end: 'none',
expected_uncomputed: 'translateZ(30px)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0px, 0px, 30px, 1)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 30, 1)',
requires_3d: true },
{ start: 'none', end: 'translate3D(40px, 60px, -40px)',
expected_uncomputed: 'translate3D(10px, 15px, -10px)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10px, 15px, -10px, 1)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 15, -10, 1)',
requires_3d: true },
// percentages are relative to 300px (width) and 50px (height)
// per the prerequisites in property_database.js
{ start: 'translate(20%)', end: 'none',
expected_uncomputed: 'translate(15%)',
expected: 'matrix(1, 0, 0, 1, 45px, 0px)',
expected: 'matrix(1, 0, 0, 1, 45, 0)',
round_error_ok: true },
{ start: 'translate(20%, 12%)', end: 'none',
expected_uncomputed: 'translate(15%, 9%)',
expected: 'matrix(1, 0, 0, 1, 45px, 4.5px)',
expected: 'matrix(1, 0, 0, 1, 45, 4.5)',
round_error_ok: true },
{ start: 'translateX(-20%)', end: 'none',
expected_uncomputed: 'translateX(-15%)',
expected: 'matrix(1, 0, 0, 1, -45px, 0px)',
expected: 'matrix(1, 0, 0, 1, -45, 0)',
round_error_ok: true },
{ start: 'translateY(-40%)', end: 'none',
expected_uncomputed: 'translateY(-30%)',
expected: 'matrix(1, 0, 0, 1, 0px, -15px)',
expected: 'matrix(1, 0, 0, 1, 0, -15)',
round_error_ok: true },
{ start: 'none', end: 'rotate(90deg) translate(20%, 20%) rotate(-90deg)',
expected_uncomputed: 'rotate(22.5deg) translate(5%, 5%) rotate(-22.5deg)',
@ -1360,11 +1360,11 @@ function test_transform_transition(prop) {
// test percent translation using matrix decomposition
{ start: 'rotate(45deg) rotate(-45deg)',
end: 'rotate(90deg) translate(20%, 20%) rotate(-90deg)',
expected: 'matrix(1, 0, 0, 1, -2.5px, 15px)',
expected: 'matrix(1, 0, 0, 1, -2.5, 15)',
round_error_ok: true },
{ start: 'rotate(45deg) rotate(-45deg)',
end: 'rotate(-90deg) translate(20%, 20%) rotate(90deg)',
expected: 'matrix(1, 0, 0, 1, 2.5px, -15px)',
expected: 'matrix(1, 0, 0, 1, 2.5, -15)',
round_error_ok: true },
// test calc() in translate
// Note that font-size: is 20px, and that percentages are relative
@ -1373,42 +1373,42 @@ function test_transform_transition(prop) {
{ start: 'translateX(20%)', /* 60px */
end: 'translateX(-moz-calc(10% + 1em))', /* 30px + 20px = 50px */
expected_uncomputed: 'translateX(-moz-calc(17.5% + 0.25em))',
expected: 'matrix(1, 0, 0, 1, 57.5px, 0px)' },
expected: 'matrix(1, 0, 0, 1, 57.5, 0)' },
{ start: 'translate(-moz-calc(0.75 * 3em + 1.5 * 10%), -moz-calc(0.5 * 5em + 0.5 * 8%))', /* 90px, 52px */
end: 'rotate(90deg) translateY(20%) rotate(90deg) translateY(-moz-calc(10% + 0.5em)) rotate(180deg)', /* -10px, -15px */
expected: 'matrix(1, 0, 0, 1, 65px, 35.25px)' },
expected: 'matrix(1, 0, 0, 1, 65, 35.25)' },
// scale
{ start: 'scale(2)', end: 'none',
expected_uncomputed: 'scale(1.75)',
expected: 'matrix(1.75, 0, 0, 1.75, 0px, 0px)' },
expected: 'matrix(1.75, 0, 0, 1.75, 0, 0)' },
{ start: 'none', end: 'scale(0.4)',
expected_uncomputed: 'scale(0.85)',
expected: 'matrix(0.85, 0, 0, 0.85, 0px, 0px)',
expected: 'matrix(0.85, 0, 0, 0.85, 0, 0)',
round_error_ok: true },
{ start: 'scale(2)', end: 'scale(-2)',
expected_uncomputed: 'scale(1)',
expected: 'matrix(1, 0, 0, 1, 0px, 0px)' },
expected: 'matrix(1, 0, 0, 1, 0, 0)' },
{ start: 'scale(2)', end: 'scale(-6)',
expected_uncomputed: 'scale(0)',
expected: 'matrix(0, 0, 0, 0, 0px, 0px)' },
expected: 'matrix(0, 0, 0, 0, 0, 0)' },
{ start: 'scale(2, 0.4)', end: 'none',
expected_uncomputed: 'scale(1.75, 0.55)',
expected: 'matrix(1.75, 0, 0, 0.55, 0px, 0px)',
expected: 'matrix(1.75, 0, 0, 0.55, 0, 0)',
round_error_ok: true },
{ start: 'scaleX(3)', end: 'none',
expected_uncomputed: 'scaleX(2.5)',
expected: 'matrix(2.5, 0, 0, 1, 0px, 0px)' },
expected: 'matrix(2.5, 0, 0, 1, 0, 0)' },
{ start: 'scaleY(5)', end: 'none',
expected_uncomputed: 'scaleY(4)',
expected: 'matrix(1, 0, 0, 4, 0px, 0px)' },
expected: 'matrix(1, 0, 0, 4, 0, 0)' },
{ start: 'scaleZ(5)', end: 'none',
expected_uncomputed: 'scaleZ(4)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0px, 0px, 0px, 1)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1)',
requires_3d: true },
{ start: 'none', end: 'scale3D(5, 5, 5)',
expected_uncomputed: 'scale3D(2, 2, 2)',
expected: 'matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0px, 0px, 0px, 1)',
expected: 'matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1)',
requires_3d: true },
// skew
@ -1428,15 +1428,15 @@ function test_transform_transition(prop) {
expected_uncomputed: 'skewY(22.5deg)' },
// matrix : skewX
{ start: 'matrix(1, 0, 3, 1, 0px, 0px)', end: 'none',
expected: 'matrix(1, 0, ' + 3 * 0.75 + ', 1, 0px, 0px)',
{ start: 'matrix(1, 0, 3, 1, 0, 0)', end: 'none',
expected: 'matrix(1, 0, ' + 3 * 0.75 + ', 1, 0, 0)',
round_error_ok: true },
{ start: 'skewX(0)', end: 'skewX(-45deg) translate(0)',
expected: 'matrix(1, 0, -0.25, 1, 0px, 0px)',
expected: 'matrix(1, 0, -0.25, 1, 0, 0)',
round_error_ok: true },
// matrix : rotate
{ start: 'rotate(-30deg)', end: 'matrix(0, 1, -1, 0, 0px, 0px)',
expected: 'matrix(1, 0, 0, 1, 0px, 0px)',
{ start: 'rotate(-30deg)', end: 'matrix(0, 1, -1, 0, 0, 0)',
expected: 'matrix(1, 0, 0, 1, 0, 0)',
round_error_ok: true },
{ start: 'rotate(-30deg) translateX(0)',
end: 'translateX(0) rotate(-90deg)',
@ -1456,7 +1456,7 @@ function test_transform_transition(prop) {
expected: c('rotate(135deg)') },
{ start: 'scale(-1)', end: 'none',
expected_uncomputed: 'scale(-0.5)',
expected: 'matrix(-0.5, 0, 0, -0.5, 0px, 0px)' },
expected: 'matrix(-0.5, 0, 0, -0.5, 0, 0)' },
{ start: 'rotate(180deg)', end: 'none',
expected_uncomputed: 'rotate(135deg)' },
{ start: 'rotate(-180deg)', end: 'none',
@ -1466,7 +1466,7 @@ function test_transform_transition(prop) {
// matrix followed by scale
{ start: 'matrix(2, 0, 0, 2, 10px, 20px) scale(2)',
end: 'none',
expected: 'matrix(3.0625, 0, 0, 3.0625, 7.5px, 15px)' },
expected: 'matrix(3.0625, 0, 0, 3.0625, 7.5, 15)' },
// ... and a bunch of similar possibilities. The spec isn't settled
// here; there are multiple options. See:
@ -1505,42 +1505,42 @@ function test_transform_transition(prop) {
{ start: 'none',
end: 'matrix(1, 0, 1.5, 1, 0pt, 0pt)',
/* skewX(atan(1.5)) */
expected: 'matrix(1, 0, ' + 1.5 * 0.25 + ', 1, 0px, 0px)',
expected: 'matrix(1, 0, ' + 1.5 * 0.25 + ', 1, 0, 0)',
round_error_ok: true },
{ start: 'none',
end: 'matrix(-1, 0, 2, -1, 0pt, 0pt)',
/* rotate(180deg) skewX(atan(-2)) */
expected: c('rotate(45deg) matrix(1, 0, ' + -2 * 0.25 + ', 1, 0px, 0px)'),
expected: c('rotate(45deg) matrix(1, 0, ' + -2 * 0.25 + ', 1, 0, 0)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(0, -1, 1, -3, 0pt, 0pt)',
/* rotate(-90deg) skewX(atan(3)) */
expected: c('rotate(-22.5deg) matrix(1, 0, ' + 3 * 0.25 + ', 1, 0px, 0px)'),
expected: c('rotate(-22.5deg) matrix(1, 0, ' + 3 * 0.25 + ', 1, 0, 0)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(0, 1, -1, 4, 0pt, 0pt)',
/* rotate(90deg) skewX(atan(4)) */
expected: c('rotate(22.5deg) matrix(1, 0, ' + 4 * 0.25 + ', 1, 0px, 0px)'),
expected: c('rotate(22.5deg) matrix(1, 0, ' + 4 * 0.25 + ', 1, 0, 0)'),
round_error_ok: true },
// and then four with negative determinants
{ start: 'none',
end: 'matrix(1, 0, 1, -1, 0pt, 0pt)',
/* rotate(-180deg) skewX(atan(-1)) scaleX(-1) */
expected: c('rotate(-45deg) matrix(1, 0, ' + -1 * 0.25 + ', 1, 0px, 0px) scaleX(0.5)'),
expected: c('rotate(-45deg) matrix(1, 0, ' + -1 * 0.25 + ', 1, 0, 0) scaleX(0.5)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(-1, 0, -1, 1, 0pt, 0pt)',
/* skewX(atan(-1)) scaleX(-1) */
expected: c('matrix(1, 0, ' + -1 * 0.25 + ', 1, 0px, 0px) scaleX(0.5)') },
expected: c('matrix(1, 0, ' + -1 * 0.25 + ', 1, 0, 0) scaleX(0.5)') },
{ start: 'none',
end: 'matrix(0, 1, 1, -2, 0pt, 0pt)',
/* rotate(-90deg) skewX(atan(2)) scaleX(-1) */
expected: c('rotate(-22.5deg) matrix(1, 0, ' + 2 * 0.25 + ', 1, 0px, 0px) scaleX(0.5)'),
expected: c('rotate(-22.5deg) matrix(1, 0, ' + 2 * 0.25 + ', 1, 0, 0) scaleX(0.5)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(0, -1, -1, 0.5, 0pt, 0pt)',
/* rotate(90deg) skewX(atan(0.5)) scaleX(-1) */
expected: c('rotate(22.5deg) matrix(1, 0, ' + 0.5 * 0.25 + ', 1, 0px, 0px) scaleX(0.5)'),
expected: c('rotate(22.5deg) matrix(1, 0, ' + 0.5 * 0.25 + ', 1, 0, 0) scaleX(0.5)'),
round_error_ok: true },
// lists vs. matrix decomposition
@ -1552,7 +1552,7 @@ function test_transform_transition(prop) {
expected_uncomputed: 'skewY(22.5deg) rotate(90deg)' },
{ start: 'skewY(45deg) rotate(90deg) translate(0)',
end: 'skewY(-45deg) rotate(90deg)',
expected: 'matrix(0, 1, -1, -0.5, 0px, 0px)',
expected: 'matrix(0, 1, -1, -0.5, 0, 0)',
round_error_ok: true },
{ start: 'skewX(45deg) rotate(90deg)',
end: 'skewX(-45deg) rotate(90deg)',
@ -1563,7 +1563,7 @@ function test_transform_transition(prop) {
round_error_ok: true },
];
var matrix_re = /^matrix\(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*)px, ([^,]*)px\)$/;
var matrix_re = /^matrix\(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*)\)$/;
for (var i in tests) {
var test = tests[i];
if (!("expected" in test)) {

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

@ -74,6 +74,9 @@
page-break-after: inherit;
vertical-align: inherit; /* needed for inline-table */
line-height: inherit; /* needed for vertical-align on inline-table */
/* Bug 722777 */
-moz-transform: inherit;
-moz-transform-origin: inherit;
}
*|*::-moz-table-row {

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

@ -229,10 +229,29 @@ nsSVGForeignObjectFrame::PaintSVG(nsSVGRenderState *aContext,
return NS_ERROR_FAILURE;
}
nsRect kidDirtyRect = kid->GetVisualOverflowRect();
/* Check if we need to draw anything. */
if (aDirtyRect) {
PRInt32 appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel();
if (!mRect.ToOutsidePixels(appUnitsPerDevPx).Intersects(*aDirtyRect))
// Transform the dirty rect into app units in our userspace.
gfxMatrix invmatrix = matrix;
invmatrix.Invert();
NS_ASSERTION(!invmatrix.IsSingular(),
"inverse of non-singular matrix should be non-singular");
gfxRect transDirtyRect = gfxRect(aDirtyRect->x, aDirtyRect->y,
aDirtyRect->width, aDirtyRect->height);
transDirtyRect = invmatrix.TransformBounds(transDirtyRect);
kidDirtyRect.IntersectRect(kidDirtyRect,
nsLayoutUtils::RoundGfxRectToAppRect(transDirtyRect,
PresContext()->AppUnitsPerCSSPixel()));
// XXX after bug 614732 is fixed, we will compare mRect with aDirtyRect,
// not with kidDirtyRect. I.e.
// PRInt32 appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel();
// mRect.ToOutsidePixels(appUnitsPerDevPx).Intersects(*aDirtyRect)
if (kidDirtyRect.IsEmpty())
return NS_OK;
}
@ -258,21 +277,6 @@ nsSVGForeignObjectFrame::PaintSVG(nsSVGRenderState *aContext,
NS_ASSERTION(!invmatrix.IsSingular(),
"inverse of non-singular matrix should be non-singular");
nsRect kidDirtyRect = kid->GetVisualOverflowRect();
if (aDirtyRect) {
gfxRect transDirtyRect = gfxRect(aDirtyRect->x, aDirtyRect->y,
aDirtyRect->width, aDirtyRect->height);
transDirtyRect = invmatrix.TransformBounds(transDirtyRect);
transDirtyRect.Scale(nsPresContext::AppUnitsPerCSSPixel());
nsPoint tl(NSToCoordFloor(transDirtyRect.X()),
NSToCoordFloor(transDirtyRect.Y()));
nsPoint br(NSToCoordCeil(transDirtyRect.XMost()),
NSToCoordCeil(transDirtyRect.YMost()));
kidDirtyRect.IntersectRect(kidDirtyRect,
nsRect(tl.x, tl.y, br.x - tl.x, br.y - tl.y));
}
PRUint32 flags = nsLayoutUtils::PAINT_IN_TRANSFORM;
if (aContext->IsPaintingToWindow()) {
flags |= nsLayoutUtils::PAINT_TO_WINDOW;
@ -344,7 +348,9 @@ nsSVGForeignObjectFrame::GetFrameForPoint(const nsPoint &aPoint)
NS_IMETHODIMP_(nsRect)
nsSVGForeignObjectFrame::GetCoveredRegion()
{
return mRect;
// See bug 614732 comment 32:
//return nsSVGUtils::TransformFrameRectToOuterSVG(mRect, GetCanvasTM(), PresContext());
return mCoveredRegion;
}
NS_IMETHODIMP
@ -362,8 +368,11 @@ nsSVGForeignObjectFrame::UpdateCoveredRegion()
if (h < 0.0f) h = 0.0f;
// GetCanvasTM includes the x,y translation
mRect = ToCanvasBounds(gfxRect(0.0, 0.0, w, h), GetCanvasTM(), PresContext());
mRect = nsLayoutUtils::RoundGfxRectToAppRect(
gfxRect(0.0, 0.0, w, h),
PresContext()->AppUnitsPerDevPixel());
mCoveredRegion = ToCanvasBounds(gfxRect(0.0, 0.0, w, h), GetCanvasTM(), PresContext());
return NS_OK;
}
@ -645,19 +654,18 @@ nsSVGForeignObjectFrame::InvalidateDirtyRect(nsSVGOuterSVGFrame* aOuter,
if (aRect.IsEmpty())
return;
// The areas dirtied by children are in app units, relative to this frame.
// We need to convert the rect to userspace to use IntersectRect.
gfxRect r(aRect.x, aRect.y, aRect.width, aRect.height);
r.Scale(1.0 / nsPresContext::AppUnitsPerCSSPixel());
nsRect rect = ToCanvasBounds(r, GetCanvasTM(), PresContext());
// Don't invalidate areas outside our bounds:
rect.IntersectRect(rect, mRect);
nsRect rect = aRect.Intersect(mRect);
if (rect.IsEmpty())
return;
// The areas dirtied by children are in app units, relative to this frame.
// We need to convert the rect from app units in our userspace to app units
// relative to our nsSVGOuterSVGFrame's content rect.
gfxRect r(aRect.x, aRect.y, aRect.width, aRect.height);
r.Scale(1.0 / nsPresContext::AppUnitsPerCSSPixel());
rect = ToCanvasBounds(r, GetCanvasTM(), PresContext());
rect = nsSVGUtils::FindFilterInvalidation(this, rect);
aOuter->InvalidateWithFlags(rect, aFlags);
}

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

@ -166,6 +166,8 @@ protected:
// Areas dirtied by changes to sub-documents embedded by our decendents
nsRegion mSubDocDirtyRegion;
nsRect mCoveredRegion;
bool mInReflow;
};

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

@ -124,6 +124,8 @@ protected:
*/
float MaybeOptimizeOpacity(float aFillOrStrokeOpacity);
nsRect mCoveredRegion;
private:
bool GetStrokeDashData(FallibleTArray<gfxFloat>& dashes, gfxFloat *dashOffset);
};

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

@ -440,7 +440,9 @@ nsSVGGlyphFrame::GetFrameForPoint(const nsPoint &aPoint)
NS_IMETHODIMP_(nsRect)
nsSVGGlyphFrame::GetCoveredRegion()
{
return mRect;
// See bug 614732 comment 32:
//return nsSVGUtils::TransformFrameRectToOuterSVG(mRect, GetCanvasTM(), PresContext());
return mCoveredRegion;
}
NS_IMETHODIMP
@ -448,13 +450,9 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
{
mRect.SetEmpty();
gfxMatrix matrix = GetCanvasTM();
if (matrix.IsSingular()) {
return NS_ERROR_FAILURE;
}
// XXX here we have tmpCtx use its default identity matrix, but does this
// function call anything that will call GetCanvasTM and break things?
nsRefPtr<gfxContext> tmpCtx = MakeTmpCtx();
tmpCtx->Multiply(matrix);
bool hasStroke = HasStroke();
if (hasStroke) {
@ -487,13 +485,19 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
// calls to record and then reset the stroke width.
gfxRect extent = tmpCtx->GetUserPathExtent();
if (hasStroke) {
extent = nsSVGUtils::PathExtentsToMaxStrokeExtents(extent, this);
extent =
nsSVGUtils::PathExtentsToMaxStrokeExtents(extent, this, gfxMatrix());
}
if (!extent.IsEmpty()) {
mRect = nsSVGUtils::ToAppPixelRect(PresContext(), extent);
mRect = nsLayoutUtils::RoundGfxRectToAppRect(extent,
PresContext()->AppUnitsPerDevPixel());
}
// See bug 614732 comment 32.
mCoveredRegion = nsSVGUtils::TransformFrameRectToOuterSVG(
mRect, GetCanvasTM(), PresContext());
return NS_OK;
}
@ -620,7 +624,9 @@ nsSVGGlyphFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
if ((aFlags & nsSVGUtils::eBBoxIncludeStroke) != 0 &&
((aFlags & nsSVGUtils::eBBoxIgnoreStrokeIfNone) == 0 || HasStroke())) {
bbox =
bbox.Union(nsSVGUtils::PathExtentsToMaxStrokeExtents(pathExtents, this));
bbox.Union(nsSVGUtils::PathExtentsToMaxStrokeExtents(pathExtents,
this,
aToBBoxUserspace));
}
return bbox;

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

@ -365,7 +365,9 @@ nsSVGImageFrame::PaintSVG(nsSVGRenderState *aContext,
if (aDirtyRect) {
dirtyRect = aDirtyRect->ToAppUnits(appUnitsPerDevPx);
// Adjust dirtyRect to match our local coordinate system.
dirtyRect.MoveBy(-mRect.TopLeft());
nsRect rootRect =
nsSVGUtils::TransformFrameRectToOuterSVG(mRect, GetCanvasTM(), PresContext());
dirtyRect.MoveBy(-rootRect.TopLeft());
}
// XXXbholley - I don't think huge images in SVGs are common enough to
@ -483,15 +485,20 @@ nsSVGImageFrame::UpdateCoveredRegion()
gfxContext context(gfxPlatform::GetPlatform()->ScreenReferenceSurface());
GeneratePath(&context);
context.IdentityMatrix();
gfxMatrix identity;
GeneratePath(&context, &identity);
gfxRect extent = context.GetUserPathExtent();
if (!extent.IsEmpty()) {
mRect = nsSVGUtils::ToAppPixelRect(PresContext(), extent);
mRect = nsLayoutUtils::RoundGfxRectToAppRect(extent,
PresContext()->AppUnitsPerDevPixel());
}
// See bug 614732 comment 32.
mCoveredRegion = nsSVGUtils::TransformFrameRectToOuterSVG(
mRect, GetCanvasTM(), PresContext());
return NS_OK;
}

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

@ -159,8 +159,16 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
fillRule = GetClipRule();
} else {
hitTestFlags = GetHitTestFlags();
// XXX once bug 614732 is fixed, aPoint won't need any conversion in order
// to compare it with mRect.
gfxMatrix canvasTM = GetCanvasTM();
if (canvasTM.IsSingular()) {
return nsnull;
}
nsPoint point =
nsSVGUtils::TransformOuterSVGPointToChildFrame(aPoint, canvasTM, PresContext());
if (!hitTestFlags || ((hitTestFlags & SVG_HIT_TEST_CHECK_MRECT) &&
!mRect.Contains(aPoint)))
!mRect.Contains(point)))
return nsnull;
fillRule = GetStyleSVG()->mFillRule;
}
@ -196,17 +204,25 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
NS_IMETHODIMP_(nsRect)
nsSVGPathGeometryFrame::GetCoveredRegion()
{
return mRect;
// See bug 614732 comment 32:
//return nsSVGUtils::TransformFrameRectToOuterSVG(mRect, GetCanvasTM(), PresContext());
return mCoveredRegion;
}
NS_IMETHODIMP
nsSVGPathGeometryFrame::UpdateCoveredRegion()
{
gfxRect extent = GetBBoxContribution(GetCanvasTM(),
gfxRect extent = GetBBoxContribution(gfxMatrix(),
nsSVGUtils::eBBoxIncludeFill | nsSVGUtils::eBBoxIgnoreFillIfNone |
nsSVGUtils::eBBoxIncludeStroke | nsSVGUtils::eBBoxIgnoreStrokeIfNone |
nsSVGUtils::eBBoxIncludeMarkers);
mRect = nsSVGUtils::ToAppPixelRect(PresContext(), extent);
mRect = nsLayoutUtils::RoundGfxRectToAppRect(extent,
PresContext()->AppUnitsPerDevPixel());
// See bug 614732 comment 32.
mCoveredRegion = nsSVGUtils::TransformFrameRectToOuterSVG(
mRect, GetCanvasTM(), PresContext());
return NS_OK;
}
@ -307,7 +323,9 @@ nsSVGPathGeometryFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
pathExtents.SizeTo(0, 0);
}
bbox =
bbox.Union(nsSVGUtils::PathExtentsToMaxStrokeExtents(pathExtents, this));
bbox.Union(nsSVGUtils::PathExtentsToMaxStrokeExtents(pathExtents,
this,
aToBBoxUserspace));
}
// Account for markers:

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

@ -1010,8 +1010,10 @@ nsSVGUtils::PaintFrameWithEffects(nsSVGRenderState *aContext,
if (!aDirtyRect->Intersects(filterFrame->GetFilterBBox(aFrame, nsnull)))
return;
} else {
nsRect leafBounds = nsSVGUtils::TransformFrameRectToOuterSVG(
aFrame->GetRect(), GetCanvasTM(aFrame), aFrame->PresContext());
nsRect rect = aDirtyRect->ToAppUnits(aFrame->PresContext()->AppUnitsPerDevPixel());
if (!rect.Intersects(aFrame->GetRect()))
if (!rect.Intersects(leafBounds))
return;
}
}
@ -1178,22 +1180,33 @@ nsSVGUtils::GetCoveredRegion(const nsFrameList &aFrames)
return rect;
}
nsRect
nsSVGUtils::ToAppPixelRect(nsPresContext *aPresContext,
double xmin, double ymin,
double xmax, double ymax)
nsPoint
nsSVGUtils::TransformOuterSVGPointToChildFrame(nsPoint aPoint,
const gfxMatrix& aFrameToCanvasTM,
nsPresContext* aPresContext)
{
return ToAppPixelRect(aPresContext,
gfxRect(xmin, ymin, xmax - xmin, ymax - ymin));
gfxMatrix devToUser = aFrameToCanvasTM;
devToUser.Invert();
NS_ABORT_IF_FALSE(!devToUser.IsSingular(), "should not get here");
gfxPoint devPt = gfxPoint(aPoint.x, aPoint.y) /
aPresContext->AppUnitsPerDevPixel();
gfxPoint userPt = devToUser.Transform(devPt).Round();
gfxPoint appPt = userPt * aPresContext->AppUnitsPerCSSPixel();
userPt.x = clamped(appPt.x, gfxFloat(nscoord_MIN), gfxFloat(nscoord_MAX));
userPt.y = clamped(appPt.y, gfxFloat(nscoord_MIN), gfxFloat(nscoord_MAX));
// now guaranteed to be safe:
return nsPoint(nscoord(userPt.x), nscoord(userPt.y));
}
nsRect
nsSVGUtils::ToAppPixelRect(nsPresContext *aPresContext, const gfxRect& rect)
nsSVGUtils::TransformFrameRectToOuterSVG(const nsRect& aRect,
const gfxMatrix& aMatrix,
nsPresContext* aPresContext)
{
return nsRect(aPresContext->DevPixelsToAppUnits(NSToIntFloor(rect.X())),
aPresContext->DevPixelsToAppUnits(NSToIntFloor(rect.Y())),
aPresContext->DevPixelsToAppUnits(NSToIntCeil(rect.XMost()) - NSToIntFloor(rect.X())),
aPresContext->DevPixelsToAppUnits(NSToIntCeil(rect.YMost()) - NSToIntFloor(rect.Y())));
gfxRect r(aRect.x, aRect.y, aRect.width, aRect.height);
r.Scale(1.0 / nsPresContext::AppUnitsPerCSSPixel());
return nsLayoutUtils::RoundGfxRectToAppRect(
aMatrix.TransformBounds(r), aPresContext->AppUnitsPerDevPixel());
}
gfxIntSize
@ -1495,15 +1508,14 @@ nsSVGUtils::WritePPM(const char *fname, gfxImageSurface *aSurface)
static gfxRect
PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
nsSVGGeometryFrame* aFrame,
double styleExpansionFactor)
double styleExpansionFactor,
const gfxMatrix& aMatrix)
{
double style_expansion =
styleExpansionFactor * aFrame->GetStrokeWidth();
gfxMatrix ctm = aFrame->GetCanvasTM();
double dx = style_expansion * (fabs(ctm.xx) + fabs(ctm.xy));
double dy = style_expansion * (fabs(ctm.yy) + fabs(ctm.yx));
double dx = style_expansion * (fabs(aMatrix.xx) + fabs(aMatrix.xy));
double dy = style_expansion * (fabs(aMatrix.yy) + fabs(aMatrix.yx));
gfxRect strokeExtents = aPathExtents;
strokeExtents.Inflate(dx, dy);
@ -1512,14 +1524,16 @@ PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
/*static*/ gfxRect
nsSVGUtils::PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
nsSVGGeometryFrame* aFrame)
nsSVGGeometryFrame* aFrame,
const gfxMatrix& aMatrix)
{
return ::PathExtentsToMaxStrokeExtents(aPathExtents, aFrame, 0.5);
return ::PathExtentsToMaxStrokeExtents(aPathExtents, aFrame, 0.5, aMatrix);
}
/*static*/ gfxRect
nsSVGUtils::PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
nsSVGPathGeometryFrame* aFrame)
nsSVGPathGeometryFrame* aFrame,
const gfxMatrix& aMatrix)
{
double styleExpansionFactor = 0.5;
@ -1539,7 +1553,8 @@ nsSVGUtils::PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
return ::PathExtentsToMaxStrokeExtents(aPathExtents,
aFrame,
styleExpansionFactor);
styleExpansionFactor,
aMatrix);
}
// ----------------------------------------------------------------------

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

@ -447,14 +447,19 @@ public:
static nsRect
GetCoveredRegion(const nsFrameList &aFrames);
/*
* Convert a rect from device pixel units to app pixel units by inflation.
*/
// Converts aPoint from an app unit point in outer-<svg> content rect space
// to an app unit point in a frame's SVG userspace.
// This is a temporary helper we should no longer need after bug 614732 is
// fixed.
static nsPoint
TransformOuterSVGPointToChildFrame(nsPoint aPoint,
const gfxMatrix& aFrameToCanvasTM,
nsPresContext* aPresContext);
static nsRect
ToAppPixelRect(nsPresContext *aPresContext,
double xmin, double ymin, double xmax, double ymax);
static nsRect
ToAppPixelRect(nsPresContext *aPresContext, const gfxRect& rect);
TransformFrameRectToOuterSVG(const nsRect& aRect,
const gfxMatrix& aMatrix,
nsPresContext* aPresContext);
/*
* Convert a surface size to an integer for use by thebes
@ -581,9 +586,11 @@ public:
* This should die once bug 478152 is fixed.
*/
static gfxRect PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
nsSVGGeometryFrame* aFrame);
nsSVGGeometryFrame* aFrame,
const gfxMatrix& aMatrix);
static gfxRect PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents,
nsSVGPathGeometryFrame* aFrame);
nsSVGPathGeometryFrame* aFrame,
const gfxMatrix& aMatrix);
/**
* Convert a floating-point value to a 32-bit integer value, clamping to

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

@ -213,6 +213,10 @@ nsTableFrame::Init(nsIContent* aContent,
const nsStyleTableBorder* tableStyle = GetStyleTableBorder();
bool borderCollapse = (NS_STYLE_BORDER_COLLAPSE == tableStyle->mBorderCollapse);
SetBorderCollapse(borderCollapse);
// Transforms need to affect the outer frame, not the inner frame (bug 722777)
mState &= ~NS_FRAME_MAY_BE_TRANSFORMED;
// Create the cell map if this frame is the first-in-flow.
if (!aPrevInFlow) {
mCellMap = new nsTableCellMap(*this, borderCollapse);

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

@ -457,8 +457,8 @@ abstract public class GeckoApp
// Disable share menuitem for about:, chrome: and file: URIs
String scheme = Uri.parse(tab.getURL()).getScheme();
boolean enabled = !(scheme.equals("about") || scheme.equals("chrome") ||
scheme.equals("file"));
boolean enabled = scheme != null && !(scheme.equals("about") || scheme.equals("chrome") ||
scheme.equals("file"));
share.setEnabled(enabled);
// Disable save as PDF for about:home and xul pages
@ -622,8 +622,8 @@ abstract public class GeckoApp
message.put("source", source);
JSONObject destination = new JSONObject();
source.put("width", dw);
source.put("height", dh);
destination.put("width", dw);
destination.put("height", dh);
message.put("destination", destination);
String json = message.toString();
@ -635,8 +635,14 @@ abstract public class GeckoApp
}
void processThumbnail(Tab thumbnailTab, Bitmap bitmap, byte[] compressed) {
if (Tabs.getInstance().isSelectedTab(thumbnailTab))
if (Tabs.getInstance().isSelectedTab(thumbnailTab)) {
if (compressed == null) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0, bos);
compressed = bos.toByteArray();
}
mLastScreen = compressed;
}
if (thumbnailTab.getURL().equals("about:home")) {
thumbnailTab.updateThumbnail(null);
return;
@ -2322,21 +2328,21 @@ abstract public class GeckoApp
private void checkMigrateProfile() {
File profileDir = getProfileDir();
long currentTime = SystemClock.uptimeMillis();
if (profileDir != null) {
long currentTime = SystemClock.uptimeMillis();
Log.i(LOGTAG, "checking profile migration in: " + profileDir.getAbsolutePath());
final GeckoApp app = GeckoApp.mAppContext;
final SetupScreen setupScreen = new SetupScreen(app);
// don't show unless we take a while
setupScreen.showDelayed(mMainHandler);
GeckoAppShell.ensureSQLiteLibsLoaded(app.getApplication().getPackageResourcePath());
ProfileMigrator profileMigrator =
new ProfileMigrator(app.getContentResolver(), profileDir);
profileMigrator.launch();
setupScreen.dismiss();
long timeDiff = SystemClock.uptimeMillis() - currentTime;
Log.i(LOGTAG, "Profile migration took " + timeDiff + " ms");
}
long timeDiff = SystemClock.uptimeMillis() - currentTime;
Log.i(LOGTAG, "Profile migration took " + timeDiff + " ms");
}
private SynchronousQueue<String> mFilePickerResult = new SynchronousQueue<String>();

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

@ -558,6 +558,17 @@ public class GeckoAppShell
mInputConnection.notifyIMEChange(text, start, end, newEnd);
}
public static void notifyScreenShot(ByteBuffer data, int tabId, int width, int height) {
final Bitmap b = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
b.copyPixelsFromBuffer(data);
final Tab tab = Tabs.getInstance().getTab(tabId);
getHandler().post(new Runnable() {
public void run() {
GeckoApp.mAppContext.processThumbnail(tab, b, null);
}
});
}
private static CountDownLatch sGeckoPendingAcks = null;
// Block the current thread until the Gecko event loop is caught up

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

@ -280,6 +280,7 @@ public class ProfileMigrator {
File dbFileShm = new File(dbPathShm);
SQLiteBridge db = null;
GeckoAppShell.ensureSQLiteLibsLoaded(GeckoApp.mAppContext.getApplication().getPackageResourcePath());
try {
db = new SQLiteBridge(dbPath);
migrateBookmarks(db);

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

@ -68,7 +68,6 @@ public class Tabs implements GeckoEventListener {
GeckoAppShell.registerGeckoEventListener("Tab:Added", this);
GeckoAppShell.registerGeckoEventListener("Tab:Close", this);
GeckoAppShell.registerGeckoEventListener("Tab:Select", this);
GeckoAppShell.registerGeckoEventListener("Tab:ScreenshotData", this);
GeckoAppShell.registerGeckoEventListener("Session:RestoreBegin", this);
GeckoAppShell.registerGeckoEventListener("Session:RestoreEnd", this);
}
@ -288,13 +287,6 @@ public class Tabs implements GeckoEventListener {
closeTab(tab);
} else if (event.equals("Tab:Select")) {
selectTab(message.getInt("tabID"));
} else if (event.equals("Tab:ScreenshotData")) {
Tab tab = getTab(message.getInt("tabID"));
String data = message.getString("data");
if (data.length() < 22)
return;
byte[] compressed = GeckoAppShell.decodeBase64(data.substring(22), GeckoAppShell.BASE64_DEFAULT);
GeckoApp.mAppContext.processThumbnail(tab, null, compressed);
} else if (event.equals("Session:RestoreBegin")) {
mRestoringSession = true;
} else if (event.equals("Session:RestoreEnd")) {

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

@ -104,8 +104,6 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
}
protected final void enterUrl(String url) {
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
Activity awesomeBarActivity = clickOnAwesomeBar();
Element urlbar = mDriver.findElement(awesomeBarActivity, "awesomebar_text");
mActions.sendKeys(url);

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

@ -7,6 +7,8 @@ public class testAwesomebar extends BaseTest {
public void testAwesomebar() {
setTestType("mochitest");
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
String url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
loadUrl(url);

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

@ -19,6 +19,8 @@ public class testAxisLocking extends PixelTest {
MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
// load page and check we're at 0,0
loadAndVerifyBoxes(url);

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

@ -12,6 +12,9 @@ public class testBookmark extends BaseTest {
public void testBookmark() {
setTestType("mochitest");
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
String url = getAbsoluteUrl("/robocop/robocop_blank_02.html");
enterUrl(url);

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

@ -15,6 +15,9 @@ public class testCheck extends PixelTest {
public void testCheck() {
setTestType("talos");
String url = getAbsoluteUrl("/startup_test/fennecmark/wikipedia.html");
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
loadAndPaint(url);
mDriver.setupScrollHandling();

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

@ -17,6 +17,8 @@ public class testFlingCorrectness extends PixelTest {
MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
// load page and check we're at 0,0
loadAndVerifyBoxes(url);

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

@ -14,6 +14,8 @@ public class testLoad extends PixelTest {
setTestType("mochitest");
String url = getAbsoluteUrl("/robocop/robocop_boxes.html");
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
loadAndVerifyBoxes(url);
verifyUrl(url);

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

@ -17,6 +17,8 @@ public class testOverscroll extends PixelTest {
MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
// load page and check we're at 0,0
loadAndVerifyBoxes(url);

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

@ -14,6 +14,8 @@ public class testPan extends PixelTest {
setTestType("talos");
String url = getAbsoluteUrl("/startup_test/fennecmark/wikipedia.html");
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
loadAndPaint(url);
mDriver.setupScrollHandling();

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

@ -17,6 +17,8 @@ public class testPanCorrectness extends PixelTest {
MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
// load page and check we're at 0,0
loadAndVerifyBoxes(url);

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

@ -9,6 +9,8 @@ public class test_bug720538 extends PixelTest {
setTestType("mochitest");
String url = getAbsoluteUrl("/robocop/test_bug720538.html");
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
/*
* for this test, we load the associated test_bug720538.html file. this file has two
* iframes (painted completely blue - #0000FF) and the rest of the page is the background

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

@ -140,12 +140,14 @@
function init() {
window.addEventListener("popstate", onPopState, false);
Services.obs.addObserver(Addons, "browser-search-engine-modified", false);
AddonManager.addInstallListener(Addons);
Addons.getAddons();
}
function uninit() {
Services.obs.removeObserver(Addons, "browser-search-engine-modified");
AddonManager.removeInstallListener(Addons);
}
@ -490,8 +492,8 @@
// visible if the user later re-adds it (works around bug 341833)
detailItem.addon.engine.hidden = false;
Services.search.removeEngine(detailItem.addon.engine);
// the search-engine-modified observer in browser.js will take care of
// updating the list
// the search-engine-modified observer will take care of updating the list
history.back();
} else {
detailItem.addon.uninstall();
let opType = this._getOpTypeForOperations(detailItem.addon.pendingOperations);
@ -554,6 +556,18 @@
element.setAttribute("opType", "needs-restart");
},
observe: function observe(aSubject, aTopic, aData) {
if (aTopic == "browser-search-engine-modified") {
switch (aData) {
case "engine-added":
case "engine-removed":
case "engine-changed":
this.getAddons();
break;
}
}
},
onInstallFailed: function(aInstall) {
},

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

@ -353,29 +353,43 @@ var BrowserApp = {
},
_showTelemetryPrompt: function _showTelemetryPrompt() {
let telemetryPrompted = false;
const PREF_TELEMETRY_PROMPTED = "toolkit.telemetry.prompted";
const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled";
const PREF_TELEMETRY_REJECTED = "toolkit.telemetry.rejected";
// This is used to reprompt users when privacy message changes
const TELEMETRY_PROMPT_REV = 2;
let telemetryPrompted = null;
try {
telemetryPrompted = Services.prefs.getBoolPref("toolkit.telemetry.prompted");
telemetryPrompted = Services.prefs.getIntPref(PREF_TELEMETRY_PROMPTED);
} catch (e) { /* Optional */ }
if (telemetryPrompted)
// If the user has seen the latest telemetry prompt, do not prompt again
// else clear old prefs and reprompt
if (telemetryPrompted === TELEMETRY_PROMPT_REV)
return;
Services.prefs.clearUserPref(PREF_TELEMETRY_PROMPTED);
Services.prefs.clearUserPref(PREF_TELEMETRY_ENABLED);
let buttons = [
{
label: Strings.browser.GetStringFromName("telemetry.optin.yes"),
callback: function () {
Services.prefs.setBoolPref("toolkit.telemetry.prompted", true);
Services.prefs.setBoolPref("toolkit.telemetry.enabled", true);
Services.prefs.setIntPref(PREF_TELEMETRY_PROMPTED, TELEMETRY_PROMPT_REV);
Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
}
},
{
label: Strings.browser.GetStringFromName("telemetry.optin.no"),
callback: function () {
Services.prefs.setBoolPref("toolkit.telemetry.prompted", true);
Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
Services.prefs.setIntPref(PREF_TELEMETRY_PROMPTED, TELEMETRY_PROMPT_REV);
Services.prefs.setBoolPref(PREF_TELEMETRY_REJECTED, true);
}
}
];
let brandShortName = Strings.brand.GetStringFromName("brandShortName");
let message = Strings.browser.formatStringFromName("telemetry.optin.message", [brandShortName], 1);
NativeWindow.doorhanger.show(message, "telemetry-optin", buttons);
@ -1365,7 +1379,7 @@ nsBrowserAccess.prototype = {
let parentId = -1;
if (newTab && !isExternal) {
let parent = BrowserApp.getTabForBrowser(BrowserApp.getBrowserForWindow(aOpener));
let parent = BrowserApp.getTabForBrowser(BrowserApp.getBrowserForWindow(aOpener.top));
if (parent)
parentId = parent.id;
}
@ -1601,24 +1615,7 @@ Tab.prototype = {
if (!this.browser || !this.browser.contentWindow)
return;
let canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
canvas.setAttribute("width", aDst.width);
canvas.setAttribute("height", aDst.height);
canvas.setAttribute("moz-opaque", "true");
let ctx = canvas.getContext("2d");
let flags = ctx.DRAWWINDOW_DO_NOT_FLUSH;
ctx.drawWindow(this.browser.contentWindow, 0, 0, aSrc.width, aSrc.height, "#fff", flags);
let message = {
gecko: {
type: "Tab:ScreenshotData",
tabID: this.id,
width: aDst.width,
height: aDst.height,
data: canvas.toDataURL()
}
};
sendMessageToJava(message);
getBridge().takeScreenshot(this.browser.contentWindow, 0, 0, aSrc.width, aSrc.height, aDst.width, aDst.height, this.id);
Services.tm.mainThread.dispatch(function() {
BrowserApp.doNextScreenshot()
}, Ci.nsIThread.DISPATCH_NORMAL);
@ -2907,14 +2904,6 @@ var FormAssistant = {
return (aElement instanceof HTMLSelectElement);
},
_isOptionElement: function(aElement) {
return aElement instanceof HTMLOptionElement;
},
_isOptionGroupElement: function(aElement) {
return aElement instanceof HTMLOptGroupElement;
},
getListForElement: function(aElement) {
let result = {
type: "Prompt:Show",
@ -2929,15 +2918,15 @@ var FormAssistant = {
];
}
this.forOptions(aElement, function(aNode, aIndex) {
this.forOptions(aElement, function(aNode, aIndex, aIsGroup, aInGroup) {
let item = {
label: aNode.text || aNode.label,
isGroup: this._isOptionGroupElement(aNode),
inGroup: this._isOptionGroupElement(aNode.parentNode),
isGroup: aIsGroup,
inGroup: aInGroup,
disabled: aNode.disabled,
id: aIndex
}
if (item.inGroup)
if (aInGroup)
item.disabled = item.disabled || aNode.parentNode.disabled;
result.listitems[aIndex] = item;
@ -2949,26 +2938,27 @@ var FormAssistant = {
forOptions: function(aElement, aFunction) {
let optionIndex = 0;
let children = aElement.children;
let numChildren = children.length;
// if there are no children in this select, we add a dummy row so that at least something appears
if (children.length == 0)
if (numChildren == 0)
aFunction.call(this, {label:""}, optionIndex);
for (let i = 0; i < children.length; i++) {
for (let i = 0; i < numChildren; i++) {
let child = children[i];
if (this._isOptionGroupElement(child)) {
aFunction.call(this, child, optionIndex);
if (child instanceof HTMLOptionElement) {
// This is a regular choice under no group.
aFunction.call(this, child, optionIndex, false, false);
optionIndex++;
} else if (child instanceof HTMLOptGroupElement) {
aFunction.call(this, child, optionIndex, true, false);
optionIndex++;
let subchildren = child.children;
for (let j = 0; j < subchildren.length; j++) {
let numSubchildren = subchildren.length;
for (let j = 0; j < numSubchildren; j++) {
let subchild = subchildren[j];
aFunction.call(this, subchild, optionIndex);
aFunction.call(this, subchild, optionIndex, false, true);
optionIndex++;
}
} else if (this._isOptionElement(child)) {
// This is a regular choice under no group.
aFunction.call(this, child, optionIndex);
optionIndex++;
}
}
}
@ -4165,7 +4155,6 @@ var CharacterEncoding = {
let docCharset = browser.docShell.QueryInterface(Ci.nsIDocCharset);
docCharset.charset = aEncoding;
browser.reload(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
},
}
};

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

@ -36,30 +36,31 @@
# ***** END LICENSE BLOCK *****
add_makefiles "
netwerk/locales/Makefile
dom/locales/Makefile
toolkit/locales/Makefile
security/manager/locales/Makefile
mobile/locales/Makefile
mobile/android/Makefile
mobile/android/app/Makefile
mobile/android/app/profile/extensions/Makefile
mobile/android/base/Makefile
mobile/android/base/locales/Makefile
mobile/locales/Makefile
$MOZ_BRANDING_DIRECTORY/Makefile
$MOZ_BRANDING_DIRECTORY/content/Makefile
$MOZ_BRANDING_DIRECTORY/locales/Makefile
mobile/android/chrome/Makefile
mobile/android/chrome/tests/Makefile
mobile/android/components/Makefile
mobile/android/components/build/Makefile
mobile/android/modules/Makefile
mobile/android/installer/Makefile
mobile/android/locales/Makefile
mobile/android/Makefile
mobile/android/themes/core/Makefile
"
if test -n "$MOZ_UPDATE_PACKAGING"; then
add_makefiles "
tools/update-packaging/Makefile
"
if [ ! "$LIBXUL_SDK" ]; then
add_makefiles "
mobile/android/components/build/Makefile
"
fi
if [ "$ENABLE_TESTS" ]; then
add_makefiles "
mobile/android/chrome/tests/Makefile
"
fi

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

@ -36,6 +36,8 @@
# ***** END LICENSE BLOCK *****
add_makefiles "
mobile/locales/Makefile
mobile/xul/Makefile
mobile/xul/app/Makefile
mobile/xul/app/profile/extensions/Makefile
$MOZ_BRANDING_DIRECTORY/Makefile
@ -43,15 +45,18 @@ $MOZ_BRANDING_DIRECTORY/content/Makefile
$MOZ_BRANDING_DIRECTORY/locales/Makefile
mobile/xul/chrome/Makefile
mobile/xul/components/Makefile
mobile/xul/components/build/Makefile
mobile/xul/modules/Makefile
mobile/xul/installer/Makefile
mobile/xul/locales/Makefile
mobile/locales/Makefile
mobile/xul/Makefile
mobile/xul/themes/core/Makefile
"
if [ ! "$LIBXUL_SDK" ]; then
add_makefiles "
mobile/xul/components/build/Makefile
"
fi
if [ "$ENABLE_TESTS" ]; then
add_makefiles "
mobile/xul/chrome/tests/Makefile

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

@ -1552,14 +1552,13 @@ bool
HttpBaseChannel::ShouldRewriteRedirectToGET(PRUint32 httpStatus,
nsHttpAtom method)
{
// always rewrite for 301 and 302, but see bug 598304
// and RFC 2616, Section 8.3.
// for 301 and 302, only rewrite POST
if (httpStatus == 301 || httpStatus == 302)
return true;
return method == nsHttp::Post;
// always rewrite for 303
// rewrite for 303 unless it was HEAD
if (httpStatus == 303)
return true;
return method != nsHttp::Head;
// otherwise, such as for 307, do not rewrite
return false;

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

@ -75,23 +75,23 @@ function run_test() {
// same-origin variant
var tests = [
// 301: rewrite just POST
[301, "DELETE", "GET", 200], // but see bug 598304
[301, "DELETE", null, 301],
[301, "GET", "GET", 200],
[301, "HEAD", "GET", 200], // but see bug 598304
[301, "HEAD", "HEAD", 200],
[301, "POST", "GET", 200],
[301, "PUT", "GET", 200], // but see bug 598304
[301, "PROPFIND", "GET", 200], // but see bug 598304
[301, "PUT", null, 301],
[301, "PROPFIND", "PROPFIND", 200],
// 302: see 301
[302, "DELETE", "GET", 200], // but see bug 598304
[302, "DELETE", null, 302],
[302, "GET", "GET", 200],
[302, "HEAD", "GET", 200], // but see bug 598304
[302, "HEAD", "HEAD", 200],
[302, "POST", "GET", 200],
[302, "PUT", "GET", 200], // but see bug 598304
[302, "PROPFIND", "GET", 200], // but see bug 598304
[302, "PUT", null, 302],
[302, "PROPFIND", "PROPFIND", 200],
// 303: rewrite to GET except HEAD
[303, "DELETE", "GET", 200],
[303, "GET", "GET", 200],
[303, "HEAD", "GET", 200],
[303, "HEAD", "HEAD", 200],
[303, "POST", "GET", 200],
[303, "PUT", "GET", 200],
[303, "PROPFIND", "GET", 200],

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

@ -111,11 +111,12 @@ static const PRInt64 gUpdateInterval = 400 * PR_USEC_PER_MSEC;
////////////////////////////////////////////////////////////////////////////////
//// nsDownloadManager
NS_IMPL_ISUPPORTS3(
NS_IMPL_ISUPPORTS4(
nsDownloadManager
, nsIDownloadManager
, nsINavHistoryObserver
, nsIObserver
, nsISupportsWeakReference
)
nsDownloadManager *nsDownloadManager::gDownloadManagerService = nsnull;
@ -886,23 +887,19 @@ nsDownloadManager::Init()
// completely initialized), but the observerservice would still keep a reference
// to us and notify us about shutdown, which may cause crashes.
// failure to add an observer is not critical
//
// These observers will be cleaned up automatically at app shutdown. We do
// not bother explicitly breaking the observers because we are a singleton
// that lives for the duration of the app.
(void)mObserverService->AddObserver(this, "quit-application", false);
(void)mObserverService->AddObserver(this, "quit-application-requested", false);
(void)mObserverService->AddObserver(this, "offline-requested", false);
(void)mObserverService->AddObserver(this, "sleep_notification", false);
(void)mObserverService->AddObserver(this, "wake_notification", false);
(void)mObserverService->AddObserver(this, "profile-before-change", false);
(void)mObserverService->AddObserver(this, NS_IOSERVICE_GOING_OFFLINE_TOPIC, false);
(void)mObserverService->AddObserver(this, NS_IOSERVICE_OFFLINE_STATUS_TOPIC, false);
(void)mObserverService->AddObserver(this, NS_PRIVATE_BROWSING_REQUEST_TOPIC, false);
(void)mObserverService->AddObserver(this, NS_PRIVATE_BROWSING_SWITCH_TOPIC, false);
(void)mObserverService->AddObserver(this, "quit-application", true);
(void)mObserverService->AddObserver(this, "quit-application-requested", true);
(void)mObserverService->AddObserver(this, "offline-requested", true);
(void)mObserverService->AddObserver(this, "sleep_notification", true);
(void)mObserverService->AddObserver(this, "wake_notification", true);
(void)mObserverService->AddObserver(this, "profile-before-change", true);
(void)mObserverService->AddObserver(this, NS_IOSERVICE_GOING_OFFLINE_TOPIC, true);
(void)mObserverService->AddObserver(this, NS_IOSERVICE_OFFLINE_STATUS_TOPIC, true);
(void)mObserverService->AddObserver(this, NS_PRIVATE_BROWSING_REQUEST_TOPIC, true);
(void)mObserverService->AddObserver(this, NS_PRIVATE_BROWSING_SWITCH_TOPIC, true);
if (history)
(void)history->AddObserver(this, false);
(void)history->AddObserver(this, true);
return NS_OK;
}

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

@ -58,6 +58,7 @@
#include "nsIObserverService.h"
#include "nsIStringBundle.h"
#include "nsISupportsPrimitives.h"
#include "nsWeakReference.h"
#include "nsITimer.h"
#include "nsString.h"
@ -76,7 +77,8 @@ class nsDownload;
class nsDownloadManager : public nsIDownloadManager,
public nsINavHistoryObserver,
public nsIObserver
public nsIObserver,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS

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

@ -57,9 +57,10 @@ CPPSRCS = \
PROGRAM = maintenanceservice$(BIN_SUFFIX)
DIST_PROGRAM = maintenanceservice$(BIN_SUFFIX)
# Don't link the maintenanceservice against libmozutils. See bug 687139
MOZ_UTILS_LDFLAGS =
MOZ_UTILS_PROGRAM_LDFLAGS =
# Don't link the maintenanceservice against mozglue.dll. See bug 687139 and
# bug 725876
MOZ_GLUE_LDFLAGS =
MOZ_GLUE_PROGRAM_LDFLAGS =
LIBS += \
../../mozapps/update/common/$(LIB_PREFIX)updatecommon.$(LIB_SUFFIX) \

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

@ -73,10 +73,8 @@ endif
XPCSHELL_TESTS = tests/unit
ifdef ENABLE_TESTS
ifneq (mobile,$(MOZ_BUILD_APP))
DIRS += tests/browser
endif
TEST_DIRS += tests/browser
endif
include $(topsrcdir)/config/rules.mk

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

@ -50,8 +50,9 @@ EXTRA_PP_JS_MODULES = \
FileUtils.jsm \
$(NULL)
TEST_DIRS += test/chrome
ifdef ENABLE_TESTS
DIRS += test/chrome
XPCSHELL_TESTS = test/unit
endif

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

@ -77,14 +77,12 @@ endif
endif
endif
ifdef ENABLE_TESTS
DIRS += test_timermanager
TEST_DIRS += test_timermanager
# Update tests require the updater binary
ifdef MOZ_UPDATER
DIRS += test
TEST_DIRS += test
ifdef MOZ_MAINTENANCE_SERVICE
DIRS += test_svc
endif
TEST_DIRS += test_svc
endif
endif

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

@ -67,10 +67,17 @@ MAKEFILES_dom="
dom/interfaces/xbl/Makefile
dom/interfaces/xpath/Makefile
dom/interfaces/xul/Makefile
dom/ipc/Makefile
dom/base/Makefile
dom/battery/Makefile
dom/indexedDB/Makefile
dom/ipc/Makefile
dom/locales/Makefile
dom/network/Makefile
dom/network/interfaces/Makefile
dom/network/src/Makefile
dom/plugins/base/Makefile
dom/plugins/ipc/Makefile
dom/power/Makefile
dom/sms/Makefile
dom/sms/interfaces/Makefile
dom/sms/src/Makefile
@ -84,9 +91,6 @@ MAKEFILES_dom="
dom/src/storage/Makefile
dom/system/Makefile
dom/workers/Makefile
dom/locales/Makefile
dom/plugins/base/Makefile
dom/plugins/ipc/Makefile
"
MAKEFILES_editor="
@ -255,6 +259,7 @@ MAKEFILES_layout="
layout/ipc/Makefile
layout/inspector/public/Makefile
layout/inspector/src/Makefile
layout/media/Makefile
layout/style/Makefile
layout/style/xbl-marquee/Makefile
layout/tables/Makefile
@ -468,7 +473,6 @@ MAKEFILES_xulapp="
toolkit/components/filepicker/Makefile
toolkit/components/find/Makefile
toolkit/components/intl/Makefile
toolkit/components/maintenanceservice/Makefile
toolkit/components/microformats/Makefile
toolkit/components/parentalcontrols/Makefile
toolkit/components/passwordmgr/Makefile
@ -714,6 +718,7 @@ if [ "$ENABLE_TESTS" ]; then
chrome/test/Makefile
content/base/test/Makefile
content/base/test/chrome/Makefile
content/base/test/websocket_hybi/Makefile
content/canvas/test/Makefile
content/canvas/test/crossorigin/Makefile
content/canvas/test/webgl/Makefile
@ -736,8 +741,11 @@ if [ "$ENABLE_TESTS" ]; then
docshell/test/navigation/Makefile
dom/battery/test/Makefile
dom/indexedDB/test/Makefile
dom/indexedDB/test/unit/Makefile
dom/network/tests/Makefile
dom/plugins/test/Makefile
dom/plugins/test/testplugin/Makefile
dom/power/test/Makefile
dom/sms/tests/Makefile
dom/src/foo/Makefile
dom/src/json/test/Makefile
@ -894,6 +902,7 @@ if [ "$ENABLE_TESTS" ]; then
toolkit/content/tests/chrome/rtlchrome/Makefile
toolkit/content/tests/chrome/rtltest/Makefile
toolkit/content/tests/widgets/Makefile
toolkit/devtools/debugger/tests/Makefile
toolkit/mozapps/downloads/tests/Makefile
toolkit/mozapps/downloads/tests/chrome/Makefile
toolkit/mozapps/extensions/test/Makefile
@ -926,11 +935,13 @@ if [ "$ENABLE_TESTS" ]; then
accessible/tests/mochitest/hyperlink/Makefile
accessible/tests/mochitest/hypertext/Makefile
accessible/tests/mochitest/name/Makefile
accessible/tests/mochitest/pivot/Makefile
accessible/tests/mochitest/relations/Makefile
accessible/tests/mochitest/selectable/Makefile
accessible/tests/mochitest/states/Makefile
accessible/tests/mochitest/table/Makefile
accessible/tests/mochitest/text/Makefile
accessible/tests/mochitest/textcaret/Makefile
accessible/tests/mochitest/textselection/Makefile
accessible/tests/mochitest/tree/Makefile
accessible/tests/mochitest/treeupdate/Makefile
@ -1007,6 +1018,11 @@ if [ "$ENABLE_TESTS" ]; then
toolkit/mozapps/update/test/chrome/Makefile
"
fi
if [ "$MOZ_MAINTENANCE_SERVICE" ]; then
add_makefiles "
toolkit/mozapps/update/test_svc/Makefile
"
fi
fi
if [ "$MOZ_URL_CLASSIFIER" ]; then
add_makefiles "
@ -1038,7 +1054,7 @@ if [ "$ENABLE_TESTS" ]; then
toolkit/components/downloads/test/browser/Makefile
toolkit/components/passwordmgr/test/browser/Makefile
toolkit/components/places/tests/browser/Makefile
toolkit/components/startup/tests/Makefile
toolkit/components/startup/tests/browser/Makefile
toolkit/content/tests/browser/Makefile
toolkit/content/tests/browser/common/Makefile
toolkit/content/tests/browser/data/Makefile
@ -1071,6 +1087,11 @@ if [ "$ENABLE_TESTS" ]; then
xpcom/tests/windows/Makefile
"
fi
if [ "$MOZ_BUILD_APP" = "mobile/android" ]; then
add_makefiles "
testing/mochitest/roboextender/Makefile
"
fi
fi
@ -1142,6 +1163,7 @@ if [ "$MOZ_B2G_RIL" ]; then
add_makefiles "
dom/system/b2g/Makefile
dom/telephony/Makefile
dom/wifi/Makefile
ipc/ril/Makefile
"
fi
@ -1250,6 +1272,12 @@ if [ "$MOZ_FEEDS" ]; then
"
fi
if [ "$MOZ_GRAPHITE" ]; then
add_makefiles "
gfx/graphite2/src/Makefile
"
fi
if [ "$MOZ_HELP_VIEWER" ]; then
add_makefiles "
toolkit/components/help/Makefile
@ -1286,6 +1314,12 @@ if [ "$MOZ_JSDEBUGGER" ]; then
"
fi
if [ "$MOZ_MAINTENANCE_SERVICE" ]; then
add_makefiles "
toolkit/components/maintenanceservice/Makefile
"
fi
if [ ! "$MOZ_NATIVE_SQLITE" ]; then
add_makefiles "
db/sqlite3/src/Makefile
@ -1330,7 +1364,6 @@ if [ "$MOZ_UPDATER" ]; then
modules/libmar/Makefile
modules/libmar/src/Makefile
modules/libmar/tool/Makefile
toolkit/mozapps/readstrings/Makefile
"
if [ ! "$SYSTEM_BZ2" ]; then
add_makefiles "
@ -1345,6 +1378,17 @@ if [ "$MOZ_UPDATER" ]; then
fi
fi
if [ "$MOZ_UPDATER" -o "$MOZ_MAINTENANCE_SERVICE" ]; then
add_makefiles "
toolkit/mozapps/readstrings/Makefile
"
if [ "$OS_TARGET" != "Android" ]; then
add_makefiles "
toolkit/mozapps/update/common/Makefile
"
fi
fi
if [ "$MOZ_UPDATER" -o "$MOZ_UPDATE_PACKAGING" ]; then
add_makefiles "
other-licenses/bsdiff/Makefile

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

@ -51,6 +51,11 @@
#include "nsThreadUtils.h"
#include "nsIThreadManager.h"
#include "mozilla/dom/sms/PSms.h"
#include "gfxImageSurface.h"
#include "gfxContext.h"
#include "nsPresContext.h"
#include "nsIDocShell.h"
#include "nsPIDOMWindow.h"
#ifdef DEBUG
#define ALOG_BRIDGE(args...) ALOG(args)
@ -103,6 +108,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
jNotifyIME = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIME", "(II)V");
jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;Z)V");
jNotifyIMEChange = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEChange", "(Ljava/lang/String;III)V");
jNotifyScreenShot = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyScreenShot", "(Ljava/nio/ByteBuffer;III)V");
jAcknowledgeEventSync = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "acknowledgeEventSync", "()V");
jEnableDeviceMotion = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableDeviceMotion", "(Z)V");
@ -1959,3 +1965,46 @@ AndroidBridge::HideSurface(jobject surface)
env->CallStaticVoidMethod(cls, method, surface);
#endif
}
/* void takeScreenshot (in nsIDOMWindow win, in PRInt32 srcX, in PRInt32 srcY, in PRInt32 srcW, in PRInt32 srcH, in PRInt32 dstX, in PRInt32 dstY, in PRInt32 dstW, in PRInt32 dstH, in AString color); */
NS_IMETHODIMP nsAndroidBridge::TakeScreenshot(nsIDOMWindow *window, PRInt32 srcX, PRInt32 srcY, PRInt32 srcW, PRInt32 srcH, PRInt32 dstW, PRInt32 dstH, PRInt32 tabId)
{
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(window);
if (!win)
return NS_ERROR_FAILURE;
nsRefPtr<nsPresContext> presContext;
nsIDocShell* docshell = win->GetDocShell();
if (docshell) {
docshell->GetPresContext(getter_AddRefs(presContext));
}
if (!presContext)
return NS_ERROR_FAILURE;
nscolor bgColor = NS_RGB(255, 255, 255);
nsIPresShell* presShell = presContext->PresShell();
PRUint32 renderDocFlags = (nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING |
nsIPresShell::RENDER_DOCUMENT_RELATIVE);
nsRect r(nsPresContext::CSSPixelsToAppUnits(srcX),
nsPresContext::CSSPixelsToAppUnits(srcY),
nsPresContext::CSSPixelsToAppUnits(srcW),
nsPresContext::CSSPixelsToAppUnits(srcH));
nsRefPtr<gfxImageSurface> surf = new gfxImageSurface(nsIntSize(dstW, dstH), gfxASurface::ImageFormatRGB16_565);
nsRefPtr<gfxContext> context = new gfxContext(surf);
nsresult rv = presShell->RenderDocument(r, renderDocFlags, bgColor, context);
NS_ENSURE_SUCCESS(rv, rv);
AndroidBridge::Bridge()->NotifyScreenshot(surf->Data(), surf->GetDataSize(), tabId, dstW, dstH);
return NS_OK;
}
void AndroidBridge::NotifyScreenshot(unsigned char* data, int size, int tabId, int width, int height)
{
JNIEnv* jenv = GetJNIEnv();
if (!jenv)
return;
AutoLocalJNIFrame jniFrame(jenv, 1);
jobject buffer = jenv->NewDirectByteBuffer(data, size);
if (!buffer)
return;
jenv->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyScreenShot, buffer, tabId, width, height);
}

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

@ -156,6 +156,8 @@ public:
static void NotifyIMEChange(const PRUnichar *aText, PRUint32 aTextLen, int aStart, int aEnd, int aNewEnd);
void NotifyScreenshot(unsigned char* data, int size, int tabId, int width, int height);
void AcknowledgeEventSync();
void EnableDeviceMotion(bool aEnable);
@ -420,6 +422,7 @@ protected:
jmethodID jNotifyIME;
jmethodID jNotifyIMEEnabled;
jmethodID jNotifyIMEChange;
jmethodID jNotifyScreenShot;
jmethodID jAcknowledgeEventSync;
jmethodID jEnableDeviceMotion;
jmethodID jEnableLocation;

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

@ -1,4 +1,5 @@
#include "nsISupports.idl"
#include "nsIDOMWindow.idl"
[scriptable, uuid(38b5c83a-3e8d-45c2-8311-6e36bd5116c0)]
interface nsIAndroidDrawMetadataProvider : nsISupports {
@ -16,4 +17,6 @@ interface nsIAndroidBridge : nsISupports
{
AString handleGeckoMessage(in AString message);
void setDrawMetadataProvider(in nsIAndroidDrawMetadataProvider provider);
void takeScreenshot(in nsIDOMWindow win, in PRInt32 srcX, in PRInt32 srcY, in PRInt32 srcW, in PRInt32 srcH,
in PRInt32 dstW, in PRInt32 dstH, in PRInt32 tabId);
};

3338
widget/gtk2/gtk3drawing.c Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -246,12 +246,15 @@ gint moz_gtk_enable_style_props(style_prop_t styleGetProp);
*/
gint moz_gtk_shutdown();
#if defined(MOZ_WIDGET_GTK2)
/**
* Retrieves the colormap to use for drawables passed to moz_gtk_widget_paint.
*/
GdkColormap* moz_gtk_widget_get_colormap();
#endif
/*** Widget drawing ***/
#if defined(MOZ_WIDGET_GTK2)
/**
* Paint a widget in the current theme.
* widget: a constant giving the widget to paint
@ -268,6 +271,13 @@ moz_gtk_widget_paint(GtkThemeWidgetType widget, GdkDrawable* drawable,
GdkRectangle* rect, GdkRectangle* cliprect,
GtkWidgetState* state, gint flags,
GtkTextDirection direction);
#else
gint
moz_gtk_widget_paint(GtkThemeWidgetType widget, cairo_t *cr,
GdkRectangle* rect, GdkRectangle* cliprect,
GtkWidgetState* state, gint flags,
GtkTextDirection direction);
#endif
/*** Widget metrics ***/