merge fx-team to mozilla central

This commit is contained in:
Gavin Sharp 2011-07-10 13:40:25 -07:00
Родитель 8b88c7d0b5 c18503ce3b
Коммит 85b41bc71b
76 изменённых файлов: 5326 добавлений и 2908 удалений

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

@ -1,193 +1,201 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist"> <blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1306529826000">
<emItems> <emItems>
<emItem id="fdm_ffext@freedownloadmanager.org"> <emItem blockID="i8" id="{B13721C7-F507-4982-B2E5-502A71474FED}">
<versionRange minVersion="1.0" maxVersion="1.3.1"> <versionRange minVersion=" " severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> </versionRange>
<versionRange minVersion="3.0a1" maxVersion="*"/> </emItem>
</targetApplication> <emItem blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
</versionRange> <versionRange minVersion="0.1" maxVersion="3.3.0.*">
</emItem> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<emItem id="firefox@bandoo.com"> <versionRange minVersion="3.7a1" maxVersion="*" />
<versionRange minVersion="5.0" maxVersion="5.0" severity="1"> </targetApplication>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> </versionRange>
<versionRange minVersion="3.7a1pre" maxVersion="*"/> <versionRange minVersion="3.3.1" maxVersion="*">
</targetApplication> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</versionRange> <versionRange minVersion="5.0a1" maxVersion="*" />
</emItem> </targetApplication>
<emItem id="langpack-vi-VN@firefox.mozilla.org"> </versionRange>
<versionRange minVersion="2.0" maxVersion="2.0"/> </emItem>
</emItem> <emItem blockID="i19" id="{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}">
<emItem id="masterfiler@gmail.com"> <versionRange minVersion="1.1b1" maxVersion="1.1b1">
<versionRange severity="3"/> </versionRange>
</emItem> </emItem>
<emItem id="mozilla_cc@internetdownloadmanager.com"> <emItem blockID="i16" id="{27182e60-b5f3-411c-b545-b44205977502}">
<versionRange minVersion=" " maxVersion="6.9.8"> <versionRange minVersion="1.0" maxVersion="1.0">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> </versionRange>
<versionRange minVersion="3.7a1pre" maxVersion="*"/> </emItem>
</targetApplication> <emItem blockID="i10" id="{8CE11043-9A15-4207-A565-0C94C42D590D}">
</versionRange> </emItem>
<versionRange minVersion="2.1" maxVersion="3.3"> <emItem blockID="i1" id="mozilla_cc@internetdownloadmanager.com">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <versionRange minVersion="2.1" maxVersion="3.3">
<versionRange minVersion="3.0a1" maxVersion="*"/> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</targetApplication> <versionRange minVersion="3.0a1" maxVersion="*" />
</versionRange> </targetApplication>
</emItem> </versionRange>
<emItem id="msntoolbar@msn.com"> <versionRange minVersion=" " maxVersion="6.9.8">
<versionRange minVersion=" " maxVersion="6.*"/> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</emItem> <versionRange minVersion="3.7a1pre" maxVersion="*" />
<emItem id="personas@christopher.beard"> </targetApplication>
<versionRange minVersion="1.6" maxVersion="1.6"> </versionRange>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> </emItem>
<versionRange minVersion="3.6" maxVersion="3.6.*"/> <emItem blockID="i18" id="msntoolbar@msn.com">
</targetApplication> <versionRange minVersion=" " maxVersion="6.*">
</versionRange> </versionRange>
</emItem> </emItem>
<emItem id="ShopperReports@ShopperReports.com"> <emItem blockID="i13" id="{E8E88AB0-7182-11DF-904E-6045E0D72085}">
<versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0"/> </emItem>
</emItem> <emItem blockID="i4" id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
<emItem id="support@daemon-tools.cc"> <versionRange minVersion="1.2" maxVersion="1.2">
<versionRange minVersion=" " maxVersion="1.0.0.5"/> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</emItem> <versionRange minVersion="3.0a1" maxVersion="*" />
<emItem id="support@update-firefox.com"/> </targetApplication>
<emItem id="yslow@yahoo-inc.com"> </versionRange>
<versionRange minVersion="2.0.5" maxVersion="2.0.5"> </emItem>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <emItem blockID="i23" id="firefox@bandoo.com">
<versionRange minVersion="3.5.7" maxVersion="*"/> <versionRange minVersion="5.0" maxVersion="5.0" severity="1">
</targetApplication> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</versionRange> <versionRange minVersion="3.7a1pre" maxVersion="*" />
</emItem> </targetApplication>
<emItem id="{2224e955-00e9-4613-a844-ce69fccaae91}"/> </versionRange>
<emItem id="{27182e60-b5f3-411c-b545-b44205977502}"> </emItem>
<versionRange minVersion="1.0" maxVersion="1.0"/> <emItem blockID="i22" id="ShopperReports@ShopperReports.com">
</emItem> <versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0">
<emItem id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}"> </versionRange>
<versionRange minVersion="2.2" maxVersion="2.2"/> </emItem>
</emItem> <emItem blockID="i2" id="fdm_ffext@freedownloadmanager.org">
<emItem id="{3f963a5b-e555-4543-90e2-c3908898db71}"> <versionRange minVersion="1.0" maxVersion="1.3.1">
<versionRange minVersion=" " maxVersion="8.5"/> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</emItem> <versionRange minVersion="3.0a1" maxVersion="*" />
<emItem id="{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}"> </targetApplication>
<versionRange minVersion="1.1b1" maxVersion="1.1b1"/> </versionRange>
</emItem> </emItem>
<emItem id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}"> <emItem blockID="i5" id="support@daemon-tools.cc">
<versionRange minVersion="1.2" maxVersion="1.2"> <versionRange minVersion=" " maxVersion="1.0.0.5">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> </versionRange>
<versionRange minVersion="3.0a1" maxVersion="*"/> </emItem>
</targetApplication> <emItem blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
</versionRange> <versionRange minVersion=" " maxVersion="8.5">
</emItem> </versionRange>
<emItem id="{6E19037A-12E3-4295-8915-ED48BC341614}"> </emItem>
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1"> <emItem blockID="i12" id="masterfiler@gmail.com">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <versionRange severity="3">
<versionRange minVersion="3.7a1pre" maxVersion="*"/> </versionRange>
</targetApplication> </emItem>
</versionRange> <emItem blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
</emItem> <versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
<emItem id="{8CE11043-9A15-4207-A565-0C94C42D590D}"/> </versionRange>
<emItem id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}"> </emItem>
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1"/> <emItem blockID="i11" id="yslow@yahoo-inc.com">
</emItem> <versionRange minVersion="2.0.5" maxVersion="2.0.5">
<emItem id="{B13721C7-F507-4982-B2E5-502A71474FED}"> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange severity="1"/> <versionRange minVersion="3.5.7" maxVersion="*" />
</emItem> </targetApplication>
<emItem id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}"> </versionRange>
<versionRange minVersion="0.1" maxVersion="3.3.0.*"> </emItem>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <emItem blockID="i17" id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
<versionRange minVersion="3.7a1" maxVersion="*"/> <versionRange minVersion="2.2" maxVersion="2.2">
</targetApplication> </versionRange>
</versionRange> </emItem>
<versionRange minVersion="3.3.1" maxVersion="*"> <emItem blockID="i3" id="langpack-vi-VN@firefox.mozilla.org">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <versionRange minVersion="2.0" maxVersion="2.0">
<versionRange minVersion="5.0a1" maxVersion="*"/> </versionRange>
</targetApplication> </emItem>
</versionRange> <emItem blockID="i7" id="{2224e955-00e9-4613-a844-ce69fccaae91}">
</emItem> </emItem>
<emItem id="{E8E88AB0-7182-11DF-904E-6045E0D72085}"/> <emItem blockID="i24" id="{6E19037A-12E3-4295-8915-ED48BC341614}">
</emItems> <versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
<pluginItems> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<pluginItem> <versionRange minVersion="3.7a1pre" maxVersion="*" />
<match name="name" exp="^Yahoo Application State Plugin$"/> </targetApplication>
<match name="description" exp="^Yahoo Application State Plugin$"/> </versionRange>
<match name="filename" exp="npYState.dll"/> </emItem>
<versionRange> <emItem blockID="i15" id="personas@christopher.beard">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <versionRange minVersion="1.6" maxVersion="1.6">
<versionRange minVersion="3.0a1" maxVersion="3.*"/> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</targetApplication> <versionRange minVersion="3.6" maxVersion="3.6.*" />
</versionRange> </targetApplication>
</pluginItem> </versionRange>
<pluginItem> </emItem>
<match name="name" exp="QuickTime Plug-in 7[.]1[.]"/> <emItem blockID="i21" id="support@update-firefox.com">
<match name="filename" exp="npqtplugin.?[.]dll"/> </emItem>
<versionRange> </emItems>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="3.*"/> <pluginItems>
</targetApplication> <pluginItem blockID="p26">
</versionRange> <match name="name" exp="^Yahoo Application State Plugin$" /> <match name="description" exp="^Yahoo Application State Plugin$" /> <match name="filename" exp="npYState.dll" /> <versionRange >
</pluginItem> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<pluginItem> <versionRange minVersion="3.0a1" maxVersion="3.*" />
<match name="filename" exp="NPFFAddOn.dll"/> </targetApplication>
<versionRange> </versionRange>
</versionRange> </pluginItem>
</pluginItem> <pluginItem blockID="p27">
<pluginItem> <match name="name" exp="QuickTime Plug-in 7[.]1[.]" /> <match name="filename" exp="npqtplugin.?[.]dll" /> <versionRange >
<match name="filename" exp="NPMySrch.dll"/> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange> <versionRange minVersion="3.0a1" maxVersion="3.*" />
</versionRange> </targetApplication>
</pluginItem> </versionRange>
<pluginItem> </pluginItem>
<match name="filename" exp="npViewpoint.dll"/> <pluginItem blockID="p28">
<versionRange> <match name="filename" exp="NPFFAddOn.dll" /> <versionRange >
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> </versionRange>
<versionRange minVersion="3.0" maxVersion="*"/> </pluginItem>
</targetApplication> <pluginItem blockID="p31">
</versionRange> <match name="filename" exp="NPMySrch.dll" /> <versionRange >
</pluginItem> </versionRange>
<pluginItem> </pluginItem>
<match name="name" exp="[0-6]\.0\.[01]\d{2}\.\d+"/> <pluginItem blockID="p32">
<match name="filename" exp="npdeploytk.dll"/> <match name="filename" exp="npViewpoint.dll" /> <versionRange >
<versionRange severity="1"> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
</versionRange> <versionRange minVersion="3.0" maxVersion="*" />
</pluginItem> </targetApplication>
<pluginItem> </versionRange>
<match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]"/> </pluginItem>
<versionRange> <pluginItem blockID="p33">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> <match name="name" exp="[0-6]\.0\.[01]\d{2}\.\d+" /> <match name="filename" exp="npdeploytk.dll" /> <versionRange severity="1">
<versionRange minVersion="3.6a1pre" maxVersion="*"/> </versionRange>
</targetApplication> </pluginItem>
</versionRange> <pluginItem blockID="p34">
</pluginItem> <match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]" /> <versionRange >
</pluginItems> <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<gfxItems> <versionRange minVersion="3.6a1pre" maxVersion="*" />
<gfxBlacklistEntry> </targetApplication>
<os>WINNT 6.1</os> </versionRange>
<vendor>0x10de</vendor> </pluginItem>
<devices> </pluginItems>
<device>0x0a6c</device>
</devices> <gfxItems>
<feature>DIRECT2D</feature> <gfxBlacklistEntry blockID="g35">
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <os>WINNT 6.1</os>
<driverVersion>8.17.12.5896</driverVersion> <vendor>0x10de</vendor>
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> <devices>
</gfxBlacklistEntry> <device>0x0a6c</device>
<gfxBlacklistEntry> </devices>
<os>WINNT 6.1</os> <feature>DIRECT2D</feature>
<vendor>0x10de</vendor> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<devices> <driverVersion>8.17.12.5896</driverVersion>
<device>0x0a6c</device> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
</devices> </gfxBlacklistEntry>
<feature>DIRECT3D_9_LAYERS</feature> <gfxBlacklistEntry blockID="g36">
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <os>WINNT 6.1</os>
<driverVersion>8.17.12.5896</driverVersion> <vendor>0x10de</vendor>
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> <devices>
</gfxBlacklistEntry> <device>0x0a6c</device>
<gfxBlacklistEntry> </devices>
<os>WINNT 5.1</os> <feature>DIRECT3D_9_LAYERS</feature>
<vendor>0x10de</vendor> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<feature>DIRECT3D_9_LAYERS</feature> <driverVersion>8.17.12.5896</driverVersion>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
<driverVersion>7.0.0.0</driverVersion> </gfxBlacklistEntry>
<driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator> <gfxBlacklistEntry blockID="g37">
</gfxBlacklistEntry> <os>WINNT 5.1</os>
</gfxItems> <vendor>0x10de</vendor>
</blocklist> <feature>DIRECT3D_9_LAYERS</feature>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<driverVersion>7.0.0.0</driverVersion>
<driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
</gfxBlacklistEntry>
</gfxItems>
</blocklist>

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

@ -1415,8 +1415,6 @@ function prepareForStartup() {
return; return;
} }
messageManager.loadFrameScript("chrome://browser/content/content.js", true);
// initialize observers and listeners // initialize observers and listeners
// and give C++ access to gBrowser // and give C++ access to gBrowser
gBrowser.init(); gBrowser.init();

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

@ -1,45 +0,0 @@
# -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is multi-process front-end code.
#
# The Initial Developer of the Original Code is
# the Mozilla Foundation
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Felipe Gomes <felipc@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
const webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
addMessageListener("WebNavigation:LoadURI", function(message) {
let flags = message.json.flags || webNavigation.LOAD_FLAGS_NONE;
webNavigation.loadURI(message.json.uri, flags, null, null, null);
});

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

@ -29,7 +29,6 @@ browser.jar:
* content/browser/browser.js (content/browser.js) * content/browser/browser.js (content/browser.js)
* content/browser/browser.xul (content/browser.xul) * content/browser/browser.xul (content/browser.xul)
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) * content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
* content/browser/content.js (content/content.js)
* content/browser/fullscreen-video.xhtml (content/fullscreen-video.xhtml) * content/browser/fullscreen-video.xhtml (content/fullscreen-video.xhtml)
content/browser/highlighter.xhtml (content/highlighter.xhtml) content/browser/highlighter.xhtml (content/highlighter.xhtml)
* content/browser/inspector.html (content/inspector.html) * content/browser/inspector.html (content/inspector.html)

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

@ -24,12 +24,10 @@ let PlacesOrganizer;
function test() { function test() {
waitForExplicitFinish(); waitForExplicitFinish();
openLibrary(onLibraryReady); gLibrary = openLibrary(onLibraryReady);
} }
function onLibraryReady(library) { function onLibraryReady() {
gLibrary = library;
ok(PlacesUtils, "PlacesUtils in scope"); ok(PlacesUtils, "PlacesUtils in scope");
ok(PlacesUIUtils, "PlacesUIUtils in scope"); ok(PlacesUIUtils, "PlacesUIUtils in scope");

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

@ -6,13 +6,14 @@ const TEST_URL = "http://example.com/";
let gLibrary; let gLibrary;
let gItemId; let gItemId;
let PlacesOrganizer;
function test() { function test() {
waitForExplicitFinish(); waitForExplicitFinish();
gLibrary = openLibrary(onLibraryReady); gLibrary = openLibrary(onLibraryReady);
} }
function onLibraryReady(library) { function onLibraryReady() {
PlacesOrganizer = gLibrary.PlacesOrganizer; PlacesOrganizer = gLibrary.PlacesOrganizer;
// Sanity checks. // Sanity checks.

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

@ -96,10 +96,7 @@ function test() {
.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId); .removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
}); });
openLibrary(function (library) { gLibrary = openLibrary(nextTest);
gLibrary = library;
executeSoon(nextTest);
});
} }
function nextTest() { function nextTest() {
@ -111,6 +108,6 @@ function nextTest() {
else { else {
// Close Library window. // Close Library window.
gLibrary.close(); gLibrary.close();
executeSoon(finish); finish();
} }
} }

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

@ -180,8 +180,5 @@ function test() {
ok(PlacesUIUtils, "PlacesUIUtils is running in chrome context"); ok(PlacesUIUtils, "PlacesUIUtils is running in chrome context");
// Open Library. // Open Library.
openLibrary(function (library) { gLibrary = openLibrary(nextTest);
gLibrary = library;
nextTest();
});
} }

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

