This commit is contained in:
Marco Bonardo 2012-01-17 16:24:46 +01:00
Родитель 0c3008780d 1d0335e9ff
Коммит cf7bdf1de9
42 изменённых файлов: 220 добавлений и 200 удалений

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

@ -237,7 +237,7 @@ pref("keyword.URL", "");
pref("general.useragent.locale", "@AB_CD@"); pref("general.useragent.locale", "@AB_CD@");
pref("general.skins.selectedSkin", "classic/1.0"); pref("general.skins.selectedSkin", "classic/1.0");
pref("general.smoothScroll", false); pref("general.smoothScroll", true);
#ifdef UNIX_BUT_NOT_MAC #ifdef UNIX_BUT_NOT_MAC
pref("general.autoScroll", false); pref("general.autoScroll", false);
#else #else
@ -1033,9 +1033,6 @@ pref("devtools.styleinspector.enabled", true);
// Enable the Tilt inspector // Enable the Tilt inspector
pref("devtools.tilt.enabled", true); pref("devtools.tilt.enabled", true);
// Enable the Tilt inspector even if WebGL capabilities are not detected
pref("devtools.tilt.force-enabled", false);
// Enable the rules view // Enable the rules view
pref("devtools.ruleview.enabled", true); pref("devtools.ruleview.enabled", true);

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

@ -1014,8 +1014,8 @@
<toolbarbutton id="inspector-3D-button" <toolbarbutton id="inspector-3D-button"
class="devtools-toolbarbutton" class="devtools-toolbarbutton"
hidden="true" hidden="true"
label="&inspect3DButton.label;" label="&inspect3DViewButton.label;"
accesskey="&inspect3DButton.accesskey;" accesskey="&inspect3DViewButton.accesskey;"
command="Inspector:Tilt"/> command="Inspector:Tilt"/>
<toolbarbutton id="inspector-style-button" <toolbarbutton id="inspector-style-button"
class="devtools-toolbarbutton" class="devtools-toolbarbutton"

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

@ -8,6 +8,7 @@
} }
.view { .view {
color: black; /* Default text color */
background: #f0f0ff; /* Background of the editor */ background: #f0f0ff; /* Background of the editor */
padding-left: 0; padding-left: 0;
} }

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

@ -751,70 +751,28 @@ StyleEditor.prototype = {
*/ */
_loadSourceFromCache: function SE__loadSourceFromCache(aHref) _loadSourceFromCache: function SE__loadSourceFromCache(aHref)
{ {
try { let channel = Services.io.newChannel(aHref, null, null);
let cacheService = Cc["@mozilla.org/network/cache-service;1"]
.getService(Ci.nsICacheService);
let session = cacheService.createSession("HTTP", Ci.nsICache.STORE_ANYWHERE, true);
session.doomEntriesIfExpired = false;
session.asyncOpenCacheEntry(aHref, Ci.nsICache.ACCESS_READ, {
onCacheEntryAvailable: this._onCacheEntryAvailable.bind(this)
});
} catch (ex) {
this._signalError(LOAD_ERROR);
}
},
/**
* The nsICacheListener.onCacheEntryAvailable method implementation used when
* the style sheet source is loaded from the browser cache.
*
* @param nsICacheEntryDescriptor aEntry
* @param nsCacheAccessMode aMode
* @param integer aStatus
*/
_onCacheEntryAvailable: function SE__onCacheEntryAvailable(aEntry, aMode, aStatus)
{
if (!Components.isSuccessCode(aStatus)) {
return this._signalError(LOAD_ERROR);
}
let stream = aEntry.openInputStream(0);
let chunks = []; let chunks = [];
let streamListener = { // nsIStreamListener inherits nsIRequestObserver let streamListener = { // nsIStreamListener inherits nsIRequestObserver
onStartRequest: function (aRequest, aContext, aStatusCode) { onStartRequest: function (aRequest, aContext, aStatusCode) {
}, if (!Components.isSuccessCode(aStatusCode)) {
return this._signalError(LOAD_ERROR);
}
}.bind(this),
onDataAvailable: function (aRequest, aContext, aStream, aOffset, aCount) { onDataAvailable: function (aRequest, aContext, aStream, aOffset, aCount) {
chunks.push(NetUtil.readInputStreamToString(aStream, aCount)); chunks.push(NetUtil.readInputStreamToString(aStream, aCount));
}, },
onStopRequest: function (aRequest, aContext, aStatusCode) { onStopRequest: function (aRequest, aContext, aStatusCode) {
if (!Components.isSuccessCode(aStatusCode)) {
return this._signalError(LOAD_ERROR);
}
this._onSourceLoad(chunks.join("")); this._onSourceLoad(chunks.join(""));
}.bind(this), }.bind(this)
}; };
let head = aEntry.getMetaDataElement("response-head"); channel.loadFlags = channel.LOAD_FROM_CACHE;
if (/^Content-Encoding:\s*gzip/mi.test(head)) { channel.asyncOpen(streamListener, null);
let converter = Cc["@mozilla.org/streamconv;1?from=gzip&to=uncompressed"]
.createInstance(Ci.nsIStreamConverter);
converter.asyncConvertData("gzip", "uncompressed", streamListener, null);
streamListener = converter; // proxy original listener via converter
}
try {
streamListener.onStartRequest(null, null);
while (stream.available()) {
streamListener.onDataAvailable(null, null, stream, 0, stream.available());
}
streamListener.onStopRequest(null, null, 0);
} catch (ex) {
this._signalError(LOAD_ERROR);
} finally {
try {
stream.close();
} catch (ex) {
// swallow (some stream implementations can auto-close at eos)
}
aEntry.close();
}
}, },
/** /**

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

@ -1142,7 +1142,8 @@ TextPropertyEditor.prototype = {
* {function} done: * {function} done:
* Called when input is committed or blurred. Called with * Called when input is committed or blurred. Called with
* current value and a boolean telling the caller whether to * current value and a boolean telling the caller whether to
* commit the change. * commit the change. This function is called after the editor
* has been torn down.
* {string} advanceChars: * {string} advanceChars:
* If any characters in advanceChars are typed, focus will advance * If any characters in advanceChars are typed, focus will advance
* to the next element. * to the next element.
@ -1286,11 +1287,11 @@ InplaceEditor.prototype = {
*/ */
_onBlur: function InplaceEditor_onBlur(aEvent) _onBlur: function InplaceEditor_onBlur(aEvent)
{ {
if (this.done) { let val = this.input.value.trim();
this.done(this.cancelled ? this.initial : this.input.value.trim(),
!this.cancelled);
}
this._clear(); this._clear();
if (this.done) {
this.done(this.cancelled ? this.initial : val, !this.cancelled);
}
}, },
_onKeyPress: function InplaceEditor_onKeyPress(aEvent) _onKeyPress: function InplaceEditor_onKeyPress(aEvent)

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

