summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerARM.h5
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h6
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h6
-rw-r--r--Source/JavaScriptCore/assembler/MacroAssemblerSH4.h23
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp13
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp18
-rw-r--r--Source/JavaScriptCore/llint/LLIntData.cpp4
-rw-r--r--Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h6
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter.asm29
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm2
-rw-r--r--Source/JavaScriptCore/parser/ParserArena.h8
-rw-r--r--Source/JavaScriptCore/runtime/JSString.cpp1
-rw-r--r--Source/JavaScriptCore/runtime/JSString.h14
-rw-r--r--Source/JavaScriptCore/runtime/Operations.h33
-rw-r--r--Source/JavaScriptCore/runtime/StringPrototype.cpp4
-rw-r--r--Source/WTF/WTF.pri2
-rw-r--r--Source/WTF/WTF.pro3
-rw-r--r--Source/WTF/wtf/PassRefPtr.h14
-rw-r--r--Source/WTF/wtf/Platform.h12
-rw-r--r--Source/WTF/wtf/unicode/wchar/UnicodeWchar.h9
-rw-r--r--Source/WebCore/Target.pri6
-rw-r--r--Source/WebCore/css/CSSCursorImageValue.cpp16
-rw-r--r--Source/WebCore/css/CSSCursorImageValue.h2
-rw-r--r--Source/WebCore/css/CSSImageSetValue.cpp9
-rw-r--r--Source/WebCore/css/CSSImageSetValue.h1
-rw-r--r--Source/WebCore/css/CSSImageValue.cpp11
-rw-r--r--Source/WebCore/css/CSSImageValue.h1
-rw-r--r--Source/WebCore/html/HTMLMediaElement.cpp4
-rw-r--r--Source/WebCore/page/ChromeClient.h1
-rw-r--r--Source/WebCore/platform/ThreadGlobalData.cpp1
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp22
-rw-r--r--Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h2
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp5
-rw-r--r--Source/WebCore/platform/graphics/qt/QFramebufferPaintDevice.cpp6
-rw-r--r--Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp5
-rw-r--r--Source/WebCore/platform/text/TextBreakIteratorICU.cpp2
-rw-r--r--Source/WebCore/platform/text/TextEncodingDetectorICU.cpp2
-rw-r--r--Source/WebCore/plugins/qt/PluginPackageQt.cpp3
-rw-r--r--Source/WebCore/rendering/RenderBlockLineLayout.cpp2
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp4
-rw-r--r--Source/WebCore/rendering/RenderTable.cpp2
-rw-r--r--Source/WebCore/rendering/style/StylePendingImage.h16
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h3
-rw-r--r--Tools/QtTestBrowser/qttestbrowser.cpp12
-rw-r--r--Tools/qmake/config.tests/icu/icu.pro4
-rw-r--r--Tools/qmake/config.tests/leveldb/leveldb.pro2
-rw-r--r--Tools/qmake/config.tests/libwebp/libwebp.pro2
-rw-r--r--Tools/qmake/mkspecs/features/configure.prf8
-rw-r--r--Tools/qmake/mkspecs/features/default_post.prf3
-rw-r--r--Tools/qmake/mkspecs/features/features.prf4
50 files changed, 294 insertions, 79 deletions
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
index 494fe640d..9058514dc 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -725,6 +725,11 @@ public:
return Jump(m_assembler.jmp(ARMCondition(cond)));
}
+ Jump branchAdd32(ResultCondition cond, Address src, RegisterID dest)
+ {
+ load32(src, ARMRegisters::S0);
+ return branchAdd32(cond, dest, ARMRegisters::S0, dest);
+ }
void mull32(RegisterID op1, RegisterID op2, RegisterID dest)
{
if (op2 == dest) {
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
index b1bc41729..ac3cc8646 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
@@ -1473,6 +1473,12 @@ public:
return branchAdd32(cond, dest, src, dest);
}
+ Jump branchAdd32(ResultCondition cond, Address src, RegisterID dest)
+ {
+ load32(src, dataTempRegister);
+ return branchAdd32(cond, dest, dataTempRegister, dest);
+ }
+
Jump branchAdd32(ResultCondition cond, TrustedImm32 imm, RegisterID dest)
{
return branchAdd32(cond, dest, imm, dest);
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h b/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h
index 927b08b07..fe78431bd 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h
@@ -1676,6 +1676,12 @@ public:
return branchAdd32(cond, immTempRegister, dest);
}
+ Jump branchAdd32(ResultCondition cond, Address address, RegisterID dest)
+ {
+ load32(address, immTempRegister);
+ return branchAdd32(cond, immTempRegister, dest);
+ }
+
Jump branchAdd32(ResultCondition cond, RegisterID src, TrustedImm32 imm, RegisterID dest)
{
move(imm, immTempRegister);
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h b/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h
index 16e604b00..a65614b92 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h
@@ -2080,6 +2080,29 @@ public:
return result ? branchTrue() : branchFalse();
}
+ Jump branchAdd32(ResultCondition cond, Address src, RegisterID dest)
+ {
+ ASSERT((cond == Overflow) || (cond == Signed) || (cond == PositiveOrZero) || (cond == Zero) || (cond == NonZero));
+
+ if (cond == Overflow) {
+ RegisterID srcVal = claimScratch();
+ load32(src, srcVal);
+ m_assembler.addvlRegReg(srcVal, dest);
+ releaseScratch(srcVal);
+ return branchTrue();
+ }
+
+ add32(src, dest);
+
+ if ((cond == Signed) || (cond == PositiveOrZero)) {
+ m_assembler.cmppz(dest);
+ return (cond == Signed) ? branchFalse() : branchTrue();
+ }
+
+ compare32(0, dest, Equal);
+ return (cond == NonZero) ? branchFalse() : branchTrue();
+ }
+
Jump branchMul32(ResultCondition cond, RegisterID src, RegisterID dest)
{
ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index 29a0b2b61..1305c0a5d 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -1644,6 +1644,11 @@ JSCell* DFG_OPERATION operationMakeRope2(ExecState* exec, JSString* left, JSStri
VM& vm = exec->vm();
NativeCallFrameTracer tracer(&vm, exec);
+ if (static_cast<int32_t>(left->length() + right->length()) < 0) {
+ throwOutOfMemoryError(exec);
+ return 0;
+ }
+
return JSRopeString::create(vm, left, right);
}
@@ -1652,6 +1657,14 @@ JSCell* DFG_OPERATION operationMakeRope3(ExecState* exec, JSString* a, JSString*
VM& vm = exec->vm();
NativeCallFrameTracer tracer(&vm, exec);
+ Checked<int32_t, RecordOverflow> length = a->length();
+ length += b->length();
+ length += c->length();
+ if (length.hasOverflowed()) {
+ throwOutOfMemoryError(exec);
+ return 0;
+ }
+
return JSRopeString::create(vm, a, b, c);
}
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index 71fd99a04..07312e036 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -3222,12 +3222,28 @@ void SpeculativeJIT::compileMakeRope(Node* node)
m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(resultGPR, JSRopeString::offsetOfFibers() + sizeof(WriteBarrier<JSString>) * i));
m_jit.load32(JITCompiler::Address(opGPRs[0], JSString::offsetOfFlags()), scratchGPR);
m_jit.load32(JITCompiler::Address(opGPRs[0], JSString::offsetOfLength()), allocatorGPR);
+ if (!ASSERT_DISABLED) {
+ JITCompiler::Jump ok = m_jit.branch32(
+ JITCompiler::GreaterThanOrEqual, allocatorGPR, TrustedImm32(0));
+ m_jit.breakpoint();
+ ok.link(&m_jit);
+ }
for (unsigned i = 1; i < numOpGPRs; ++i) {
m_jit.and32(JITCompiler::Address(opGPRs[i], JSString::offsetOfFlags()), scratchGPR);
- m_jit.add32(JITCompiler::Address(opGPRs[i], JSString::offsetOfLength()), allocatorGPR);
+ speculationCheck(
+ Uncountable, JSValueSource(), 0,
+ m_jit.branchAdd32(
+ JITCompiler::Overflow,
+ JITCompiler::Address(opGPRs[i], JSString::offsetOfLength()), allocatorGPR));
}
m_jit.and32(JITCompiler::TrustedImm32(JSString::Is8Bit), scratchGPR);
m_jit.store32(scratchGPR, JITCompiler::Address(resultGPR, JSString::offsetOfFlags()));
+ if (!ASSERT_DISABLED) {
+ JITCompiler::Jump ok = m_jit.branch32(
+ JITCompiler::GreaterThanOrEqual, allocatorGPR, TrustedImm32(0));
+ m_jit.breakpoint();
+ ok.link(&m_jit);
+ }
m_jit.store32(allocatorGPR, JITCompiler::Address(resultGPR, JSString::offsetOfLength()));
switch (numOpGPRs) {
diff --git a/Source/JavaScriptCore/llint/LLIntData.cpp b/Source/JavaScriptCore/llint/LLIntData.cpp
index f91da9c0a..f1e367510 100644
--- a/Source/JavaScriptCore/llint/LLIntData.cpp
+++ b/Source/JavaScriptCore/llint/LLIntData.cpp
@@ -116,7 +116,11 @@ void Data::performAssertions(VM& vm)
#if !ASSERT_DISABLED
Vector<int> testVector;
testVector.resize(42);
+#if USE(JSVALUE64) && OS(WINDOWS)
+ ASSERT(bitwise_cast<uint32_t*>(&testVector)[4] == 42);
+#else
ASSERT(bitwise_cast<uint32_t*>(&testVector)[sizeof(void*)/sizeof(uint32_t) + 1] == 42);
+#endif
ASSERT(bitwise_cast<int**>(&testVector)[0] == testVector.begin());
#endif
diff --git a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
index bad62ddf8..9010757b4 100644
--- a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
+++ b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
@@ -104,6 +104,12 @@
#define OFFLINE_ASM_JSVALUE64 0
#endif
+#if USE(JSVALUE64) && OS(WINDOWS)
+#define OFFLINE_ASM_WIN64 1
+#else
+#define OFFLINE_ASM_WIN64 0
+#endif
+
#if !ASSERT_DISABLED
#define OFFLINE_ASM_ASSERT_ENABLED 1
#else
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
index 2b5a23c24..22ba11164 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
@@ -87,6 +87,12 @@ else
const PayloadOffset = 0
end
+if JSVALUE64
+ const JSCellPayloadOffset = 0
+else
+ const JSCellPayloadOffset = PayloadOffset
+end
+
# Constant for reasoning about butterflies.
const IsArray = 1
const IndexingShapeMask = 30
@@ -155,13 +161,14 @@ end
# This must match wtf/Vector.h
const VectorBufferOffset = 0
-if JSVALUE64
+if WIN64
+ const VectorSizeOffset = 16
+elsif JSVALUE64
const VectorSizeOffset = 12
else
const VectorSizeOffset = 8
end
-
# Some common utilities.
macro crash()
if C_LOOP
@@ -267,13 +274,13 @@ macro assertNotConstant(index)
end
macro functionForCallCodeBlockGetter(targetRegister)
- loadp Callee[cfr], targetRegister
+ loadp Callee + JSCellPayloadOffset[cfr], targetRegister
loadp JSFunction::m_executable[targetRegister], targetRegister
loadp FunctionExecutable::m_codeBlockForCall[targetRegister], targetRegister
end
macro functionForConstructCodeBlockGetter(targetRegister)
- loadp Callee[cfr], targetRegister
+ loadp Callee + JSCellPayloadOffset[cfr], targetRegister
loadp JSFunction::m_executable[targetRegister], targetRegister
loadp FunctionExecutable::m_codeBlockForConstruct[targetRegister], targetRegister
end
@@ -671,7 +678,7 @@ _llint_op_resolve_global_var:
macro resolveScopedVarBody(resolveOperations)
# First ResolveOperation is to skip scope chain nodes
getScope(macro(dest)
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
end,
ResolveOperation::m_scopesToSkip[resolveOperations], t1, t2)
loadp JSVariableObject::m_registers[t1], t1 # t1 now contains the activation registers
@@ -696,7 +703,7 @@ _llint_op_resolve_scoped_var_on_top_scope:
loadisFromInstruction(1, t3)
# We know we want the top scope chain entry
- loadp ScopeChain + PayloadOffset[cfr], t1
+ loadp ScopeChain + JSCellPayloadOffset[cfr], t1
loadp JSVariableObject::m_registers[t1], t1 # t1 now contains the activation registers
# Second ResolveOperation tells us what offset to use
@@ -718,7 +725,7 @@ _llint_op_resolve_scoped_var_with_top_scope_check:
loadp JSScope::m_next[t1], dest
jmp .done
.scopeChainNotCreated:
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
.done:
end,
# Second ResolveOperation tells us how many more nodes to skip
@@ -773,7 +780,7 @@ _llint_op_resolve_base_to_scope:
getResolveOperation(4, t0)
# First ResolveOperation is to skip scope chain nodes
getScope(macro(dest)
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
end,
ResolveOperation::m_scopesToSkip[t0], t1, t2)
loadisFromInstruction(1, t3)
@@ -798,7 +805,7 @@ _llint_op_resolve_base_to_scope_with_top_scope_check:
loadp JSScope::m_next[t1], dest
jmp .done
.scopeChainNotCreated:
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
.done:
end,
# Second ResolveOperation tells us how many more nodes to skip
@@ -823,7 +830,7 @@ macro interpretResolveWithBase(opcodeLength, slowPath)
getResolveOperation(4, t0)
btpz t0, .slowPath
- loadp ScopeChain[cfr], t3
+ loadp ScopeChain + JSCellPayloadOffset[cfr], t3
# Get the base
loadis ResolveOperation::m_operation[t0], t2
@@ -845,7 +852,7 @@ macro interpretResolveWithBase(opcodeLength, slowPath)
loadp JSScope::m_next[t1], dest
jmp .done
.scopeChainNotCreated:
- loadp ScopeChain + PayloadOffset[cfr], dest
+ loadp ScopeChain + JSCellPayloadOffset[cfr], dest
.done:
end,
sizeof ResolveOperation + ResolveOperation::m_scopesToSkip[t0], t1, t2)
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index 89e40c7d6..87aa09eab 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -1692,7 +1692,7 @@ _llint_op_next_pname:
loadi 20[PC], t2
loadi PayloadOffset[cfr, t2, 8], t2
loadp JSPropertyNameIterator::m_jsStrings[t2], t3
- loadi [t3, t0, 8], t3
+ loadi PayloadOffset[t3, t0, 8], t3
addi 1, t0
storei t0, PayloadOffset[cfr, t1, 8]
loadi 4[PC], t1
diff --git a/Source/JavaScriptCore/parser/ParserArena.h b/Source/JavaScriptCore/parser/ParserArena.h
index 45d4b158e..8d790c44c 100644
--- a/Source/JavaScriptCore/parser/ParserArena.h
+++ b/Source/JavaScriptCore/parser/ParserArena.h
@@ -71,6 +71,10 @@ namespace JSC {
template <typename T>
ALWAYS_INLINE const Identifier& IdentifierArena::makeIdentifier(VM* vm, const T* characters, size_t length)
{
+ if (length == 0) {
+ m_identifiers.append(Identifier(Identifier::EmptyIdentifier));
+ return m_identifiers.last();
+ }
if (characters[0] >= MaximumCachableCharacter) {
m_identifiers.append(Identifier(vm, characters, length));
return m_identifiers.last();
@@ -92,6 +96,10 @@ namespace JSC {
ALWAYS_INLINE const Identifier& IdentifierArena::makeIdentifierLCharFromUChar(VM* vm, const UChar* characters, size_t length)
{
+ if (length == 0) {
+ m_identifiers.append(Identifier(Identifier::EmptyIdentifier));
+ return m_identifiers.last();
+ }
if (characters[0] >= MaximumCachableCharacter) {
m_identifiers.append(Identifier::createLCharFromUChar(vm, characters, length));
return m_identifiers.last();
diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp
index 86704d715..6f0b09d13 100644
--- a/Source/JavaScriptCore/runtime/JSString.cpp
+++ b/Source/JavaScriptCore/runtime/JSString.cpp
@@ -40,6 +40,7 @@ void JSRopeString::RopeBuilder::expand()
{
ASSERT(m_index == JSRopeString::s_maxInternalRopeLength);
JSString* jsString = m_jsString;
+ RELEASE_ASSERT(jsString);
m_jsString = jsStringBuilder(&m_vm);
m_index = 0;
append(jsString);
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index 855de974d..fc383b2f4 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2014 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -121,7 +121,8 @@ public:
static JSString* create(VM& vm, PassRefPtr<StringImpl> value)
{
ASSERT(value);
- size_t length = value->length();
+ int32_t length = value->length();
+ RELEASE_ASSERT(length >= 0);
size_t cost = value->cost();
JSString* newString = new (NotNull, allocateCell<JSString>(vm.heap)) JSString(vm, value);
newString->finishCreation(vm, length, cost);
@@ -226,15 +227,21 @@ class JSRopeString : public JSString {
{
}
- void append(JSString* jsString)
+ bool append(JSString* jsString)
{
if (m_index == JSRopeString::s_maxInternalRopeLength)
expand();
+ if (static_cast<int32_t>(m_jsString->length() + jsString->length()) < 0) {
+ m_jsString = 0;
+ return false;
+ }
m_jsString->append(m_vm, m_index++, jsString);
+ return true;
}
JSRopeString* release()
{
+ RELEASE_ASSERT(m_jsString);
JSRopeString* tmp = m_jsString;
m_jsString = 0;
return tmp;
@@ -284,6 +291,7 @@ private:
{
m_fibers[index].set(vm, this, jsString);
m_length += jsString->m_length;
+ RELEASE_ASSERT(static_cast<int32_t>(m_length) >= 0);
setIs8Bit(is8Bit() && jsString->is8Bit());
}
diff --git a/Source/JavaScriptCore/runtime/Operations.h b/Source/JavaScriptCore/runtime/Operations.h
index afac13000..e628662e0 100644
--- a/Source/JavaScriptCore/runtime/Operations.h
+++ b/Source/JavaScriptCore/runtime/Operations.h
@@ -42,13 +42,13 @@ ALWAYS_INLINE JSValue jsString(ExecState* exec, JSString* s1, JSString* s2)
{
VM& vm = exec->vm();
- unsigned length1 = s1->length();
+ int32_t length1 = s1->length();
if (!length1)
return s2;
- unsigned length2 = s2->length();
+ int32_t length2 = s2->length();
if (!length2)
return s1;
- if ((length1 + length2) < length1)
+ if ((length1 + length2) < 0)
return throwOutOfMemoryError(exec);
return JSRopeString::create(vm, s1, s2);
@@ -58,9 +58,13 @@ ALWAYS_INLINE JSValue jsString(ExecState* exec, const String& u1, const String&
{
VM* vm = &exec->vm();
- unsigned length1 = u1.length();
- unsigned length2 = u2.length();
- unsigned length3 = u3.length();
+ int32_t length1 = u1.length();
+ int32_t length2 = u2.length();
+ int32_t length3 = u3.length();
+
+ if (length1 < 0 || length2 < 0 || length3 < 0)
+ return throwOutOfMemoryError(exec);
+
if (!length1)
return jsString(exec, jsString(vm, u2), jsString(vm, u3));
if (!length2)
@@ -68,9 +72,9 @@ ALWAYS_INLINE JSValue jsString(ExecState* exec, const String& u1, const String&
if (!length3)
return jsString(exec, jsString(vm, u1), jsString(vm, u2));
- if ((length1 + length2) < length1)
+ if ((length1 + length2) < 0)
return throwOutOfMemoryError(exec);
- if ((length1 + length2 + length3) < length3)
+ if ((length1 + length2 + length3) < 0)
return throwOutOfMemoryError(exec);
return JSRopeString::create(exec->vm(), jsString(vm, u1), jsString(vm, u2), jsString(vm, u3));
@@ -81,15 +85,11 @@ ALWAYS_INLINE JSValue jsString(ExecState* exec, Register* strings, unsigned coun
VM* vm = &exec->vm();
JSRopeString::RopeBuilder ropeBuilder(*vm);
- unsigned oldLength = 0;
-
for (unsigned i = 0; i < count; ++i) {
JSValue v = strings[i].jsValue();
- ropeBuilder.append(v.toString(exec));
- if (ropeBuilder.length() < oldLength) // True for overflow
+ if (!ropeBuilder.append(v.toString(exec)))
return throwOutOfMemoryError(exec);
- oldLength = ropeBuilder.length();
}
return ropeBuilder.release();
@@ -101,15 +101,10 @@ ALWAYS_INLINE JSValue jsStringFromArguments(ExecState* exec, JSValue thisValue)
JSRopeString::RopeBuilder ropeBuilder(*vm);
ropeBuilder.append(thisValue.toString(exec));
- unsigned oldLength = 0;
-
for (unsigned i = 0; i < exec->argumentCount(); ++i) {
JSValue v = exec->argument(i);
- ropeBuilder.append(v.toString(exec));
-
- if (ropeBuilder.length() < oldLength) // True for overflow
+ if (!ropeBuilder.append(v.toString(exec)))
return throwOutOfMemoryError(exec);
- oldLength = ropeBuilder.length();
}
return ropeBuilder.release();
diff --git a/Source/JavaScriptCore/runtime/StringPrototype.cpp b/Source/JavaScriptCore/runtime/StringPrototype.cpp
index c422fd17b..2e9baba73 100644
--- a/Source/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/StringPrototype.cpp
@@ -761,6 +761,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncIndexOf(ExecState* exec)
else {
unsigned pos;
int len = s.length();
+ RELEASE_ASSERT(len >= 0);
if (a1.isUInt32())
pos = std::min<uint32_t>(a1.asUInt32(), len);
else {
@@ -904,6 +905,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSlice(ExecState* exec)
return throwVMTypeError(exec);
String s = thisValue.toString(exec)->value(exec);
int len = s.length();
+ RELEASE_ASSERT(len >= 0);
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
@@ -1216,6 +1218,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSubstring(ExecState* exec)
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
int len = jsString->length();
+ RELEASE_ASSERT(len >= 0);
double start = a0.toNumber(exec);
double end;
@@ -1253,6 +1256,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToLowerCase(ExecState* exec)
int sSize = s.length();
if (!sSize)
return JSValue::encode(sVal);
+ RELEASE_ASSERT(sSize >= 0);
StringImpl* ourImpl = s.impl();
RefPtr<StringImpl> lower = ourImpl->lower();
diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri
index 4c0d1908e..696e4962e 100644
--- a/Source/WTF/WTF.pri
+++ b/Source/WTF/WTF.pri
@@ -13,7 +13,7 @@ mac {
# Therefore WebKit provides adequate header files.
INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH
LIBS += -licucore
-} else {
+} else:!use?(wchar_unicode): {
win32: LIBS += -licuin -licuuc -licudt
else:!contains(QT_CONFIG,no-pkg-config):packagesExist("icu-i18n"): PKGCONFIG *= icu-i18n
else:android: LIBS += -licui18n -licuuc
diff --git a/Source/WTF/WTF.pro b/Source/WTF/WTF.pro
index ef622920d..2976d007b 100644
--- a/Source/WTF/WTF.pro
+++ b/Source/WTF/WTF.pro
@@ -264,6 +264,8 @@ win32 {
threads/BinarySemaphore.cpp
}
+use?(wchar_unicode): SOURCES += wtf/unicode/wchar/UnicodeWchar.cpp
+
QT += core
QT -= gui
@@ -276,4 +278,3 @@ QT -= gui
# For GCC 4.5 and before we disable C++0x mode in JSC for if enabled in Qt's mkspec
QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x -std=c++11 -std=gnu++11
}
-
diff --git a/Source/WTF/wtf/PassRefPtr.h b/Source/WTF/wtf/PassRefPtr.h
index 1e1c777ad..848fc5fd3 100644
--- a/Source/WTF/wtf/PassRefPtr.h
+++ b/Source/WTF/wtf/PassRefPtr.h
@@ -32,28 +32,18 @@ namespace WTF {
inline void adopted(const void*) { }
-#if !(PLATFORM(QT) && CPU(ARM))
- #define REF_DEREF_INLINE ALWAYS_INLINE
-#else
- // Older version of gcc used by Harmattan SDK fails to build with ALWAYS_INLINE.
- // See https://bugs.webkit.org/show_bug.cgi?id=37253 for details.
- #define REF_DEREF_INLINE inline
-#endif
-
- template<typename T> REF_DEREF_INLINE void refIfNotNull(T* ptr)
+ template<typename T> ALWAYS_INLINE void refIfNotNull(T* ptr)
{
if (LIKELY(ptr != 0))
ptr->ref();
}
- template<typename T> REF_DEREF_INLINE void derefIfNotNull(T* ptr)
+ template<typename T> ALWAYS_INLINE void derefIfNotNull(T* ptr)
{
if (LIKELY(ptr != 0))
ptr->deref();
}
- #undef REF_DEREF_INLINE
-
template<typename T> class PassRefPtr {
public:
PassRefPtr() : m_ptr(0) { }
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 688fdf494..a53c60de5 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -132,6 +132,9 @@
/* CPU(SH4) - SuperH SH-4 */
#if defined(__SH4__)
#define WTF_CPU_SH4 1
+#ifdef __BIG_ENDIAN__
+#define WTF_CPU_BIG_ENDIAN 1
+#endif
#endif
/* CPU(SPARC32) - SPARC 32-bit */
@@ -569,6 +572,10 @@
#endif /* OS(WINCE) && !PLATFORM(QT) */
+#if OS(ANDROID) && PLATFORM(QT)
+# define WTF_USE_WCHAR_UNICODE 1
+#endif
+
#if !USE(WCHAR_UNICODE)
#define WTF_USE_ICU_UNICODE 1
#endif
@@ -758,6 +765,11 @@
#define ENABLE_JIT 0
#endif
+/* All the current JIT implementations target little-endian */
+#if CPU(BIG_ENDIAN)
+#define ENABLE_JIT 0
+#endif
+
/* Disable JIT on x32 */
#if CPU(X32)
#define ENABLE_JIT 0
diff --git a/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h b/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
index 10c2026c5..a8610916d 100644
--- a/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
+++ b/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h
@@ -26,11 +26,16 @@
#define WTF_UnicodeWchar_h
#include <stdint.h>
-#include <wchar.h>
#include <wtf/unicode/ScriptCodesFromICU.h>
#include <wtf/unicode/UnicodeMacrosFromICU.h>
-typedef wchar_t UChar;
+#ifndef ANDROID
+# include <wchar.h>
+ typedef wchar_t UChar;
+#else
+ typedef unsigned short int UChar;
+#endif
+
typedef uint32_t UChar32;
namespace WTF {
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index c16ac36ab..b9167d13b 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -2981,6 +2981,12 @@ mac {
}
contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp
+use?(wchar_unicode): {
+ SOURCES += platform/text/wchar/TextBreakIteratorWchar.cpp \
+ platform/text/TextEncodingDetectorNone.cpp
+ SOURCES -= platform/text/TextEncodingDetectorICU.cpp
+}
+
mac {
# For Mac we use the same SmartReplace implementation as the Apple port.
SOURCES += editing/SmartReplaceCF.cpp
diff --git a/Source/WebCore/css/CSSCursorImageValue.cpp b/Source/WebCore/css/CSSCursorImageValue.cpp
index b7c747e8a..f37273ccd 100644
--- a/Source/WebCore/css/CSSCursorImageValue.cpp
+++ b/Source/WebCore/css/CSSCursorImageValue.cpp
@@ -67,8 +67,16 @@ CSSCursorImageValue::CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool h
{
}
+inline void CSSCursorImageValue::detachPendingImage()
+{
+ if (m_image && m_image->isPendingImage())
+ static_cast<StylePendingImage&>(*m_image).detachFromCSSValue();
+}
+
CSSCursorImageValue::~CSSCursorImageValue()
{
+ detachPendingImage();
+
#if ENABLE(SVG)
if (!isSVGCursor())
return;
@@ -153,6 +161,7 @@ StyleImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());
// FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), loader->document())) {
+ detachPendingImage();
RefPtr<CSSImageValue> svgImageValue = CSSImageValue::create(cursorElement->href());
StyleCachedImage* cachedImage = svgImageValue->cachedImage(loader);
m_image = cachedImage;
@@ -161,8 +170,10 @@ StyleImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
}
#endif
- if (m_imageValue->isImageValue())
+ if (m_imageValue->isImageValue()) {
+ detachPendingImage();
m_image = static_cast<CSSImageValue*>(m_imageValue.get())->cachedImage(loader);
+ }
}
if (m_image && m_image->isCachedImage())
@@ -205,7 +216,8 @@ String CSSCursorImageValue::cachedImageURL()
void CSSCursorImageValue::clearCachedImage()
{
- m_image = 0;
+ detachPendingImage();
+ m_image.clear();
m_accessedImage = false;
}
diff --git a/Source/WebCore/css/CSSCursorImageValue.h b/Source/WebCore/css/CSSCursorImageValue.h
index 89391c33d..8e1ae35d1 100644
--- a/Source/WebCore/css/CSSCursorImageValue.h
+++ b/Source/WebCore/css/CSSCursorImageValue.h
@@ -64,6 +64,8 @@ public:
private:
CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot);
+ void detachPendingImage();
+
#if ENABLE(SVG)
bool isSVGCursor() const;
String cachedImageURL();
diff --git a/Source/WebCore/css/CSSImageSetValue.cpp b/Source/WebCore/css/CSSImageSetValue.cpp
index cbd8a4333..96cacf163 100644
--- a/Source/WebCore/css/CSSImageSetValue.cpp
+++ b/Source/WebCore/css/CSSImageSetValue.cpp
@@ -49,8 +49,16 @@ CSSImageSetValue::CSSImageSetValue()
{
}
+inline void CSSImageSetValue::detachPendingImage()
+{
+ if (m_imageSet && m_imageSet->isPendingImage())
+ static_cast<StylePendingImage&>(*m_imageSet).detachFromCSSValue();
+}
+
CSSImageSetValue::~CSSImageSetValue()
{
+ detachPendingImage();
+
if (m_imageSet && m_imageSet->isCachedImageSet())
static_cast<StyleCachedImageSet*>(m_imageSet.get())->clearImageSetValue();
}
@@ -114,6 +122,7 @@ StyleCachedImageSet* CSSImageSetValue::cachedImageSet(CachedResourceLoader* load
CachedResourceRequest request(ResourceRequest(document->completeURL(image.imageURL)));
request.setInitiator(cachedResourceRequestInitiators().css);
if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request)) {
+ detachPendingImage();
m_imageSet = StyleCachedImageSet::create(cachedImage.get(), image.scaleFactor, this);
m_accessedBestFitImage = true;
}
diff --git a/Source/WebCore/css/CSSImageSetValue.h b/Source/WebCore/css/CSSImageSetValue.h
index 95270a67d..bb950734c 100644
--- a/Source/WebCore/css/CSSImageSetValue.h
+++ b/Source/WebCore/css/CSSImageSetValue.h
@@ -71,6 +71,7 @@ private:
CSSImageSetValue();
CSSImageSetValue(const CSSImageSetValue& cloneFrom);
+ void detachPendingImage();
void fillImageSet();
static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale second) { return first.scaleFactor < second.scaleFactor; }
diff --git a/Source/WebCore/css/CSSImageValue.cpp b/Source/WebCore/css/CSSImageValue.cpp
index a040ac3b5..bdb8d9e5a 100644
--- a/Source/WebCore/css/CSSImageValue.cpp
+++ b/Source/WebCore/css/CSSImageValue.cpp
@@ -51,8 +51,15 @@ CSSImageValue::CSSImageValue(const String& url, StyleImage* image)
{
}
+inline void CSSImageValue::detachPendingImage()
+{
+ if (m_image && m_image->isPendingImage())
+ static_cast<StylePendingImage&>(*m_image).detachFromCSSValue();
+}
+
CSSImageValue::~CSSImageValue()
{
+ detachPendingImage();
}
StyleImage* CSSImageValue::cachedOrPendingImage()
@@ -75,8 +82,10 @@ StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader, const
request.setInitiator(cachedResourceRequestInitiators().css);
else
request.setInitiator(m_initiatorName);
- if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request))
+ if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage(request)) {
+ detachPendingImage();
m_image = StyleCachedImage::create(cachedImage.get());
+ }
}
return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage*>(m_image.get()) : 0;
diff --git a/Source/WebCore/css/CSSImageValue.h b/Source/WebCore/css/CSSImageValue.h
index 8b73cee0c..66b596e4e 100644
--- a/Source/WebCore/css/CSSImageValue.h
+++ b/Source/WebCore/css/CSSImageValue.h
@@ -61,6 +61,7 @@ public:
private:
explicit CSSImageValue(const String& url);
CSSImageValue(const String& url, StyleImage*);
+ void detachPendingImage();
String m_url;
RefPtr<StyleImage> m_image;
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index fc8578e57..395aabe80 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -374,8 +374,10 @@ HTMLMediaElement::~HTMLMediaElement()
}
#endif
- if (m_mediaController)
+ if (m_mediaController) {
m_mediaController->removeMediaElement(this);
+ m_mediaController = 0;
+ }
#if ENABLE(MEDIA_SOURCE)
setSourceState(MediaSource::closedKeyword());
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index 6fce249eb..3146d41ff 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -266,6 +266,7 @@ public:
FilterTrigger = 1 << 5,
ScrollableInnerFrameTrigger = 1 << 6,
AnimatedOpacityTrigger = 1 << 7,
+ LargeAreaTrigger = 1 << 8,
AllTriggers = 0xFFFFFFFF
};
typedef unsigned CompositingTriggerFlags;
diff --git a/Source/WebCore/platform/ThreadGlobalData.cpp b/Source/WebCore/platform/ThreadGlobalData.cpp
index fe88c3af1..698ec6e98 100644
--- a/Source/WebCore/platform/ThreadGlobalData.cpp
+++ b/Source/WebCore/platform/ThreadGlobalData.cpp
@@ -32,6 +32,7 @@
#include "InspectorCounters.h"
#include "ThreadTimers.h"
#include <wtf/MainThread.h>
+#include <wtf/PassOwnPtr.h>
#include <wtf/WTFThreadData.h>
#include <wtf/text/StringImpl.h>
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
index 7c326f593..f7ab46b64 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
@@ -38,8 +38,10 @@
#include <OpenGL/gl.h>
#elif PLATFORM(QT)
#include <private/qopenglextensions_p.h>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
#include <private/qopenglvertexarrayobject_p.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN)
+#endif
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
#include "OpenGLShims.h"
#endif
@@ -50,7 +52,7 @@ namespace WebCore {
Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context)
: Extensions3DOpenGLCommon(context)
{
-#if PLATFORM(QT)
+#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
context->makeContextCurrent();
m_vaoFunctions = new QOpenGLVertexArrayObjectHelper(context->platformGraphicsContext3D());
#endif
@@ -58,7 +60,7 @@ Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context)
Extensions3DOpenGL::~Extensions3DOpenGL()
{
-#if PLATFORM(QT)
+#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
delete m_vaoFunctions;
m_vaoFunctions = 0;
#endif
@@ -90,8 +92,10 @@ Platform3DObject Extensions3DOpenGL::createVertexArrayOES()
if (isVertexArrayObjectSupported())
glGenVertexArrays(1, &array);
#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
if (isVertexArrayObjectSupported())
m_vaoFunctions->glGenVertexArrays(1, &array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glGenVertexArraysAPPLE(1, &array);
#endif
@@ -108,8 +112,10 @@ void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
if (isVertexArrayObjectSupported())
glDeleteVertexArrays(1, &array);
#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
if (isVertexArrayObjectSupported())
m_vaoFunctions->glDeleteVertexArrays(1, &array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glDeleteVertexArraysAPPLE(1, &array);
#endif
@@ -124,9 +130,11 @@ GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array)
#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN))
if (isVertexArrayObjectSupported())
return glIsVertexArray(array);
-#elif PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
if (isVertexArrayObjectSupported())
return m_vaoFunctions->glIsVertexArray(array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
return glIsVertexArrayAPPLE(array);
#endif
@@ -142,8 +150,10 @@ void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
if (isVertexArrayObjectSupported())
glBindVertexArray(array);
#elif PLATFORM(QT)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
if (isVertexArrayObjectSupported())
m_vaoFunctions->glBindVertexArray(array);
+#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glBindVertexArrayAPPLE(array);
#else
@@ -270,7 +280,11 @@ bool Extensions3DOpenGL::isVertexArrayObjectSupported()
#elif PLATFORM(QT)
bool Extensions3DOpenGL::isVertexArrayObjectSupported()
{
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
return m_vaoFunctions && m_vaoFunctions->isValid();
+#else
+ return false;
+#endif
}
#endif
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
index 45eacea6a..cf68fcbd9 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
@@ -71,7 +71,7 @@ private:
bool isVertexArrayObjectSupported();
#endif
-#if PLATFORM(QT)
+#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
QOpenGLVertexArrayObjectHelper *m_vaoFunctions;
#endif
};
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
index 827f436c8..ca404869a 100644
--- a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
@@ -274,8 +274,11 @@ void ImageBufferDataPrivateAccelerated::paintToTextureMapper(TextureMapper* text
}
invalidateState();
-
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_paintDevice->texture(), TextureMapperGL::ShouldBlend, m_paintDevice->size(), targetRect, matrix, opacity);
+#else
+ static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_paintDevice->texture(), TextureMapperGL::ShouldBlend | TextureMapperGL::ShouldFlipTexture, m_paintDevice->size(), targetRect, matrix, opacity);
+#endif
}
#if USE(GRAPHICS_SURFACE)
diff --git a/Source/WebCore/platform/graphics/qt/QFramebufferPaintDevice.cpp b/Source/WebCore/platform/graphics/qt/QFramebufferPaintDevice.cpp
index a4c088cbf..6d5936956 100644
--- a/Source/WebCore/platform/graphics/qt/QFramebufferPaintDevice.cpp
+++ b/Source/WebCore/platform/graphics/qt/QFramebufferPaintDevice.cpp
@@ -26,7 +26,9 @@ QFramebufferPaintDevice::QFramebufferPaintDevice(const QSize& size)
, m_framebufferObject(size, QOpenGLFramebufferObject::CombinedDepthStencil)
{
m_surface = QOpenGLContext::currentContext()->surface();
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
setPaintFlipped(true);
+#endif
m_framebufferObject.bind();
context()->functions()->glClearColor(0, 0, 0, 0);
context()->functions()->glClear(GL_COLOR_BUFFER_BIT);
@@ -47,7 +49,11 @@ QImage QFramebufferPaintDevice::toImage() const
context()->makeCurrent(m_surface);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
QImage image = m_framebufferObject.toImage(false);
+#else
+ QImage image = m_framebufferObject.toImage();
+#endif
if (currentContext)
currentContext->makeCurrent(currentSurface);
diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 5990a4075..fc6954610 100644
--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -687,9 +687,12 @@ void QNetworkReplyHandler::forwardData()
// -1 means we do not provide any data about transfer size to inspector so it would use
// Content-Length headers or content size to show transfer size.
client->didReceiveData(m_resourceHandle, buffer, readSize, -1);
+ // Check if the request has been aborted or this reply-handler was otherwise released.
+ if (wasAborted() || !m_replyWrapper)
+ break;
}
delete[] buffer;
- if (bytesAvailable > 0)
+ if (bytesAvailable > 0 && m_replyWrapper)
m_queue.requeue(&QNetworkReplyHandler::forwardData);
}
diff --git a/Source/WebCore/platform/text/TextBreakIteratorICU.cpp b/Source/WebCore/platform/text/TextBreakIteratorICU.cpp
index 5e25684b8..b4046ac9b 100644
--- a/Source/WebCore/platform/text/TextBreakIteratorICU.cpp
+++ b/Source/WebCore/platform/text/TextBreakIteratorICU.cpp
@@ -20,6 +20,7 @@
*/
#include "config.h"
+#if USE(ICU_UNICODE)
#include "TextBreakIterator.h"
#include "LineBreakIteratorPoolICU.h"
@@ -687,3 +688,4 @@ TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
}
}
+#endif // #if USE(ICU_UNICODE)
diff --git a/Source/WebCore/platform/text/TextEncodingDetectorICU.cpp b/Source/WebCore/platform/text/TextEncodingDetectorICU.cpp
index 430104eac..c7898abeb 100644
--- a/Source/WebCore/platform/text/TextEncodingDetectorICU.cpp
+++ b/Source/WebCore/platform/text/TextEncodingDetectorICU.cpp
@@ -29,6 +29,7 @@
*/
#include "config.h"
+#if USE(ICU_UNICODE)
#include "TextEncodingDetector.h"
#include "TextEncoding.h"
@@ -115,3 +116,4 @@ bool detectTextEncoding(const char* data, size_t len,
}
}
+#endif // #if USE(ICU_UNICODE)
diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
index 679480bd5..a674ad39d 100644
--- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -146,7 +146,8 @@ bool PluginPackage::isPluginBlacklisted()
{
// TODO: enumerate all plugins that are incompatible with Qt5.
const QLatin1String pluginBlacklist[] = {
- QLatin1String("skypebuttons")
+ QLatin1String("skypebuttons"),
+ QLatin1String("libkpartsplugin")
};
QString baseName = QFileInfo(static_cast<QString>(m_path)).baseName();
diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
index 8550ca495..c6f283a73 100644
--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -423,7 +423,7 @@ static void checkMidpoints(LineMidpointState& lineMidpointState, InlineIterator&
if (currpoint == lBreak) {
// We hit the line break before the start point. Shave off the start point.
lineMidpointState.numMidpoints--;
- if (endpoint.m_obj->style()->collapseWhiteSpace())
+ if (endpoint.m_obj->style()->collapseWhiteSpace() && endpoint.m_obj->isText())
endpoint.m_pos--;
}
}
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 784ebdc80..da390cb75 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -85,6 +85,7 @@ bool WebCoreHas3DRendering = true;
namespace WebCore {
static const int canvasAreaThresholdRequiringCompositing = 50 * 100;
+static const int largeAreaThresholdForCompositing = 8192 * 8192;
// During page loading delay layer flushes up to this many seconds to allow them coalesce, reducing workload.
static const double throttledLayerFlushDelay = .5;
@@ -1804,6 +1805,9 @@ bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer, R
bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const
{
+ if (!(m_compositingTriggers & ChromeClient::LargeAreaTrigger) && layer->size().area() > largeAreaThresholdForCompositing)
+ return false;
+
// FIXME: We disable accelerated compositing for elements in a RenderFlowThread as it doesn't work properly.
// See http://webkit.org/b/84900 to re-enable it.
return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer->renderer()->flowThreadState() == RenderObject::NotInsideFlowThread;
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index 3249afb8a..336b6c995 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -805,6 +805,7 @@ void RenderTable::splitColumn(unsigned position, unsigned firstSpan)
}
m_columnPos.grow(numEffCols() + 1);
+ m_columnPos[numEffCols()] = m_columnPos[numEffCols() - 1];
}
void RenderTable::appendColumn(unsigned span)
@@ -826,6 +827,7 @@ void RenderTable::appendColumn(unsigned span)
}
m_columnPos.grow(numEffCols() + 1);
+ m_columnPos[numEffCols()] = m_columnPos[numEffCols() - 1];
}
RenderTableCol* RenderTable::firstColumn() const
diff --git a/Source/WebCore/rendering/style/StylePendingImage.h b/Source/WebCore/rendering/style/StylePendingImage.h
index b689ee779..96e825c17 100644
--- a/Source/WebCore/rendering/style/StylePendingImage.h
+++ b/Source/WebCore/rendering/style/StylePendingImage.h
@@ -28,6 +28,9 @@
#include "CSSCursorImageValue.h"
#include "CSSImageGeneratorValue.h"
+#include "CSSImageValue.h"
+#include "StyleImage.h"
+
#if ENABLE(CSS_IMAGE_SET)
#include "CSSImageSetValue.h"
#endif
@@ -48,13 +51,15 @@ public:
virtual WrappedImagePtr data() const { return static_cast<CSSImageValue*>(m_value); }
virtual PassRefPtr<CSSValue> cssValue() const { return m_value; }
- CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? static_cast<CSSImageValue*>(m_value) : 0; }
- CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }
- CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }
+ CSSImageValue* cssImageValue() const { return m_value && m_value->isImageValue() ? static_cast<CSSImageValue*>(m_value) : 0; }
+ CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value && m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }
+ CSSCursorImageValue* cssCursorImageValue() const { return m_value && m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }
#if ENABLE(CSS_IMAGE_SET)
- CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }
+ CSSImageSetValue* cssImageSetValue() const { return m_value && m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }
#endif
-
+
+ void detachFromCSSValue() { m_value = 0; }
+
virtual LayoutSize imageSize(const RenderObject*, float /*multiplier*/) const OVERRIDE { return LayoutSize(); }
virtual bool imageHasRelativeWidth() const { return false; }
virtual bool imageHasRelativeHeight() const { return false; }
@@ -81,4 +86,5 @@ private:
};
}
+
#endif
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index d48b67ab0..c0cbee716 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -192,7 +192,8 @@ private:
VideoTrigger |
PluginTrigger|
CanvasTrigger |
- AnimationTrigger);
+ AnimationTrigger |
+ LargeAreaTrigger);
}
virtual bool layerTreeStateIsFrozen() const OVERRIDE;
diff --git a/Tools/QtTestBrowser/qttestbrowser.cpp b/Tools/QtTestBrowser/qttestbrowser.cpp
index ee1e7d4fa..b9fa59399 100644
--- a/Tools/QtTestBrowser/qttestbrowser.cpp
+++ b/Tools/QtTestBrowser/qttestbrowser.cpp
@@ -31,11 +31,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
+
#include "DumpRenderTreeSupportQt.h"
-#include "QtTestSupport.h"
#include "launcherwindow.h"
#include "urlloader.h"
+#if HAVE(QTTESTSUPPORT)
+#include "QtTestSupport.h"
+#endif
+
WindowOptions windowOptions;
#include <QApplication>
@@ -149,7 +154,9 @@ void LauncherApplication::handleUserOptions()
<< "[-offline-storage-database-enabled]"
<< "[-offline-web-application-cache-enabled]"
<< "[-set-offline-storage-default-quota maxSize]"
+#if HAVE(QTTESTSUPPORT)
<< "[-use-test-fonts]"
+#endif
<< "[-print-loaded-urls]"
<< "URLs";
appQuit(0);
@@ -245,9 +252,10 @@ void LauncherApplication::handleUserOptions()
windowOptions.useQOpenGLWidgetViewport = true;
}
-
+#if HAVE(QTTESTSUPPORT)
if (args.contains("-use-test-fonts"))
WebKit::QtTestSupport::initializeTestFonts();
+#endif
if (args.contains("-print-loaded-urls"))
windowOptions.printLoadedUrls = true;
diff --git a/Tools/qmake/config.tests/icu/icu.pro b/Tools/qmake/config.tests/icu/icu.pro
index 16267ff82..0486c531a 100644
--- a/Tools/qmake/config.tests/icu/icu.pro
+++ b/Tools/qmake/config.tests/icu/icu.pro
@@ -12,6 +12,10 @@ win32 {
} else {
LIBS += -licuin -licuuc -licudt
}
+} else:!contains(QT_CONFIG,no-pkg-config):packagesExist("icu-i18n") {
+ PKGCONFIG += icu-i18n
} else {
LIBS += -licui18n -licuuc -licudata
}
+
+load(qt_build_config)
diff --git a/Tools/qmake/config.tests/leveldb/leveldb.pro b/Tools/qmake/config.tests/leveldb/leveldb.pro
index 2d64eeba9..f28cfd155 100644
--- a/Tools/qmake/config.tests/leveldb/leveldb.pro
+++ b/Tools/qmake/config.tests/leveldb/leveldb.pro
@@ -1,3 +1,5 @@
SOURCES = leveldb.cpp
OBJECTS_DIR = obj
LIBS += -lleveldb -lmemenv
+
+load(qt_build_config)
diff --git a/Tools/qmake/config.tests/libwebp/libwebp.pro b/Tools/qmake/config.tests/libwebp/libwebp.pro
index 925725270..700c44df6 100644
--- a/Tools/qmake/config.tests/libwebp/libwebp.pro
+++ b/Tools/qmake/config.tests/libwebp/libwebp.pro
@@ -1,3 +1,5 @@
SOURCES = libwebp.cpp
OBJECTS_DIR = obj
LIBS += -lwebp
+
+load(qt_build_config)
diff --git a/Tools/qmake/mkspecs/features/configure.prf b/Tools/qmake/mkspecs/features/configure.prf
index 8bb90929d..73756e9d0 100644
--- a/Tools/qmake/mkspecs/features/configure.prf
+++ b/Tools/qmake/mkspecs/features/configure.prf
@@ -85,9 +85,6 @@ defineReplace(configEnabled) {
# command line options
defineTest(finalizeConfigure) {
- # Sanitize clashing options
- santizeFeatures()
-
# Sanitize build options
!qtHaveModule(testlib) {
CONFIGURE_WARNINGS += "Missing QtTest module, disabling DumpRenderTree, WebKitTestRunner and tests"
@@ -114,13 +111,16 @@ defineTest(finalizeConfigure) {
WEBKIT_CONFIG -= build_webkit2 build_minibrowser build_wtr
}
+ # Sanitize clashing options
+ santizeFeatures()
+
print_defaults {
log(DEFINES: $$configDefines()$${EOL})
error(Done computing defaults)
}
# Sanity checks that would prevent us from building the whole project altogether.
- !mac:!config_icu {
+ !android:!mac:!config_icu {
addReasonForSkippingBuild("ICU is required.")
}
production_build:blackberry {
diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
index e07d5e47d..cf6aabe89 100644
--- a/Tools/qmake/mkspecs/features/default_post.prf
+++ b/Tools/qmake/mkspecs/features/default_post.prf
@@ -48,8 +48,7 @@ DEFINES += $$configDefines()
INCLUDEPATH += \
$${ROOT_WEBKIT_DIR}/Source \
- $${ROOT_BUILD_DIR}/Source/include \
- $${QT.script.includes}
+ $${ROOT_BUILD_DIR}/Source/include
CONFIG -= warn_on
diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf
index 46278a610..ef1d5d74a 100644
--- a/Tools/qmake/mkspecs/features/features.prf
+++ b/Tools/qmake/mkspecs/features/features.prf
@@ -142,6 +142,8 @@ defineTest(detectFeatures) {
# IndexedDB requires leveldb
enable?(indexed_database): WEBKIT_CONFIG += use_leveldb
+ !config_icu:!mac: WEBKIT_CONFIG += use_wchar_unicode
+
export(WEBKIT_CONFIG)
export(CONFIGURE_WARNINGS)
}
@@ -176,7 +178,7 @@ defineTest(santizeFeatures) {
# VideoTrack requires video
!enable?(video): WEBKIT_CONFIG -= video_track
- # Minibrowser must be able to query for QtTestSupport
+ # QtTestBrowser and MiniBrowser must be able to query for QtTestSupport
build?(qttestsupport): WEBKIT_CONFIG += have_qttestsupport
# Accelerated 2D canvas uses 3D graphics support.