@ -602,8 +602,8 @@ menuitem.bookmark-item {
} }
#navigator-toolbox[iconsize=large][mode=icons] > #nav-bar { #navigator-toolbox[iconsize=large][mode=icons] > #nav-bar {
padding-left: 2px; -moz-padding-start: 0;
padding-right: 2px; -moz-padding-end: 2px;
} }
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button, #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
@ -665,17 +665,18 @@ menuitem.bookmark-item {
} }
#nav-bar .toolbarbutton-1[disabled="true"] { #nav-bar .toolbarbutton-1[disabled="true"] {
opacity: .8; opacity: .4;
} }
#nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon, #nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-icon { #nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-icon {
opacity: .5; opacity: 1;
} }
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):not(:active):hover, #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):not(:active):hover,
#nav-bar .toolbarbutton-1:not([open="true"]):not(:active):hover > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]), #nav-bar .toolbarbutton-1:not([open="true"]):not(:active):hover > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
#nav-bar .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):not([checked="true"]):not([open="true"]):not(:active):hover { #nav-bar .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):not([checked="true"]):not([open="true"]):not(:active):hover,
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open]):not(:active):hover > .toolbarbutton-icon {
background-color: hsla(190,60%,70%,.5); background-color: hsla(190,60%,70%,.5);
border-color: hsla(190,50%,65%,.8) hsla(190,50%,50%,.8) hsla(190,50%,40%,.8); border-color: hsla(190,50%,65%,.8) hsla(190,50%,50%,.8) hsla(190,50%,40%,.8);
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset, box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
@ -794,14 +795,26 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
} }
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button { #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button {
border-radius: 10000px; margin: -5px 0;
padding: 0; padding-top: 0;
width: 30px; padding-bottom: 0;
height: 30px; -moz-padding-start: 5px;
-moz-padding-end: 0;
position: relative; position: relative;
z-index: 1; z-index: 1;
margin-top: -2px; border-radius: 0 10000px 10000px 0;
margin-bottom: -2px; background: transparent;
border: none;
box-shadow: none;
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:-moz-locale-dir(rtl) {
border-radius: 10000px 0 0 10000px;
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button > .toolbarbutton-icon {
border-radius: 10000px;
padding: 5px;
border: none; border: none;
background-image: -moz-linear-gradient(rgba(251,252,253,.97), rgba(246,247,248,.5) 49%, background-image: -moz-linear-gradient(rgba(251,252,253,.97), rgba(246,247,248,.5) 49%,
rgba(231,232,233,.45) 51%, rgba(225,226,229,.2)); rgba(231,232,233,.45) 51%, rgba(225,226,229,.2));
@ -812,7 +825,7 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
0 1px 1px rgba(0,0,0,.3); 0 1px 1px rgba(0,0,0,.3);
} }
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover { #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover > .toolbarbutton-icon {
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset, box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
0 0 0 2px rgba(255,255,255,.1) inset, 0 0 0 2px rgba(255,255,255,.1) inset,
0 0 0 1px hsla(190,50%,40%,.3), 0 0 0 1px hsla(190,50%,40%,.3),
@ -821,8 +834,8 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
0 0 5px 1px hsl(190,90%,80%); 0 0 5px 1px hsl(190,90%,80%);
} }
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):hover:active, #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):hover:active > .toolbarbutton-icon,
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button[open="true"] { #navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button[open="true"] > .toolbarbutton-icon {
box-shadow: 0 0 6.5px rgba(0,0,0,.4) inset, box-shadow: 0 0 6.5px rgba(0,0,0,.4) inset,
0 0 2px rgba(0,0,0,.4) inset, 0 0 2px rgba(0,0,0,.4) inset,
0 0 0 1px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.65),

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

@ -2053,7 +2053,6 @@ case "$target" in
else else
MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer" MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
fi fi
MOZ_MEMORY=1
_PEDANTIC= _PEDANTIC=
CFLAGS="$CFLAGS -fno-common" CFLAGS="$CFLAGS -fno-common"
CXXFLAGS="$CXXFLAGS -fno-common" CXXFLAGS="$CXXFLAGS -fno-common"

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

@ -122,6 +122,11 @@ public:
CanvasLayer *aOldLayer, CanvasLayer *aOldLayer,
LayerManager *aManager) = 0; LayerManager *aManager) = 0;
// Return true if the canvas should be forced to be "inactive" to ensure
// it can be drawn to the screen even if it's too large to be blitted by
// an accelerated CanvasLayer.
virtual PRBool ShouldForceInactiveLayer(LayerManager *aManager) { return PR_FALSE; }
virtual void MarkContextClean() = 0; virtual void MarkContextClean() = 0;
// Redraw the dirty rectangle of this canvas. // Redraw the dirty rectangle of this canvas.

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

@ -349,10 +349,11 @@ public:
NS_IMETHOD SetIsOpaque(PRBool isOpaque); NS_IMETHOD SetIsOpaque(PRBool isOpaque);
NS_IMETHOD Reset(); NS_IMETHOD Reset();
already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder, virtual already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,
CanvasLayer *aOldLayer, CanvasLayer *aOldLayer,
LayerManager *aManager); LayerManager *aManager);
void MarkContextClean(); virtual PRBool ShouldForceInactiveLayer(LayerManager *aManager);
virtual void MarkContextClean();
NS_IMETHOD SetIsIPC(PRBool isIPC); NS_IMETHOD SetIsIPC(PRBool isIPC);
// this rect is in canvas device space // this rect is in canvas device space
NS_IMETHOD Redraw(const gfxRect &r); NS_IMETHOD Redraw(const gfxRect &r);
@ -1071,9 +1072,7 @@ nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
gfxASurface::gfxImageFormat format = GetImageFormat(); gfxASurface::gfxImageFormat format = GetImageFormat();
if (PR_GetEnv("MOZ_CANVAS_IMAGE_SURFACE")) { if (!PR_GetEnv("MOZ_CANVAS_IMAGE_SURFACE")) {
surface = new gfxImageSurface(gfxIntSize(width, height), format);
} else {
nsCOMPtr<nsIContent> content = nsCOMPtr<nsIContent> content =
do_QueryInterface(static_cast<nsIDOMHTMLCanvasElement*>(mCanvasElement)); do_QueryInterface(static_cast<nsIDOMHTMLCanvasElement*>(mCanvasElement));
nsIDocument* ownerDoc = nsnull; nsIDocument* ownerDoc = nsnull;
@ -1093,8 +1092,15 @@ nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
} }
} }
if (surface && surface->CairoStatus() != 0) if (!surface || surface->CairoStatus()) {
surface = NULL; // If we couldn't create a surface of the type we want, fall back
// to an image surface. This lets us handle surface sizes that
// the underlying cairo backend might not handle.
surface = new gfxImageSurface(gfxIntSize(width, height), format);
if (!surface || surface->CairoStatus()) {
surface = nsnull;
}
}
} }
if (surface) { if (surface) {
if (gCanvasMemoryReporter == nsnull) { if (gCanvasMemoryReporter == nsnull) {
@ -4017,6 +4023,12 @@ nsCanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
return canvasLayer.forget(); return canvasLayer.forget();
} }
PRBool
nsCanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager *aManager)
{
return !aManager->CanUseCanvasLayerForSize(gfxIntSize(mWidth, mHeight));
}
void void
nsCanvasRenderingContext2D::MarkContextClean() nsCanvasRenderingContext2D::MarkContextClean()
{ {

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

@ -194,79 +194,6 @@ public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
protected:
nsCanvasGradientAzure(Type aType) : mType(aType)
{}
nsTArray<GradientStop> mRawStops;
RefPtr<GradientStops> mStops;
Type mType;
};
class nsCanvasRadialGradientAzure : public nsCanvasGradientAzure
{
public:
nsCanvasRadialGradientAzure(const Point &aBeginOrigin, Float aBeginRadius,
const Point &aEndOrigin, Float aEndRadius)
: nsCanvasGradientAzure(RADIAL)
, mCenter(aEndOrigin)
, mRadius(aEndRadius)
{
mOffsetStart = aBeginRadius / mRadius;
mOffsetRatio = 1 - mOffsetStart;
mOrigin = ((mCenter * aBeginRadius) - (aBeginOrigin * mRadius)) /
(aBeginRadius - mRadius);
}
/* nsIDOMCanvasGradient */
NS_IMETHOD AddColorStop (float offset,
const nsAString& colorstr)
{
if (!FloatValidate(offset) || offset < 0.0 || offset > 1.0) {
return NS_ERROR_DOM_INDEX_SIZE_ERR;
}
nscolor color;
nsCSSParser parser;
nsresult rv = parser.ParseColorString(nsString(colorstr),
nsnull, 0, &color);
if (NS_FAILED(rv)) {
return NS_ERROR_DOM_SYNTAX_ERR;
}
mStops = nsnull;
GradientStop newStop;
newStop.offset = offset * mOffsetRatio + mOffsetStart;
newStop.color = Color::FromABGR(color);
mRawStops.AppendElement(newStop);
return NS_OK;
}
// XXX - Temporary gradient code, this will be fixed soon as per bug 666097
Point mCenter;
Float mRadius;
Point mOrigin;
Float mOffsetStart;
Float mOffsetRatio;
};
class nsCanvasLinearGradientAzure : public nsCanvasGradientAzure
{
public:
nsCanvasLinearGradientAzure(const Point &aBegin, const Point &aEnd)
: nsCanvasGradientAzure(LINEAR)
, mBegin(aBegin)
, mEnd(aEnd)
{
}
/* nsIDOMCanvasGradient */ /* nsIDOMCanvasGradient */
NS_IMETHOD AddColorStop (float offset, NS_IMETHOD AddColorStop (float offset,
const nsAString& colorstr) const nsAString& colorstr)
@ -295,6 +222,44 @@ public:
return NS_OK; return NS_OK;
} }
protected:
nsCanvasGradientAzure(Type aType) : mType(aType)
{}
nsTArray<GradientStop> mRawStops;
RefPtr<GradientStops> mStops;
Type mType;
};
class nsCanvasRadialGradientAzure : public nsCanvasGradientAzure
{
public:
nsCanvasRadialGradientAzure(const Point &aBeginOrigin, Float aBeginRadius,
const Point &aEndOrigin, Float aEndRadius)
: nsCanvasGradientAzure(RADIAL)
, mCenter1(aBeginOrigin)
, mCenter2(aEndOrigin)
, mRadius1(aBeginRadius)
, mRadius2(aEndRadius)
{
}
Point mCenter1;
Point mCenter2;
Float mRadius1;
Float mRadius2;
};
class nsCanvasLinearGradientAzure : public nsCanvasGradientAzure
{
public:
nsCanvasLinearGradientAzure(const Point &aBegin, const Point &aEnd)
: nsCanvasGradientAzure(LINEAR)
, mBegin(aBegin)
, mEnd(aEnd)
{
}
protected: protected:
friend class nsCanvasRenderingContext2DAzure; friend class nsCanvasRenderingContext2DAzure;
@ -827,8 +792,8 @@ protected:
static_cast<nsCanvasRadialGradientAzure*>(state.gradientStyles[aStyle].get()); static_cast<nsCanvasRadialGradientAzure*>(state.gradientStyles[aStyle].get());
mPattern = new (mRadialGradientPattern.addr()) mPattern = new (mRadialGradientPattern.addr())
RadialGradientPattern(gradient->mCenter, gradient->mOrigin, gradient->mRadius, RadialGradientPattern(gradient->mCenter1, gradient->mCenter2, gradient->mRadius1,
gradient->GetGradientStopsForTarget(aRT)); gradient->mRadius2, gradient->GetGradientStopsForTarget(aRT));
} else if (state.patternStyles[aStyle]) { } else if (state.patternStyles[aStyle]) {
if (aCtx->mCanvasElement) { if (aCtx->mCanvasElement) {
CanvasUtils::DoDrawImageSecurityCheck(aCtx->HTMLCanvasElement(), CanvasUtils::DoDrawImageSecurityCheck(aCtx->HTMLCanvasElement(),

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

@ -6,17 +6,6 @@
<body> <body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> <canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script> <script>
function IsAzureEnabled() {
var enabled = false;
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
enabled = Components.classes["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).AzureEnabled;
} catch (e) { }
return enabled;
}
function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) { function isPixel(ctx, x,y, r,g,b,a, pos, colour, d) {
var pixel = ctx.getImageData(x, y, 1, 1); var pixel = ctx.getImageData(x, y, 1, 1);
@ -59,28 +48,15 @@ g.addColorStop(1, '#0f0');
ctx.fillStyle = g; ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50); ctx.fillRect(0, 0, 100, 50);
if (IsAzureEnabled()) { isPixel(ctx, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 0);
// XXX - See Bug 666097. isPixel(ctx, 50,1, 0,255,0,255, "50,1", "0,255,0,255", 0);
todo_isPixel(ctx, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 0); isPixel(ctx, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 0);
todo_isPixel(ctx, 50,1, 0,255,0,255, "50,1", "0,255,0,255", 0); isPixel(ctx, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 0);
todo_isPixel(ctx, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 0); isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
todo_isPixel(ctx, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 0); isPixel(ctx, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 0);
todo_isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0); isPixel(ctx, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 0);
todo_isPixel(ctx, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 0); isPixel(ctx, 50,48, 0,255,0,255, "50,48", "0,255,0,255", 0);
todo_isPixel(ctx, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 0); isPixel(ctx, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 0);
todo_isPixel(ctx, 50,48, 0,255,0,255, "50,48", "0,255,0,255", 0);
todo_isPixel(ctx, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 0);
} else {
isPixel(ctx, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 0);
isPixel(ctx, 50,1, 0,255,0,255, "50,1", "0,255,0,255", 0);
isPixel(ctx, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 0);
isPixel(ctx, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 0);
isPixel(ctx, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 0);
isPixel(ctx, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 0);
isPixel(ctx, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 0);
isPixel(ctx, 50,48, 0,255,0,255, "50,48", "0,255,0,255", 0);
isPixel(ctx, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 0);
}
SimpleTest.finish(); SimpleTest.finish();

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

@ -6399,28 +6399,15 @@ g.addColorStop(1, '#f00');
ctx.fillStyle = g; ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50); ctx.fillRect(0, 0, 100, 50);
if (IsAzureEnabled()) { isPixel(ctx, 1, 1, 0, 255, 0, 255, 0);
// XXX - See Bug 666097. isPixel(ctx, 50, 1, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 1, 1, 0, 255, 0, 255, 0); isPixel(ctx, 98, 1, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 50, 1, 0, 255, 0, 255, 0); isPixel(ctx, 1, 25, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 98, 1, 0, 255, 0, 255, 0); isPixel(ctx, 50, 25, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 1, 25, 0, 255, 0, 255, 0); isPixel(ctx, 98, 25, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 50, 25, 0, 255, 0, 255, 0); isPixel(ctx, 1, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 98, 25, 0, 255, 0, 255, 0); isPixel(ctx, 50, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 1, 48, 0, 255, 0, 255, 0); isPixel(ctx, 98, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 50, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 98, 48, 0, 255, 0, 255, 0);
} else {
isPixel(ctx, 1, 1, 0, 255, 0, 255, 0);
isPixel(ctx, 50, 1, 0, 255, 0, 255, 0);
isPixel(ctx, 98, 1, 0, 255, 0, 255, 0);
isPixel(ctx, 1, 25, 0, 255, 0, 255, 0);
isPixel(ctx, 50, 25, 0, 255, 0, 255, 0);
isPixel(ctx, 98, 25, 0, 255, 0, 255, 0);
isPixel(ctx, 1, 48, 0, 255, 0, 255, 0);
isPixel(ctx, 50, 48, 0, 255, 0, 255, 0);
isPixel(ctx, 98, 48, 0, 255, 0, 255, 0);
}
} }
</script> </script>
@ -6570,29 +6557,15 @@ g.addColorStop(1, '#0f0');
ctx.fillStyle = g; ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50); ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 1, 1, 0, 255, 0, 255, 0);
if (IsAzureEnabled()) { isPixel(ctx, 50, 1, 0, 255, 0, 255, 0);
// XXX - See Bug 666097. isPixel(ctx, 98, 1, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 1, 1, 0, 255, 0, 255, 0); isPixel(ctx, 1, 25, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 50, 1, 0, 255, 0, 255, 0); isPixel(ctx, 50, 25, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 98, 1, 0, 255, 0, 255, 0); isPixel(ctx, 98, 25, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 1, 25, 0, 255, 0, 255, 0); isPixel(ctx, 1, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 50, 25, 0, 255, 0, 255, 0); isPixel(ctx, 50, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 98, 25, 0, 255, 0, 255, 0); isPixel(ctx, 98, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 1, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 50, 48, 0, 255, 0, 255, 0);
todo_isPixel(ctx, 98, 48, 0, 255, 0, 255, 0);
} else {
isPixel(ctx, 1, 1, 0, 255, 0, 255, 0);
isPixel(ctx, 50, 1, 0, 255, 0, 255, 0);
isPixel(ctx, 98, 1, 0, 255, 0, 255, 0);
isPixel(ctx, 1, 25, 0, 255, 0, 255, 0);
isPixel(ctx, 50, 25, 0, 255, 0, 255, 0);
isPixel(ctx, 98, 25, 0, 255, 0, 255, 0);
isPixel(ctx, 1, 48, 0, 255, 0, 255, 0);
isPixel(ctx, 50, 48, 0, 255, 0, 255, 0);
isPixel(ctx, 98, 48, 0, 255, 0, 255, 0);
}
} }
</script> </script>

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