@ -81,9 +81,9 @@ StyleInspector.prototype = {
this.registrationObject = { this.registrationObject = {
id: "styleinspector", id: "styleinspector",
label: this.l10n("style.highlighter.button.label1"), label: this.l10n("style.highlighter.button.label2"),
tooltiptext: this.l10n("style.highlighter.button.tooltip"), tooltiptext: this.l10n("style.highlighter.button.tooltip"),
accesskey: this.l10n("style.highlighter.accesskey1"), accesskey: this.l10n("style.highlighter.accesskey2"),
context: this, context: this,
get isOpen() isOpen(), get isOpen() isOpen(),
onSelect: this.selectNode, onSelect: this.selectNode,

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

@ -42,3 +42,7 @@
.ruleview-computedlist:not(.styleinspector-open) { .ruleview-computedlist:not(.styleinspector-open) {
display: none; display: none;
} }
.ruleview-code {
direction: ltr;
}

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

@ -271,7 +271,7 @@ Tilt.prototype = {
get enabled() get enabled()
{ {
return (TiltVisualizer.Prefs.enabled && return (TiltVisualizer.Prefs.enabled &&
(TiltVisualizer.Prefs.forceEnabled || TiltGL.isWebGLSupported())); (TiltGL.isWebGLForceEnabled() || TiltGL.isWebGLSupported()));
}, },
/** /**

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

@ -37,7 +37,7 @@
* *
***** END LICENSE BLOCK *****/ ***** END LICENSE BLOCK *****/
/*global Components, TiltMath, TiltUtils, mat4 */ /*global Components, Services, TiltMath, TiltUtils, mat4 */
"use strict"; "use strict";
const Cc = Components.classes; const Cc = Components.classes;
@ -46,6 +46,7 @@ const Cu = Components.utils;
const WEBGL_CONTEXT_NAME = "experimental-webgl"; const WEBGL_CONTEXT_NAME = "experimental-webgl";
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/devtools/TiltMath.jsm"); Cu.import("resource:///modules/devtools/TiltMath.jsm");
Cu.import("resource:///modules/devtools/TiltUtils.jsm"); Cu.import("resource:///modules/devtools/TiltUtils.jsm");
@ -1554,6 +1555,11 @@ TiltGL.ColorShader = {
].join("\n") ].join("\n")
}; };
TiltGL.isWebGLForceEnabled = function TGL_isWebGLForceEnabled()
{
return Services.prefs.getBoolPref("webgl.force-enabled");
};
/** /**
* Tests if the WebGL OpenGL or Angle renderer is available using the * Tests if the WebGL OpenGL or Angle renderer is available using the
* GfxInfo service. * GfxInfo service.

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

@ -1548,20 +1548,6 @@ TiltVisualizer.Prefs = {
this._enabled = value; this._enabled = value;
}, },
/**
* Specifies if Tilt should be enabled even if WebGL may not be available.
*/
get forceEnabled()
{
return this._forceEnabled;
},
set forceEnabled(value)
{
TiltUtils.Preferences.set("force-enabled", "boolean", value);
this._forceEnabled = value;
},
/** /**
* Loads the preferences. * Loads the preferences.
*/ */
@ -1570,7 +1556,6 @@ TiltVisualizer.Prefs = {
let prefs = TiltUtils.Preferences; let prefs = TiltUtils.Preferences;
TiltVisualizer.Prefs._enabled = prefs.get("enabled", "boolean"); TiltVisualizer.Prefs._enabled = prefs.get("enabled", "boolean");
TiltVisualizer.Prefs._forceEnabled = prefs.get("force-enabled", "boolean");
} }
}; };

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

