merge backout

This commit is contained in:
Mats Palmgren 2014-04-17 15:10:44 +00:00
commit 307fabfc74
58 changed files with 570 additions and 187 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 916012 moves definition from one WEBIDL_FILE to another (Bug 979886)
Bug 995411 moves some files around in gfx/layers and widget/xpwidget

View File

@ -30,10 +30,8 @@ GStreamerFormatHelper* GStreamerFormatHelper::Instance() {
}
void GStreamerFormatHelper::Shutdown() {
if (gInstance) {
delete gInstance;
gInstance = nullptr;
}
delete gInstance;
gInstance = nullptr;
}
static char const *const sContainers[6][2] = {

View File

@ -180,10 +180,8 @@ void AudioOutput::Close()
AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__));
mTrack.clear();
if (mCallbackData) {
delete mCallbackData;
mCallbackData = NULL;
}
delete mCallbackData;
mCallbackData = nullptr;
}
// static

View File

@ -323,10 +323,8 @@ MediaPluginHost *GetMediaPluginHost()
void MediaPluginHost::Shutdown()
{
if (sMediaPluginHost) {
delete sMediaPluginHost;
sMediaPluginHost = nullptr;
}
delete sMediaPluginHost;
sMediaPluginHost = nullptr;
}
} // namespace mozilla

View File

@ -468,10 +468,7 @@ MediaEngineWebRTCAudioSource::Shutdown()
mVoENetwork->DeRegisterExternalTransport(mChannel);
}
if (mNullTransport) {
delete mNullTransport;
}
delete mNullTransport;
return;
}
@ -491,9 +488,7 @@ MediaEngineWebRTCAudioSource::Shutdown()
mVoENetwork->DeRegisterExternalTransport(mChannel);
}
if (mNullTransport) {
delete mNullTransport;
}
delete mNullTransport;
mVoEProcessing = nullptr;
mVoENetwork = nullptr;

View File

@ -1,29 +1,29 @@
fails-if(Android||B2G) == empty-1.xul empty-ref.xul # bug 783658
!= empty-2.xul empty-ref.xul
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == empty-1.xul empty-ref.xul # bug 783658
skip-if(B2G&&browserIsRemote) != empty-2.xul empty-ref.xul
# There is no way to simulate an autocomplete textbox in windows XP/Vista/7 default theme using CSS.
# Therefore, the equlity tests below should be marked as failing.
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == autocomplete-1.xul autocomplete-ref.xul # bug 783658
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == emptyautocomplete-1.xul emptyautocomplete-ref.xul # bug 783658
!= emptymultiline-1.xul emptymultiline-ref.xul
fails-if(Android||B2G) == emptymultiline-2.xul emptymultiline-ref.xul # bug 783658
fails-if(Android||B2G) == emptytextbox-1.xul emptytextbox-ref.xul # bug 783658
fails-if(Android||B2G) == emptytextbox-2.xul emptytextbox-ref.xul # bug 783658
!= emptytextbox-3.xul emptytextbox-ref.xul
!= emptytextbox-4.xul emptytextbox-ref.xul
fails-if(Android||B2G) == emptytextbox-5.xul emptytextbox-ref.xul # bug 783658
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == autocomplete-1.xul autocomplete-ref.xul # bug 783658
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == emptyautocomplete-1.xul emptyautocomplete-ref.xul # bug 783658
skip-if(B2G&&browserIsRemote) != emptymultiline-1.xul emptymultiline-ref.xul
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptymultiline-2.xul emptymultiline-ref.xul # bug 783658
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptytextbox-1.xul emptytextbox-ref.xul # bug 783658
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptytextbox-2.xul emptytextbox-ref.xul # bug 783658
skip-if(B2G&&browserIsRemote) != emptytextbox-3.xul emptytextbox-ref.xul
skip-if(B2G&&browserIsRemote) != emptytextbox-4.xul emptytextbox-ref.xul
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptytextbox-5.xul emptytextbox-ref.xul # bug 783658
# There is no way to simulate a number textbox in windows XP/Vista/7 default theme using CSS.
# Therefore, the equlity tests below should be marked as failing.
!= number-1.xul number-ref.xul
!= number-2.xul number-ref.xul
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == number-3.xul number-ref.xul # bug 783658
!= number-4.xul number-ref.xul
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == number-5.xul number-ref.xul # bug 783658
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == numberwithvalue-1.xul numberwithvalue-ref.xul # bug 783658
fails-if(Android||B2G) == passwd-1.xul passwd-ref.xul # bug 783658
fails-if(Android||B2G) == passwd-2.xul passwd-ref.xul # bug 783658
!= passwd-3.xul passwd-ref.xul
fails-if(Android||B2G) == plain-1.xul plain-ref.xul # bug 783658
fails-if(Android||B2G) == textbox-1.xul textbox-ref.xul
!= textbox-disabled.xul textbox-ref.xul
skip-if(B2G&&browserIsRemote) != number-1.xul number-ref.xul
skip-if(B2G&&browserIsRemote) != number-2.xul number-ref.xul
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == number-3.xul number-ref.xul # bug 783658
skip-if(B2G&&browserIsRemote) != number-4.xul number-ref.xul
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == number-5.xul number-ref.xul # bug 783658
fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == numberwithvalue-1.xul numberwithvalue-ref.xul # bug 783658
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == passwd-1.xul passwd-ref.xul # bug 783658
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == passwd-2.xul passwd-ref.xul # bug 783658
skip-if(B2G&&browserIsRemote) != passwd-3.xul passwd-ref.xul
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == plain-1.xul plain-ref.xul # bug 783658
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == textbox-1.xul textbox-ref.xul
skip-if(B2G&&browserIsRemote) != textbox-disabled.xul textbox-ref.xul
# Read-only textboxes look like normal textboxes in windows Vista/7 default theme
fails-if(windowsDefaultTheme&&/^Windows\x20NT\x206\.[012]/.test(http.oscpu)) != textbox-readonly.xul textbox-ref.xul
fails-if(windowsDefaultTheme&&/^Windows\x20NT\x206\.[012]/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) != textbox-readonly.xul textbox-ref.xul

View File

@ -830,13 +830,13 @@ gfxMacPlatformFontList::RegisteredFontsChangedNotificationCallback(CFNotificatio
return;
}
gfxMacPlatformFontList* fl = static_cast<gfxMacPlatformFontList*>(observer);
// xxx - should be carefully pruning the list of fonts, not rebuilding it from scratch
static_cast<gfxMacPlatformFontList*>(observer)->UpdateFontList();
fl->UpdateFontList();
// modify a preference that will trigger reflow everywhere
static const char kPrefName[] = "font.internaluseonly.changed";
bool fontInternalChange = Preferences::GetBool(kPrefName, false);
Preferences::SetBool(kPrefName, !fontInternalChange);
fl->ForceGlobalReflow();
}
gfxFontEntry*

View File

@ -9,6 +9,7 @@
#include "prlog.h"
#include "gfxPlatformFontList.h"
#include "gfxUserFontSet.h"
#include "nsUnicharUtils.h"
#include "nsUnicodeRange.h"
@ -303,6 +304,21 @@ gfxPlatformFontList::ResolveFontName(const nsAString& aFontName, nsAString& aRes
return false;
}
static PLDHashOperator
RebuildLocalFonts(nsPtrHashKey<gfxUserFontSet>* aKey,
void* aClosure)
{
aKey->GetKey()->RebuildLocalRules();
return PL_DHASH_NEXT;
}
void
gfxPlatformFontList::UpdateFontList()
{
InitFontList();
mUserFontSetList.EnumerateEntries(RebuildLocalFonts, nullptr);
}
struct FontListData {
FontListData(nsIAtom *aLangGroup,
const nsACString& aGenericFamily,
@ -797,6 +813,11 @@ gfxPlatformFontList::LoadFontInfo()
}
#endif
if (done) {
mOtherFamilyNamesInitialized = true;
mFaceNamesInitialized = true;
}
return done;
}
@ -820,8 +841,6 @@ gfxPlatformFontList::CleanupLoader()
}
#endif
mOtherFamilyNamesInitialized = true;
mFaceNamesInitialized = true;
gfxFontInfoLoader::CleanupLoader();
}
@ -839,6 +858,15 @@ gfxPlatformFontList::GetPrefsAndStartLoader()
StartLoader(delay, interval);
}
void
gfxPlatformFontList::ForceGlobalReflow()
{
// modify a preference that will trigger reflow everywhere
static const char kPrefName[] = "font.internaluseonly.changed";
bool fontInternalChange = Preferences::GetBool(kPrefName, false);
Preferences::SetBool(kPrefName, !fontInternalChange);
}
// Support for memory reporting
static size_t