@ -170,6 +170,10 @@ public:
already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder, already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,
CanvasLayer *aOldLayer, CanvasLayer *aOldLayer,
LayerManager *aManager); LayerManager *aManager);
// Should return true if the canvas layer should always be marked inactive.
// We should return true here if we can't do accelerated compositing with
// a non-BasicCanvasLayer.
PRBool ShouldForceInactiveLayer(LayerManager *aManager);
// Call this whenever we need future changes to the canvas // Call this whenever we need future changes to the canvas
// to trigger fresh invalidation requests. This needs to be called // to trigger fresh invalidation requests. This needs to be called
@ -193,6 +197,7 @@ protected:
const nsAString& aType, const nsAString& aType,
nsIDOMFile** aResult); nsIDOMFile** aResult);
nsresult GetContextHelper(const nsAString& aContextId, nsresult GetContextHelper(const nsAString& aContextId,
PRBool aForceThebes,
nsICanvasRenderingContextInternal **aContext); nsICanvasRenderingContextInternal **aContext);
nsString mCurrentContextId; nsString mCurrentContextId;

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

@ -380,11 +380,12 @@ nsHTMLCanvasElement::MozGetAsFileImpl(const nsAString& aName,
nsresult nsresult
nsHTMLCanvasElement::GetContextHelper(const nsAString& aContextId, nsHTMLCanvasElement::GetContextHelper(const nsAString& aContextId,
PRBool aForceThebes,
nsICanvasRenderingContextInternal **aContext) nsICanvasRenderingContextInternal **aContext)
{ {
NS_ENSURE_ARG(aContext); NS_ENSURE_ARG(aContext);
NS_LossyConvertUTF16toASCII ctxId(aContextId); NS_ConvertUTF16toUTF8 ctxId(aContextId);
// check that ctxId is clamped to A-Za-z0-9_- // check that ctxId is clamped to A-Za-z0-9_-
for (PRUint32 i = 0; i < ctxId.Length(); i++) { for (PRUint32 i = 0; i < ctxId.Length(); i++) {
@ -402,6 +403,10 @@ nsHTMLCanvasElement::GetContextHelper(const nsAString& aContextId,
nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id="); nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id=");
ctxString.Append(ctxId); ctxString.Append(ctxId);
if (aForceThebes && ctxId.EqualsASCII("2d")) {
ctxString.AssignASCII("@mozilla.org/content/2dthebes-canvas-rendering-context;1");
}
nsresult rv; nsresult rv;
nsCOMPtr<nsICanvasRenderingContextInternal> ctx = nsCOMPtr<nsICanvasRenderingContextInternal> ctx =
do_CreateInstance(ctxString.get(), &rv); do_CreateInstance(ctxString.get(), &rv);
@ -433,8 +438,10 @@ nsHTMLCanvasElement::GetContext(const nsAString& aContextId,
{ {
nsresult rv; nsresult rv;
if (mCurrentContextId.IsEmpty()) { PRBool forceThebes = PR_FALSE;
rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext));
while (mCurrentContextId.IsEmpty()) {
rv = GetContextHelper(aContextId, forceThebes, getter_AddRefs(mCurrentContext));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
if (!mCurrentContext) { if (!mCurrentContext) {
return NS_OK; return NS_OK;
@ -506,11 +513,18 @@ nsHTMLCanvasElement::GetContext(const nsAString& aContextId,
rv = UpdateContext(contextProps); rv = UpdateContext(contextProps);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
mCurrentContext = nsnull; mCurrentContext = nsnull;
if (!forceThebes) {
// Try again with a Thebes context
forceThebes = PR_TRUE;
continue;
}
return rv; return rv;
} }
mCurrentContextId.Assign(aContextId); mCurrentContextId.Assign(aContextId);
} else if (!mCurrentContextId.Equals(aContextId)) { break;
}
if (!mCurrentContextId.Equals(aContextId)) {
//XXX eventually allow for more than one active context on a given canvas //XXX eventually allow for more than one active context on a given canvas
return NS_OK; return NS_OK;
} }
@ -535,7 +549,7 @@ nsHTMLCanvasElement::MozGetIPCContext(const nsAString& aContextId,
nsresult rv; nsresult rv;
if (mCurrentContextId.IsEmpty()) { if (mCurrentContextId.IsEmpty()) {
rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext)); rv = GetContextHelper(aContextId, PR_FALSE, getter_AddRefs(mCurrentContext));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
if (!mCurrentContext) { if (!mCurrentContext) {
return NS_OK; return NS_OK;
@ -700,6 +714,12 @@ nsHTMLCanvasElement::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
return mCurrentContext->GetCanvasLayer(aBuilder, aOldLayer, aManager); return mCurrentContext->GetCanvasLayer(aBuilder, aOldLayer, aManager);
} }
PRBool
nsHTMLCanvasElement::ShouldForceInactiveLayer(LayerManager *aManager)
{
return !mCurrentContext || mCurrentContext->ShouldForceInactiveLayer(aManager);
}
void void
nsHTMLCanvasElement::MarkContextClean() nsHTMLCanvasElement::MarkContextClean()
{ {

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

@ -310,6 +310,10 @@ nsresult nsBuiltinDecoderReader::DecodeToTarget(PRInt64 aTarget)
if (HasAudio()) { if (HasAudio()) {
// Decode audio forward to the seek target. // Decode audio forward to the seek target.
PRInt64 targetSample = 0;
if (!UsecsToSamples(aTarget, mInfo.mAudioRate, targetSample)) {
return NS_ERROR_FAILURE;
}
PRBool eof = PR_FALSE; PRBool eof = PR_FALSE;
while (HasAudio() && !eof) { while (HasAudio() && !eof) {
while (!eof && mAudioQueue.GetSize() == 0) { while (!eof && mAudioQueue.GetSize() == 0) {
@ -322,14 +326,53 @@ nsresult nsBuiltinDecoderReader::DecodeToTarget(PRInt64 aTarget)
} }
} }
} }
nsAutoPtr<SoundData> audio(mAudioQueue.PeekFront()); const SoundData* audio = mAudioQueue.PeekFront();
if (audio && audio->mTime + audio->mDuration <= aTarget) { if (!audio)
mAudioQueue.PopFront(); break;
PRInt64 startSample = 0;
if (!UsecsToSamples(audio->mTime, mInfo.mAudioRate, startSample)) {
return NS_ERROR_FAILURE;
}
if (startSample + audio->mSamples <= targetSample) {
// Our seek target lies after the samples in this SoundData. Pop it
// off the queue, and keep decoding forwards.
delete mAudioQueue.PopFront();
audio = nsnull; audio = nsnull;
} else { continue;
audio.forget(); }
// The seek target lies somewhere in this SoundData's samples, strip off
// any samples which lie before the seek target, so we'll begin playback
// exactly at the seek target.
NS_ASSERTION(targetSample >= startSample, "Target must at or be after data start.");
NS_ASSERTION(startSample + audio->mSamples > targetSample, "Data must end after target.");
PRInt64 samplesToPrune = targetSample - startSample;
if (samplesToPrune > audio->mSamples) {
// We've messed up somehow. Don't try to trim samples, the |samples|
// variable below will overflow.
NS_WARNING("Can't prune more samples that we have!");
break; break;
} }
PRUint32 samples = audio->mSamples - static_cast<PRUint32>(samplesToPrune);
PRUint32 channels = audio->mChannels;
nsAutoArrayPtr<SoundDataValue> audioData(new SoundDataValue[samples * channels]);
memcpy(audioData.get(),
audio->mAudioData.get() + (samplesToPrune * channels),
samples * channels * sizeof(SoundDataValue));
PRInt64 duration;
if (!SamplesToUsecs(samples, mInfo.mAudioRate, duration)) {
return NS_ERROR_FAILURE;
}
nsAutoPtr<SoundData> data(new SoundData(audio->mOffset,
aTarget,
duration,
samples,
audioData.forget(),
channels));
delete mAudioQueue.PopFront();
mAudioQueue.PushFront(data.forget());
break;
} }
} }
return NS_OK; return NS_OK;

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

@ -1496,6 +1496,7 @@ nsSHistory::LoadEntry(PRInt32 aIndex, long aLoadType, PRUint32 aHistCmd)
if (!canNavigate) { if (!canNavigate) {
// If the listener asked us not to proceed with // If the listener asked us not to proceed with
// the operation, simply return. // the operation, simply return.
mRequestedIndex = -1;
return NS_OK; // XXX Maybe I can return some other error code? return NS_OK; // XXX Maybe I can return some other error code?
} }

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

@ -9089,6 +9089,8 @@ nsGlobalWindow::RunTimeout(nsTimeout *aTimeout)
dummy_timeout.AddRef(); dummy_timeout.AddRef();
last_insertion_point = mTimeoutInsertionPoint; last_insertion_point = mTimeoutInsertionPoint;
// If we ever start setting mTimeoutInsertionPoint to a non-dummy timeout,
// the logic in ResetTimersForNonBackgroundWindow will need to change.
mTimeoutInsertionPoint = &dummy_timeout; mTimeoutInsertionPoint = &dummy_timeout;
for (timeout = FirstTimeout(); for (timeout = FirstTimeout();
@ -9426,7 +9428,16 @@ nsresult nsGlobalWindow::ResetTimersForNonBackgroundWindow()
TimeStamp now = TimeStamp::Now(); TimeStamp now = TimeStamp::Now();
for (nsTimeout *timeout = FirstTimeout(); IsTimeout(timeout); ) { // If mTimeoutInsertionPoint is non-null, we're in the middle of firing
// timers and the timers we're planning to fire all come before
// mTimeoutInsertionPoint; mTimeoutInsertionPoint itself is a dummy timeout
// with an mWhen that may be semi-bogus. In that case, we don't need to do
// anything with mTimeoutInsertionPoint or anything before it, so should
// start at the timer after mTimeoutInsertionPoint, if there is one.
// Otherwise, start at the beginning of the list.
for (nsTimeout *timeout = mTimeoutInsertionPoint ?
mTimeoutInsertionPoint->Next() : FirstTimeout();
IsTimeout(timeout); ) {
// It's important that this check be <= so that we guarantee that // It's important that this check be <= so that we guarantee that
// taking NS_MAX with |now| won't make a quantity equal to // taking NS_MAX with |now| won't make a quantity equal to
// timeout->mWhen below. // timeout->mWhen below.

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

@ -914,8 +914,14 @@ protected:
// These member variable are used only on inner windows. // These member variable are used only on inner windows.
nsRefPtr<nsEventListenerManager> mListenerManager; nsRefPtr<nsEventListenerManager> mListenerManager;
// mTimeouts is generally sorted by mWhen, unless mTimeoutInsertionPoint is
// non-null. In that case, the dummy timeout pointed to by
// mTimeoutInsertionPoint may have a later mWhen than some of the timeouts
// that come after it.
PRCList mTimeouts; PRCList mTimeouts;
// If mTimeoutInsertionPoint is non-null, insertions should happen after it. // If mTimeoutInsertionPoint is non-null, insertions should happen after it.
// This is a dummy timeout at the moment; if that ever changes, the logic in
// ResetTimersForNonBackgroundWindow needs to change.
nsTimeout* mTimeoutInsertionPoint; nsTimeout* mTimeoutInsertionPoint;
PRUint32 mTimeoutPublicIdCounter; PRUint32 mTimeoutPublicIdCounter;
PRUint32 mTimeoutFiringDepth; PRUint32 mTimeoutFiringDepth;

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

@ -246,22 +246,25 @@ public:
* aStops GradientStops object for this gradient, this should match the * aStops GradientStops object for this gradient, this should match the
* backend type of the draw target this pattern will be used with. * backend type of the draw target this pattern will be used with.
*/ */
RadialGradientPattern(const Point &aCenter, RadialGradientPattern(const Point &aCenter1,
const Point &aOrigin, const Point &aCenter2,
Float aRadius, Float aRadius1,
Float aRadius2,
GradientStops *aStops) GradientStops *aStops)
: mCenter(aCenter) : mCenter1(aCenter1)
, mOrigin(aOrigin) , mCenter2(aCenter2)
, mRadius(aRadius) , mRadius1(aRadius1)
, mRadius2(aRadius2)
, mStops(aStops) , mStops(aStops)
{ {
} }
virtual PatternType GetType() const { return PATTERN_RADIAL_GRADIENT; } virtual PatternType GetType() const { return PATTERN_RADIAL_GRADIENT; }
Point mCenter; Point mCenter1;
Point mOrigin; Point mCenter2;
Float mRadius; Float mRadius1;
Float mRadius2;
RefPtr<GradientStops> mStops; RefPtr<GradientStops> mStops;
}; };

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

@ -229,7 +229,7 @@ DrawTargetD2D::DrawSurface(SourceSurface *aSurface,
{ {
RefPtr<ID2D1Bitmap> bitmap; RefPtr<ID2D1Bitmap> bitmap;
ID2D1RenderTarget *rt = GetRTForOperator(aOptions.mCompositionOp); ID2D1RenderTarget *rt = GetRTForOperation(aOptions.mCompositionOp, ColorPattern(Color()));
PrepareForDrawing(rt); PrepareForDrawing(rt);
@ -279,7 +279,7 @@ DrawTargetD2D::DrawSurface(SourceSurface *aSurface,
rt->DrawBitmap(bitmap, D2DRect(aDest), aOptions.mAlpha, D2DFilter(aSurfOptions.mFilter), D2DRect(srcRect)); rt->DrawBitmap(bitmap, D2DRect(aDest), aOptions.mAlpha, D2DFilter(aSurfOptions.mFilter), D2DRect(srcRect));
FinalizeRTForOperator(aOptions.mCompositionOp, aDest); FinalizeRTForOperation(aOptions.mCompositionOp, ColorPattern(Color()), aDest);
} }
void void
@ -693,7 +693,7 @@ DrawTargetD2D::FillRect(const Rect &aRect,
const Pattern &aPattern, const Pattern &aPattern,
const DrawOptions &aOptions) const DrawOptions &aOptions)
{ {
ID2D1RenderTarget *rt = GetRTForOperator(aOptions.mCompositionOp); ID2D1RenderTarget *rt = GetRTForOperation(aOptions.mCompositionOp, aPattern);
PrepareForDrawing(rt); PrepareForDrawing(rt);
@ -703,7 +703,7 @@ DrawTargetD2D::FillRect(const Rect &aRect,
rt->FillRectangle(D2DRect(aRect), brush); rt->FillRectangle(D2DRect(aRect), brush);
} }
FinalizeRTForOperator(aOptions.mCompositionOp, aRect); FinalizeRTForOperation(aOptions.mCompositionOp, aPattern, aRect);
} }
void void
@ -712,7 +712,7 @@ DrawTargetD2D::StrokeRect(const Rect &aRect,
const StrokeOptions &aStrokeOptions, const StrokeOptions &aStrokeOptions,
const DrawOptions &aOptions) const DrawOptions &aOptions)
{ {
ID2D1RenderTarget *rt = GetRTForOperator(aOptions.mCompositionOp); ID2D1RenderTarget *rt = GetRTForOperation(aOptions.mCompositionOp, aPattern);
PrepareForDrawing(rt); PrepareForDrawing(rt);
@ -724,7 +724,7 @@ DrawTargetD2D::StrokeRect(const Rect &aRect,
rt->DrawRectangle(D2DRect(aRect), brush, aStrokeOptions.mLineWidth, strokeStyle); rt->DrawRectangle(D2DRect(aRect), brush, aStrokeOptions.mLineWidth, strokeStyle);
} }
FinalizeRTForOperator(aOptions.mCompositionOp, aRect); FinalizeRTForOperation(aOptions.mCompositionOp, aPattern, aRect);
} }
void void
@ -734,7 +734,7 @@ DrawTargetD2D::StrokeLine(const Point &aStart,
const StrokeOptions &aStrokeOptions, const StrokeOptions &aStrokeOptions,
const DrawOptions &aOptions) const DrawOptions &aOptions)
{ {
ID2D1RenderTarget *rt = GetRTForOperator(aOptions.mCompositionOp); ID2D1RenderTarget *rt = GetRTForOperation(aOptions.mCompositionOp, aPattern);
PrepareForDrawing(rt); PrepareForDrawing(rt);
@ -746,7 +746,7 @@ DrawTargetD2D::StrokeLine(const Point &aStart,
rt->DrawLine(D2DPoint(aStart), D2DPoint(aEnd), brush, aStrokeOptions.mLineWidth, strokeStyle); rt->DrawLine(D2DPoint(aStart), D2DPoint(aEnd), brush, aStrokeOptions.mLineWidth, strokeStyle);
} }
FinalizeRTForOperator(aOptions.mCompositionOp, Rect(0, 0, Float(mSize.width), Float(mSize.height))); FinalizeRTForOperation(aOptions.mCompositionOp, aPattern, Rect(0, 0, Float(mSize.width), Float(mSize.height)));
} }
void void
@ -762,7 +762,7 @@ DrawTargetD2D::Stroke(const Path *aPath,
const PathD2D *d2dPath = static_cast<const PathD2D*>(aPath); const PathD2D *d2dPath = static_cast<const PathD2D*>(aPath);
ID2D1RenderTarget *rt = GetRTForOperator(aOptions.mCompositionOp); ID2D1RenderTarget *rt = GetRTForOperation(aOptions.mCompositionOp, aPattern);
PrepareForDrawing(rt); PrepareForDrawing(rt);
@ -774,7 +774,7 @@ DrawTargetD2D::Stroke(const Path *aPath,
rt->DrawGeometry(d2dPath->mGeometry, brush, aStrokeOptions.mLineWidth, strokeStyle); rt->DrawGeometry(d2dPath->mGeometry, brush, aStrokeOptions.mLineWidth, strokeStyle);
} }
FinalizeRTForOperator(aOptions.mCompositionOp, Rect(0, 0, Float(mSize.width), Float(mSize.height))); FinalizeRTForOperation(aOptions.mCompositionOp, aPattern, Rect(0, 0, Float(mSize.width), Float(mSize.height)));
} }
void void
@ -789,7 +789,7 @@ DrawTargetD2D::Fill(const Path *aPath,
const PathD2D *d2dPath = static_cast<const PathD2D*>(aPath); const PathD2D *d2dPath = static_cast<const PathD2D*>(aPath);
ID2D1RenderTarget *rt = GetRTForOperator(aOptions.mCompositionOp); ID2D1RenderTarget *rt = GetRTForOperation(aOptions.mCompositionOp, aPattern);
PrepareForDrawing(rt); PrepareForDrawing(rt);
@ -805,7 +805,7 @@ DrawTargetD2D::Fill(const Path *aPath,
d2dPath->mGeometry->GetBounds(D2D1::IdentityMatrix(), &d2dbounds); d2dPath->mGeometry->GetBounds(D2D1::IdentityMatrix(), &d2dbounds);
bounds = ToRect(d2dbounds); bounds = ToRect(d2dbounds);
} }
FinalizeRTForOperator(aOptions.mCompositionOp, bounds); FinalizeRTForOperation(aOptions.mCompositionOp, aPattern, bounds);
} }
void void
@ -821,7 +821,7 @@ DrawTargetD2D::FillGlyphs(ScaledFont *aFont,
ScaledFontDWrite *font = static_cast<ScaledFontDWrite*>(aFont); ScaledFontDWrite *font = static_cast<ScaledFontDWrite*>(aFont);
ID2D1RenderTarget *rt = GetRTForOperator(aOptions.mCompositionOp); ID2D1RenderTarget *rt = GetRTForOperation(aOptions.mCompositionOp, aPattern);
PrepareForDrawing(rt); PrepareForDrawing(rt);
@ -857,7 +857,7 @@ DrawTargetD2D::FillGlyphs(ScaledFont *aFont,
rt->DrawGlyphRun(D2D1::Point2F(), &glyphRun, brush); rt->DrawGlyphRun(D2D1::Point2F(), &glyphRun, brush);
} }
FinalizeRTForOperator(aOptions.mCompositionOp, Rect(0, 0, (Float)mSize.width, (Float)mSize.height)); FinalizeRTForOperation(aOptions.mCompositionOp, aPattern, Rect(0, 0, (Float)mSize.width, (Float)mSize.height));
} }
void void
@ -986,13 +986,13 @@ DrawTargetD2D::CreatePathBuilder(FillRule aFillRule) const
} }
TemporaryRef<GradientStops> TemporaryRef<GradientStops>
DrawTargetD2D::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops) const DrawTargetD2D::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops) const
{ {
D2D1_GRADIENT_STOP *stops = new D2D1_GRADIENT_STOP[aNumStops]; D2D1_GRADIENT_STOP *stops = new D2D1_GRADIENT_STOP[aNumStops];
for (uint32_t i = 0; i < aNumStops; i++) { for (uint32_t i = 0; i < aNumStops; i++) {
stops[i].position = aStops[i].offset; stops[i].position = rawStops[i].offset;
stops[i].color = D2DColor(aStops[i].color); stops[i].color = D2DColor(rawStops[i].color);
} }
RefPtr<ID2D1GradientStopCollection> stopCollection; RefPtr<ID2D1GradientStopCollection> stopCollection;
@ -1290,9 +1290,9 @@ DrawTargetD2D::GetBlendStateForOperator(CompositionOp aOperator)
* drawing operation other than OVER is required. * drawing operation other than OVER is required.
*/ */
ID2D1RenderTarget* ID2D1RenderTarget*
DrawTargetD2D::GetRTForOperator(CompositionOp aOperator) DrawTargetD2D::GetRTForOperation(CompositionOp aOperator, const Pattern &aPattern)
{ {
if (aOperator == OP_OVER) { if (aOperator == OP_OVER && !IsPatternSupportedByD2D(aPattern)) {
return mRT; return mRT;
} }
@ -1331,9 +1331,9 @@ DrawTargetD2D::GetRTForOperator(CompositionOp aOperator)
* to the surface. * to the surface.
*/ */
void void
DrawTargetD2D::FinalizeRTForOperator(CompositionOp aOperator, const Rect &aBounds) DrawTargetD2D::FinalizeRTForOperation(CompositionOp aOperator, const Pattern &aPattern, const Rect &aBounds)
{ {
if (aOperator == OP_OVER) { if (aOperator == OP_OVER && !IsPatternSupportedByD2D(aPattern)) {
return; return;
} }
@ -1377,13 +1377,26 @@ DrawTargetD2D::FinalizeRTForOperator(CompositionOp aOperator, const Rect &aBound
viewport.TopLeftY = 0; viewport.TopLeftY = 0;
mDevice->RSSetViewports(1, &viewport); mDevice->RSSetViewports(1, &viewport);
mPrivateData->mEffect->GetVariableByName("tex")->AsShaderResource()->SetResource(mSRView);
mPrivateData->mEffect->GetVariableByName("QuadDesc")->AsVector()-> mPrivateData->mEffect->GetVariableByName("QuadDesc")->AsVector()->
SetFloatVector(ShaderConstantRectD3D10(-1.0f, 1.0f, 2.0f, -2.0f)); SetFloatVector(ShaderConstantRectD3D10(-1.0f, 1.0f, 2.0f, -2.0f));
mPrivateData->mEffect->GetVariableByName("TexCoords")->AsVector()->
SetFloatVector(ShaderConstantRectD3D10(0, 0, 1.0f, 1.0f));
mPrivateData->mEffect->GetTechniqueByName("SampleTexture")->GetPassByIndex(0)->Apply(0); if (!IsPatternSupportedByD2D(aPattern)) {
mPrivateData->mEffect->GetVariableByName("TexCoords")->AsVector()->
SetFloatVector(ShaderConstantRectD3D10(0, 0, 1.0f, 1.0f));
mPrivateData->mEffect->GetVariableByName("tex")->AsShaderResource()->SetResource(mSRView);
mPrivateData->mEffect->GetTechniqueByName("SampleTexture")->GetPassByIndex(0)->Apply(0);
} else if (aPattern.GetType() == PATTERN_RADIAL_GRADIENT) {
const RadialGradientPattern *pat = static_cast<const RadialGradientPattern*>(&aPattern);
if (pat->mCenter1 == pat->mCenter2 && pat->mRadius1 == pat->mRadius2) {
// Draw nothing!
return;
}
mPrivateData->mEffect->GetVariableByName("mask")->AsShaderResource()->SetResource(mSRView);
SetupEffectForRadialGradient(pat);
}
mDevice->OMSetBlendState(GetBlendStateForOperator(aOperator), NULL, 0xffffffff); mDevice->OMSetBlendState(GetBlendStateForOperator(aOperator), NULL, 0xffffffff);
@ -1504,6 +1517,12 @@ DrawTargetD2D::PopAllClips()
TemporaryRef<ID2D1Brush> TemporaryRef<ID2D1Brush>
DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha) DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
{ {
if (IsPatternSupportedByD2D(aPattern)) {
RefPtr<ID2D1SolidColorBrush> colBrush;
mRT->CreateSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 1.0f, 1.0f), byRef(colBrush));
return colBrush;
}
if (aPattern.GetType() == PATTERN_COLOR) { if (aPattern.GetType() == PATTERN_COLOR) {
RefPtr<ID2D1SolidColorBrush> colBrush; RefPtr<ID2D1SolidColorBrush> colBrush;
Color color = static_cast<const ColorPattern*>(&aPattern)->mColor; Color color = static_cast<const ColorPattern*>(&aPattern)->mColor;
@ -1542,13 +1561,15 @@ DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
return NULL; return NULL;
} }
mRT->CreateRadialGradientBrush(D2D1::RadialGradientBrushProperties(D2DPoint(pat->mCenter), // This will not be a complex radial gradient brush.
D2DPoint(pat->mOrigin - pat->mCenter), mRT->CreateRadialGradientBrush(
pat->mRadius, D2D1::RadialGradientBrushProperties(D2DPoint(pat->mCenter1),
pat->mRadius), D2D1::Point2F(),
D2D1::BrushProperties(aAlpha), pat->mRadius2, pat->mRadius2),
stops->mStopCollection, D2D1::BrushProperties(aAlpha),
byRef(gradBrush)); stops->mStopCollection,
byRef(gradBrush));
return gradBrush; return gradBrush;
} else if (aPattern.GetType() == PATTERN_SURFACE) { } else if (aPattern.GetType() == PATTERN_SURFACE) {
RefPtr<ID2D1BitmapBrush> bmBrush; RefPtr<ID2D1BitmapBrush> bmBrush;
@ -1687,6 +1708,133 @@ DrawTargetD2D::CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions)
return style; return style;
} }
TemporaryRef<ID3D10Texture1D>
DrawTargetD2D::CreateGradientTexture(const GradientStopsD2D *aStops)
{
CD3D10_TEXTURE1D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, 4096, 1, 1);
std::vector<D2D1_GRADIENT_STOP> rawStops;
rawStops.resize(aStops->mStopCollection->GetGradientStopCount());
aStops->mStopCollection->GetGradientStops(&rawStops.front(), rawStops.size());
std::vector<unsigned char> textureData;
textureData.resize(4096 * 4);
unsigned char *texData = &textureData.front();
float prevColorPos = 0;
float nextColorPos = 1.0f;
D2D1_COLOR_F prevColor = rawStops[0].color;
D2D1_COLOR_F nextColor = prevColor;
if (rawStops.size() >= 2) {
nextColor = rawStops[1].color;
nextColorPos = rawStops[1].position;
}
uint32_t stopPosition = 2;
// Not the most optimized way but this will do for now.
for (int i = 0; i < 4096; i++) {
// The 4095 seems a little counter intuitive, but we want the gradient
// color at offset 0 at the first pixel, and at offset 1.0f at the last
// pixel.
float pos = float(i) / 4095;
if (pos > nextColorPos) {
prevColor = nextColor;
prevColorPos = nextColorPos;
if (rawStops.size() > stopPosition) {
nextColor = rawStops[stopPosition].color;
nextColorPos = rawStops[stopPosition++].position;
} else {
nextColorPos = 1.0f;
}
}
float interp = (pos - prevColorPos) / (nextColorPos - prevColorPos);
Color newColor(prevColor.r + (nextColor.r - prevColor.r) * interp,
prevColor.g + (nextColor.g - prevColor.g) * interp,
prevColor.b + (nextColor.b - prevColor.b) * interp,
prevColor.a + (nextColor.a - prevColor.a) * interp);
texData[i * 4] = (char)(255.0f * newColor.b);
texData[i * 4 + 1] = (char)(255.0f * newColor.g);
texData[i * 4 + 2] = (char)(255.0f * newColor.r);
texData[i * 4 + 3] = (char)(255.0f * newColor.a);
}
D3D10_SUBRESOURCE_DATA data;
data.pSysMem = &textureData.front();
RefPtr<ID3D10Texture1D> tex;
mDevice->CreateTexture1D(&desc, &data, byRef(tex));
return tex;
}
void
DrawTargetD2D::SetupEffectForRadialGradient(const RadialGradientPattern *aPattern)
{
mPrivateData->mEffect->GetTechniqueByName("SampleRadialGradient")->GetPassByIndex(0)->Apply(0);
mPrivateData->mEffect->GetVariableByName("MaskTexCoords")->AsVector()->
SetFloatVector(ShaderConstantRectD3D10(0, 0, 1.0f, 1.0f));
float dimensions[] = { float(mSize.width), float(mSize.height), 0, 0 };
mPrivateData->mEffect->GetVariableByName("dimensions")->AsVector()->
SetFloatVector(dimensions);
const GradientStopsD2D *stops =
static_cast<const GradientStopsD2D*>(aPattern->mStops.get());
RefPtr<ID3D10Texture1D> tex = CreateGradientTexture(stops);
RefPtr<ID3D10ShaderResourceView> srView;
mDevice->CreateShaderResourceView(tex, NULL, byRef(srView));
mPrivateData->mEffect->GetVariableByName("tex")->AsShaderResource()->SetResource(srView);
Point dc = aPattern->mCenter2 - aPattern->mCenter1;
float dr = aPattern->mRadius2 - aPattern->mRadius1;
float diffv[] = { dc.x, dc.y, dr, 0 };
mPrivateData->mEffect->GetVariableByName("diff")->AsVector()->
SetFloatVector(diffv);
float center1[] = { aPattern->mCenter1.x, aPattern->mCenter1.y, dr, 0 };
mPrivateData->mEffect->GetVariableByName("center1")->AsVector()->
SetFloatVector(center1);
mPrivateData->mEffect->GetVariableByName("radius1")->AsScalar()->
SetFloat(aPattern->mRadius1);
mPrivateData->mEffect->GetVariableByName("sq_radius1")->AsScalar()->
SetFloat(pow(aPattern->mRadius1, 2));
Matrix invTransform = mTransform;
if (!invTransform.Invert()) {
// Bail if the matrix is singular.
return;
}
float matrix[] = { invTransform._11, invTransform._12, 0, 0,
invTransform._21, invTransform._22, 0, 0,
invTransform._31, invTransform._32, 1.0f, 0,
0, 0, 0, 1.0f };
mPrivateData->mEffect->GetVariableByName("DeviceSpaceToUserSpace")->
AsMatrix()->SetMatrix(matrix);
float A = dc.x * dc.x + dc.y * dc.y - dr * dr;
if (A == 0) {
mPrivateData->mEffect->GetTechniqueByName("SampleRadialGradient")->
GetPassByIndex(1)->Apply(0);
} else {
mPrivateData->mEffect->GetVariableByName("A")->AsScalar()->SetFloat(A);
mPrivateData->mEffect->GetTechniqueByName("SampleRadialGradient")->
GetPassByIndex(0)->Apply(0);
}
}
ID2D1Factory* ID2D1Factory*
DrawTargetD2D::factory() DrawTargetD2D::factory()
{ {

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

@ -50,6 +50,7 @@ namespace mozilla {
namespace gfx { namespace gfx {
class SourceSurfaceD2DTarget; class SourceSurfaceD2DTarget;
class GradientStopsD2D;
struct PrivateD3D10DataD2D struct PrivateD3D10DataD2D
{ {
@ -154,9 +155,8 @@ private:
void MarkChanged(); void MarkChanged();
ID3D10BlendState *GetBlendStateForOperator(CompositionOp aOperator); ID3D10BlendState *GetBlendStateForOperator(CompositionOp aOperator);
ID2D1RenderTarget *GetRTForOperator(CompositionOp aOperator); ID2D1RenderTarget *GetRTForOperation(CompositionOp aOperator, const Pattern &aPattern);
void FinalizeRTForOperator(CompositionOp aOperator, const Rect &aBounds); void FinalizeRTForOperation(CompositionOp aOperator, const Pattern &aPattern, const Rect &aBounds); void EnsureViews();
void EnsureViews();
void PopAllClips(); void PopAllClips();
TemporaryRef<ID2D1RenderTarget> CreateRTForTexture(ID3D10Texture2D *aTexture); TemporaryRef<ID2D1RenderTarget> CreateRTForTexture(ID3D10Texture2D *aTexture);
@ -165,6 +165,12 @@ private:
TemporaryRef<ID2D1Brush> CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f); TemporaryRef<ID2D1Brush> CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f);
TemporaryRef<ID2D1StrokeStyle> CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions); TemporaryRef<ID2D1StrokeStyle> CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions);
TemporaryRef<ID3D10Texture1D> CreateGradientTexture(const GradientStopsD2D *aStops);
void SetupEffectForRadialGradient(const RadialGradientPattern *aPattern);
static const uint32_t test = 4;
IntSize mSize; IntSize mSize;
RefPtr<ID3D10Device1> mDevice; RefPtr<ID3D10Device1> mDevice;

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

@ -151,6 +151,29 @@ static inline int BytesPerPixel(SurfaceFormat aFormat)
} }
} }
static bool IsPatternSupportedByD2D(const Pattern &aPattern)
{
if (aPattern.GetType() != PATTERN_RADIAL_GRADIENT) {
return false;
}
const RadialGradientPattern *pat =
static_cast<const RadialGradientPattern*>(&aPattern);
if (pat->mRadius1 != 0) {
return true;
}
Point diff = pat->mCenter2 - pat->mCenter1;
if (sqrt(diff.x * diff.x + diff.y * diff.y) >= pat->mRadius2) {
// Inner point lies outside the circle.
return true;
}
return false;
}
/** /**
* This structure is used to pass rectangles to our shader constant. We can use * This structure is used to pass rectangles to our shader constant. We can use
* this for passing rectangular areas to SetVertexShaderConstant. In the format * this for passing rectangular areas to SetVertexShaderConstant. In the format

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

@ -24,6 +24,18 @@ cbuffer cb1
float4 ShadowColor; float4 ShadowColor;
} }
cbuffer cb2
{
float3x3 DeviceSpaceToUserSpace;
float2 dimensions;
// Precalculate as much as we can!
float3 diff;
float2 center1;
float A;
float radius1;
float sq_radius1;
}
struct VS_OUTPUT struct VS_OUTPUT
{ {
float4 Position : SV_Position; float4 Position : SV_Position;
@ -31,6 +43,13 @@ struct VS_OUTPUT
float2 MaskTexCoord : TEXCOORD1; float2 MaskTexCoord : TEXCOORD1;
}; };
struct VS_RADIAL_OUTPUT
{
float4 Position : SV_Position;
float2 MaskTexCoord : TEXCOORD0;
float2 PixelCoord : TEXCOORD1;
};
Texture2D tex; Texture2D tex;
Texture2D mask; Texture2D mask;
@ -94,6 +113,25 @@ VS_OUTPUT SampleTextureVS(float3 pos : POSITION)
return Output; return Output;
} }
VS_RADIAL_OUTPUT SampleRadialVS(float3 pos : POSITION)
{
VS_RADIAL_OUTPUT Output;
Output.Position.w = 1.0f;
Output.Position.x = pos.x * QuadDesc.z + QuadDesc.x;
Output.Position.y = pos.y * QuadDesc.w + QuadDesc.y;
Output.Position.z = 0;
Output.MaskTexCoord.x = pos.x * MaskTexCoords.z + MaskTexCoords.x;
Output.MaskTexCoord.y = pos.y * MaskTexCoords.w + MaskTexCoords.y;
// For the radial gradient pixel shader we need to pass in the pixel's
// coordinates in user space for the color to be correctly determined.
Output.PixelCoord.x = ((Output.Position.x + 1.0f) / 2.0f) * dimensions.x;
Output.PixelCoord.y = ((1.0f - Output.Position.y) / 2.0f) * dimensions.y;
Output.PixelCoord.xy = mul(float3(Output.PixelCoord.x, Output.PixelCoord.y, 1.0f), DeviceSpaceToUserSpace).xy;
return Output;
}
float4 SampleTexturePS( VS_OUTPUT In) : SV_Target float4 SampleTexturePS( VS_OUTPUT In) : SV_Target
{ {
return tex.Sample(sSampler, In.TexCoord); return tex.Sample(sSampler, In.TexCoord);
@ -104,6 +142,68 @@ float4 SampleMaskTexturePS( VS_OUTPUT In) : SV_Target
return tex.Sample(sSampler, In.TexCoord) * mask.Sample(sMaskSampler, In.MaskTexCoord).a; return tex.Sample(sSampler, In.TexCoord) * mask.Sample(sMaskSampler, In.MaskTexCoord).a;
}; };
float4 SampleRadialGradientPS( VS_RADIAL_OUTPUT In) : SV_Target
{
// Radial gradient painting is defined as the set of circles whose centers
// are described by C(t) = (C2 - C1) * t + C1; with radii
// R(t) = (R2 - R1) * t + R1; for R(t) > 0. This shader solves the
// quadratic equation that arises when calculating t for pixel (x, y).
//
// A more extensive derrivation can be found in the pixman radial gradient
// code.
float2 p = In.PixelCoord;
float3 dp = float3(p - center1, radius1);
// dpx * dcx + dpy * dcy + r * dr
float B = dot(dp, diff);
float C = pow(dp.x, 2) + pow(dp.y, 2) - sq_radius1;
float det = pow(B, 2) - A * C;
if (det < 0) {
return float4(0, 0, 0, 0);
}
float sqrt_det = sqrt(abs(det));
float2 t = (B + float2(sqrt_det, -sqrt_det)) / A;
float2 isValid = step(float2(-radius1, -radius1), t * diff.z);
if (max(isValid.x, isValid.y) <= 0) {
return float4(0, 0, 0, 0);
}
float upper_t = lerp(t.y, t.x, isValid.x);
// Multiply the output color by the input mask for the operation.
return tex.Sample(sSampler, float2(upper_t, 0.5)) * mask.Sample(sMaskSampler, In.MaskTexCoord).a;
};
float4 SampleRadialGradientA0PS( VS_RADIAL_OUTPUT In) : SV_Target
{
// This simpler shader is used for the degenerate case where A is 0,
// i.e. we're actually solving a linear equation.
float2 p = In.PixelCoord;
float3 dp = float3(p - center1, radius1);
// dpx * dcx + dpy * dcy + r * dr
float B = dot(dp, diff);
float C = pow(dp.x, 2) + pow(dp.y, 2) - pow(radius1, 2);
float t = 0.5 * C / B;
if (-radius1 >= t * diff.z) {
return float4(0, 0, 0, 0);
}
return tex.Sample(sSampler, float2(t, 0.5)) * mask.Sample(sMaskSampler, In.MaskTexCoord).a;
};
float4 SampleShadowHPS( VS_OUTPUT In) : SV_Target float4 SampleShadowHPS( VS_OUTPUT In) : SV_Target
{ {
float outputStrength = 0; float outputStrength = 0;
@ -166,6 +266,24 @@ technique10 SampleTexture
} }
} }
technique10 SampleRadialGradient
{
pass P0
{
SetRasterizerState(TextureRast);
SetVertexShader(CompileShader(vs_4_0_level_9_3, SampleRadialVS()));
SetGeometryShader(NULL);
SetPixelShader(CompileShader(ps_4_0_level_9_3, SampleRadialGradientPS()));
}
pass P1
{
SetRasterizerState(TextureRast);
SetVertexShader(CompileShader(vs_4_0_level_9_3, SampleRadialVS()));
SetGeometryShader(NULL);
SetPixelShader(CompileShader(ps_4_0_level_9_3, SampleRadialGradientA0PS()));
}
}
technique10 SampleMaskedTexture technique10 SampleMaskedTexture
{ {
pass P0 pass P0

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

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

@ -434,6 +434,7 @@ public:
CreateDrawTarget(const mozilla::gfx::IntSize &aSize, CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
mozilla::gfx::SurfaceFormat aFormat); mozilla::gfx::SurfaceFormat aFormat);
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) { return PR_TRUE; }
/** /**
* Return the name of the layer manager's backend. * Return the name of the layer manager's backend.

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

@ -115,6 +115,15 @@ public:
const CallbackInfo &GetCallbackInfo() { return mCurrentCallbackInfo; } const CallbackInfo &GetCallbackInfo() { return mCurrentCallbackInfo; }
// D3D10 guarantees textures can be at least this size
enum {
MAX_TEXTURE_SIZE = 8192
};
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize)
{
return aSize <= gfxIntSize(MAX_TEXTURE_SIZE, MAX_TEXTURE_SIZE);
}
virtual already_AddRefed<ThebesLayer> CreateThebesLayer(); virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
virtual already_AddRefed<ContainerLayer> CreateContainerLayer(); virtual already_AddRefed<ContainerLayer> CreateContainerLayer();

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

@ -181,6 +181,7 @@ SwapChainD3D9::Reset()
DeviceManagerD3D9::DeviceManagerD3D9() DeviceManagerD3D9::DeviceManagerD3D9()
: mDeviceResetCount(0) : mDeviceResetCount(0)
, mMaxTextureSize(0)
, mHasDynamicTextures(false) , mHasDynamicTextures(false)
, mDeviceWasRemoved(false) , mDeviceWasRemoved(false)
{ {
@ -646,6 +647,7 @@ DeviceManagerD3D9::VerifyCaps()
caps.MaxTextureWidth < 4096) { caps.MaxTextureWidth < 4096) {
return false; return false;
} }
mMaxTextureSize = NS_MIN(caps.MaxTextureHeight, caps.MaxTextureWidth);
if ((caps.PixelShaderVersion & 0xffff) < 0x200 || if ((caps.PixelShaderVersion & 0xffff) < 0x200 ||
(caps.VertexShaderVersion & 0xffff) < 0x200) { (caps.VertexShaderVersion & 0xffff) < 0x200) {

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

@ -168,6 +168,8 @@ public:
*/ */
nsTArray<LayerD3D9*> mLayersWithResources; nsTArray<LayerD3D9*> mLayersWithResources;
PRInt32 GetMaxTextureSize() { return mMaxTextureSize; }
private: private:
friend class SwapChainD3D9; friend class SwapChainD3D9;
@ -238,6 +240,8 @@ private:
PRUint32 mDeviceResetCount; PRUint32 mDeviceResetCount;
PRUint32 mMaxTextureSize;
/* If this device supports dynamic textures */ /* If this device supports dynamic textures */
bool mHasDynamicTextures; bool mHasDynamicTextures;

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

@ -141,6 +141,14 @@ public:
void SetRoot(Layer* aLayer); void SetRoot(Layer* aLayer);
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize)
{
if (!mDeviceManager)
return false;
PRInt32 maxSize = mDeviceManager->GetMaxTextureSize();
return aSize <= gfxIntSize(maxSize, maxSize);
}
virtual already_AddRefed<ThebesLayer> CreateThebesLayer(); virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
virtual already_AddRefed<ContainerLayer> CreateContainerLayer(); virtual already_AddRefed<ContainerLayer> CreateContainerLayer();

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