@ -51,6 +51,7 @@ _BROWSER_TEST_FILES = \
browser_tilt_03_tab_switch.js \ browser_tilt_03_tab_switch.js \
browser_tilt_04_initialization.js \ browser_tilt_04_initialization.js \
browser_tilt_05_destruction-esc.js \ browser_tilt_05_destruction-esc.js \
browser_tilt_05_destruction-url.js \
browser_tilt_05_destruction.js \ browser_tilt_05_destruction.js \
browser_tilt_arcball.js \ browser_tilt_arcball.js \
browser_tilt_controller.js \ browser_tilt_controller.js \

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

@ -31,11 +31,6 @@ function test() {
is(Tilt.visualizers[id], null, is(Tilt.visualizers[id], null,
"A instance of the visualizer shouldn't be initialized yet."); "A instance of the visualizer shouldn't be initialized yet.");
is(typeof TiltVisualizer.Prefs.enabled, "boolean",
"The 'enabled' pref should have been loaded by now.");
is(typeof TiltVisualizer.Prefs.forceEnabled, "boolean",
"The 'force-enabled' pref should have been loaded by now.");
}, },
onTiltOpen: function(instance) onTiltOpen: function(instance)
{ {

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

@ -0,0 +1,41 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/*global ok, is, info, waitForExplicitFinish, finish, gBrowser */
/*global isTiltEnabled, isWebGLSupported, createTab, createTilt */
/*global Services, EventUtils, Tilt, TiltUtils, InspectorUI, TILT_DESTROYED */
"use strict";
function test() {
if (!isTiltEnabled()) {
info("Skipping destruction test because Tilt isn't enabled.");
return;
}
if (!isWebGLSupported()) {
info("Skipping destruction test because WebGL isn't supported.");
return;
}
waitForExplicitFinish();
createTab(function() {
createTilt({
onTiltOpen: function()
{
Services.obs.addObserver(cleanup, TILT_DESTROYED, false);
window.content.location = "about:mozilla";
}
});
});
}
function cleanup() {
let id = TiltUtils.getWindowId(gBrowser.selectedBrowser.contentWindow);
is(Tilt.visualizers[id], null,
"The current instance of the visualizer wasn't destroyed properly.");
Services.obs.removeObserver(cleanup, TILT_DESTROYED);
gBrowser.removeCurrentTab();
finish();
}

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

@ -217,8 +217,13 @@ can reach it easily. -->
<!ENTITY inspectButton.label "Inspect"> <!ENTITY inspectButton.label "Inspect">
<!ENTITY inspectButton.accesskey "I"> <!ENTITY inspectButton.accesskey "I">
<!ENTITY inspectCloseButton.tooltiptext "Close Inspector"> <!ENTITY inspectCloseButton.tooltiptext "Close Inspector">
<!ENTITY inspect3DButton.label "3D">
<!ENTITY inspect3DButton.accesskey "M"> <!-- LOCALIZATION NOTE (inspect3DViewButton.label): This button shows an
- alternate view for the Inspector, creating a 3D visualization of the
- webpage. -->
<!ENTITY inspect3DViewButton.label "3D View">
<!ENTITY inspect3DViewButton.accesskey "W">
<!ENTITY inspectStyleButton.label "Style"> <!ENTITY inspectStyleButton.label "Style">
<!ENTITY inspectStyleButton.accesskey "S"> <!ENTITY inspectStyleButton.accesskey "S">

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

@ -33,10 +33,11 @@ rule.sourceElement=element
rule.inheritedSource=Inherited from %S (%S) rule.inheritedSource=Inherited from %S (%S)
# LOCALIZATION NOTE (style.highlighter.button): These strings are used inside # LOCALIZATION NOTE (style.highlighter.button): These strings are used inside
# sidebar of the Highlighter for the style inspector button # sidebar of the Highlighter for the style inspector button.
style.highlighter.button.label1=Properties # "Computed" refers to the Computed Style of the element.
style.highlighter.accesskey1=P style.highlighter.button.label2=Computed
style.highlighter.button.tooltip=Inspect element styles style.highlighter.accesskey2=C
style.highlighter.button.tooltip=Inspect element computed styles
# LOCALIZATION NOTE (helpLinkTitle): For each style property # LOCALIZATION NOTE (helpLinkTitle): For each style property
# the user can hover it and get a help link button which allows one to # the user can hover it and get a help link button which allows one to

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

@ -2003,6 +2003,10 @@ panel[dimmed="true"] {
position: relative; position: relative;
} }
#devtools-sidebar-box {
background-color: -moz-Field;
}
/* Highlighter - toolbar resizers */ /* Highlighter - toolbar resizers */
.inspector-resizer { .inspector-resizer {

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

@ -234,10 +234,6 @@
-moz-margin-end: 5px; -moz-margin-end: 5px;
} }
.ruleview-expander:-moz-locale-dir(rtl) {
background-position: 16px 0;
}
.ruleview-expander.styleinspector-open { .ruleview-expander.styleinspector-open {
background-position: 8px 0; background-position: 8px 0;
} }

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