View File

@ -82,6 +82,8 @@ struct FontListSizes {
uint32_t mCharMapsSize; // memory used for cmap coverage info
};
class gfxUserFontSet;
class gfxPlatformFontList : public gfxFontInfoLoader
{
public:
@ -115,7 +117,7 @@ public:
virtual bool ResolveFontName(const nsAString& aFontName,
nsAString& aResolvedFontName);
void UpdateFontList() { InitFontList(); }
void UpdateFontList();
void ClearPrefFonts() { mPrefFonts.Clear(); }
@ -178,6 +180,15 @@ public:
// remove the cmap from the shared cmap set
void RemoveCmap(const gfxCharacterMap *aCharMap);
// keep track of userfont sets to notify when global fontlist changes occur
void AddUserFontSet(gfxUserFontSet *aUserFontSet) {
mUserFontSetList.PutEntry(aUserFontSet);
}
void RemoveUserFontSet(gfxUserFontSet *aUserFontSet) {
mUserFontSetList.RemoveEntry(aUserFontSet);
}
protected:
class MemoryReporter MOZ_FINAL : public nsIMemoryReporter
{
@ -254,6 +265,9 @@ protected:
// read the loader initialization prefs, and start it
void GetPrefsAndStartLoader();
// for font list changes that affect all documents
void ForceGlobalReflow();
// used by memory reporter to accumulate sizes of family names in the hash
static size_t
SizeOfFamilyNameEntryExcludingThis(const nsAString& aKey,
@ -305,6 +319,8 @@ protected:
uint32_t mStartIndex;
uint32_t mIncrement;
uint32_t mNumFamilies;
nsTHashtable<nsPtrHashKey<gfxUserFontSet> > mUserFontSetList;
};
#endif /* GFXPLATFORMFONTLIST_H_ */

View File

@ -18,6 +18,7 @@
#include "gfxFontConstants.h"
#include "mozilla/Services.h"
#include "mozilla/gfx/2D.h"
#include "gfxPlatformFontList.h"
#include "opentype-sanitiser.h"
#include "ots-memory-stream.h"
@ -102,13 +103,21 @@ gfxProxyFontEntry::CreateFontInstance(const gfxFontStyle *aFontStyle, bool aNeed
}
gfxUserFontSet::gfxUserFontSet()
: mFontFamilies(5)
: mFontFamilies(5), mLocalRulesUsed(false)
{
IncrementGeneration();
gfxPlatformFontList *fp = gfxPlatformFontList::PlatformFontList();
if (fp) {
fp->AddUserFontSet(this);
}
}
gfxUserFontSet::~gfxUserFontSet()
{
gfxPlatformFontList *fp = gfxPlatformFontList::PlatformFontList();
if (fp) {
fp->RemoveUserFontSet(this);
}
}
gfxFontEntry*
@ -539,6 +548,7 @@ gfxUserFontSet::LoadNext(gfxMixedFontFamily *aFamily,
gfxFontEntry *fe =
gfxPlatform::GetPlatform()->LookupLocalFont(aProxyEntry,
currSrc.mLocalName);
mLocalRulesUsed = true;
if (fe) {
LOG(("userfonts (%p) [src %d] loaded local: (%s) for (%s) gen: %8.8x\n",
this, aProxyEntry->mSrcIndex,
@ -664,6 +674,13 @@ gfxUserFontSet::IncrementGeneration()
mGeneration = sFontSetGeneration;
}
void
gfxUserFontSet::RebuildLocalRules()
{
if (mLocalRulesUsed) {
DoRebuildUserFontSet();
}
}
gfxFontEntry*
gfxUserFontSet::LoadFont(gfxMixedFontFamily *aFamily,

View File

@ -242,6 +242,9 @@ public:
// increment the generation on font load
void IncrementGeneration();
// rebuild if local rules have been used
void RebuildLocalRules();
class UserFontCache {
public:
// Record a loaded user-font in the cache. This requires that the
@ -418,11 +421,17 @@ protected:
static bool OTSMessage(void *aUserData, const char *format, ...);
// helper method for performing the actual userfont set rebuild
virtual void DoRebuildUserFontSet() = 0;
// font families defined by @font-face rules
nsRefPtrHashtable<nsStringHashKey, gfxMixedFontFamily> mFontFamilies;
uint64_t mGeneration;
// true when local names have been looked up, false otherwise
bool mLocalRulesUsed;
static PRLogModuleInfo* GetUserFontsLog();
private:

View File

@ -8,5 +8,5 @@
# Tests for RLE4 with an invalid BPP
== wrapper.html?invalid-compression-RLE4.bmp about:blank
# Tests for RLE8 with an invalid BPP
== wrapper.html?invalid-compression-RLE8.bmp about:blank
random-if(B2G) == wrapper.html?invalid-compression-RLE8.bmp about:blank # Bug 921207

View File

@ -237,6 +237,33 @@ if (isAsmJSCompilationAvailable() && isCachingEnabled()) {
})();
/* Implicit "use strict" context */
(function() {
var funcHeader = 'function (glob, ffi, heap) {',
funcBody = '\n"use asm";\n\
function g() {}\n\
return g;\n\n'
funcFooter = '}',
funcSource = funcHeader + funcBody + funcFooter
useStrict = '\n"use strict";\n';
var f4 = eval("\"use strict\";\n(" + funcSource + ")");
var expectedToString = funcHeader + useStrict + funcBody + funcFooter
var expectedToSource = '(' + expectedToString + ')'
assertEq(f4.toString(), expectedToString);
assertEq(f4.toSource(), expectedToSource);
if (isAsmJSCompilationAvailable() && isCachingEnabled()) {
var f5 = eval("\"use strict\";\n(" + funcSource + ")");
assertEq(isAsmJSModuleLoadedFromCache(f5), true);
assertEq(f5.toString(), expectedToString);
assertEq(f5.toSource(), expectedToSource);
}
})();
/* Functions */
(function() {

View File

@ -1143,7 +1143,13 @@ class MOZ_STACK_CLASS ModuleCompiler
uint32_t funcStart = parser_.pc->maybeFunction->pn_body->pn_pos.begin;
uint32_t offsetToEndOfUseAsm = parser_.tokenStream.currentToken().pos.end;
module_ = cx_->new_<AsmJSModule>(parser_.ss, funcStart, offsetToEndOfUseAsm);
// "use strict" should be added to the source if we are in an implicit
// strict context, see also comment above addUseStrict in
// js::FunctionToString.
bool strict = parser_.pc->sc->strict && !parser_.pc->sc->hasExplicitUseStrict();
module_ = cx_->new_<AsmJSModule>(parser_.ss, funcStart, offsetToEndOfUseAsm, strict);
if (!module_)
return false;
@ -1514,7 +1520,6 @@ class MOZ_STACK_CLASS ModuleCompiler
{
module_->initFuncEnd(parser_.tokenStream.currentToken().pos.end,
parser_.tokenStream.peekTokenPos().end);
masm_.finish();
if (masm_.oom())
return false;

View File

@ -800,8 +800,31 @@ js::AsmJSModuleToString(JSContext *cx, HandleFunction fun, bool addParenToLambda
if (!src)
return nullptr;
if (!out.append(src->chars(), src->length()))
return nullptr;
if (module.strict()) {
// We need to add "use strict" in the body right after the opening
// brace.
size_t bodyStart = 0, bodyEnd;
// No need to test for functions created with the Function ctor as
// these doesn't implicitly inherit the "use strict" context. Strict mode is
// enabled for functions created with the Function ctor only if they begin with
// the "use strict" directive, but these functions won't validate as asm.js
// modules.
ConstTwoByteChars chars(src->chars(), src->length());
if (!FindBody(cx, fun, chars, src->length(), &bodyStart, &bodyEnd))
return nullptr;
if (!out.append(chars, bodyStart) ||
!out.append("\n\"use strict\";\n") ||
!out.append(chars + bodyStart, src->length() - bodyStart))
{
return nullptr;
}
} else {
if (!out.append(src->chars(), src->length()))
return nullptr;
}
if (funCtor && !out.append("\n}"))
return nullptr;

View File

@ -328,7 +328,8 @@ AsmJSModule::staticallyLink(ExclusiveContext *cx)
}
}
AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t funcStart, uint32_t offsetToEndOfUseAsm)
AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t funcStart,
uint32_t offsetToEndOfUseAsm, bool strict)
: globalArgumentName_(nullptr),
importArgumentName_(nullptr),
bufferArgumentName_(nullptr),
@ -344,6 +345,7 @@ AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t funcStart, uint32_
mozilla::PodZero(&pod);
scriptSource_->incref();
pod.minHeapLength_ = AsmJSAllocationGranularity;
pod.strict_ = strict;
}
AsmJSModule::~AsmJSModule()
@ -876,7 +878,7 @@ AsmJSModule::clone(JSContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) con
{
AutoUnprotectCodeForClone cloneGuard(cx, *this);
*moduleOut = cx->new_<AsmJSModule>(scriptSource_, funcStart_, offsetToEndOfUseAsm_);
*moduleOut = cx->new_<AsmJSModule>(scriptSource_, funcStart_, offsetToEndOfUseAsm_, pod.strict_);
if (!*moduleOut)
return false;
@ -1313,8 +1315,9 @@ js::LookupAsmJSModuleInCache(ExclusiveContext *cx,
uint32_t funcStart = parser.pc->maybeFunction->pn_body->pn_pos.begin;
uint32_t offsetToEndOfUseAsm = parser.tokenStream.currentToken().pos.end;
bool strict = parser.pc->sc->strict && !parser.pc->sc->hasExplicitUseStrict();
ScopedJSDeletePtr<AsmJSModule> module(
cx->new_<AsmJSModule>(parser.ss, funcStart, offsetToEndOfUseAsm));
cx->new_<AsmJSModule>(parser.ss, funcStart, offsetToEndOfUseAsm, strict));
if (!module)
return false;
cursor = module->deserialize(cx, cursor);

View File

@ -431,6 +431,7 @@ class AsmJSModule
struct Pod {
uint32_t funcLength_;
uint32_t funcLengthWithRightBrace_;
bool strict_;
uint32_t numGlobalVars_;
uint32_t numFFIs_;
size_t funcPtrTableAndExitBytes_;
@ -464,7 +465,8 @@ class AsmJSModule
mutable bool codeIsProtected_;
public:
explicit AsmJSModule(ScriptSource *scriptSource, uint32_t functStart, uint32_t offsetToEndOfUseAsm);
explicit AsmJSModule(ScriptSource *scriptSource, uint32_t functStart,
uint32_t offsetToEndOfUseAsm, bool strict);
~AsmJSModule();
void trace(JSTracer *trc) {
@ -524,6 +526,9 @@ class AsmJSModule
uint32_t funcEndAfterCurly() const {
return funcStart_ + pod.funcLengthWithRightBrace_;
}
bool strict() const {
return pod.strict_;
}
bool addGlobalVarInit(const Value &v, AsmJSCoercion coercion, uint32_t *globalIndex) {
JS_ASSERT(pod.funcPtrTableAndExitBytes_ == 0);

View File

@ -626,14 +626,18 @@ const Class JSFunction::class_ = {
const Class* const js::FunctionClassPtr = &JSFunction::class_;
/* Find the body of a function (not including braces). */
static bool
FindBody(JSContext *cx, HandleFunction fun, ConstTwoByteChars chars, size_t length,
bool
js::FindBody(JSContext *cx, HandleFunction fun, ConstTwoByteChars chars, size_t length,
size_t *bodyStart, size_t *bodyEnd)
{
// We don't need principals, since those are only used for error reporting.
CompileOptions options(cx);
options.setFileAndLine("internal-findBody", 0)
.setVersion(fun->nonLazyScript()->getVersion());
options.setFileAndLine("internal-findBody", 0);
// For asm.js modules, there's no script.
if (fun->hasScript())
options.setVersion(fun->nonLazyScript()->getVersion());
AutoKeepAtoms keepAtoms(cx->perThreadData);
TokenStream ts(cx, options, chars.get(), length, nullptr);
int nest = 0;

View File

@ -554,6 +554,11 @@ CloneFunctionObject(JSContext *cx, HandleFunction fun, HandleObject parent,
gc::AllocKind kind = JSFunction::FinalizeKind,
NewObjectKind newKindArg = GenericObject);
extern bool
FindBody(JSContext *cx, HandleFunction fun, ConstTwoByteChars chars, size_t length,
size_t *bodyStart, size_t *bodyEnd);
} // namespace js
inline js::FunctionExtended *

View File

@ -5,6 +5,7 @@
#include "nsDisplayListInvalidation.h"
#include "nsDisplayList.h"
#include "nsIFrame.h"
nsDisplayItemGeometry::nsDisplayItemGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
{

View File

@ -6690,8 +6690,8 @@ nsFrame::BreakWordBetweenPunctuation(const PeekWordState* aState,
}
if (!Preferences::GetBool("layout.word_select.stop_at_punctuation")) {
// When this pref is false, we never stop at a punctuation boundary unless
// it's after whitespace
return false;
// it's followed by whitespace (in the relevant direction).
return aWhitespaceAfter;
}
if (!aIsKeyboardSelect) {
// mouse caret movement (e.g. word selection) always stops at every punctuation boundary

View File

@ -14,7 +14,7 @@
<p id="catch">Catch-all
<pre id="test"><script class="testbody" type="text/javascript;version=1.7">
/** Test for Bug 384147 **/
/** Tests for bugs 384147 and 981281 **/
SimpleTest.waitForExplicitFinish();
@ -27,6 +27,7 @@ function focusing() {
}
var eatSpace;
var stopAtPunctuation;
var wordModifiers =
(navigator.platform.indexOf("Mac") >= 0) ? {altKey:true} : {ctrlKey:true};
var sel = window.getSelection();
@ -34,11 +35,13 @@ var editor = document.getElementById("editor");
function setPrefs(eat_space, stop_at_punctuation, callback) {
eatSpace = eat_space;
stopAtPunctuation = stop_at_punctuation;
SpecialPowers.pushPrefEnv({"set": [["layout.word_select.eat_space_to_next_word", eat_space], ["layout.word_select.stop_at_punctuation", stop_at_punctuation]]}, callback);
}
function errString(dir) {
return dir + " movement broken with eatSpace=" + eatSpace + " in \"" + editor.innerHTML +
return dir + " movement broken with eatSpace=" + eatSpace +
", stopAtPunctuation=" + stopAtPunctuation + " in \"" + editor.innerHTML +
"\"; sel.anchorNode.parentNode=" + sel.anchorNode.parentNode;
}
@ -282,6 +285,192 @@ function test2() {
testLeft(editor.firstChild, 3);
testLeft(editor.firstChild, 0);
// Test basic word movement with stop_at_punctuation false (bug 981281).
setPrefs(false, false, test3);
}
function test3() {
editor.innerHTML = "Hello Kitty";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 11);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 0);
editor.innerHTML = "<b>Hello</b> Kitty";
sel.collapse(editor.firstChild.firstChild, 0);
testRight(editor.firstChild.nextSibling, 0);
testRight(editor.firstChild.nextSibling, 6);
testLeft(editor.firstChild.nextSibling, 1);
testLeft(editor.firstChild.firstChild, 0);
editor.innerHTML = "<b>Hello </b>Kitty";
sel.collapse(editor.firstChild.firstChild, 0);
testRight(editor.firstChild.firstChild, 5);
testRight(editor.firstChild.nextSibling, 5);
testLeft(editor.firstChild.firstChild, 6);
testLeft(editor.firstChild.firstChild, 0);
editor.innerHTML = "<b>Log out</b> roc";
sel.collapse(editor.firstChild.firstChild, 0);
testRight(editor.firstChild.firstChild, 3);
testRight(editor.firstChild.nextSibling, 0);
testRight(editor.firstChild.nextSibling, 5);
testLeft(editor.firstChild.nextSibling, 1);
testLeft(editor.firstChild.firstChild, 4);
testLeft(editor.firstChild.firstChild, 0);
editor.innerHTML = "http://www.mozilla.org";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 22);
testLeft(editor.firstChild, 0);
editor.innerHTML = "Set .rc to <b>'</b>quiz'";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 3);
testRight(editor.firstChild, 7);
testRight(editor.firstChild, 10);
testRight(editor.firstChild.nextSibling.nextSibling, 5);
testLeft(editor.firstChild, 11);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
editor.innerHTML = ChineseChars + KatakanaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 0);
editor.innerHTML = ChineseChars + JapaneseComma + ChineseChars + JapaneseFullStop + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 0);
// And again with eat_space_next_to_word true.
setPrefs(true, false, test4);
}
function test4() {
editor.innerHTML = "Hello Kitty";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 11);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 0);
editor.innerHTML = "<b>Hello</b> Kitty";
sel.collapse(editor.firstChild.firstChild, 0);
testRight(editor.firstChild.nextSibling, 1);
testRight(editor.firstChild.nextSibling, 6);
testLeft(editor.firstChild.nextSibling, 1);
testLeft(editor.firstChild.firstChild, 0);
editor.innerHTML = "<b>Hello </b>Kitty";
sel.collapse(editor.firstChild.firstChild, 0);
testRight(editor.firstChild.nextSibling, 0);
testRight(editor.firstChild.nextSibling, 5);
testLeft(editor.firstChild.firstChild, 6);
testLeft(editor.firstChild.firstChild, 0);
editor.innerHTML = "<b>Log out</b> roc";
sel.collapse(editor.firstChild.firstChild, 0);
testRight(editor.firstChild.firstChild, 4);
testRight(editor.firstChild.nextSibling, 2);
testRight(editor.firstChild.nextSibling, 5);
testLeft(editor.firstChild.nextSibling, 1);
testLeft(editor.firstChild.firstChild, 4);
testLeft(editor.firstChild.firstChild, 0);
editor.innerHTML = "http://www.mozilla.org";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 22);
testLeft(editor.firstChild, 0);
editor.innerHTML = "Set .rc to <b>'</b>quiz'";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 8);
testRight(editor.firstChild.nextSibling.firstChild, 0);
testRight(editor.firstChild.nextSibling.nextSibling, 5);
testLeft(editor.firstChild, 11);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
editor.innerHTML = ChineseChars + KatakanaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 0);
editor.innerHTML = ChineseChars + JapaneseComma + ChineseChars + JapaneseFullStop + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 0);
SimpleTest.finish();
}

View File

@ -86,8 +86,8 @@ random-if(winWidget) == 305643-1.html 305643-1-ref.html # depends on windows ver
== 409375.html 409375-ref.html
== 413542-1.html 413542-1-ref.html
== 413542-2.html 413542-2-ref.html
== 413928-1.html 413928-1-ref.html
== 413928-2.html 413928-2-ref.html
random-if(B2G) == 413928-1.html 413928-1-ref.html
random-if(B2G) == 413928-2.html 413928-2-ref.html
== 425338-1a.html 425338-1-ref.html
== 425338-1b.html 425338-1-ref.html
== 489517-1.html 489517-1-ref.html
@ -139,6 +139,6 @@ skip-if(B2G) == 726420-1.html 726420-1-ref.html
== 779003-1.html 779003-1-ref.html
== 779003-1-dynamic.html 779003-1-ref.html
== 847242-1.html 847242-1-ref.html
== 869833-1.xul 869833-1-ref.xul
skip-if(B2G&&browserIsRemote) == 869833-1.xul 869833-1-ref.xul
fails-if(B2G) == 922530-1.html 922530-1-ref.html # B2G kerning
== 922550-1.html 922550-1-ref.html

View File

@ -1,7 +1,7 @@
== box-ordinal-with-out-of-flow-1.html box-ordinal-with-out-of-flow-1-ref.html
== dynamic-1-remove-to-none-grouped.xul dynamic-1-ref.xul
== dynamic-1-add-to-one-grouped.xul dynamic-1-ref.xul
== dynamic-1-remove-to-one-grouped-1.xul dynamic-1-ref.xul
fails == dynamic-1-remove-to-one-grouped-2.xul dynamic-1-ref.xul # bug 575500
== dynamic-1-add-to-two-grouped-1.xul dynamic-1-ref.xul
== dynamic-1-add-to-two-grouped-2.xul dynamic-1-ref.xul
skip-if(B2G&&browserIsRemote) == box-ordinal-with-out-of-flow-1.html box-ordinal-with-out-of-flow-1-ref.html
skip-if(B2G&&browserIsRemote) == dynamic-1-remove-to-none-grouped.xul dynamic-1-ref.xul
skip-if(B2G&&browserIsRemote) == dynamic-1-add-to-one-grouped.xul dynamic-1-ref.xul
skip-if(B2G&&browserIsRemote) == dynamic-1-remove-to-one-grouped-1.xul dynamic-1-ref.xul
fails skip-if(B2G&&browserIsRemote) == dynamic-1-remove-to-one-grouped-2.xul dynamic-1-ref.xul # bug 575500
skip-if(B2G&&browserIsRemote) == dynamic-1-add-to-two-grouped-1.xul dynamic-1-ref.xul
skip-if(B2G&&browserIsRemote) == dynamic-1-add-to-two-grouped-2.xul dynamic-1-ref.xul

View File

@ -1,4 +1,4 @@
== outline-radius-percent-1.html outline-radius-percent-1-ref.html
random-if(B2G) == outline-radius-percent-1.html outline-radius-percent-1-ref.html
== min-width-1.html min-width-1-ref.html
== min-height-1.html min-height-1-ref.html
== max-width-1.html max-width-1-ref.html

View File

@ -14,7 +14,7 @@ fails-if(Android||B2G) == boxshadow-fileupload.html boxshadow-fileupload-ref.htm
== boxshadow-inner-basic.html boxshadow-inner-basic-ref.svg
random-if(layersGPUAccelerated) == boxshadow-mixed.html boxshadow-mixed-ref.html
random-if(d2d) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
HTTP(..) == boxshadow-dynamic.xul boxshadow-dynamic-ref.xul
skip-if(B2G&&browserIsRemote) HTTP(..) == boxshadow-dynamic.xul boxshadow-dynamic-ref.xul
random-if(d2d) == boxshadow-onecorner.html boxshadow-onecorner-ref.html
random-if(d2d) == boxshadow-twocorners.html boxshadow-twocorners-ref.html
random-if(d2d) == boxshadow-threecorners.html boxshadow-threecorners-ref.html

View File

@ -1384,7 +1384,7 @@ skip-if(B2G&&browserIsRemote) == 498228-1.xul 498228-1-ref.xul # bug 974780
== 501257-1a.html 501257-1-ref.html
== 501257-1b.html 501257-1-ref.html
== 501257-1.xhtml 501257-1-ref.xhtml
== 501627-1.html 501627-1-ref.html
skip-if(B2G) == 501627-1.html 501627-1-ref.html # Bug 989165
== 502288-1.html 502288-1-ref.html
skip-if(B2G) == 502447-1.html 502447-1-ref.html
== 502795-1.html 502795-1-ref.html
@ -1609,7 +1609,7 @@ fuzzy-if(Android&&AndroidVersion>=15,8,20) == 602200-3.html 602200-3-ref.html
== 602200-4.html 602200-4-ref.html
== 603423-1.html 603423-1-ref.html
== 604737.html 604737-ref.html
== 605138-1.html 605138-1-ref.html
random-if(B2G) == 605138-1.html 605138-1-ref.html # Bug 988758
== 605157-1.xhtml 605157-1-ref.xhtml
== 607267-1.html 607267-1-ref.html
== 608636-1.html 608636-1-ref.html

View File

@ -19,8 +19,8 @@
== column-box-alignment-rtl.html column-box-alignment-rtl-ref.html
HTTP(..) == columnfill-balance.html columnfill-balance-ref.html
HTTP(..) == columnfill-auto.html columnfill-auto-ref.html
HTTP(..) == columnfill-auto-2.html columnfill-auto-2-ref.html
HTTP(..) == columnfill-auto-3.html columnfill-auto-2-ref.html
random-if(B2G) HTTP(..) == columnfill-auto-2.html columnfill-auto-2-ref.html
random-if(B2G) HTTP(..) == columnfill-auto-3.html columnfill-auto-2-ref.html
skip-if(B2G) == columnrule-basic.html columnrule-basic-ref.html # bug 773482
skip-if(B2G) == columnrule-complex.html columnrule-complex-ref.html # bug 773482
!= columnrule-linestyles.html columnrule-linestyles-notref.html

View File

@ -31,7 +31,7 @@
== insertmultiplemultiple-2.html insertmultiplemultiple-ref.html
# testing bindings that have multiple insertion points
== multipleinsertionpoints-ref2.xhtml multipleinsertionpoints-ref.xhtml
fails-if(B2G) == multipleinsertionpoints-ref2.xhtml multipleinsertionpoints-ref.xhtml #Bug 988759
# append a single element
skip-if(B2G) == multipleinsertionpoints-appendsingle-1.xhtml multipleinsertionpoints-ref.xhtml # bug 773482
skip-if(B2G) == multipleinsertionpoints-appendsingle-2.xhtml multipleinsertionpoints-ref.xhtml # bug 773482
@ -45,7 +45,7 @@ skip-if(B2G) == multipleinsertionpoints-insertmultiple.xhtml multipleinsertionpo
# test appending some nodes whose frame construction should be done lazily
# followed by appending a node that might not be done lazily
== multipleappendwithxul.xhtml multipleappendwithxul-ref.xhtml
skip-if(B2G&&browserIsRemote) == multipleappendwithxul.xhtml multipleappendwithxul-ref.xhtml # Bug 974780
== multipleappendwithinput.xhtml multipleappendwithinput-ref.xhtml
== multipleappendwitheditable.xhtml multipleappendwitheditable-ref.xhtml

View File

@ -26,7 +26,7 @@ load stress-10.html # crash test
== stress-11.xhtml stress-11-ref.xhtml
== border-not-apply.html border-not-apply-ref.html
== 287088-1.html 287088-1-ref.html
skip-if(B2G) == 287088-1.html 287088-1-ref.html # Bug 975254
== 287088-2.html 287088-2-ref.html
== 403177-1.html 403177-1-ref.html
== 469227-2.html 469227-2-ref.html

View File

@ -21,7 +21,7 @@ fuzzy-if(/^Windows\x20NT\x205\.1/.test(http.oscpu),64,4) fuzzy-if(cocoaWidget,63
== number-disabled.html number-disabled-ref.html
# auto width:
== number-auto-width-1.html number-auto-width-1-ref.html
random-if(B2G) == number-auto-width-1.html number-auto-width-1-ref.html
# min-height/max-height tests:
skip-if(B2G||Android) == number-min-height-1.html number-min-height-1-ref.html

View File

@ -17,10 +17,10 @@
== value-prop.html 75pct-common-ref.html
== valueAsNumber-prop-unthemed.html 75pct-unthemed-common-ref.html
== valueAsNumber-prop.html 75pct-common-ref.html
== stepDown-unthemed.html 75pct-unthemed-common-ref.html
== stepDown.html 75pct-common-ref.html
== stepUp-unthemed.html 75pct-unthemed-common-ref.html
== stepUp.html 75pct-common-ref.html
random-if(B2G) == stepDown-unthemed.html 75pct-unthemed-common-ref.html # Bug 878916
random-if(B2G) == stepDown.html 75pct-common-ref.html # Bug 878916
random-if(B2G) == stepUp-unthemed.html 75pct-unthemed-common-ref.html # Bug 969256
random-if(B2G) == stepUp.html 75pct-common-ref.html # Bug 969256
fuzzy-if(B2G,1,1) == max-prop.html 100pct-common-ref.html
# 'direction' property:

View File

@ -64,7 +64,7 @@
== insert-into-split-inline-16a.html insert-into-split-inline-16-ref.html
== insert-into-split-inline-16b.html insert-into-split-inline-16-ref.html
== insert-into-split-inline-16-ref.html insert-into-split-inline-16-noib-ref.html
== float-inside-inline-between-blocks-1.html float-inside-inline-between-blocks-1-ref.html
random-if(B2G) == float-inside-inline-between-blocks-1.html float-inside-inline-between-blocks-1-ref.html
== table-pseudo-in-part3-1.html table-pseudo-in-part3-1-ref.html
== emptyspan-1.html emptyspan-1-ref.html
== emptyspan-2.html emptyspan-2-ref.html

View File

@ -44,4 +44,4 @@ fuzzy(1,16900) == gradient-html-07c.html gradient-html-07d.html
HTTP == invalidate-1.html invalidate-1-ref.html
== pattern-html-01.html pattern-html-01-ref.svg
== pattern-html-02.html pattern-html-02-ref.svg
== referenced-from-binding-01.html referenced-from-binding-01-ref.html
fails-if(B2G) == referenced-from-binding-01.html referenced-from-binding-01-ref.html # Bug 988763

View File

@ -1 +1 @@
== image-region.xul image-region-ref.xul
skip-if(B2G&&browserIsRemote) == image-region.xul image-region-ref.xul

View File

@ -1,4 +1,4 @@
== 166591-dynamic-1.html 166591-dynamic-1-ref.html
fails-if(B2G) == 166591-dynamic-1.html 166591-dynamic-1-ref.html
fuzzy-if(Android&&AndroidVersion>=15,8,50) == 336736-1a.html 336736-1-ref.html
fuzzy-if(Android&&AndroidVersion>=15,8,50) == 336736-1b.html 336736-1-ref.html
== 406073-1.html 406073-1-ref.html

View File

@ -54,4 +54,4 @@ fails == svg-with-type.html svg-with-type-ref.html
# XXX missing test 034 from http://biesi.damowmow.com/object/ here; would
# need to require Flash on the test machine to run them
#
== malformed-uri.html malformed-uri-ref.html
fails-if(B2G) == malformed-uri.html malformed-uri-ref.html

View File

@ -20,15 +20,15 @@ fails-if(B2G) == 609227-2b.html 609227-2-ref.html # reftest-print doesn't work o
== 626395-2c.html 626395-2-ref.html
== 626395-2d.html 626395-2-ref.html
== 652178-1.html 652178-1-ref.html
fails-if(B2G) == 115199-1.html 115199-1-ref.html # reftest-print doesn't work on B2G
== 115199-2a.html 115199-2-ref.html
== 115199-2b.html 115199-2-ref.html
random-if(B2G) == 115199-1.html 115199-1-ref.html # reftest-print doesn't work on B2G
random-if(B2G) == 115199-2a.html 115199-2-ref.html
random-if(B2G) == 115199-2b.html 115199-2-ref.html
== 652178-1.html 652178-1-ref2.html
skip-if(B2G) fuzzy-if(cocoaWidget,1,5000) == 745025-1.html 745025-1-ref.html # reftest-print doesn't work on B2G
== 820496-1.html 820496-1-ref.html
# NOTE: These tests don't yet rigorously test what they're
# trying to test (shrink-to-fit behavior), due to bug 967311.
fails-if(B2G) == 960822.html 960822-ref.html # reftest-print doesn't work on B2G (scrollbar difference only)
random-if(B2G) == 960822.html 960822-ref.html # reftest-print doesn't work on B2G (scrollbar difference only)
== 966419-1.html 966419-1-ref.html
== 966419-2.html 966419-2-ref.html

View File

@ -165,7 +165,7 @@ include font-face/reftest.list
include font-features/reftest.list
# mobile font size inflation
include font-inflation/reftest.list
skip-if(B2G) include font-inflation/reftest.list # Bug 972697
# font matching
include font-matching/reftest.list

View File

@ -226,7 +226,7 @@ random-if(gtk2Widget) == objectBoundingBox-and-fePointLight-02.svg objectBoundin
skip-if(d2d) fuzzy-if(azureQuartz,1,99974) == opacity-and-gradient-02.svg opacity-and-gradient-02-ref.svg
== opacity-and-pattern-01.svg pass.svg
== opacity-and-transform-01.svg opacity-and-transform-01-ref.svg
fuzzy-if(Android&&AndroidVersion>=15,8,200) == outer-svg-border-and-padding-01.svg outer-svg-border-and-padding-01-ref.svg
fuzzy-if(Android&&AndroidVersion>=15,8,200) random-if(B2G) == outer-svg-border-and-padding-01.svg outer-svg-border-and-padding-01-ref.svg
== overflow-on-outer-svg-01.svg overflow-on-outer-svg-01-ref.svg
== overflow-on-outer-svg-02a.xhtml overflow-on-outer-svg-02-ref.xhtml
== overflow-on-outer-svg-02b.xhtml overflow-on-outer-svg-02-ref.xhtml

View File

@ -284,16 +284,16 @@ HTTP(../..) == inline--position-relative--01.xhtml inline--position-relative-
# tests do not have any width or height on the <object> element so they should
# be sized purely by the embedded SVG's intrinsic size.
random-if(Android) == object--auto-auto--0-0.html pass-empty.svg # XXX add border
random-if(Android) == object--auto-auto--0-pct.html object--auto-auto--0-pct--ref.html
random-if(Android) == object--auto-auto--0-px.html object--auto-auto--0-px--ref.html
random-if(Android) == object--auto-auto--pct-0.html object--auto-auto--pct-0--ref.html
random-if(Android||B2G) == object--auto-auto--0-0.html pass-empty.svg # XXX add border
random-if(Android||B2G) == object--auto-auto--0-pct.html object--auto-auto--0-pct--ref.html
random-if(Android||B2G) == object--auto-auto--0-px.html object--auto-auto--0-px--ref.html
random-if(Android||B2G) == object--auto-auto--pct-0.html object--auto-auto--pct-0--ref.html
# The following four commented out tests fail post bug 428023:
#== object--auto-auto--pct-pct.html object--auto-auto--pct-pct--ref.html
#== object--auto-auto--pct-px.html object--auto-auto--pct-px--ref.html
random-if(Android) == object--auto-auto--px-0.html object--auto-auto--px-0--ref.html
random-if(Android||B2G) == object--auto-auto--px-0.html object--auto-auto--px-0--ref.html
#== object--auto-auto--px-pct.html object--auto-auto--px-pct--ref.html
random-if(Android) == object--auto-auto--px-px.html object--auto-auto--px-px--ref.html
random-if(Android||B2G) == object--auto-auto--px-px.html object--auto-auto--px-px--ref.html
#== object--pct-pct--0-0.html pass.svg

View File

@ -1,8 +1,8 @@
== basic.xul basic-ref.xul
random-if(Android) == basic-negcoord.xul basic-negcoord-ref.xul
!= blur.xul blur-notref.xul
== color-inherit.xul color-inherit-ref.xul
== multiple-noblur.xul multiple-noblur-ref.xul
skip-if(B2G&&browserIsRemote) == basic.xul basic-ref.xul
random-if(Android) skip-if(B2G&&browserIsRemote) == basic-negcoord.xul basic-negcoord-ref.xul
skip-if(B2G&&browserIsRemote) != blur.xul blur-notref.xul
skip-if(B2G&&browserIsRemote) == color-inherit.xul color-inherit-ref.xul
skip-if(B2G&&browserIsRemote) == multiple-noblur.xul multiple-noblur-ref.xul
HTTP(..) == blur-opacity.html blur-opacity-ref.html
== basic.html basic-ref.html

View File

@ -11,7 +11,7 @@
== rotatex-perspective-1c.html rotatex-1-ref.html
== rotatex-perspective-3a.html rotatex-perspective-3-ref.html
== scalez-1a.html scalez-1-ref.html
== preserve3d-1a.html preserve3d-1-ref.html
fails-if(B2G) == preserve3d-1a.html preserve3d-1-ref.html # Bug 988766
== preserve3d-1b.html about:blank
== preserve3d-clipped.html about:blank
== preserve3d-2a.html preserve3d-2-ref.html
@ -20,7 +20,7 @@
== preserve3d-2d.html preserve3d-2-ref.html
== preserve3d-3a.html preserve3d-3-ref.html
skip-if(B2G) == preserve3d-4a.html green-rect.html
fuzzy-if(Android&&AndroidVersion>=15,4,300) == preserve3d-5a.html preserve3d-5-ref.html
fuzzy-if(Android&&AndroidVersion>=15,4,300) fails-if(B2G) == preserve3d-5a.html preserve3d-5-ref.html # Bug 988767
== scale3d-z.html scalez-1-ref.html
fuzzy-if(winWidget,102,580) fuzzy-if(d2d,143,681) fuzzy-if(OSX==10.8,224,924) fuzzy-if(OSX==10.9,224,924) == scale3d-all.html scale3d-1-ref.html # subpixel AA
fuzzy-if(winWidget,102,580) fuzzy-if(d2d,143,681) fuzzy-if(OSX==10.8,224,924) fuzzy-if(OSX==10.9,224,924) == scale3d-all-separate.html scale3d-1-ref.html # subpixel AA

View File

@ -8,6 +8,6 @@
== box-sizing-padding-box-001.xht box-sizing-padding-box-001-ref.xht
== box-sizing-padding-box-002.xht box-sizing-padding-box-002-ref.xht
== box-sizing-padding-box-003.xht box-sizing-padding-box-003-ref.xht
fails-if(B2G) random-if(Android) == box-sizing-replaced-001.xht box-sizing-replaced-001-ref.xht
== box-sizing-replaced-002.xht box-sizing-replaced-002-ref.xht
== box-sizing-replaced-003.xht box-sizing-replaced-003-ref.xht
random-if(Android) skip-if(B2G) == box-sizing-replaced-001.xht box-sizing-replaced-001-ref.xht # Bug 982547
random-if(B2G) == box-sizing-replaced-002.xht box-sizing-replaced-002-ref.xht
random-if(B2G) == box-sizing-replaced-003.xht box-sizing-replaced-003-ref.xht

View File

@ -1,23 +1,23 @@
== test001.xul reference-green-window.xul
== test002.xul reference-green-window.xul
== test003.xul reference-green-window.xul
== test004.xul reference-green-window.xul
== test005.xul reference-green-window.xul
== test006.xul reference-green-window.xul
== test007.xul reference-green-window.xul
== test008.xul reference-green-window.xul
== test009.xul reference-green-window.xul
== test010.xul reference-green-window.xul
== test011.xul reference-green-window.xul
== test012.xul reference-green-window.xul
== test013.xul reference-green-window.xul
== test014.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test001.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test002.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test003.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test004.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test005.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test006.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test007.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test008.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test009.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test010.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test011.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test012.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test013.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test014.xul reference-green-window.xul
# Disabled due to compartments for now.
#== test015.xul reference-green-window.xul
== test016.xul reference-green-window.xul
== test017.xul reference-green-window.xul
== test018.xul reference-green-window.xul
== test019.xul reference-green-window.xul
== test020.xul reference-green-window.xul
== test021.xul reference-green-window.xul
== test022.xul reference-green-window.xul
#skip-if(B2G&&browserIsRemote) == test015.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test016.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test017.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test018.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test019.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test020.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test021.xul reference-green-window.xul
skip-if(B2G&&browserIsRemote) == test022.xul reference-green-window.xul

View File

@ -1,9 +1,9 @@
== menuitem-key.xul menuitem-key-ref.xul
skip-if(B2G&&browserIsRemote) == menuitem-key.xul menuitem-key-ref.xul
# these random-if(Android) are due to differences between Android Native & Xul, see bug 732569
random-if(Android||B2G) == menulist-shrinkwrap-1.xul menulist-shrinkwrap-1-ref.xul
random-if(Android||B2G) fails-if(winWidget) == menulist-shrinkwrap-2.xul menulist-shrinkwrap-2-ref.xul
== textbox-overflow-1.xul textbox-overflow-1-ref.xul # for bug 749658
random-if(Android||B2G) skip-if(B2G&&browserIsRemote) == menulist-shrinkwrap-1.xul menulist-shrinkwrap-1-ref.xul
random-if(Android||B2G) fails-if(winWidget) skip-if(B2G&&browserIsRemote) == menulist-shrinkwrap-2.xul menulist-shrinkwrap-2-ref.xul
skip-if(B2G&&browserIsRemote) == textbox-overflow-1.xul textbox-overflow-1-ref.xul # for bug 749658
# accesskeys are not normally displayed on Mac, so skip this test
skip-if(cocoaWidget) == accesskey.xul accesskey-ref.xul
fails-if(cocoaWidget) fails-if(B2G) == tree-row-outline-1.xul tree-row-outline-1-ref.xul
!= tree-row-outline-1.xul tree-row-outline-1-notref.xul
skip-if(cocoaWidget) skip-if(B2G&&browserIsRemote) == accesskey.xul accesskey-ref.xul
fails-if(cocoaWidget) fails-if(B2G) skip-if(B2G&&browserIsRemote) == tree-row-outline-1.xul tree-row-outline-1-ref.xul
skip-if(B2G&&browserIsRemote) != tree-row-outline-1.xul tree-row-outline-1-notref.xul

View File

@ -490,9 +490,24 @@ nsUserFontSet::UpdateRules(const nsTArray<nsFontFaceRuleContainer>& aRules)
IncrementGeneration();
}
// local rules have been rebuilt, so clear the flag
mLocalRulesUsed = false;
return modified;
}
static bool
HasLocalSrc(const nsCSSValue::Array *aSrcArr)
{
size_t numSrc = aSrcArr->Count();
for (size_t i = 0; i < numSrc; i++) {
if (aSrcArr->Item(i).GetUnit() == eCSSUnit_Local_Font) {
return true;
}
}
return false;
}
void
nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
nsTArray<FontFaceRuleRecord>& aOldRules,
@ -524,8 +539,20 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule* aRule, uint8_t aSheetType,
// to the new rule list, and put the entry into the appropriate family
for (uint32_t i = 0; i < aOldRules.Length(); ++i) {
const FontFaceRuleRecord& ruleRec = aOldRules[i];
if (ruleRec.mContainer.mRule == aRule &&
ruleRec.mContainer.mSheetType == aSheetType) {
// if local rules were used, don't use the old font entry
// for rules containing src local usage
if (mLocalRulesUsed) {
aRule->GetDesc(eCSSFontDesc_Src, val);
unit = val.GetUnit();
if (unit == eCSSUnit_Array && HasLocalSrc(val.GetArrayValue())) {
break;
}
}
AddFontFace(fontfamily, ruleRec.mFontEntry);
mRules.AppendElement(ruleRec);
aOldRules.RemoveElementAt(i);
@ -983,3 +1010,9 @@ nsUserFontSet::GetPrivateBrowsing()
nsCOMPtr<nsILoadContext> loadContext = ps->GetDocument()->GetLoadContext();
return loadContext && loadContext->UsePrivateBrowsing();
}
void
nsUserFontSet::DoRebuildUserFontSet()
{
mPresContext->RebuildUserFontSet();
}

View File

@ -87,6 +87,8 @@ protected:
virtual bool GetPrivateBrowsing() MOZ_OVERRIDE;
virtual void DoRebuildUserFontSet() MOZ_OVERRIDE;
nsPresContext* mPresContext; // weak reference
// Set of all loaders pointing to us. These are not strong pointers,

View File

@ -1,18 +1,18 @@
== row-sizing-1.xul row-sizing-1-ref.xul
== column-sizing-1.xul column-sizing-1-ref.xul
== row-or-column-sizing-1.xul row-or-column-sizing-2.xul
== row-or-column-sizing-1.xul row-or-column-sizing-3.xul
== row-or-column-sizing-1.xul row-or-column-sizing-4.xul
== z-order-1.xul z-order-1-ref.xul
== z-order-2.xul z-order-2-ref.xul
== not-full-basic.xul not-full-basic-ref.xhtml
== not-full-grid-pack-align.xul not-full-basic-ref.xhtml
== not-full-row-group-align.xul not-full-row-group-align-ref.xhtml # does anyone want/need this behavior?
== not-full-row-group-pack.xul not-full-row-group-pack-ref.xhtml
== not-full-row-group-direction.xul not-full-row-group-direction-ref.xhtml
== not-full-row-leaf-align.xul not-full-basic-ref.xhtml
== not-full-row-leaf-pack.xul not-full-row-leaf-pack-ref.xhtml
== not-full-row-leaf-direction.xul not-full-row-leaf-pack-ref.xhtml
skip-if(B2G&&browserIsRemote) == row-sizing-1.xul row-sizing-1-ref.xul
skip-if(B2G&&browserIsRemote) == column-sizing-1.xul column-sizing-1-ref.xul
skip-if(B2G&&browserIsRemote) == row-or-column-sizing-1.xul row-or-column-sizing-2.xul
skip-if(B2G&&browserIsRemote) == row-or-column-sizing-1.xul row-or-column-sizing-3.xul
skip-if(B2G&&browserIsRemote) == row-or-column-sizing-1.xul row-or-column-sizing-4.xul
skip-if(B2G&&browserIsRemote) == z-order-1.xul z-order-1-ref.xul
skip-if(B2G&&browserIsRemote) == z-order-2.xul z-order-2-ref.xul
skip-if(B2G&&browserIsRemote) == not-full-basic.xul not-full-basic-ref.xhtml
skip-if(B2G&&browserIsRemote) == not-full-grid-pack-align.xul not-full-basic-ref.xhtml
skip-if(B2G&&browserIsRemote) == not-full-row-group-align.xul not-full-row-group-align-ref.xhtml # does anyone want/need this behavior?
skip-if(B2G&&browserIsRemote) == not-full-row-group-pack.xul not-full-row-group-pack-ref.xhtml
skip-if(B2G&&browserIsRemote) == not-full-row-group-direction.xul not-full-row-group-direction-ref.xhtml
skip-if(B2G&&browserIsRemote) == not-full-row-leaf-align.xul not-full-basic-ref.xhtml
skip-if(B2G&&browserIsRemote) == not-full-row-leaf-pack.xul not-full-row-leaf-pack-ref.xhtml
skip-if(B2G&&browserIsRemote) == not-full-row-leaf-direction.xul not-full-row-leaf-pack-ref.xhtml
skip-if(B2G) fails-if(Android&&browserIsRemote) == scrollable-columns.xul scrollable-columns-ref.xhtml # bug 650597, 732569
fails == scrollable-rows.xul scrollable-rows-ref.xhtml
== sizing-2d.xul sizing-2d-ref.xul
fails skip-if(B2G&&browserIsRemote) == scrollable-rows.xul scrollable-rows-ref.xhtml
skip-if(B2G&&browserIsRemote) == sizing-2d.xul sizing-2d-ref.xul

View File

@ -1,5 +1,5 @@
fails-if(Android||B2G) == textbox-multiline-noresize.xul textbox-multiline-ref.xul # reference is blank on Android (due to no native theme support?)
!= textbox-multiline-resize.xul textbox-multiline-ref.xul
== popup-explicit-size.xul popup-explicit-size-ref.xul
random-if(Android) == image-size.xul image-size-ref.xul
== image-scaling-min-height-1.xul image-scaling-min-height-1-ref.xul
fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == textbox-multiline-noresize.xul textbox-multiline-ref.xul # reference is blank on Android (due to no native theme support?)
skip-if(B2G&&browserIsRemote) != textbox-multiline-resize.xul textbox-multiline-ref.xul
skip-if(B2G&&browserIsRemote) == popup-explicit-size.xul popup-explicit-size-ref.xul
random-if(Android) skip-if(B2G&&browserIsRemote) == image-size.xul image-size-ref.xul
skip-if(B2G&&browserIsRemote) == image-scaling-min-height-1.xul image-scaling-min-height-1-ref.xul

View File

@ -27,9 +27,9 @@ interface nsIStreamLoaderObserver : nsISupports
* If the observer wants to take over responsibility for the
* data buffer (result), it returns NS_SUCCESS_ADOPTED_DATA
* in place of NS_OK as its success code. The loader will then
* "forget" about the data, and not NS_Free() it in its own
* destructor; observer must call NS_Free() when the data is
* no longer required.
* "forget" about the data and not NS_Free() it after
* onStreamComplete() returns; observer must call NS_Free()
* when the data is no longer required.
*/
void onStreamComplete(in nsIStreamLoader loader,
in nsISupports ctxt,

View File

@ -18,9 +18,7 @@ nsStreamLoader::nsStreamLoader()
nsStreamLoader::~nsStreamLoader()
{
if (mData) {
NS_Free(mData);
}
ReleaseData();
}
NS_IMETHODIMP
@ -103,10 +101,9 @@ nsStreamLoader::OnStopRequest(nsIRequest* request, nsISupports *ctxt,
// the observer now owns the data buffer, and the loader must
// not deallocate it
mData = nullptr;
mLength = 0;
mAllocated = 0;
}
// done.. cleanup
ReleaseData();
mRequest = 0;
mObserver = 0;
mContext = 0;
@ -132,8 +129,7 @@ nsStreamLoader::WriteSegmentFun(nsIInputStream *inStr,
self->mData = static_cast<uint8_t*>(NS_Realloc(self->mData,
self->mLength + count));
if (!self->mData) {
self->mLength = 0;
self->mAllocated = 0;
self->ReleaseData();
return NS_ERROR_OUT_OF_MEMORY;
}
self->mAllocated = self->mLength + count;
@ -155,3 +151,14 @@ nsStreamLoader::OnDataAvailable(nsIRequest* request, nsISupports *ctxt,
uint32_t countRead;
return inStr->ReadSegments(WriteSegmentFun, this, count, &countRead);
}
void
nsStreamLoader::ReleaseData()
{
if (mData) {
NS_Free(mData);
mData = nullptr;
}
mLength = 0;
mAllocated = 0;
}

View File

@ -30,6 +30,10 @@ protected:
static NS_METHOD WriteSegmentFun(nsIInputStream *, void *, const char *,
uint32_t, uint32_t, uint32_t *);
// Utility method to free mData, if present, and update other state to
// reflect that no data has been allocated.
void ReleaseData();
nsCOMPtr<nsIStreamLoaderObserver> mObserver;
nsCOMPtr<nsISupports> mContext; // the observer's context
nsCOMPtr<nsIRequest> mRequest;

View File

@ -610,6 +610,10 @@ nsHTTPListener::~nsHTTPListener()
if (mResponsibleForDoneSignal)
send_done_signal();
if (mResultData) {
NS_Free(const_cast<uint8_t *>(mResultData));
}
if (mLoader) {
nsCOMPtr<nsIThread> mainThread(do_GetMainThread());
NS_ProxyRelease(mainThread, mLoader);
@ -678,7 +682,8 @@ nsHTTPListener::OnStreamComplete(nsIStreamLoader* aLoader,
mHttpRequestSucceeded = false;
mResultLen = stringLen;
mResultData = string; // reference. Make sure loader lives as long as this
mResultData = string; // take ownership of allocation
aStatus = NS_SUCCESS_ADOPTED_DATA;
unsigned int rcode;
rv = hchan->GetResponseStatus(&rcode);

View File

@ -49,7 +49,7 @@ public:
uint16_t mHttpResponseCode;
nsCString mHttpResponseContentType;
const uint8_t* mResultData; // not owned, refers to mLoader
const uint8_t* mResultData; // allocated in loader, but owned by listener
uint32_t mResultLen;
mozilla::Mutex mLock;

View File

@ -1,4 +1,6 @@
recursive-include marionette/touch *.js
recursive-include marionette/www *
recursive-include marionette/chrome *
recursive-include marionette/runner/mixins/resources *
exclude MANIFEST.in
include requirements.txt

View File

@ -475,6 +475,10 @@ class BaseMarionetteOptions(OptionParser):
dest='sources',
action='store',
help='path to sources.xml (Firefox OS only)')
self.add_option('--server-root',
dest='server_root',
action='store',
help='sets the web server\'s root directory to the given path')
def parse_args(self, args=None, values=None):
options, tests = OptionParser.parse_args(self, args, values)
@ -545,7 +549,8 @@ class BaseMarionetteTestRunner(object):
logcat_dir=None, xml_output=None, repeat=0, gecko_path=None,
testvars=None, tree=None, type=None, device_serial=None,
symbols_path=None, timeout=None, es_servers=None, shuffle=False,
sdcard=None, this_chunk=1, total_chunks=1, sources=None, **kwargs):
sdcard=None, this_chunk=1, total_chunks=1, sources=None, server_root=None,
**kwargs):
self.address = address
self.emulator = emulator
self.emulatorBinary = emulatorBinary
@ -581,6 +586,7 @@ class BaseMarionetteTestRunner(object):
self.shuffle = shuffle
self.sdcard = sdcard
self.sources = sources
self.server_root = server_root
self.this_chunk = this_chunk
self.total_chunks = total_chunks
self.mixin_run_tests = []
@ -654,9 +660,12 @@ class BaseMarionetteTestRunner(object):
host = "127.0.0.1"
if need_external_ip:
host = moznetwork.get_ip()
docroot = self.server_root or os.path.join(os.path.dirname(os.path.dirname(__file__)), 'www')
if not os.path.isdir(docroot):
raise Exception("Server root %s is not a valid path" % docroot)
self.httpd = MozHttpd(host=host,
port=0,
docroot=os.path.join(os.path.dirname(os.path.dirname(__file__)), 'www'))
docroot=docroot)
self.httpd.start()
self.marionette.baseurl = 'http://%s:%d/' % (host, self.httpd.httpd.server_port)
self.logger.info('running webserver on %s' % self.marionette.baseurl)

View File

@ -1,2 +1,2 @@
random-if(cocoaWidget) == bug-442419-progressmeter-max.xul bug-442419-progressmeter-max-ref.xul # fails most of the time on Mac because progress meter animates
!= textbox-multiline-default-value.xul textbox-multiline-empty.xul
skip-if(B2G&&browserIsRemote) random-if(cocoaWidget) == bug-442419-progressmeter-max.xul bug-442419-progressmeter-max-ref.xul # fails most of the time on Mac because progress meter animates # Bug 974780
skip-if(B2G&&browserIsRemote) != textbox-multiline-default-value.xul textbox-multiline-empty.xul # Bug 974780