@ -138,6 +138,14 @@ public:
virtual void SetRoot(Layer* aLayer) { mRoot = aLayer; } virtual void SetRoot(Layer* aLayer) { mRoot = aLayer; }
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize)
{
if (!mGLContext)
return false;
PRInt32 maxSize = mGLContext->GetMaxTextureSize();
return aSize <= gfxIntSize(maxSize, maxSize);
}
virtual already_AddRefed<ThebesLayer> CreateThebesLayer(); virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
virtual already_AddRefed<ContainerLayer> CreateContainerLayer(); virtual already_AddRefed<ContainerLayer> CreateContainerLayer();

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

@ -1,6 +1,6 @@
url-prefix ../../jsreftest.html?test=e4x/GC/ url-prefix ../../jsreftest.html?test=e4x/GC/
script regress-280844-1.js skip-if(Android) script regress-280844-1.js
script regress-280844-2.js skip-if(Android) script regress-280844-2.js
skip-if(!xulRuntime.shell) script regress-292455.js # does not always dismiss alert skip-if(!xulRuntime.shell) script regress-292455.js # does not always dismiss alert
script regress-313952-01.js script regress-313952-01.js
script regress-313952-02.js script regress-313952-02.js

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

@ -80,17 +80,17 @@ script regress-375406.js
script regress-378492.js script regress-378492.js
script regress-380833.js script regress-380833.js
script regress-383255.js script regress-383255.js
silentfail script regress-394941.js skip-if(Android) silentfail script regress-394941.js
script regress-407323.js script regress-407323.js
script regress-426520.js script regress-426520.js
script regress-453915.js script regress-453915.js
silentfail script regress-458679-01.js skip-if(Android) silentfail script regress-458679-01.js
silentfail script regress-458679-02.js skip-if(Android) silentfail script regress-458679-02.js
script regress-460180.js script regress-460180.js
script regress-465063.js script regress-465063.js
script regress-470619.js script regress-470619.js
script regress-473709.js skip-if(Android) script regress-473709.js
script regress-474319.js skip-if(Android) script regress-474319.js
script regress-477053.js script regress-477053.js
script regress-561031.js script regress-561031.js
script regress-587434.js script regress-587434.js

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