@ -2738,6 +2738,10 @@ panel[dimmed="true"] {
position: relative; position: relative;
} }
#devtools-sidebar-box {
background-color: -moz-Field;
}
/* Highlighter - toolbar resizers */ /* Highlighter - toolbar resizers */
.inspector-resizer { .inspector-resizer {

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

@ -236,10 +236,6 @@
-moz-margin-end: 5px; -moz-margin-end: 5px;
} }
.ruleview-expander:-moz-locale-dir(rtl) {
background-position: 16px 0;
}
.ruleview-expander.styleinspector-open { .ruleview-expander.styleinspector-open {
background-position: 8px 0; background-position: 8px 0;
} }

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

@ -2683,6 +2683,10 @@ panel[dimmed="true"] {
position: relative; position: relative;
} }
#devtools-sidebar-box {
background-color: -moz-Field;
}
/* Highlighter - toolbar resizers */ /* Highlighter - toolbar resizers */
.inspector-resizer { .inspector-resizer {

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

@ -74,7 +74,7 @@
color: hsl(200,100%,60%) !important; color: hsl(200,100%,60%) !important;
} }
.devtools-toolbarbutton:[checked]:hover:active { .devtools-toolbarbutton[checked]:hover:active {
background-color: hsla(211,68%,6%,.2); background-color: hsla(211,68%,6%,.2);
} }

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

@ -234,10 +234,6 @@
-moz-margin-end: 5px; -moz-margin-end: 5px;
} }
.ruleview-expander:-moz-locale-dir(rtl) {
background-position: 16px 0;
}
.ruleview-expander.styleinspector-open { .ruleview-expander.styleinspector-open {
background-position: 8px 0; background-position: 8px 0;
} }

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

@ -36,6 +36,8 @@
# #
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
from __future__ import with_statement
from optparse import OptionParser from optparse import OptionParser
import logging import logging
import os import os
@ -57,14 +59,13 @@ def digest_file(filename, digest, chunk_size=1024):
if hashlib is not None: if hashlib is not None:
logger.debug('Creating new %s object' % digest) logger.debug('Creating new %s object' % digest)
h = hashlib.new(digest) h = hashlib.new(digest)
f = open(filename, "rb") with open(filename, 'rb') as f:
while True: while True:
data = f.read(chunk_size) data = f.read(chunk_size)
if not data: if not data:
logger.debug('Finished reading in file') logger.debug('Finished reading in file')
break break
h.update(data) h.update(data)
f.close()
hash = h.hexdigest() hash = h.hexdigest()
logger.debug('Hash for %s is %s' % (filename, hash)) logger.debug('Hash for %s is %s' % (filename, hash))
return hash return hash
@ -75,15 +76,15 @@ def digest_file(filename, digest, chunk_size=1024):
return None return None
def process_files(files, output_filename, digest, strip): def process_files(files, output_filename, digests, strip):
'''This function takes a list of file names, 'files'. It will then '''This function takes a list of file names, 'files'. It will then
compute the checksum for each of the files by opening the files. compute the checksum for each of the files by opening the files.
Once each file is read and its checksum is computed, this function Once each file is read and its checksum is computed, this function
will write the information to the file specified by 'output_filename'. will write the information to the file specified by 'output_filename'.
The path written in the output file will have anything specified by 'strip' The path written in the output file will have anything specified by 'strip'
removed from the path. The output file is closed before returning nothing removed from the path. The output file is closed before returning nothing
The algorithm to compute checksums with can be specified by 'digest' The algorithm to compute checksums with can be specified by 'digests'
and needs to be a valid OpenSSL algorithm. and needs to be a list of valid OpenSSL algorithms.
The output file is written in the format: The output file is written in the format:
<hash> <algorithm> <filesize> <filepath> <hash> <algorithm> <filesize> <filepath>
@ -97,25 +98,25 @@ def process_files(files, output_filename, digest, strip):
output_filename) output_filename)
else: else:
logger.debug('Creating a new checksums file "%s"' % output_filename) logger.debug('Creating a new checksums file "%s"' % output_filename)
output = open(output_filename, 'w+') with open(output_filename, 'w+') as output:
for file in files: for file in files:
if os.path.isdir(file): if os.path.isdir(file):
logger.warn('%s is a directory, skipping' % file) logger.warn('%s is a directory, skipping' % file)
else:
hash = digest_file(file, digest)
if hash is None:
logger.warn('Unable to generate a hash for %s. ' +
'Using NOHASH as fallback' % file)
hash = 'NOHASH'
if file.startswith(strip):
short_file = file[len(strip):]
short_file = short_file.lstrip('/')
else: else:
short_file = file for digest in digests:
print >>output, '%s %s %s %s' % (hash, digest, hash = digest_file(file, digest)
os.path.getsize(file), if hash is None:
short_file) logger.warn('Unable to generate a hash for %s. ' +
output.close() 'Skipping.' % file)
continue
if file.startswith(strip):
short_file = file[len(strip):]
short_file = short_file.lstrip('/')
else:
short_file = file
print >>output, '%s %s %s %s' % (hash, digest,
os.path.getsize(file),
short_file)
def setup_logging(level=logging.DEBUG): def setup_logging(level=logging.DEBUG):
'''This function sets up the logging module using a speficiable logging '''This function sets up the logging module using a speficiable logging
@ -141,7 +142,7 @@ def main():
# Parse command line arguments # Parse command line arguments
parser = OptionParser() parser = OptionParser()
parser.add_option('-d', '--digest', help='checksum algorithm to use', parser.add_option('-d', '--digest', help='checksum algorithm to use',
action='store', dest='digest', default='sha1') action='append', dest='digests')
parser.add_option('-o', '--output', help='output file to use', parser.add_option('-o', '--output', help='output file to use',
action='store', dest='outfile', default='checksums') action='store', dest='outfile', default='checksums')
parser.add_option('-v', '--verbose', parser.add_option('-v', '--verbose',
@ -167,11 +168,14 @@ def main():
logger = logging.getLogger('checksums.py') logger = logging.getLogger('checksums.py')
# Validate the digest type to use # Validate the digest type to use
if not options.digests:
options.digests = ['sha1']
try: try:
hashlib.new(options.digest) for digest in options.digests:
hashlib.new(digest)
except ValueError, ve: except ValueError, ve:
logger.error('Could not create a "%s" hash object (%s)' % logger.error('Could not create a "%s" hash object (%s)' %
(options.digest, ve.args[0])) (digest, ve.args[0]))
exit(1) exit(1)
# Validate the files to checksum # Validate the files to checksum
@ -181,7 +185,7 @@ def main():
files.append(i) files.append(i)
else: else:
logger.info('File "%s" was not found on the filesystem' % i) logger.info('File "%s" was not found on the filesystem' % i)
process_files(files, options.outfile, options.digest, options.strip) process_files(files, options.outfile, options.digests, options.strip)
if __name__ == '__main__': if __name__ == '__main__':
main() main()

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

@ -4273,15 +4273,21 @@ static const char* kNSURIs[] = {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement)
if (NS_UNLIKELY(cb.WantDebugInfo())) { if (NS_UNLIKELY(cb.WantDebugInfo())) {
char name[72]; char name[512];
PRUint32 nsid = tmp->GetNameSpaceID(); PRUint32 nsid = tmp->GetNameSpaceID();
nsAtomCString localName(tmp->NodeInfo()->NameAtom()); nsAtomCString localName(tmp->NodeInfo()->NameAtom());
nsCAutoString uri;
if (tmp->OwnerDoc()->GetDocumentURI()) {
tmp->OwnerDoc()->GetDocumentURI()->GetSpec(uri);
}
if (nsid < ArrayLength(kNSURIs)) { if (nsid < ArrayLength(kNSURIs)) {
PR_snprintf(name, sizeof(name), "nsGenericElement%s %s", kNSURIs[nsid], PR_snprintf(name, sizeof(name), "nsGenericElement%s %s %s", kNSURIs[nsid],
localName.get()); localName.get(), uri.get());
} }
else { else {
PR_snprintf(name, sizeof(name), "nsGenericElement %s", localName.get()); PR_snprintf(name, sizeof(name), "nsGenericElement %s %s",
localName.get(), uri.get());
} }
cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsGenericElement), cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsGenericElement),
name); name);

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