@ -48,7 +48,7 @@ script 13.4.4.7.js
script 13.4.4.8.js script 13.4.4.8.js
script 13.4.4.9.js script 13.4.4.9.js
script regress-291930.js script regress-291930.js
silentfail script regress-324422-1.js skip-if(Android) silentfail script regress-324422-1.js
skip script regress-324422-2.js # slow skip script regress-324422-2.js # slow
skip script regress-324688.js # bug 528404 - disable due to random timeouts skip script regress-324688.js # bug 528404 - disable due to random timeouts
script regress-336921.js script regress-336921.js

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

@ -9,5 +9,5 @@ script function-bind.js
script function-call.js script function-call.js
script redefine-arguments-length.js script redefine-arguments-length.js
script builtin-no-prototype.js script builtin-no-prototype.js
script Function-arguments-gc.js skip-if(Android) script Function-arguments-gc.js
script builtin-no-construct.js script builtin-no-construct.js

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

@ -5,7 +5,7 @@ random script regress-101964.js # bogus perf test (bug 467263)
script regress-107138.js script regress-107138.js
fails-if(!xulRuntime.shell) script regress-108440.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 74 fails-if(!xulRuntime.shell) script regress-108440.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 74
script regress-154338.js script regress-154338.js
skip-if(xulRuntime.XPCOMABI.match(/x86_64/)) script regress-157652.js # No test results skip-if(xulRuntime.XPCOMABI.match(/x86_64/)||Android) script regress-157652.js # No test results
script regress-178722.js script regress-178722.js
script regress-255555.js script regress-255555.js
script regress-299644.js script regress-299644.js
@ -14,7 +14,7 @@ script regress-310351.js
script regress-311515.js script regress-311515.js
script regress-313153.js script regress-313153.js
script regress-315509-01.js script regress-315509-01.js
skip-if(xulRuntime.XPCOMABI.match(/x86_64/)) script regress-330812.js # No test results skip-if(xulRuntime.XPCOMABI.match(/x86_64/)||Android) script regress-330812.js # No test results
script regress-345961.js script regress-345961.js
script regress-348810.js script regress-348810.js
script regress-350256-01.js script regress-350256-01.js

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

@ -12,5 +12,5 @@ script regress-332472.js
script regress-333728.js script regress-333728.js
script regress-342359.js script regress-342359.js
script regress-347674.js script regress-347674.js
script regress-350650-n.js skip-if(Android) script regress-350650-n.js
script regress-350837.js script regress-350837.js

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

@ -7,9 +7,9 @@ script regress-178389.js
script regress-222029-001.js script regress-222029-001.js
script regress-222029-002.js script regress-222029-002.js
script regress-292215.js script regress-292215.js
#silentfail script regress-338001.js # disabled pending bug 657444 #skip-if(Android) silentfail script regress-338001.js # disabled pending bug 657444
#silentfail script regress-338121-01.js # disabled pending bug 657444 #skip-if(Android) silentfail script regress-338121-01.js # disabled pending bug 657444
#silentfail script regress-338121-02.js # disabled pending bug 657444 #skip-if(Android) silentfail script regress-338121-02.js # disabled pending bug 657444
#silentfail script regress-338121-03.js # disabled pending bug 657444 #skip-if(Android) silentfail script regress-338121-03.js # disabled pending bug 657444
script regress-344052.js script regress-344052.js
script regress-364023.js script regress-364023.js

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

@ -17,10 +17,10 @@ skip script regress-338653.js # slow, killed on x86_64
script regress-341877-01.js script regress-341877-01.js
script regress-341877-02.js script regress-341877-02.js
skip script regress-346794.js # slow, killed skip script regress-346794.js # slow, killed
script regress-348532.js skip-if(Android) script regress-348532.js
script regress-352606.js script regress-352606.js
skip script regress-383269-01.js # unreliable - based on GC timing skip script regress-383269-01.js # unreliable - based on GC timing
skip script regress-383269-02.js # unreliable - based on GC timing skip script regress-383269-02.js # unreliable - based on GC timing
script regress-390078.js script regress-390078.js
script regress-418128.js script regress-418128.js
script regress-440558.js skip-if(Android) script regress-440558.js

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