@ -22,8 +22,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=350471
/** Test for Bug 350471 **/ /** Test for Bug 350471 **/
// This test depends on general.smoothScroll being off.
const minLineHeight = 10, maxLineHeight = 20; const minLineHeight = 10, maxLineHeight = 20;
function between(x, min, max) (min <= max) ? (min <= x && x <= max) : (max <= x && x <= min); function between(x, min, max) (min <= max) ? (min <= x && x <= max) : (max <= x && x <= min);
@ -228,6 +226,7 @@ function initPrefs()
// Disables the app level scroll acceleration // Disables the app level scroll acceleration
prefSvc.setIntPref("mousewheel.acceleration.start", -1); prefSvc.setIntPref("mousewheel.acceleration.start", -1);
prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false); prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false);
prefSvc.setBoolPref("general.smoothScroll", false);
} }
function clearPrefs() function clearPrefs()
@ -236,10 +235,9 @@ function clearPrefs()
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]. var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2); getService(Components.interfaces.nsIPrefBranch2);
if (prefSvc.prefHasUserValue("mousewheel.acceleration.start")) prefSvc.clearUserPref("mousewheel.acceleration.start");
prefSvc.clearUserPref("mousewheel.acceleration.start"); prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
if (prefSvc.prefHasUserValue("mousewheel.system_scroll_override_on_root_content.enabled")) prefSvc.clearUserPref("general.smoothScroll");
prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
} }
window.onload = function () { window.onload = function () {

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

@ -20,8 +20,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=574663
/** Test for Bug 574663 **/ /** Test for Bug 574663 **/
// This test depends on general.smoothScroll being off.
function sendTouchpadScrollMotion(scrollbox, direction, ctrl, momentum) { function sendTouchpadScrollMotion(scrollbox, direction, ctrl, momentum) {
var win = scrollbox.ownerDocument.defaultView; var win = scrollbox.ownerDocument.defaultView;
let event = { let event = {
@ -107,6 +105,7 @@ function initPrefs()
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]. var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2); getService(Components.interfaces.nsIPrefBranch2);
prefSvc.setBoolPref("general.smoothScroll", false);
// Disables the app level scroll acceleration // Disables the app level scroll acceleration
prefSvc.setIntPref("mousewheel.acceleration.start", -1); prefSvc.setIntPref("mousewheel.acceleration.start", -1);
prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false); prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false);
@ -120,12 +119,10 @@ function clearPrefs()
var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]. var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2); getService(Components.interfaces.nsIPrefBranch2);
if (prefSvc.prefHasUserValue("mousewheel.acceleration.start")) prefSvc.clearUserPref("general.smoothScroll");
prefSvc.clearUserPref("mousewheel.acceleration.start"); prefSvc.clearUserPref("mousewheel.acceleration.start");
if (prefSvc.prefHasUserValue("mousewheel.system_scroll_override_on_root_content.enabled")) prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled"); prefSvc.clearUserPref("mousewheel.withcontrolkey.action");
if (prefSvc.prefHasUserValue("mousewheel.withcontrolkey.action"))
prefSvc.clearUserPref("mousewheel.withcontrolkey.action");
} }
window.onload = function () { window.onload = function () {

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

@ -613,31 +613,6 @@ ImageDocument::HandleEvent(nsIDOMEvent* aEvent)
ShrinkToFit(); ShrinkToFit();
} }
} }
else if (eventType.EqualsLiteral("keypress")) {
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
PRUint32 charCode;
bool ctrlKey, metaKey, altKey;
keyEvent->GetCharCode(&charCode);
keyEvent->GetCtrlKey(&ctrlKey);
keyEvent->GetMetaKey(&metaKey);
keyEvent->GetAltKey(&altKey);
// plus key
if (charCode == 0x2B && !ctrlKey && !metaKey && !altKey) {
mShouldResize = false;
if (mImageIsResized) {
ResetZoomLevel();
RestoreImage();
}
}
// minus key
else if (charCode == 0x2D && !ctrlKey && !metaKey && !altKey) {
mShouldResize = true;
if (mImageIsOverflowing) {
ResetZoomLevel();
ShrinkToFit();
}
}
}
return NS_OK; return NS_OK;
} }

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