@ -91,7 +91,7 @@ script regress-275378.js
script regress-276103.js script regress-276103.js
script regress-278873.js script regress-278873.js
script regress-280769-1.js script regress-280769-1.js
silentfail script regress-280769-2.js skip-if(Android) silentfail script regress-280769-2.js
script regress-280769-3.js script regress-280769-3.js
script regress-280769-4.js script regress-280769-4.js
script regress-280769-5.js script regress-280769-5.js
@ -111,7 +111,7 @@ script regress-295052.js
script regress-295666.js script regress-295666.js
script regress-299209.js script regress-299209.js
script regress-299641.js script regress-299641.js
skip-if(!xulRuntime.shell) script regress-303213.js # bug 524731 skip-if(!xulRuntime.shell||Android) script regress-303213.js # bug 524731
script regress-306633.js script regress-306633.js
script regress-306727.js script regress-306727.js
script regress-306794.js script regress-306794.js
@ -125,7 +125,7 @@ script regress-311071.js
script regress-311629.js script regress-311629.js
script regress-312260.js script regress-312260.js
script regress-31255.js script regress-31255.js
script regress-312588.js skip-if(Android) script regress-312588.js
random script regress-313967-01.js # BigO random script regress-313967-01.js # BigO
random script regress-313967-02.js # BigO random script regress-313967-02.js # BigO
skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow script regress-314401.js skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow script regress-314401.js
@ -151,8 +151,8 @@ script regress-328012.js
script regress-328664.js script regress-328664.js
script regress-328897.js script regress-328897.js
script regress-329383.js script regress-329383.js
script regress-329530.js skip-if(Android) script regress-329530.js
script regress-330352.js skip-if(Android) script regress-330352.js
script regress-330951.js script regress-330951.js
script regress-334807-01.js script regress-334807-01.js
script regress-334807-02.js script regress-334807-02.js

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

@ -44,9 +44,9 @@ script regress-328556.js
skip script regress-330569.js # Yarr doesn't bail on complex regexps. skip script regress-330569.js # Yarr doesn't bail on complex regexps.
script regress-333541.js script regress-333541.js
skip script regress-335700.js # bug xxx - reftest hang, BigO skip script regress-335700.js # bug xxx - reftest hang, BigO
skip-if(!xulRuntime.shell) slow script regress-336409-1.js # no results reported. skip-if(!xulRuntime.shell||Android) slow script regress-336409-1.js # no results reported.
skip-if(!xulRuntime.shell&&((Android||(isDebugBuild&&xulRuntime.OS=="Linux")||xulRuntime.XPCOMABI.match(/x86_64/)))) silentfail script regress-336409-2.js # can fail silently due to out of memory, bug 615011 - timeouts on slow debug Linux skip-if(!xulRuntime.shell&&((Android||(isDebugBuild&&xulRuntime.OS=="Linux")||xulRuntime.XPCOMABI.match(/x86_64/)))) silentfail script regress-336409-2.js # can fail silently due to out of memory, bug 615011 - timeouts on slow debug Linux
skip-if(!xulRuntime.shell) silentfail script regress-336410-1.js # can fail silently due to out of memory skip-if(!xulRuntime.shell||Android) silentfail script regress-336410-1.js # can fail silently due to out of memory
skip-if(!xulRuntime.shell&&((isDebugBuild&&xulRuntime.OS=="Linux")||Android||xulRuntime.XPCOMABI.match(/x86_64/)||xulRuntime.OS=="WINNT")) silentfail script regress-336410-2.js # can fail silently due to out of memory, bug 621348 - timeouts on slow debug Linux skip-if(!xulRuntime.shell&&((isDebugBuild&&xulRuntime.OS=="Linux")||Android||xulRuntime.XPCOMABI.match(/x86_64/)||xulRuntime.OS=="WINNT")) silentfail script regress-336410-2.js # can fail silently due to out of memory, bug 621348 - timeouts on slow debug Linux
script regress-338804-01.js script regress-338804-01.js
script regress-338804-02.js script regress-338804-02.js
@ -152,11 +152,11 @@ script regress-394967.js
script regress-396326.js script regress-396326.js
skip script regress-406572.js skip script regress-406572.js
script regress-407019.js script regress-407019.js
script regress-407501.js skip-if(Android) script regress-407501.js
skip-if(!xulRuntime.shell) slow script regress-407720.js skip-if(!xulRuntime.shell) slow script regress-407720.js
script regress-412926.js script regress-412926.js
script regress-414755.js skip-if(Android) script regress-414755.js
script regress-416354.js skip-if(Android) script regress-416354.js
script regress-416460.js script regress-416460.js
script regress-416834.js script regress-416834.js
skip script regress-418730.js # obsolete test skip script regress-418730.js # obsolete test
@ -184,14 +184,14 @@ skip script regress-437288-01.js # obsolete test
script regress-44009.js script regress-44009.js
script regress-443569.js script regress-443569.js
script regress-446386.js script regress-446386.js
script regress-452168.js skip-if(Android) script regress-452168.js
script regress-452178.js script regress-452178.js
script regress-452329.js script regress-452329.js
script regress-452338.js script regress-452338.js
script regress-452565.js script regress-452565.js
script regress-453249.js script regress-453249.js
script regress-454040.js script regress-454040.js
script regress-454142.js skip-if(Android) script regress-454142.js
script regress-454704.js script regress-454704.js
script regress-455380.js script regress-455380.js
script regress-455408.js script regress-455408.js
@ -205,7 +205,7 @@ script regress-465276.js
script regress-469625.js script regress-469625.js
script regress-469761.js script regress-469761.js
script regress-472599.js script regress-472599.js
script regress-472787.js skip-if(Android) script regress-472787.js
script regress-476447.js script regress-476447.js
script regress-479487.js script regress-479487.js
script regress-479551.js script regress-479551.js

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

@ -6,8 +6,8 @@ script regress-414098.js
fails-if(!xulRuntime.shell) script regress-455464-01.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 1 fails-if(!xulRuntime.shell) script regress-455464-01.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 1
fails-if(!xulRuntime.shell) script regress-455464-02.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 49 fails-if(!xulRuntime.shell) script regress-455464-02.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 49
fails-if(!xulRuntime.shell) script regress-455464-03.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 1 fails-if(!xulRuntime.shell) script regress-455464-03.js # bug - NS_ERROR_DOM_NOT_SUPPORTED_ERR line 1
fails-if(!xulRuntime.shell&&!isDebugBuild) skip-if(!xulRuntime.shell&&isDebugBuild) script regress-455464-04.js # bug xxx - hangs reftests in debug, ### bug xxx - NS_ERROR_DOM_NOT_SUPPORTED_ERR in opt fails-if(!xulRuntime.shell&&!isDebugBuild) skip-if((!xulRuntime.shell&&isDebugBuild)||Android) script regress-455464-04.js # bug xxx - hangs reftests in debug, ### bug xxx - NS_ERROR_DOM_NOT_SUPPORTED_ERR in opt
skip-if(!xulRuntime.shell) slow script regress-456826.js # bug 504632 skip-if(!xulRuntime.shell||Android) slow script regress-456826.js # bug 504632
script regress-457521.js script regress-457521.js
script regress-465443.js script regress-465443.js
script regress-470310.js script regress-470310.js

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

@ -1,3 +1,3 @@
url-prefix ../../jsreftest.html?test=js1_7/GC/ url-prefix ../../jsreftest.html?test=js1_7/GC/
script regress-341675.js script regress-341675.js
script regress-381374.js skip-if(Android) script regress-381374.js

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

@ -63,7 +63,7 @@ script regress-470300-02.js
script regress-473282.js script regress-473282.js
script regress-474771-01.js script regress-474771-01.js
script regress-474771-02.js script regress-474771-02.js
script regress-476257.js skip-if(Android) script regress-476257.js
script regress-477048.js script regress-477048.js
script regress-589112.js script regress-589112.js
script regress-590813.js script regress-590813.js

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

@ -65,4 +65,4 @@ script regress-470223.js
script regress-470388-01.js script regress-470388-01.js
script regress-470388-02.js script regress-470388-02.js
script regress-470388-03.js script regress-470388-03.js
script regress-474771.js skip-if(Android) script regress-474771.js

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

@ -36,7 +36,7 @@ skip-if(!xulRuntime.shell) slow script regress-476414-01.js
skip-if(!xulRuntime.shell) slow script regress-476414-02.js skip-if(!xulRuntime.shell) slow script regress-476414-02.js
fails-if(!xulRuntime.shell) script regress-476427.js # NS_ERROR_DOM_NOT_SUPPORTED_ERR fails-if(!xulRuntime.shell) script regress-476427.js # NS_ERROR_DOM_NOT_SUPPORTED_ERR
script regress-476653.js script regress-476653.js
script regress-476869.js skip-if(Android) script regress-476869.js
script regress-476871-02.js script regress-476871-02.js
skip script regress-479252.js skip script regress-479252.js
skip script regress-479381.js skip script regress-479381.js

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

@ -26,7 +26,7 @@ script regress-463783.js
script regress-464092-01.js script regress-464092-01.js
script regress-464092-02.js script regress-464092-02.js
script regress-464096.js script regress-464096.js
script regress-464418.js skip-if(Android) script regress-464418.js
script regress-464978.js script regress-464978.js
script regress-465220.js script regress-465220.js
script regress-465234.js script regress-465234.js
@ -64,7 +64,7 @@ script regress-468711.js
script regress-469547.js script regress-469547.js
script regress-469625-02.js script regress-469625-02.js
script regress-469625-03.js script regress-469625-03.js
script regress-471373.js # bug xxx No test results reported skip-if(Android) script regress-471373.js # bug xxx No test results reported
script regress-471660.js script regress-471660.js
script regress-472450-01.js script regress-472450-01.js
script regress-472450-02.js script regress-472450-02.js
@ -72,7 +72,7 @@ script regress-472528-01.js
script regress-472528-02.js script regress-472528-02.js
script regress-472703.js script regress-472703.js
script regress-474769.js script regress-474769.js
script regress-474771.js skip-if(Android) script regress-474771.js
script regress-474935.js script regress-474935.js
script regress-476655.js script regress-476655.js
script regress-477234.js script regress-477234.js

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

@ -9,7 +9,7 @@ script regress-452498-224.js
script regress-466905-04.js script regress-466905-04.js
skip script regress-466905-05.js # no-op in browser, fails in shell - see bug 554793 skip script regress-466905-05.js # no-op in browser, fails in shell - see bug 554793
script regress-477158.js script regress-477158.js
script regress-477187.js skip-if(Android) script regress-477187.js
script regress-520572.js script regress-520572.js
script new-parenthesization.js script new-parenthesization.js
fails-if(Android) script strict-warning.js fails-if(Android) script strict-warning.js

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

@ -8,7 +8,7 @@ script regress-452498-039.js
script regress-452498-040.js script regress-452498-040.js
script regress-452498-050.js script regress-452498-050.js
script regress-452498-051.js script regress-452498-051.js
script regress-452498-052-a.js skip-if(Android) script regress-452498-052-a.js
script regress-452498-052.js script regress-452498-052.js
script regress-452498-053.js script regress-452498-053.js
script regress-452498-054.js script regress-452498-054.js
@ -28,7 +28,7 @@ script regress-452498-082.js
script regress-452498-091.js script regress-452498-091.js
script regress-452498-092.js script regress-452498-092.js
script regress-452498-098.js script regress-452498-098.js
script regress-452498-099-a.js skip-if(Android) script regress-452498-099-a.js
script regress-452498-099.js script regress-452498-099.js
script regress-452498-101.js script regress-452498-101.js
script regress-452498-102.js script regress-452498-102.js
@ -50,7 +50,7 @@ script regress-452498-123.js
script regress-452498-129.js script regress-452498-129.js
script regress-452498-130.js script regress-452498-130.js
script regress-452498-131.js script regress-452498-131.js
script regress-452498-135-a.js skip-if(Android) script regress-452498-135-a.js
script regress-452498-135.js script regress-452498-135.js
script regress-452498-138.js script regress-452498-138.js
script regress-452498-139.js script regress-452498-139.js
@ -68,11 +68,11 @@ script regress-452498-191.js
script regress-452498-192.js script regress-452498-192.js
script regress-466905-01.js script regress-466905-01.js
script regress-466905-02.js script regress-466905-02.js
script regress-479430-01.js skip-if(Android) script regress-479430-01.js
script regress-479430-02.js skip-if(Android) script regress-479430-02.js
script regress-479430-03.js skip-if(Android) script regress-479430-03.js
script regress-479430-04.js skip-if(Android) script regress-479430-04.js
script regress-479430-05.js skip-if(Android) script regress-479430-05.js
script regress-495773.js script regress-495773.js
script regress-495907.js script regress-495907.js
script regress-496922.js script regress-496922.js
@ -81,7 +81,7 @@ script regress-507295.js
script regress-507424.js script regress-507424.js
script regress-509354.js script regress-509354.js
script regress-515885.js script regress-515885.js
skip-if(isDebugBuild&&!xulRuntime.shell) script regress-524743.js # hang skip-if((isDebugBuild&&!xulRuntime.shell)||Android) script regress-524743.js # hang
script regress-522123.js script regress-522123.js
script regress-524264.js script regress-524264.js
script regress-530879.js script regress-530879.js

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

@ -9,7 +9,7 @@ skip-if(!xulRuntime.shell) script worker-fib.js
skip-if(!xulRuntime.shell) script worker-init.js skip-if(!xulRuntime.shell) script worker-init.js
skip-if(!xulRuntime.shell) script worker-simple.js skip-if(!xulRuntime.shell) script worker-simple.js
skip-if(!xulRuntime.shell) script worker-terminate.js skip-if(!xulRuntime.shell) script worker-terminate.js
skip-if(!xulRuntime.shell) script worker-timeout.js skip-if(!xulRuntime.shell||Android) script worker-timeout.js
script regress-558541.js script regress-558541.js
script scripted-proxies.js script scripted-proxies.js
script watch-undefined-setter.js script watch-undefined-setter.js

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

@ -29,7 +29,7 @@ script regress-559438.js
script regress-560101.js script regress-560101.js
script regress-560998-1.js script regress-560998-1.js
script regress-560998-2.js script regress-560998-2.js
script regress-563210.js skip-if(Android) script regress-563210.js
script regress-563221.js script regress-563221.js
script regress-566549.js script regress-566549.js
script regress-566914.js script regress-566914.js
@ -84,7 +84,7 @@ skip-if(!xulRuntime.shell) script regress-618576.js # uses evalcx
fails-if(!xulRuntime.shell) script regress-618652.js fails-if(!xulRuntime.shell) script regress-618652.js
script regress-619003-1.js script regress-619003-1.js
script regress-619003-2.js script regress-619003-2.js
script regress-620376-1.js skip-if(Android) script regress-620376-1.js
script regress-620376-2.js script regress-620376-2.js
script regress-621814.js script regress-621814.js
script regress-620750.js script regress-620750.js

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

@ -54,7 +54,6 @@ _TEST_FILES = bug500931_helper.html \
file_evalInSandbox.html \ file_evalInSandbox.html \
file_wrappers-2.html \ file_wrappers-2.html \
test_bug92773.html \ test_bug92773.html \
test_bug361111.xul \
test_bug384632.html \ test_bug384632.html \
test_bug390488.html \ test_bug390488.html \
test_bug393269.html \ test_bug393269.html \
@ -95,6 +94,10 @@ _TEST_FILES = bug500931_helper.html \
file_bug658560.html \ file_bug658560.html \
$(NULL) $(NULL)
_CHROME_FILES = \
test_bug361111.xul \
$(NULL)
ifneq ($(OS_TARGET),Android) ifneq ($(OS_TARGET),Android)
ifndef MOZ_PLATFORM_MAEMO ifndef MOZ_PLATFORM_MAEMO
_TEST_FILES += test_bug657267.html \ _TEST_FILES += test_bug657267.html \
@ -107,3 +110,7 @@ endif
libs:: $(_TEST_FILES) libs:: $(_TEST_FILES)
$(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_CHROME_FILES)
$(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)

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

@ -1,13 +1,13 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?> <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?> <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<!-- <!--
https://bugzilla.mozilla.org/show_bug.cgi?id=361111 https://bugzilla.mozilla.org/show_bug.cgi?id=361111
--> -->
<window title="Mozilla Bug 361111" <window title="Mozilla Bug 361111"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="/MochiKit/packed.js" /> <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js" />
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"/> <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<!-- test results are displayed in the html:body --> <!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml"> <body xmlns="http://www.w3.org/1999/xhtml">

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