@ -43,7 +43,9 @@ window.onload = runTest;
var testWindow; var testWindow;
var testNum = 0; var testNum = 0;
var smoothScrollPref = "general.smoothScroll";
function runTest() { function runTest() {
SpecialPowers.setBoolPref(smoothScrollPref, false);
testWindow = window.open(gTallRedBoxURI, "testWindow", "width=300,height=300,location=yes,scrollbars=yes"); testWindow = window.open(gTallRedBoxURI, "testWindow", "width=300,height=300,location=yes,scrollbars=yes");
} }
@ -122,6 +124,7 @@ var step3 =function() {
"Page2Again: Ensure we can still scroll."); "Page2Again: Ensure we can still scroll.");
testWindow.close(); testWindow.close();
SpecialPowers.clearUserPref(smoothScrollPref);
window.SimpleTest.finish(); window.SimpleTest.finish();
}, true); }, true);
sendKey('DOWN', testWindow); sendKey('DOWN', testWindow);

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

@ -1404,8 +1404,9 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsGlobalWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGlobalWindow) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGlobalWindow)
if (tmp->mDoc && nsCCUncollectableMarker::InGeneration( if ((tmp->mDoc && nsCCUncollectableMarker::InGeneration(
cb, tmp->mDoc->GetMarkedCCGeneration())) { cb, tmp->mDoc->GetMarkedCCGeneration())) ||
(nsCCUncollectableMarker::sGeneration && tmp->IsBlack())) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE; return NS_SUCCESS_INTERRUPTED_TRAVERSE;
} }

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