@ -106,6 +106,9 @@ public:
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager) LayerManager* aManager)
{ {
if (CanvasElementFromContent(mFrame->GetContent())->ShouldForceInactiveLayer(aManager))
return LAYER_INACTIVE;
// If compositing is cheap, just do that // If compositing is cheap, just do that
if (aManager->IsCompositingCheap()) if (aManager->IsCompositingCheap())
return mozilla::LAYER_ACTIVE; return mozilla::LAYER_ACTIVE;

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

@ -1545,7 +1545,7 @@ random-if(!winWidget) == 574907-2.html 574907-2-ref.html
random-if(!winWidget) fails-if(winWidget&&!d2d) random-if(winWidget&&d2d) != 574907-3.html 574907-3-notref.html random-if(!winWidget) fails-if(winWidget&&!d2d) random-if(winWidget&&d2d) != 574907-3.html 574907-3-notref.html
== 577838-1.html 577838-1-ref.html == 577838-1.html 577838-1-ref.html
== 577838-2.html 577838-2-ref.html == 577838-2.html 577838-2-ref.html
fails-if(Android) random-if(layersGPUAccelerated) fails-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) fails-if(/Mac\x20OS\x20X\x2010\.5/.test(http.oscpu)) == 579323-1.html 579323-1-ref.html # bug 623450 for WinXP and bug 627560 for OSX 10.5 fails-if(Android) random-if(layersGPUAccelerated) == 579323-1.html 579323-1-ref.html
== 579349-1.html 579349-1-ref.html == 579349-1.html 579349-1-ref.html
== 579655-1.html 579655-1-ref.html == 579655-1.html 579655-1-ref.html
fails-if(Android) == 579808-1.html 579808-1-ref.html fails-if(Android) == 579808-1.html 579808-1-ref.html
@ -1622,7 +1622,7 @@ fails-if(Android) == 625409-1.html 625409-1-ref.html
== 630835-1.html about:blank == 630835-1.html about:blank
== 631352-1.html 631352-1-ref.html == 631352-1.html 631352-1-ref.html
fails-if(Android) == 632423-1.html 632423-1-ref.html fails-if(Android) == 632423-1.html 632423-1-ref.html
skip-if(Android) fails-if(winWidget) == 632781-verybig.html 632781-ref.html # large canvas elements are not drawn on Windows, see bug 633936 skip-if(Android) == 632781-verybig.html 632781-ref.html
== 632781-normalsize.html 632781-ref.html == 632781-normalsize.html 632781-ref.html
== 633344-1.html 633344-1-ref.html == 633344-1.html 633344-1-ref.html
fails-if(Android) == 634232-1.html 634232-1-ref.html fails-if(Android) == 634232-1.html 634232-1-ref.html

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

@ -1,4 +1,5 @@
== default-size.html default-size-ref.html == default-size.html default-size-ref.html
== size-1.html size-1-ref.html
== image-rendering-test.html image-rendering-ref.html == image-rendering-test.html image-rendering-ref.html
== image-shadow.html image-shadow-ref.html == image-shadow.html image-shadow-ref.html

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

@ -0,0 +1,9 @@
<!DOCTYPE HTML>
<html>
<body>
<div style="background:lime; width:100px; height:30000px;"></div>
<script>
window.scrollTo(0, 100000);
</script>
</body>
</html>

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

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<body>
<canvas style="display:block" id="c" width="100" height="30000"></canvas>
<script>
var ctx = document.getElementById("c").getContext("2d");
ctx.fillStyle = "lime";
ctx.fillRect(0, 0, 100, 30000);
window.scrollTo(0, 100000);
</script>
</body>
</html>

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

@ -338,9 +338,9 @@ nsSVGGeometryFrame::SetupCairoStroke(gfxContext *aContext)
} }
PRUint16 PRUint16
nsSVGGeometryFrame::GetHittestMask() nsSVGGeometryFrame::GetHitTestFlags()
{ {
PRUint16 mask = 0; PRUint16 flags = 0;
switch(GetStyleVisibility()->mPointerEvents) { switch(GetStyleVisibility()->mPointerEvents) {
case NS_STYLE_POINTER_EVENTS_NONE: case NS_STYLE_POINTER_EVENTS_NONE:
@ -349,49 +349,49 @@ nsSVGGeometryFrame::GetHittestMask()
case NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED: case NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED:
if (GetStyleVisibility()->IsVisible()) { if (GetStyleVisibility()->IsVisible()) {
if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None) if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None)
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None) if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None)
mask |= HITTEST_MASK_STROKE; flags |= SVG_HIT_TEST_STROKE;
if (GetStyleSVG()->mStrokeOpacity > 0) if (GetStyleSVG()->mStrokeOpacity > 0)
mask |= HITTEST_MASK_CHECK_MRECT; flags |= SVG_HIT_TEST_CHECK_MRECT;
} }
break; break;
case NS_STYLE_POINTER_EVENTS_VISIBLEFILL: case NS_STYLE_POINTER_EVENTS_VISIBLEFILL:
if (GetStyleVisibility()->IsVisible()) { if (GetStyleVisibility()->IsVisible()) {
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
} }
break; break;
case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE: case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE:
if (GetStyleVisibility()->IsVisible()) { if (GetStyleVisibility()->IsVisible()) {
mask |= HITTEST_MASK_STROKE; flags |= SVG_HIT_TEST_STROKE;
} }
break; break;
case NS_STYLE_POINTER_EVENTS_VISIBLE: case NS_STYLE_POINTER_EVENTS_VISIBLE:
if (GetStyleVisibility()->IsVisible()) { if (GetStyleVisibility()->IsVisible()) {
mask |= HITTEST_MASK_FILL | HITTEST_MASK_STROKE; flags |= SVG_HIT_TEST_FILL | SVG_HIT_TEST_STROKE;
} }
break; break;
case NS_STYLE_POINTER_EVENTS_PAINTED: case NS_STYLE_POINTER_EVENTS_PAINTED:
if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None) if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None)
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None) if (GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None)
mask |= HITTEST_MASK_STROKE; flags |= SVG_HIT_TEST_STROKE;
if (GetStyleSVG()->mStrokeOpacity) if (GetStyleSVG()->mStrokeOpacity)
mask |= HITTEST_MASK_CHECK_MRECT; flags |= SVG_HIT_TEST_CHECK_MRECT;
break; break;
case NS_STYLE_POINTER_EVENTS_FILL: case NS_STYLE_POINTER_EVENTS_FILL:
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
break; break;
case NS_STYLE_POINTER_EVENTS_STROKE: case NS_STYLE_POINTER_EVENTS_STROKE:
mask |= HITTEST_MASK_STROKE; flags |= SVG_HIT_TEST_STROKE;
break; break;
case NS_STYLE_POINTER_EVENTS_ALL: case NS_STYLE_POINTER_EVENTS_ALL:
mask |= HITTEST_MASK_FILL | HITTEST_MASK_STROKE; flags |= SVG_HIT_TEST_FILL | SVG_HIT_TEST_STROKE;
break; break;
default: default:
NS_ERROR("not reached"); NS_ERROR("not reached");
break; break;
} }
return mask; return flags;
} }

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

@ -46,9 +46,9 @@ class gfxContext;
typedef nsFrame nsSVGGeometryFrameBase; typedef nsFrame nsSVGGeometryFrameBase;
#define HITTEST_MASK_FILL 0x01 #define SVG_HIT_TEST_FILL 0x01
#define HITTEST_MASK_STROKE 0x02 #define SVG_HIT_TEST_STROKE 0x02
#define HITTEST_MASK_CHECK_MRECT 0x04 #define SVG_HIT_TEST_CHECK_MRECT 0x04
/* nsSVGGeometryFrame is a base class for SVG objects that directly /* nsSVGGeometryFrame is a base class for SVG objects that directly
* have geometry (circle, ellipse, line, polyline, polygon, path, and * have geometry (circle, ellipse, line, polyline, polygon, path, and
@ -106,7 +106,14 @@ public:
protected: protected:
nsSVGPaintServerFrame *GetPaintServer(const nsStyleSVGPaint *aPaint, nsSVGPaintServerFrame *GetPaintServer(const nsStyleSVGPaint *aPaint,
const FramePropertyDescriptor *aProperty); const FramePropertyDescriptor *aProperty);
virtual PRUint16 GetHittestMask();
/**
* This function returns a set of bit flags indicating which parts of the
* element (fill, stroke, bounds) should intercept pointer events. It takes
* into account the type of element and the value of the 'pointer-events'
* property on the element.
*/
virtual PRUint16 GetHitTestFlags();
private: private:
nsresult GetStrokeDashArray(double **arr, PRUint32 *count); nsresult GetStrokeDashArray(double **arr, PRUint32 *count);

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

@ -415,8 +415,8 @@ nsSVGGlyphFrame::PaintSVG(nsSVGRenderState *aContext,
NS_IMETHODIMP_(nsIFrame*) NS_IMETHODIMP_(nsIFrame*)
nsSVGGlyphFrame::GetFrameForPoint(const nsPoint &aPoint) nsSVGGlyphFrame::GetFrameForPoint(const nsPoint &aPoint)
{ {
PRUint16 mask = GetHittestMask(); PRUint16 hitTestFlags = GetHitTestFlags();
if (!mask) { if (!hitTestFlags) {
return nsnull; return nsnull;
} }
@ -431,7 +431,7 @@ nsSVGGlyphFrame::GetFrameForPoint(const nsPoint &aPoint)
// //
// http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty // http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty
// //
// Currently we just test the character cells if GetHittestMask says we're // Currently we just test the character cells if GetHitTestFlags says we're
// supposed to be testing either the fill OR the stroke: // supposed to be testing either the fill OR the stroke:
PRInt32 i; PRInt32 i;
@ -448,7 +448,7 @@ nsSVGGlyphFrame::GetFrameForPoint(const nsPoint &aPoint)
PresContext()->AppUnitsToGfxUnits(aPoint.y))); PresContext()->AppUnitsToGfxUnits(aPoint.y)));
PRBool isHit = PR_FALSE; PRBool isHit = PR_FALSE;
if (mask & HITTEST_MASK_FILL || mask & HITTEST_MASK_STROKE) { if (hitTestFlags & SVG_HIT_TEST_FILL || hitTestFlags & SVG_HIT_TEST_STROKE) {
isHit = context->PointInFill(userSpacePoint); isHit = context->PointInFill(userSpacePoint);
} }

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

@ -91,7 +91,7 @@ public:
// nsSVGPathGeometryFrame methods: // nsSVGPathGeometryFrame methods:
NS_IMETHOD UpdateCoveredRegion(); NS_IMETHOD UpdateCoveredRegion();
virtual PRUint16 GetHittestMask(); virtual PRUint16 GetHitTestFlags();
// nsIFrame interface: // nsIFrame interface:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
@ -460,9 +460,9 @@ nsSVGImageFrame::UpdateCoveredRegion()
} }
PRUint16 PRUint16
nsSVGImageFrame::GetHittestMask() nsSVGImageFrame::GetHitTestFlags()
{ {
PRUint16 mask = 0; PRUint16 flags = 0;
switch(GetStyleVisibility()->mPointerEvents) { switch(GetStyleVisibility()->mPointerEvents) {
case NS_STYLE_POINTER_EVENTS_NONE: case NS_STYLE_POINTER_EVENTS_NONE:
@ -471,31 +471,31 @@ nsSVGImageFrame::GetHittestMask()
case NS_STYLE_POINTER_EVENTS_AUTO: case NS_STYLE_POINTER_EVENTS_AUTO:
if (GetStyleVisibility()->IsVisible()) { if (GetStyleVisibility()->IsVisible()) {
/* XXX: should check pixel transparency */ /* XXX: should check pixel transparency */
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
} }
break; break;
case NS_STYLE_POINTER_EVENTS_VISIBLEFILL: case NS_STYLE_POINTER_EVENTS_VISIBLEFILL:
case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE: case NS_STYLE_POINTER_EVENTS_VISIBLESTROKE:
case NS_STYLE_POINTER_EVENTS_VISIBLE: case NS_STYLE_POINTER_EVENTS_VISIBLE:
if (GetStyleVisibility()->IsVisible()) { if (GetStyleVisibility()->IsVisible()) {
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
} }
break; break;
case NS_STYLE_POINTER_EVENTS_PAINTED: case NS_STYLE_POINTER_EVENTS_PAINTED:
/* XXX: should check pixel transparency */ /* XXX: should check pixel transparency */
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
break; break;
case NS_STYLE_POINTER_EVENTS_FILL: case NS_STYLE_POINTER_EVENTS_FILL:
case NS_STYLE_POINTER_EVENTS_STROKE: case NS_STYLE_POINTER_EVENTS_STROKE:
case NS_STYLE_POINTER_EVENTS_ALL: case NS_STYLE_POINTER_EVENTS_ALL:
mask |= HITTEST_MASK_FILL; flags |= SVG_HIT_TEST_FILL;
break; break;
default: default:
NS_ERROR("not reached"); NS_ERROR("not reached");
break; break;
} }
return mask; return flags;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

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

@ -153,14 +153,14 @@ nsSVGPathGeometryFrame::PaintSVG(nsSVGRenderState *aContext,
NS_IMETHODIMP_(nsIFrame*) NS_IMETHODIMP_(nsIFrame*)
nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint) nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
{ {
PRUint16 fillRule, mask; PRUint16 fillRule, hitTestFlags;
if (GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD) { if (GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD) {
mask = HITTEST_MASK_FILL; hitTestFlags = SVG_HIT_TEST_FILL;
fillRule = GetClipRule(); fillRule = GetClipRule();
} else { } else {
mask = GetHittestMask(); hitTestFlags = GetHitTestFlags();
if (!mask || ((mask & HITTEST_MASK_CHECK_MRECT) && if (!hitTestFlags || ((hitTestFlags & SVG_HIT_TEST_CHECK_MRECT) &&
!mRect.Contains(aPoint))) !mRect.Contains(aPoint)))
return nsnull; return nsnull;
fillRule = GetStyleSVG()->mFillRule; fillRule = GetStyleSVG()->mFillRule;
} }
@ -180,9 +180,9 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
else else
context->SetFillRule(gfxContext::FILL_RULE_WINDING); context->SetFillRule(gfxContext::FILL_RULE_WINDING);
if (mask & HITTEST_MASK_FILL) if (hitTestFlags & SVG_HIT_TEST_FILL)
isHit = context->PointInFill(userSpacePoint); isHit = context->PointInFill(userSpacePoint);
if (!isHit && (mask & HITTEST_MASK_STROKE)) { if (!isHit && (hitTestFlags & SVG_HIT_TEST_STROKE)) {
SetupCairoStrokeHitGeometry(context); SetupCairoStrokeHitGeometry(context);
isHit = context->PointInStroke(userSpacePoint); isHit = context->PointInStroke(userSpacePoint);
} }

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

@ -767,6 +767,9 @@ protected:
// root prescontext's root frame. // root prescontext's root frame.
nsIntPoint mCachedMousePoint; nsIntPoint mCachedMousePoint;
// cached modifiers
PRInt8 mCachedModifiers;
// set to the currently active menu bar, if any // set to the currently active menu bar, if any
nsMenuBarFrame* mActiveMenuBar; nsMenuBarFrame* mActiveMenuBar;

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

@ -73,6 +73,11 @@
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#define FLAG_ALT 0x01
#define FLAG_CONTROL 0x02
#define FLAG_SHIFT 0x04
#define FLAG_META 0x08
const nsNavigationDirection DirectionFromKeyCodeTable[2][6] = { const nsNavigationDirection DirectionFromKeyCodeTable[2][6] = {
{ {
eNavigationDirection_Last, // NS_VK_END eNavigationDirection_Last, // NS_VK_END
@ -140,6 +145,7 @@ NS_IMPL_ISUPPORTS4(nsXULPopupManager,
nsXULPopupManager::nsXULPopupManager() : nsXULPopupManager::nsXULPopupManager() :
mRangeOffset(0), mRangeOffset(0),
mCachedMousePoint(0, 0), mCachedMousePoint(0, 0),
mCachedModifiers(0),
mActiveMenuBar(nsnull), mActiveMenuBar(nsnull),
mPopups(nsnull), mPopups(nsnull),
mNoHidePanels(nsnull), mNoHidePanels(nsnull),
@ -462,6 +468,8 @@ nsXULPopupManager::InitTriggerEvent(nsIDOMEvent* aEvent, nsIContent* aPopup,
} }
} }
mCachedModifiers = 0;
nsCOMPtr<nsIDOMNSUIEvent> uiEvent = do_QueryInterface(aEvent); nsCOMPtr<nsIDOMNSUIEvent> uiEvent = do_QueryInterface(aEvent);
if (uiEvent) { if (uiEvent) {
uiEvent->GetRangeParent(getter_AddRefs(mRangeParent)); uiEvent->GetRangeParent(getter_AddRefs(mRangeParent));
@ -475,6 +483,22 @@ nsXULPopupManager::InitTriggerEvent(nsIDOMEvent* aEvent, nsIContent* aPopup,
nsEvent* event; nsEvent* event;
event = privateEvent->GetInternalNSEvent(); event = privateEvent->GetInternalNSEvent();
if (event) { if (event) {
if (event->eventStructType == NS_MOUSE_EVENT ||
event->eventStructType == NS_KEY_EVENT) {
nsInputEvent* inputEvent = static_cast<nsInputEvent*>(event);
if (inputEvent->isAlt) {
mCachedModifiers |= FLAG_ALT;
}
if (inputEvent->isControl) {
mCachedModifiers |= FLAG_CONTROL;
}
if (inputEvent->isShift) {
mCachedModifiers |= FLAG_SHIFT;
}
if (inputEvent->isMeta) {
mCachedModifiers |= FLAG_META;
}
}
nsIDocument* doc = aPopup->GetCurrentDoc(); nsIDocument* doc = aPopup->GetCurrentDoc();
if (doc) { if (doc) {
nsIPresShell* presShell = doc->GetShell(); nsIPresShell* presShell = doc->GetShell();
@ -1187,10 +1211,19 @@ nsXULPopupManager::FirePopupShowingEvent(nsIContent* aPopup,
} }
event.refPoint = mCachedMousePoint; event.refPoint = mCachedMousePoint;
event.isAlt = !!(mCachedModifiers & FLAG_ALT);
event.isControl = !!(mCachedModifiers & FLAG_CONTROL);
event.isShift = !!(mCachedModifiers & FLAG_SHIFT);
event.isMeta = !!(mCachedModifiers & FLAG_META);
nsEventDispatcher::Dispatch(popup, presContext, &event, nsnull, &status); nsEventDispatcher::Dispatch(popup, presContext, &event, nsnull, &status);
mCachedMousePoint = nsIntPoint(0, 0); mCachedMousePoint = nsIntPoint(0, 0);
mOpeningPopup = nsnull; mOpeningPopup = nsnull;
mCachedModifiers = 0;
// if a panel, blur whatever has focus so that the panel can take the focus. // if a panel, blur whatever has focus so that the panel can take the focus.
// This is done after the popupshowing event in case that event is cancelled. // This is done after the popupshowing event in case that event is cancelled.
// Using noautofocus="true" will disable this behaviour, which is needed for // Using noautofocus="true" will disable this behaviour, which is needed for

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

@ -40,15 +40,6 @@
function redirect(aURL) function redirect(aURL)
{ {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); SpecialPowers.loadURI(window, aURL + location.search,
const Cc = Components.classes;
const Ci = Components.interfaces;
// Can't just set window.location because of security restrictions
// that don't care about our UniversalXPConnectness
var webNav = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
webNav.loadURI(aURL + location.search,
null, null, null, null); null, null, null, null);
} }

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

@ -500,12 +500,7 @@ class Mochitest(object):
manifest = self.addChromeToProfile(options) manifest = self.addChromeToProfile(options)
self.copyExtraFilesToProfile(options) self.copyExtraFilesToProfile(options)
# We only need special powers in non-chrome harnesses self.installSpecialPowersExtension(options)
if (not options.browserChrome and
not options.chrome and
not options.a11y):
self.installSpecialPowersExtension(options)
self.installExtensionsToProfile(options) self.installExtensionsToProfile(options)
return manifest return manifest

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

@ -208,6 +208,12 @@ SpecialPowers.prototype = {
.createInstance(Ci.nsIXMLHttpRequest); .createInstance(Ci.nsIXMLHttpRequest);
}, },
loadURI: function(window, uri, referrer, charset, x, y) {
var webNav = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
webNav.loadURI(uri, referrer, charset, x, y);
},
gc: function() { gc: function() {
this.DOMWindowUtils.garbageCollect(); this.DOMWindowUtils.garbageCollect();
}, },
@ -342,12 +348,9 @@ SpecialPowersManager.prototype = {
handleEvent: function handleEvent(aEvent) { handleEvent: function handleEvent(aEvent) {
var window = aEvent.target.defaultView; var window = aEvent.target.defaultView;
// Need to make sure we are called on what we care about - // only add SpecialPowers to data pages, not about:*
// content windows. DOMWindowCreated is called on *all* HTMLDocuments,
// some of which belong to chrome windows or other special content.
//
var uri = window.document.documentURIObject; var uri = window.document.documentURIObject;
if (uri.scheme === "chrome" || uri.spec.split(":")[0] == "about") { if (uri.spec.split(":")[0] == "about") {
return; return;
} }

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

@ -109,7 +109,7 @@ SimpleTest.todo = function(condition, name, diag) {
SimpleTest._getCurrentTestURL = function() { SimpleTest._getCurrentTestURL = function() {
return parentRunner && parentRunner.currentTestURL || return parentRunner && parentRunner.currentTestURL ||
typeof gTestPath == "string" && gTestPath || typeof gTestPath == "string" && gTestPath ||
""; "unknown test url";
}; };
SimpleTest._logResult = function(test, passString, failString) { SimpleTest._logResult = function(test, passString, failString) {

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

@ -42,13 +42,7 @@ TestRunner._urls = [];
TestRunner.timeout = 5 * 60 * 1000; // 5 minutes. TestRunner.timeout = 5 * 60 * 1000; // 5 minutes.
TestRunner.maxTimeouts = 4; // halt testing after too many timeouts TestRunner.maxTimeouts = 4; // halt testing after too many timeouts
// running in e10s build and need to use IPC? TestRunner.ipcMode = SpecialPowers.hasContentProcesses();
if (typeof SpecialPowers != 'undefined') {
TestRunner.ipcMode = SpecialPowers.hasContentProcesses();
} else {
TestRunner.ipcMode = false;
}
TestRunner._expectingProcessCrash = false; TestRunner._expectingProcessCrash = false;
/** /**
@ -170,9 +164,7 @@ TestRunner._makeIframe = function (url, retry) {
TestRunner.runTests = function (/*url...*/) { TestRunner.runTests = function (/*url...*/) {
TestRunner.log("SimpleTest START"); TestRunner.log("SimpleTest START");
if (typeof SpecialPowers != "undefined") { SpecialPowers.registerProcessCrashObservers();
SpecialPowers.registerProcessCrashObservers();
}
TestRunner._urls = flattenArguments(arguments); TestRunner._urls = flattenArguments(arguments);
$('testframe').src=""; $('testframe').src="";
@ -233,10 +225,6 @@ TestRunner.runNextTest = function() {
}; };
TestRunner.expectChildProcessCrash = function() { TestRunner.expectChildProcessCrash = function() {
if (typeof SpecialPowers == "undefined") {
throw "TestRunner.expectChildProcessCrash must only be called from plain mochitests.";
}
TestRunner._expectingProcessCrash = true; TestRunner._expectingProcessCrash = true;
}; };
@ -278,14 +266,10 @@ TestRunner.testFinished = function(tests) {
TestRunner.runNextTest(); TestRunner.runNextTest();
} }
if (typeof SpecialPowers != 'undefined') { SpecialPowers.executeAfterFlushingMessageQueue(function() {
SpecialPowers.executeAfterFlushingMessageQueue(function() { cleanUpCrashDumpFiles();
cleanUpCrashDumpFiles();
runNextTest();
});
} else {
runNextTest(); runNextTest();
} });
}; };
/** /**

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

@ -3,6 +3,22 @@ var gTrigger = null;
var gIsMenu = false; var gIsMenu = false;
var gScreenX = -1, gScreenY = -1; var gScreenX = -1, gScreenY = -1;
var gCachedEvent = null; var gCachedEvent = null;
var gCachedEvent2 = null;
function cacheEvent(modifiers)
{
var cachedEvent = null;
var mouseFn = function(event) {
cachedEvent = event;
}
window.addEventListener("mousedown", mouseFn, false);
synthesizeMouse(document.documentElement, 0, 0, modifiers);
window.removeEventListener("mousedown", mouseFn, false);
return cachedEvent;
}
function runTests() function runTests()
{ {
@ -15,17 +31,13 @@ function runTests()
gIsMenu = gTrigger.boxObject instanceof Components.interfaces.nsIMenuBoxObject; gIsMenu = gTrigger.boxObject instanceof Components.interfaces.nsIMenuBoxObject;
var mouseFn = function(event) { // a hacky way to get the screen position of the document. Cache the event
gScreenX = event.screenX; // so that we can use it in calls to openPopup.
gScreenY = event.screenY; gCachedEvent = cacheEvent({ shiftKey: true });
// cache the event so that we can use it in calls to openPopup gScreenX = gCachedEvent.screenX;
gCachedEvent = event; gScreenY = gCachedEvent.screenY;
} gCachedEvent2 = cacheEvent({ altKey: true, ctrlKey: true, shiftKey: true, metaKey: true });
// a hacky way to get the screen position of the document
window.addEventListener("mousedown", mouseFn, false);
synthesizeMouse(document.documentElement, 0, 0, { });
window.removeEventListener("mousedown", mouseFn, false);
startPopupTests(popupTests); startPopupTests(popupTests);
} }
@ -254,7 +266,7 @@ var popupTests = [
// can be used to override the popup's position. This test also passes an // can be used to override the popup's position. This test also passes an
// event to openPopup to check the trigger node. // event to openPopup to check the trigger node.
testname: "open popup anchored with override", testname: "open popup anchored with override",
events: [ "popupshowing thepopup", "popupshown thepopup" ], events: [ "popupshowing thepopup 0010", "popupshown thepopup" ],
test: function(testname, step) { test: function(testname, step) {
// attribute overrides the position passed in // attribute overrides the position passed in
gMenuPopup.setAttribute("position", "end_after"); gMenuPopup.setAttribute("position", "end_after");
@ -403,7 +415,7 @@ var popupTests = [
}, },
{ {
testname: "open context popup at screen", testname: "open context popup at screen",
events: [ "popupshowing thepopup", "popupshown thepopup" ], events: [ "popupshowing thepopup 0010", "popupshown thepopup" ],
test: function(testname, step) { test: function(testname, step) {
gExpectedTriggerNode = gCachedEvent.target; gExpectedTriggerNode = gCachedEvent.target;
gMenuPopup.openPopupAtScreen(gScreenX + 8, gScreenY + 16, true, gCachedEvent); gMenuPopup.openPopupAtScreen(gScreenX + 8, gScreenY + 16, true, gCachedEvent);
@ -558,6 +570,14 @@ var popupTests = [
checkActive(gMenuPopup, "", testname); checkActive(gMenuPopup, "", testname);
} }
}, },
{
testname: "open context popup at screen with all modifiers set",
events: [ "popupshowing thepopup 1111", "popupshown thepopup" ],
autohide: "thepopup",
test: function(testname, step) {
gMenuPopup.openPopupAtScreen(gScreenX + 8, gScreenY + 16, true, gCachedEvent2);
}
},
{ {
testname: "open popup with open property", testname: "open popup with open property",
events: [ "popupshowing thepopup", "popupshown thepopup" ], events: [ "popupshowing thepopup", "popupshown thepopup" ],

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

@ -133,6 +133,16 @@ function eventOccurred(event)
matches = eventitem[0] == event.type && eventitem[1] == event.target.id; matches = eventitem[0] == event.type && eventitem[1] == event.target.id;
} }
var modifiersMask = eventitem[2];
if (modifiersMask) {
var m = "";
m += event.altKey ? '1' : '0';
m += event.ctrlKey ? '1' : '0';
m += event.shiftKey ? '1' : '0';
m += event.metaKey ? '1' : '0';
is(m, modifiersMask, test.testname + " modifiers mask matches");
}
var expectedState; var expectedState;
switch (event.type) { switch (event.type) {
case "popupshowing": expectedState = "showing"; break; case "popupshowing": expectedState = "showing"; break;

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

@ -273,6 +273,9 @@ void ExceptionHandler::Initialize(const wstring& dump_path,
set_dump_path(dump_path); set_dump_path(dump_path);
} }
// Reserve one element for the instruction memory
app_memory_info_.push_back(AppMemory(0, 0));
// There is a race condition here. If the first instance has not yet // There is a race condition here. If the first instance has not yet
// initialized the critical section, the second (and later) instances may // initialized the critical section, the second (and later) instances may
// try to use uninitialized critical section object. The feature of multiple // try to use uninitialized critical section object. The feature of multiple
@ -1045,7 +1048,10 @@ bool ExceptionHandler::WriteMinidumpWithExceptionForProcess(
reinterpret_cast<ULONG64>(info.BaseAddress) reinterpret_cast<ULONG64>(info.BaseAddress)
+ info.RegionSize); + info.RegionSize);
ULONG size = static_cast<ULONG>(end_of_range - base); ULONG size = static_cast<ULONG>(end_of_range - base);
app_memory_info_.push_back(AppMemory(base, size));
AppMemory &elt = app_memory_info_.front();
elt.ptr = base;
elt.length = size;
} }
} }
@ -1053,6 +1059,10 @@ bool ExceptionHandler::WriteMinidumpWithExceptionForProcess(
context.iter = app_memory_info_.begin(); context.iter = app_memory_info_.begin();
context.end = app_memory_info_.end(); context.end = app_memory_info_.end();
// Skip the reserved element if there was no instruction memory
if (context.iter->ptr == 0)
context.iter++;
MINIDUMP_CALLBACK_INFORMATION callback; MINIDUMP_CALLBACK_INFORMATION callback;
callback.CallbackRoutine = MinidumpWriteDumpCallback; callback.CallbackRoutine = MinidumpWriteDumpCallback;
callback.CallbackParam = reinterpret_cast<void*>(&context); callback.CallbackParam = reinterpret_cast<void*>(&context);

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

@ -280,6 +280,15 @@ static int EnumSizeForCocoaSize(NSControlSize cocoaControlSize) {
return regularControlSize; return regularControlSize;
} }
static NSControlSize CocoaSizeForEnum(PRInt32 enumControlSize) {
if (enumControlSize == miniControlSize)
return NSMiniControlSize;
else if (enumControlSize == smallControlSize)
return NSSmallControlSize;
else
return NSRegularControlSize;
}
static void InflateControlRect(NSRect* rect, NSControlSize cocoaControlSize, const float marginSet[][3][4]) static void InflateControlRect(NSRect* rect, NSControlSize cocoaControlSize, const float marginSet[][3][4])
{ {
if (!marginSet) if (!marginSet)
@ -556,6 +565,49 @@ struct CellRenderSettings {
float margins[1][3][4]; float margins[1][3][4];
}; };
/*
* This is a helper method that returns the required NSControlSize given a size
* and the size of the three controls plus a tolerance.
* size - The width or the height of the element to draw.
* sizes - An array with the all the width/height of the element for its
* different sizes.
* tolerance - The tolerance as passed to DrawCellWithSnapping.
* NOTE: returns NSRegularControlSize if all values in 'sizes' are zero.
*/
static NSControlSize FindControlSize(CGFloat size, CGFloat* sizes, CGFloat tolerance)
{
for (PRUint32 i = miniControlSize; i <= regularControlSize; ++i) {
if (sizes[i] == 0) {
continue;
}
CGFloat next = 0;
// Find next value.
for (PRUint32 j = i+1; j <= regularControlSize; ++j) {
if (sizes[j] != 0) {
next = sizes[j];
break;
}
}
// If it's the latest value, we pick it.
if (next == 0) {
return CocoaSizeForEnum(i);
}
if (size <= sizes[i] + tolerance && size < next) {
return CocoaSizeForEnum(i);
}
}
// If we are here, that means sizes[] was an array with only empty values
// or the algorithm above is wrong.
// The former can happen but the later would be wrong.
NS_ASSERTION(sizes[0] == 0 && sizes[1] == 0 && sizes[2] == 0,
"We found no control! We shouldn't be there!");
return CocoaSizeForEnum(regularControlSize);
}
/* /*
* Draw the given NSCell into the given cgContext with a nice control size. * Draw the given NSCell into the given cgContext with a nice control size.
* *
@ -583,18 +635,12 @@ static void DrawCellWithSnapping(NSCell *cell,
const NSSize smallSize = sizes[EnumSizeForCocoaSize(NSSmallControlSize)]; const NSSize smallSize = sizes[EnumSizeForCocoaSize(NSSmallControlSize)];
const NSSize regularSize = sizes[EnumSizeForCocoaSize(NSRegularControlSize)]; const NSSize regularSize = sizes[EnumSizeForCocoaSize(NSRegularControlSize)];
NSControlSize controlSizeX = NSRegularControlSize, controlSizeY = NSRegularControlSize;
HIRect drawRect = destRect; HIRect drawRect = destRect;
if (rectWidth <= miniSize.width + snapTolerance && rectWidth < smallSize.width) CGFloat controlWidths[3] = { miniSize.width, smallSize.width, regularSize.width };
controlSizeX = NSMiniControlSize; NSControlSize controlSizeX = FindControlSize(rectWidth, controlWidths, snapTolerance);
else if(rectWidth <= smallSize.width + snapTolerance && rectWidth < regularSize.width) CGFloat controlHeights[3] = { miniSize.height, smallSize.height, regularSize.height };
controlSizeX = NSSmallControlSize; NSControlSize controlSizeY = FindControlSize(rectHeight, controlHeights, snapTolerance);
if (rectHeight <= miniSize.height + snapTolerance && rectHeight < smallSize.height)
controlSizeY = NSMiniControlSize;
else if(rectHeight <= smallSize.height + snapTolerance && rectHeight < regularSize.height)
controlSizeY = NSSmallControlSize;
NSControlSize controlSize = NSRegularControlSize; NSControlSize controlSize = NSRegularControlSize;
int sizeIndex = 0; int sizeIndex = 0;