@ -9,6 +9,10 @@
<script class="testbody" type="application/javascript"> <script class="testbody" type="application/javascript">
<![CDATA[ <![CDATA[
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("general.smoothScroll", false);
function runTest() { function runTest() {
var tests = execTests(); var tests = execTests();
function execNext() { function execNext() {
@ -186,16 +190,14 @@ function execTests() {
is(testPageSelectCommand("cmd_selectPageUp", 0), 22 - lineNum, "cmd_selectPageUp"); is(testPageSelectCommand("cmd_selectPageUp", 0), 22 - lineNum, "cmd_selectPageUp");
} }
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var origPrefValue = prefs.getBoolPref("layout.word_select.eat_space_to_next_word");
try { try {
prefs.setBoolPref("layout.word_select.eat_space_to_next_word", false); prefs.setBoolPref("layout.word_select.eat_space_to_next_word", false);
runSelectionTests(body, 1); runSelectionTests(body, 1);
prefs.setBoolPref("layout.word_select.eat_space_to_next_word", true); prefs.setBoolPref("layout.word_select.eat_space_to_next_word", true);
runSelectionTests(node(2), 0); runSelectionTests(node(2), 0);
} finally { } finally {
prefs.setBoolPref("layout.word_select.eat_space_to_next_word", origPrefValue); prefs.clearUserPref("general.smoothScroll");
prefs.clearUserPref("layout.word_select.eat_space_to_next_word");
} }
SimpleTest.finish(); SimpleTest.finish();

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

@ -19,6 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549262
/** Test for Bug 549262 **/ /** Test for Bug 549262 **/
var smoothScrollPref = "general.smoothScroll";
SpecialPowers.setBoolPref(smoothScrollPref, false);
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
var win = window.open("file_bug549262.html", "_blank", var win = window.open("file_bug549262.html", "_blank",
"width=600,height=600,scrollbars=yes"); "width=600,height=600,scrollbars=yes");
@ -90,6 +92,7 @@ SimpleTest.waitForFocus(function() {
is(win.getSelection().focusOffset, ed.textContent.length, "Selection should be moved to the end"); is(win.getSelection().focusOffset, ed.textContent.length, "Selection should be moved to the end");
win.close(); win.close();
SpecialPowers.clearUserPref(smoothScrollPref);
SimpleTest.finish(); SimpleTest.finish();
}, 0); }, 0);
}, 0); }, 0);

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

@ -34,11 +34,13 @@ addLoadEvent(function() {
is(iframe.contentWindow.scrollY, 0, "Sanity check"); is(iframe.contentWindow.scrollY, 0, "Sanity check");
var rect = iframe.getBoundingClientRect(); var rect = iframe.getBoundingClientRect();
setTimeout(function() { setTimeout(function() {
synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {}); var onscroll = function () {
setTimeout(function() { iframe.contentWindow.removeEventListener("scroll", onscroll, false);
isnot(iframe.contentWindow.scrollY, 0, "The scrollbar should work"); isnot(iframe.contentWindow.scrollY, 0, "The scrollbar should work");
SimpleTest.finish(); SimpleTest.finish();
}, 0); }
iframe.contentWindow.addEventListener("scroll", onscroll, false);
synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
}, 0); }, 0);
}); });

0
gfx/2d/ScaledFontSkia.cpp Executable file → Normal file
Просмотреть файл

0
gfx/2d/ScaledFontSkia.h Executable file → Normal file
Просмотреть файл

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

@ -43,21 +43,39 @@ while (windows.hasMoreElements()) {
var osName = sysInfo.getProperty("name"); var osName = sysInfo.getProperty("name");
switch(osName) switch(osName)
{ {
case "Darwin": case "Darwin": // Mac OS X.
// We only enable OpenGL layers on machines that don't support QuickDraw // We only enable OpenGL layers on machines that don't support QuickDraw
// plugins. x86-64 architecture is a good proxy for this plugin support. // plugins. x86-64 architecture is a good proxy for this plugin support.
if (sysInfo.getProperty("arch") != "x86-64") { if (sysInfo.getProperty("arch") != "x86-64") {
is(acceleratedWindows, 0, "Acceleration not supported on x86 OS X"); is(acceleratedWindows, 0, "Acceleration not supported on x86 OS X");
} else { } else {
// Workaround for SeaMonkey tinderboxes which don't support acceleration.
if (navigator.userAgent.match(/ SeaMonkey\//)) {
if (acceleratedWindows == 0) {
todo(false, "Acceleration not supported on x86-64 OS X" +
" (This is expected on SeaMonkey (tinderboxes).)");
break;
}
}
isnot(acceleratedWindows, 0, "Acceleration enabled on x86-64 OS X"); isnot(acceleratedWindows, 0, "Acceleration enabled on x86-64 OS X");
} }
break; break;
case "Windows_NT": case "Windows_NT": // Windows.
var version = parseFloat(sysInfo.getProperty("version")); var version = parseFloat(sysInfo.getProperty("version"));
if (version == 5.0) { if (version == 5.0) {
is(acceleratedWindows, 0, "Acceleration not supported on Windows 2000"); is(acceleratedWindows, 0, "Acceleration not supported on Windows 2000");
} else { } else {
// Workaround for SeaMonkey tinderboxes which don't support acceleration.
if (navigator.userAgent.match(/ SeaMonkey\//)) {
if (acceleratedWindows == 0) {
todo(false, "Acceleration not supported on Windows XP or newer" +
" (This is expected on SeaMonkey (tinderboxes).)");
break;
}
}
isnot(acceleratedWindows, 0, "Acceleration enabled on Windows XP or newer"); isnot(acceleratedWindows, 0, "Acceleration enabled on Windows XP or newer");
} }
@ -71,7 +89,7 @@ switch(osName)
} }
break; break;
default: default: // Linux and others.
is(acceleratedWindows, 0, "Acceleration not supported on '" + osName + "'"); is(acceleratedWindows, 0, "Acceleration not supported on '" + osName + "'");
} }

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

@ -12,7 +12,7 @@
area.focus(); area.focus();
sendKey("W"); // enter a character sendKey("W"); // enter a character
sendKey("VK_BACK_SPACE"); sendKey("BACK_SPACE");
</script> </script>
</body> </body>
</html> </html>

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

@ -42,9 +42,12 @@ function runTests() {
function finish() { function finish() {
// assert that scroll top is now less than before // assert that scroll top is now less than before
ok(scrollTopBefore > doc.body.scrollTop, "pressing up arrow should scroll up"); ok(scrollTopBefore > doc.body.scrollTop, "pressing up arrow should scroll up");
SpecialPowers.clearUserPref(smoothScrollPref);
SimpleTest.finish(); SimpleTest.finish();
} }
var smoothScrollPref = "general.smoothScroll";
SpecialPowers.setBoolPref(smoothScrollPref, false);
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(runTests); SimpleTest.waitForFocus(runTests);
</script> </script>

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

@ -49,6 +49,8 @@ This is bad during printing, it means tall image frames won't know
the size of the paper and cannot break into continuations along the size of the paper and cannot break into continuations along
multiple pages. */ multiple pages. */
img { img {
color: #eee;
text-align: center;
display: block; display: block;
position: absolute; position: absolute;
margin: auto; margin: auto;

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

@ -73,6 +73,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=378028
/** Test for Bug 378028 **/ /** Test for Bug 378028 **/
/* and for Bug 350471 **/ /* and for Bug 350471 **/
var smoothScrollPref = "general.smoothScroll";
SpecialPowers.setBoolPref(smoothScrollPref, false);
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
/* There are three kinds of scroll events: /* There are three kinds of scroll events:
@ -230,6 +232,7 @@ function runTests()
testListbox("listbox"); testListbox("listbox");
testArrowScrollbox("hscrollbox"); testArrowScrollbox("hscrollbox");
testArrowScrollbox("vscrollbox"); testArrowScrollbox("vscrollbox");
SpecialPowers.clearUserPref(smoothScrollPref);
SimpleTest.finish(); SimpleTest.finish();
}); });
} }

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

@ -904,7 +904,7 @@ ESCAPE_SPACE = $(subst $(space),\$(space),$(1))
# This variable defines which OpenSSL algorithm to use to # This variable defines which OpenSSL algorithm to use to
# generate checksums for files that we upload # generate checksums for files that we upload
CHECKSUM_ALGORITHM = 'sha512' CHECKSUM_ALGORITHM_PARAM = -d sha512 -d md5 -d sha1
# This variable defines where the checksum file will be located # This variable defines where the checksum file will be located
CHECKSUM_FILE = "$(DIST)/$(PKG_PATH)/$(CHECKSUMS_FILE_BASENAME).checksums" CHECKSUM_FILE = "$(DIST)/$(PKG_PATH)/$(CHECKSUMS_FILE_BASENAME).checksums"
@ -941,7 +941,7 @@ checksum:
mkdir -p `dirname $(CHECKSUM_FILE)` mkdir -p `dirname $(CHECKSUM_FILE)`
@$(PYTHON) $(MOZILLA_DIR)/build/checksums.py \ @$(PYTHON) $(MOZILLA_DIR)/build/checksums.py \
-o $(CHECKSUM_FILE) \ -o $(CHECKSUM_FILE) \
-d $(CHECKSUM_ALGORITHM) \ $(CHECKSUM_ALGORITHM_PARAM) \
-s $(call QUOTED_WILDCARD,$(DIST)) \ -s $(call QUOTED_WILDCARD,$(DIST)) \
$(UPLOAD_FILES) $(UPLOAD_FILES)
@echo "CHECKSUM FILE START" @echo "CHECKSUM FILE START"

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

@ -78,9 +78,12 @@ var gIgnoreScrollEvent = true;
var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"]. var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2); getService(Components.interfaces.nsIPrefBranch2);
const kPrefSmoothScroll = "general.smoothScroll";
const kPrefNameTimeout = "mousewheel.transaction.timeout"; const kPrefNameTimeout = "mousewheel.transaction.timeout";
const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout); const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
var gTimeout = kDefaultTimeout; var gTimeout = kDefaultTimeout;
gBody.addEventListener("MozMouseScrollFailed", onMouseScrollFailed, false); gBody.addEventListener("MozMouseScrollFailed", onMouseScrollFailed, false);
@ -117,6 +120,7 @@ function onunload()
{ {
resetTimeoutPrefs(); resetTimeoutPrefs();
disableNonTestMouseEvents(false); disableNonTestMouseEvents(false);
gPrefSvc.clearUserPref(kPrefSmoothScroll);
window.opener.wrappedJSObject.SimpleTest.finish(); window.opener.wrappedJSObject.SimpleTest.finish();
} }

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

@ -110,11 +110,14 @@ var gTimer;
var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"]. var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch2); getService(Components.interfaces.nsIPrefBranch2);
const kPrefSmoothScroll = "general.smoothScroll";
const kPrefNameTimeout = "mousewheel.transaction.timeout"; const kPrefNameTimeout = "mousewheel.transaction.timeout";
const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay"; const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay";
const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout); const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay) const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay);
gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
var gTimeout, gIgnoreMoveDelay; var gTimeout, gIgnoreMoveDelay;
var gEnoughForTimeout, gEnoughForIgnoreMoveDelay; var gEnoughForTimeout, gEnoughForIgnoreMoveDelay;
@ -171,6 +174,7 @@ function onload()
function onunload() function onunload()
{ {
resetTimeoutPrefs(); resetTimeoutPrefs();
gPrefSvc.clearUserPref(kPrefSmoothScroll);
disableNonTestMouseEvents(false); disableNonTestMouseEvents(false);
window.opener.wrappedJSObject.SimpleTest.finish(); window.opener.wrappedJSObject.SimpleTest.finish();
} }