Index: /trunk/JavaScriptCore/runtime/Identifier.cpp =================================================================== --- /trunk/JavaScriptCore/runtime/Identifier.cpp (revision 1402) +++ /trunk/JavaScriptCore/runtime/Identifier.cpp (revision 1404) @@ -44,5 +44,5 @@ (*iter)->setIsIdentifier(false); } - + std::pair::iterator, bool> add(UString::Rep* value) { @@ -125,13 +125,8 @@ PassRefPtr Identifier::add(JSGlobalData* globalData, const char* c) { - if (!c) { - UString::Rep* rep = UString::null().rep(); - rep->hash(); - return rep; - } - if (!c[0]) { - UString::Rep::empty()->hash(); + if (!c) + return UString::null().rep(); + if (!c[0]) return UString::Rep::empty(); - } if (!c[1]) return add(globalData, globalData->smallStrings.singleCharacterStringRep(static_cast(c[0]))); @@ -194,8 +189,6 @@ return add(globalData, globalData->smallStrings.singleCharacterStringRep(c)); } - if (!length) { - UString::Rep::empty()->hash(); + if (!length) return UString::Rep::empty(); - } UCharBuffer buf = {s, length}; pair::iterator, bool> addResult = globalData->identifierTable->add(buf); @@ -214,19 +207,16 @@ { ASSERT(!r->isIdentifier()); + // The empty & null strings are static singletons, and static strings are handled + // in ::add() in the header, so we should never get here with a zero length string. + ASSERT(r->length()); + if (r->length() == 1) { UChar c = r->characters()[0]; if (c <= 0xFF) r = globalData->smallStrings.singleCharacterStringRep(c); - if (r->isIdentifier()) { -#ifndef NDEBUG - checkSameIdentifierTable(globalData, r); -#endif + if (r->isIdentifier()) return r; - } - } - if (!r->length()) { - UString::Rep::empty()->hash(); - return UString::Rep::empty(); - } + } + return *globalData->identifierTable->add(r).first; } @@ -259,23 +249,22 @@ #ifndef NDEBUG -void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep*) -{ - ASSERT_UNUSED(exec, exec->globalData().identifierTable == currentIdentifierTable()); -} - -void Identifier::checkSameIdentifierTable(JSGlobalData* globalData, UString::Rep*) -{ +void Identifier::checkCurrentIdentifierTable(JSGlobalData* globalData) +{ + // Check the identifier table accessible through the threadspecific matches the + // globalData's identifier table. ASSERT_UNUSED(globalData, globalData->identifierTable == currentIdentifierTable()); } +void Identifier::checkCurrentIdentifierTable(ExecState* exec) +{ + checkCurrentIdentifierTable(&exec->globalData()); +} + #else -void Identifier::checkSameIdentifierTable(ExecState*, UString::Rep*) -{ -} - -void Identifier::checkSameIdentifierTable(JSGlobalData*, UString::Rep*) -{ -} +// These only exists so that our exports are the same for debug and release builds. +// This would be an ASSERT_NOT_REACHED(), but we're in NDEBUG only code here! +void Identifier::checkCurrentIdentifierTable(JSGlobalData*) { CRASH(); } +void Identifier::checkCurrentIdentifierTable(ExecState*) { CRASH(); } #endif Index: /trunk/JavaScriptCore/runtime/UStringImpl.h =================================================================== --- /trunk/JavaScriptCore/runtime/UStringImpl.h (revision 1402) +++ /trunk/JavaScriptCore/runtime/UStringImpl.h (revision 1404) @@ -73,5 +73,5 @@ enum StaticStringConstructType { ConstructStaticString }; UStringOrRopeImpl(unsigned length, StaticStringConstructType) - : m_refCountAndFlags(s_refCountFlagStatic | BufferOwned) + : m_refCountAndFlags(s_refCountFlagStatic | s_refCountFlagIsIdentifier | BufferOwned) , m_length(length) { @@ -106,45 +106,100 @@ class UStringImpl : public UStringOrRopeImpl { + friend class CStringTranslator; + friend class UCharBufferTranslator; + friend class JIT; + friend class SmallStringsStorage; + friend class UStringOrRopeImpl; + friend void initializeUString(); +private: + // For SmallStringStorage, which allocates an array and uses an in-place new. + UStringImpl() { } + + // Used to construct static strings, which have an special refCount that can never hit zero. + // This means that the static string will never be destroyed, which is important because + // static strings will be shared across threads & ref-counted in a non-threadsafe manner. + UStringImpl(const UChar* characters, unsigned length, StaticStringConstructType) + : UStringOrRopeImpl(length, ConstructStaticString) + , m_data(characters) + , m_buffer(0) + , m_hash(0) + { + hash(); + } + + // Create a normal string with internal storage (BufferInternal) + UStringImpl(unsigned length) + : UStringOrRopeImpl(length, BufferInternal) + , m_data(reinterpret_cast(this + 1)) + , m_buffer(0) + , m_hash(0) + { + ASSERT(m_data); + ASSERT(m_length); + } + + // Create a UStringImpl adopting ownership of the provided buffer (BufferOwned) + UStringImpl(const UChar* characters, unsigned length) + : UStringOrRopeImpl(length, BufferOwned) + , m_data(characters) + , m_buffer(0) + , m_hash(0) + { + ASSERT(m_data); + ASSERT(m_length); + } + + // Used to create new strings that are a substring of an existing UStringImpl (BufferSubstring) + UStringImpl(const UChar* characters, unsigned length, PassRefPtr base) + : UStringOrRopeImpl(length, BufferSubstring) + , m_data(characters) + , m_substringBuffer(base.releaseRef()) + , m_hash(0) + { + ASSERT(m_data); + ASSERT(m_length); + ASSERT(m_substringBuffer->bufferOwnership() != BufferSubstring); + } + + // Used to construct new strings sharing an existing SharedUChar (BufferShared) + UStringImpl(const UChar* characters, unsigned length, PassRefPtr sharedBuffer) + : UStringOrRopeImpl(length, BufferShared) + , m_data(characters) + , m_sharedBuffer(sharedBuffer.releaseRef()) + , m_hash(0) + { + ASSERT(m_data); + ASSERT(m_length); + } + + // For use only by Identifier's XXXTranslator helpers. + void setHash(unsigned hash) + { + ASSERT(!isStatic()); + ASSERT(!m_hash); + ASSERT(hash == computeHash(m_data, m_length)); + m_hash = hash; + } + public: - template - static PassRefPtr adopt(Vector& vector) - { - if (unsigned length = vector.size()) { - ASSERT(vector.data()); - return adoptRef(new UStringImpl(vector.releaseBuffer(), length)); - } - return empty(); - } - - static PassRefPtr create(const UChar* buffer, unsigned length); - static PassRefPtr create(const char* c, unsigned length); - static PassRefPtr create(const char* c); - + ~UStringImpl(); + + static PassRefPtr create(const UChar*, unsigned length); + static PassRefPtr create(const char*, unsigned length); + static PassRefPtr create(const char*); + static PassRefPtr create(PassRefPtr, const UChar*, unsigned length); static PassRefPtr create(PassRefPtr rep, unsigned offset, unsigned length) { ASSERT(rep); - rep->checkConsistency(); - return adoptRef(new UStringImpl(rep->m_data + offset, length, rep->bufferOwnerString())); - } - - static PassRefPtr create(PassRefPtr sharedBuffer, const UChar* buffer, unsigned length) - { - return adoptRef(new UStringImpl(buffer, length, sharedBuffer)); - } - - static PassRefPtr createUninitialized(unsigned length, UChar*& output) - { - if (!length) { - output = 0; + ASSERT(length <= rep->length()); + + if (!length) return empty(); - } - - if (length > ((std::numeric_limits::max() - sizeof(UStringImpl)) / sizeof(UChar))) - CRASH(); - UStringImpl* resultImpl = static_cast(fastMalloc(sizeof(UChar) * length + sizeof(UStringImpl))); - output = reinterpret_cast(resultImpl + 1); - return adoptRef(new(resultImpl) UStringImpl(length)); - } - + + UStringImpl* ownerRep = (rep->bufferOwnership() == BufferSubstring) ? rep->m_substringBuffer : rep.get(); + return adoptRef(new UStringImpl(rep->m_data + offset, length, ownerRep)); + } + + static PassRefPtr createUninitialized(unsigned length, UChar*& output); static PassRefPtr tryCreateUninitialized(unsigned length, UChar*& output) { @@ -163,11 +218,22 @@ } + template + static PassRefPtr adopt(Vector& vector) + { + if (size_t size = vector.size()) { + ASSERT(vector.data()); + return adoptRef(new UStringImpl(vector.releaseBuffer(), size)); + } + return empty(); + } + SharedUChar* sharedBuffer(); const UChar* characters() const { return m_data; } + size_t cost() { // For substrings, return the cost of the base string. if (bufferOwnership() == BufferSubstring) - return m_bufferSubstring->cost(); + return m_substringBuffer->cost(); if (m_refCountAndFlags & s_refCountFlagShouldReportedCost) { @@ -177,10 +243,9 @@ return 0; } - unsigned hash() const { if (!m_hash) m_hash = computeHash(m_data, m_length); return m_hash; } - unsigned existingHash() const { ASSERT(m_hash); return m_hash; } // fast path for Identifiers - void setHash(unsigned hash) { ASSERT(hash == computeHash(m_data, m_length)); m_hash = hash; } // fast path for Identifiers + bool isIdentifier() const { return m_refCountAndFlags & s_refCountFlagIsIdentifier; } void setIsIdentifier(bool isIdentifier) { + ASSERT(!isStatic()); if (isIdentifier) m_refCountAndFlags |= s_refCountFlagIsIdentifier; @@ -189,5 +254,13 @@ } + unsigned hash() const { if (!m_hash) m_hash = computeHash(m_data, m_length); return m_hash; } + unsigned existingHash() const { ASSERT(m_hash); return m_hash; } + static unsigned computeHash(const UChar* data, unsigned length) { return WTF::stringHash(data, length); } + static unsigned computeHash(const char* data, unsigned length) { return WTF::stringHash(data, length); } + static unsigned computeHash(const char* data) { return WTF::stringHash(data); } + ALWAYS_INLINE void deref() { m_refCountAndFlags -= s_refCountIncrement; if (!(m_refCountAndFlags & (s_refCountMask | s_refCountFlagStatic))) delete this; } + + static UStringImpl* empty(); static void copyChars(UChar* destination, const UChar* source, unsigned numCharacters) @@ -200,107 +273,22 @@ } - static unsigned computeHash(const UChar* s, unsigned length) { return WTF::stringHash(s, length); } - static unsigned computeHash(const char* s, unsigned length) { return WTF::stringHash(s, length); } - static unsigned computeHash(const char* s) { return WTF::stringHash(s); } - - static UStringImpl* empty(); - - ALWAYS_INLINE void checkConsistency() const - { - // There is no recursion of substrings. - ASSERT(bufferOwnerString()->bufferOwnership() != BufferSubstring); - // Static strings cannot be put in identifier tables, because they are globally shared. - ASSERT(!isStatic() || !isIdentifier()); - } - private: - // For SmallStringStorage, which allocates an array and uses an in-place new. - UStringImpl() { } - - // Used to construct normal strings with an internal buffer. - UStringImpl(unsigned length) - : UStringOrRopeImpl(length, BufferInternal) - , m_data(reinterpret_cast(this + 1)) - , m_buffer(0) - , m_hash(0) - { - checkConsistency(); - } - - // Used to construct normal strings with an external buffer. - UStringImpl(const UChar* data, unsigned length) - : UStringOrRopeImpl(length, BufferOwned) - , m_data(data) - , m_buffer(0) - , m_hash(0) - { - checkConsistency(); - } - - // Used to construct static strings, which have an special refCount that can never hit zero. - // This means that the static string will never be destroyed, which is important because - // static strings will be shared across threads & ref-counted in a non-threadsafe manner. - UStringImpl(const UChar* data, unsigned length, StaticStringConstructType) - : UStringOrRopeImpl(length, ConstructStaticString) - , m_data(data) - , m_buffer(0) - , m_hash(0) - { - checkConsistency(); - } - - // Used to create new strings that are a substring of an existing string. - UStringImpl(const UChar* data, unsigned length, PassRefPtr base) - : UStringOrRopeImpl(length, BufferSubstring) - , m_data(data) - , m_bufferSubstring(base.releaseRef()) - , m_hash(0) - { - // Do use static strings as a base for substrings; UntypedPtrAndBitfield assumes - // that all pointers will be at least 8-byte aligned, we cannot guarantee that of - // UStringImpls that are not heap allocated. - ASSERT(m_bufferSubstring->length()); - ASSERT(!m_bufferSubstring->isStatic()); - checkConsistency(); - } - - // Used to construct new strings sharing an existing shared buffer. - UStringImpl(const UChar* data, unsigned length, PassRefPtr sharedBuffer) - : UStringOrRopeImpl(length, BufferShared) - , m_data(data) - , m_bufferShared(sharedBuffer.releaseRef()) - , m_hash(0) - { - checkConsistency(); - } - - ~UStringImpl(); - // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings. - static const unsigned s_minLengthToShare = 10; static const unsigned s_copyCharsInlineCutOff = 20; - UStringImpl* bufferOwnerString() { return (bufferOwnership() == BufferSubstring) ? m_bufferSubstring : this; } - const UStringImpl* bufferOwnerString() const { return (bufferOwnership() == BufferSubstring) ? m_bufferSubstring : this; } - SharedUChar* baseSharedBuffer(); - unsigned bufferOwnership() const { return m_refCountAndFlags & s_refCountMaskBufferOwnership; } + BufferOwnership bufferOwnership() const { return static_cast(m_refCountAndFlags & s_refCountMaskBufferOwnership); } bool isStatic() const { return m_refCountAndFlags & s_refCountFlagStatic; } - // unshared data const UChar* m_data; union { void* m_buffer; - UStringImpl* m_bufferSubstring; - SharedUChar* m_bufferShared; + UStringImpl* m_substringBuffer; + SharedUChar* m_sharedBuffer; }; mutable unsigned m_hash; - - friend class JIT; - friend class SmallStringsStorage; +}; + +class URopeImpl : public UStringOrRopeImpl { friend class UStringOrRopeImpl; - friend void initializeUString(); -}; - -class URopeImpl : public UStringOrRopeImpl { public: // A URopeImpl is composed from a set of smaller strings called Fibers. @@ -340,6 +328,4 @@ unsigned m_fiberCount; Fiber m_fibers[1]; - - friend class UStringOrRopeImpl; }; Index: /trunk/JavaScriptCore/runtime/Identifier.h =================================================================== --- /trunk/JavaScriptCore/runtime/Identifier.h (revision 1395) +++ /trunk/JavaScriptCore/runtime/Identifier.h (revision 1404) @@ -94,20 +94,18 @@ static PassRefPtr add(ExecState* exec, UString::Rep* r) { - if (r->isIdentifier()) { #ifndef NDEBUG - checkSameIdentifierTable(exec, r); + checkCurrentIdentifierTable(exec); #endif + if (r->isIdentifier()) return r; - } return addSlowCase(exec, r); } static PassRefPtr add(JSGlobalData* globalData, UString::Rep* r) { - if (r->isIdentifier()) { #ifndef NDEBUG - checkSameIdentifierTable(globalData, r); + checkCurrentIdentifierTable(globalData); #endif + if (r->isIdentifier()) return r; - } return addSlowCase(globalData, r); } @@ -116,6 +114,6 @@ static PassRefPtr addSlowCase(JSGlobalData*, UString::Rep* r); - static void checkSameIdentifierTable(ExecState*, UString::Rep*); - static void checkSameIdentifierTable(JSGlobalData*, UString::Rep*); + static void checkCurrentIdentifierTable(ExecState*); + static void checkCurrentIdentifierTable(JSGlobalData*); }; Index: /trunk/JavaScriptCore/runtime/UStringImpl.cpp =================================================================== --- /trunk/JavaScriptCore/runtime/UStringImpl.cpp (revision 1402) +++ /trunk/JavaScriptCore/runtime/UStringImpl.cpp (revision 1404) @@ -37,4 +37,30 @@ namespace JSC { +static const unsigned minLengthToShare = 20; + +UStringImpl::~UStringImpl() +{ + ASSERT(!isStatic()); + + if (isIdentifier()) + Identifier::remove(this); + + BufferOwnership ownership = bufferOwnership(); + if (ownership != BufferInternal) { + if (ownership == BufferOwned) { + ASSERT(!m_sharedBuffer); + ASSERT(m_data); + fastFree(const_cast(m_data)); + } else if (ownership == BufferSubstring) { + ASSERT(m_substringBuffer); + m_substringBuffer->deref(); + } else { + ASSERT(ownership == BufferShared); + ASSERT(m_sharedBuffer); + m_sharedBuffer->deref(); + } + } +} + UStringImpl* UStringImpl::empty() { @@ -44,4 +70,23 @@ DEFINE_STATIC_LOCAL(UStringImpl, emptyString, (invalidNonNullUCharPtr, 0, ConstructStaticString)); return &emptyString; +} + +PassRefPtr UStringImpl::createUninitialized(unsigned length, UChar*& data) +{ + if (!length) { + data = 0; + return empty(); + } + + // Allocate a single buffer large enough to contain the StringImpl + // struct as well as the data which it contains. This removes one + // heap allocation from this call. + if (length > ((std::numeric_limits::max() - sizeof(UStringImpl)) / sizeof(UChar))) + CRASH(); + size_t size = sizeof(UStringImpl) + length * sizeof(UChar); + UStringImpl* string = static_cast(fastMalloc(size)); + + data = reinterpret_cast(string + 1); + return adoptRef(new (string) UStringImpl(length)); } @@ -78,48 +123,33 @@ } -SharedUChar* UStringImpl::baseSharedBuffer() +PassRefPtr UStringImpl::create(PassRefPtr sharedBuffer, const UChar* buffer, unsigned length) { - ASSERT((bufferOwnership() == BufferShared) - || ((bufferOwnership() == BufferOwned) && !m_buffer)); - - if (bufferOwnership() != BufferShared) { - m_refCountAndFlags = (m_refCountAndFlags & ~s_refCountMaskBufferOwnership) | BufferShared; - m_bufferShared = SharedUChar::create(new SharableUChar(m_data)).releaseRef(); - } - - return m_bufferShared; + if (!length) + return empty(); + return adoptRef(new UStringImpl(buffer, length, sharedBuffer)); } SharedUChar* UStringImpl::sharedBuffer() { - if (m_length < s_minLengthToShare) + if (m_length < minLengthToShare) return 0; + // All static strings are smaller that the minimim length to share. ASSERT(!isStatic()); - UStringImpl* owner = bufferOwnerString(); - if (owner->bufferOwnership() == BufferInternal) + BufferOwnership ownership = bufferOwnership(); + + if (ownership == BufferInternal) return 0; + if (ownership == BufferSubstring) + return m_substringBuffer->sharedBuffer(); + if (ownership == BufferOwned) { + ASSERT(!m_sharedBuffer); + m_sharedBuffer = SharedUChar::create(new SharableUChar(m_data)).releaseRef(); + m_refCountAndFlags = (m_refCountAndFlags & ~s_refCountMaskBufferOwnership) | BufferShared; + } - return owner->baseSharedBuffer(); -} - -UStringImpl::~UStringImpl() -{ - ASSERT(!isStatic()); - checkConsistency(); - - if (isIdentifier()) - Identifier::remove(this); - - if (bufferOwnership() != BufferInternal) { - if (bufferOwnership() == BufferOwned) - fastFree(const_cast(m_data)); - else if (bufferOwnership() == BufferSubstring) - m_bufferSubstring->deref(); - else { - ASSERT(bufferOwnership() == BufferShared); - m_bufferShared->deref(); - } - } + ASSERT(bufferOwnership() == BufferShared); + ASSERT(m_sharedBuffer); + return m_sharedBuffer; } Index: /trunk/JavaScriptCore/qt/api/qscriptvalue_p.h =================================================================== --- /trunk/JavaScriptCore/qt/api/qscriptvalue_p.h (revision 1392) +++ /trunk/JavaScriptCore/qt/api/qscriptvalue_p.h (revision 1404) @@ -39,8 +39,8 @@ Implementation of QScriptValue. The implementation is based on a state machine. The states names are included in - QScriptValuePrivate::States. Each method should check for the current state and then perform a + QScriptValuePrivate::State. Each method should check for the current state and then perform a correct action. - States: + State: Invalid -> QSVP is invalid, no assumptions should be made about class members (apart from m_value). CString -> QSVP is created from QString or const char* and no JSC engine has been associated yet. @@ -54,5 +54,5 @@ JSValue -> QSVP is associated with engine, but there is no information about real type, the state have really short live cycle. Normally it is created as a function call result. - JSNative -> QSVP is associated with engine, and it is sure that it isn't a JavaScript object. + JSPrimitive -> QSVP is associated with engine, and it is sure that it isn't a JavaScript object. JSObject -> QSVP is associated with engine, and it is sure that it is a JavaScript object. @@ -118,5 +118,5 @@ private: // Please, update class documentation when you change the enum. - enum States { + enum State { Invalid = 0, CString = 0x1000, @@ -125,5 +125,5 @@ CSpecial, JSValue = 0x2000, // JS values are equal or higher then this value. - JSNative, + JSPrimitive, JSObject } m_state; @@ -137,5 +137,5 @@ inline bool inherits(const char*); - inline States refinedJSValue(); + inline State refinedJSValue(); inline bool isJSBased() const; @@ -211,5 +211,5 @@ QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, bool value) - : m_state(JSNative) + : m_state(JSPrimitive) { if (!engine) { @@ -226,5 +226,5 @@ QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, int value) - : m_state(JSNative) + : m_state(JSPrimitive) { if (!engine) { @@ -241,5 +241,5 @@ QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, uint value) - : m_state(JSNative) + : m_state(JSPrimitive) { if (!engine) { @@ -256,5 +256,5 @@ QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, qsreal value) - : m_state(JSNative) + : m_state(JSPrimitive) { if (!engine) { @@ -271,5 +271,5 @@ QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, const QString& value) - : m_state(JSNative) + : m_state(JSPrimitive) { if (!engine) { @@ -286,5 +286,5 @@ QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, QScriptValue::SpecialValue value) - : m_state(JSNative) + : m_state(JSPrimitive) { if (!engine) { @@ -327,8 +327,8 @@ return true; case JSValue: - if (refinedJSValue() != JSNative) + if (refinedJSValue() != JSPrimitive) return false; // Fall-through. - case JSNative: + case JSPrimitive: return JSValueIsBoolean(context(), value()); default: @@ -343,8 +343,8 @@ return true; case JSValue: - if (refinedJSValue() != JSNative) + if (refinedJSValue() != JSPrimitive) return false; // Fall-through. - case JSNative: + case JSPrimitive: return JSValueIsNumber(context(), value()); default: @@ -359,8 +359,8 @@ return m_number == static_cast(QScriptValue::NullValue); case JSValue: - if (refinedJSValue() != JSNative) + if (refinedJSValue() != JSPrimitive) return false; // Fall-through. - case JSNative: + case JSPrimitive: return JSValueIsNull(context(), value()); default: @@ -375,8 +375,8 @@ return true; case JSValue: - if (refinedJSValue() != JSNative) + if (refinedJSValue() != JSPrimitive) return false; // Fall-through. - case JSNative: + case JSPrimitive: return JSValueIsString(context(), value()); default: @@ -391,8 +391,8 @@ return m_number == static_cast(QScriptValue::UndefinedValue); case JSValue: - if (refinedJSValue() != JSNative) + if (refinedJSValue() != JSPrimitive) return false; // Fall-through. - case JSNative: + case JSPrimitive: return JSValueIsUndefined(context(), value()); default: @@ -456,5 +456,5 @@ return m_number == QScriptValue::NullValue ? QString::fromLatin1("null") : QString::fromLatin1("undefined"); case JSValue: - case JSNative: + case JSPrimitive: case JSObject: return QScriptConverter::toString(JSValueToStringCopy(context(), value(), /* exception */ 0)); @@ -469,5 +469,5 @@ switch (m_state) { case JSValue: - case JSNative: + case JSPrimitive: case JSObject: return JSValueToNumber(context(), value(), /* exception */ 0); @@ -501,5 +501,5 @@ switch (m_state) { case JSValue: - case JSNative: + case JSPrimitive: return JSValueToBoolean(context(), value()); case JSObject: @@ -628,5 +628,5 @@ } m_engine = engine; - m_state = JSNative; + m_state = JSPrimitive; setValue(value); return true; @@ -720,9 +720,9 @@ Refines the state of this QScriptValuePrivate. Returns the new state. */ -QScriptValuePrivate::States QScriptValuePrivate::refinedJSValue() +QScriptValuePrivate::State QScriptValuePrivate::refinedJSValue() { Q_ASSERT(m_state == JSValue); if (!JSValueIsObject(context(), value())) { - m_state = JSNative; + m_state = JSPrimitive; } else { m_state = JSObject; Index: /trunk/JavaScriptCore/wtf/VMTags.h =================================================================== --- /trunk/JavaScriptCore/wtf/VMTags.h (revision 1395) +++ /trunk/JavaScriptCore/wtf/VMTags.h (revision 1404) @@ -29,5 +29,5 @@ // On Mac OS X, the VM subsystem allows tagging memory requested from mmap and vm_map // in order to aid tools that inspect system memory use. -#if OS(DARWIN) && !defined(BUILDING_ON_TIGER) +#if OS(DARWIN) && !defined(TARGETING_TIGER) #include @@ -55,5 +55,5 @@ #endif // defined(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS) -#else // OS(DARWIN) && !defined(BUILDING_ON_TIGER) +#else // OS(DARWIN) && !defined(TARGETING_TIGER) #define VM_TAG_FOR_TCMALLOC_MEMORY -1 @@ -63,5 +63,5 @@ #define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY -1 -#endif // OS(DARWIN) && !defined(BUILDING_ON_TIGER) +#endif // OS(DARWIN) && !defined(TARGETING_TIGER) #endif // VMTags_h Index: /trunk/JavaScriptCore/API/JSClassRef.cpp =================================================================== --- /trunk/JavaScriptCore/API/JSClassRef.cpp (revision 1402) +++ /trunk/JavaScriptCore/API/JSClassRef.cpp (revision 1404) @@ -112,5 +112,6 @@ OpaqueJSClass::~OpaqueJSClass() { - ASSERT(!m_className.rep()->isIdentifier()); + // The empty string is shared across threads & is an identifier, in all other cases we should have done a deep copy in className(), below. + ASSERT(!m_className.size() || !m_className.rep()->isIdentifier()); if (m_staticValues) { Index: /trunk/JavaScriptCore/yarr/RegexInterpreter.cpp =================================================================== --- /trunk/JavaScriptCore/yarr/RegexInterpreter.cpp (revision 1126) +++ /trunk/JavaScriptCore/yarr/RegexInterpreter.cpp (revision 1404) @@ -281,18 +281,4 @@ } - bool tryConsumeCharacter(int testChar) - { - if (input.atEnd()) - return false; - - int ch = input.read(); - - if (pattern->m_ignoreCase ? ((Unicode::toLower(testChar) == ch) || (Unicode::toUpper(testChar) == ch)) : (testChar == ch)) { - input.next(); - return true; - } - return false; - } - bool checkCharacter(int testChar, int inputPosition) { @@ -304,21 +290,4 @@ int ch = input.readChecked(inputPosition); return (loChar == ch) || (hiChar == ch); - } - - bool tryConsumeCharacterClass(CharacterClass* characterClass, bool invert) - { - if (input.atEnd()) - return false; - - bool match = testCharacterClass(characterClass, input.read()); - - if (invert) - match = !match; - - if (match) { - input.next(); - return true; - } - return false; } Index: /trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def =================================================================== --- /trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def (revision 1402) +++ /trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def (revision 1404) @@ -30,5 +30,5 @@ ??1Structure@JSC@@QAE@XZ ??1ThreadCondition@WTF@@QAE@XZ - ??1UStringImpl@JSC@@AAE@XZ + ??1UStringImpl@JSC@@QAE@XZ ??2JSGlobalObject@JSC@@SAPAXIPAVJSGlobalData@1@@Z ??8JSC@@YA_NABVUString@0@0@Z @@ -53,6 +53,6 @@ ?callOnMainThreadAndWait@WTF@@YAXP6AXPAX@Z0@Z ?changePrototypeTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@VJSValue@2@@Z - ?checkSameIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@PAVUStringImpl@2@@Z - ?checkSameIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@PAVUStringImpl@2@@Z + ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@@Z + ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z ?checkSyntax@JSC@@YA?AVCompletion@1@PAVExecState@1@ABVSourceCode@1@@Z ?classInfo@InternalFunction@JSC@@UBEPBUClassInfo@2@XZ @@ -71,4 +71,5 @@ ?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@XZ ?create@OpaqueJSString@@SA?AV?$PassRefPtr@UOpaqueJSString@@@WTF@@ABVUString@JSC@@@Z + ?create@UStringImpl@JSC@@SA?AV?$PassRefPtr@VUStringImpl@JSC@@@WTF@@V?$PassRefPtr@V?$CrossThreadRefCounted@V?$OwnFastMallocPtr@$$CB_W@WTF@@@WTF@@@4@PB_WI@Z ?createEmptyString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@@Z ?createInheritorID@JSObject@JSC@@AAEPAVStructure@2@XZ Index: /trunk/JavaScriptCore/ChangeLog =================================================================== --- /trunk/JavaScriptCore/ChangeLog (revision 1402) +++ /trunk/JavaScriptCore/ChangeLog (revision 1404) @@ -1,2 +1,199 @@ +2010-03-15 Gavin Barraclough + + Reviewed by NOBODY (build fix). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-03-12 Gavin Barraclough + + Reviewed by NOBODY (build fix). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-03-11 Gavin Barraclough + + Reviewed by Oliver Hunt. + + Bug 36075 - Clean up screwyness re static string impls & Identifiers. + + * API/JSClassRef.cpp: + (OpaqueJSClass::~OpaqueJSClass): Classname may be null/empty, and these are an identifer. This is okay, since the null/empty strings are shared across all threads. + * JavaScriptCore.exp: + * runtime/Identifier.cpp: + (JSC::Identifier::add): No need to explicitly hash null reps, this is done in the ststic UStringImpl constructor. + (JSC::Identifier::addSlowCase): UStringImpl::empty() handled & checkCurrentIdentifierTable now called in the header. + (JSC::Identifier::checkCurrentIdentifierTable): Replaces checkSameIdentifierTable (this no longer checked the rep since the identifierTable pointer was removed from UString::Rep long ago). + * runtime/Identifier.h: + (JSC::Identifier::add): Replace call to checkSameIdentifierTable with call to checkCurrentIdentifierTable at head of function. + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::~UStringImpl): Remove call to checkConsistency - this function no longer checks anything interesting. + * runtime/UStringImpl.h: + (JSC::UStringOrRopeImpl::UStringOrRopeImpl): Set s_refCountFlagIsIdentifier in static constructor. + (JSC::UStringImpl::UStringImpl): remove calls to checkConsistency (see above), add new ASSERT to substring constructor. + (JSC::UStringImpl::setHash): ASSERT not static (static strings set the hash in their constructor, should not reach this code path). + (JSC::UStringImpl::create): Add missing ASSERT. + (JSC::UStringImpl::setIsIdentifier): ASSERT !isStatic() (static strings hash set in constructor). + +2010-03-12 Peter Varga + + Reviewed by David Levin. + + Two functions tryConsumeCharacter() and tryConsumeCharacterClass() are + removed from yarr/RegexInterpreter.cpp because they are never called. + + * yarr/RegexInterpreter.cpp: + +2010-03-11 Kent Hansen + + Reviewed by Simon Hausmann. + + Mac OS X: Use deployment target to determine whether memory tagging should be enabled + https://bugs.webkit.org/show_bug.cgi?id=34888 + + Use TARGETING_TIGER rather than BUILDING_ON_TIGER to determine the tags. + + * wtf/VMTags.h: + +2010-03-11 Jedrzej Nowacki + + Reviewed by Simon Hausmann. + + The JSNative state was renamed to JSPrimitive. The new name better + coresponds to the ECMAScript standard. + + Enum QScriptValuePrivate::States was renamed to State to obey Qt + coding style rules ("States" name suggests that a state could + mixed together with an other state using bitwise logic operators. + + [Qt] QScriptValuePrivate::States has naming issues + https://bugs.webkit.org/show_bug.cgi?id=35968 + + * qt/api/qscriptvalue_p.h: + (QScriptValuePrivate::): + (QScriptValuePrivate::QScriptValuePrivate): + (QScriptValuePrivate::isBool): + (QScriptValuePrivate::isNumber): + (QScriptValuePrivate::isNull): + (QScriptValuePrivate::isString): + (QScriptValuePrivate::isUndefined): + (QScriptValuePrivate::toString): + (QScriptValuePrivate::toNumber): + (QScriptValuePrivate::toBool): + (QScriptValuePrivate::assignEngine): + (QScriptValuePrivate::refinedJSValue): + +2010-03-11 Gavin Barraclough + + Reviewed by NOBODY (Windows build fix). + + Add export. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-03-11 Gavin Barraclough + + Reviewed by NOBODY (Windows build fix). + + Add export. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-03-11 Gavin Barraclough + + Rubber stamped by Oliver Hunt. + + Remove nonsense comments used in development & commited in error. + + * runtime/UStringImpl.h: + +2010-03-11 Gavin Barraclough + + Reviewed by NOBODY (Windows build fix). + + Remove export. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-03-11 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=36041 + Remove unnecessary differences in common code between WebCore::StringImpl & JSC::UStringImpl + + Much of the code in WebCore::StringImpl and JSC::UStringImpl is now very similar, + but has trivial and unnecessary formatting differences, such as the exact wording + of comments, missing ASSERTs, functions implemented in the .h vs .cpp etc. + + * runtime/Identifier.cpp: + (JSC::Identifier::add): UStringImpl::empty() now automatically hashes, uas per WebCore strings. + (JSC::Identifier::addSlowCase): UStringImpl::empty() now automatically hashes, uas per WebCore strings. + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::~UStringImpl): Only call bufferOwnership() once, add missing ASSERTs. + (JSC::UStringImpl::createUninitialized): Move from .h, not commonly called, no need to inline. + (JSC::UStringImpl::create): Move from .h, not commonly called, no need to inline. + (JSC::UStringImpl::sharedBuffer): Rewritten to more closely match WebCore implementation, remove need for separate baseSharedBuffer() method. + * runtime/UStringImpl.h: + (JSC::UStringImpl::UStringImpl): Automatically hash static strings, ASSERT m_data & m_length are non-null/non-zero in non-static strings. + (JSC::UStringImpl::setHash): Add missing ASSERT. + (JSC::UStringImpl::create): Moved to .cpp / added missing check for empty string creation. + (JSC::UStringImpl::adopt): Vector.size() returns size_t, not unsigned. + (JSC::UStringImpl::cost): Renamed m_bufferSubstring -> m_substringBuffer + (JSC::UStringImpl::hash): Reordered in file. + (JSC::UStringImpl::existingHash): Reordered in file. + (JSC::UStringImpl::computeHash): Reordered in file, renamed parameter. + (JSC::UStringImpl::checkConsistency): rewrote ASSERT. + (JSC::UStringImpl::bufferOwnership): Return type should be BufferOwnership. + (JSC::UStringImpl::): Moved friends to head of class. + +2010-03-11 Mark Rowe + + Reviewed by David Kilzer. + + Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version + + Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version. + + * Configurations/Base.xcconfig: + +2010-03-11 Mark Rowe + + Reviewed by Tim Hatcher. + + Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version + + Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted. It defaults to the + current Mac OS X version unless otherwise specified. + + Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR. + + Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice + may not be usable when targetting a different Mac OS X version. + + Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off + MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used. + + * Configurations/Base.xcconfig: + * Configurations/DebugRelease.xcconfig: + * Configurations/FeatureDefines.xcconfig: + * Configurations/JavaScriptCore.xcconfig: + * Configurations/Version.xcconfig: + +2010-03-11 Simon Fraser + + Reviewed by Mark Rowe. + + Sort the project file. + + * JavaScriptCore.xcodeproj/project.pbxproj: + +2010-03-11 Simon Fraser + + Reviewed by Mark Rowe. + + Sort the project file . + + * JavaScriptCore.xcodeproj/project.pbxproj: + 2010-03-11 Gabor Loki Index: /trunk/JavaScriptCore/Configurations/Version.xcconfig =================================================================== --- /trunk/JavaScriptCore/Configurations/Version.xcconfig (revision 1402) +++ /trunk/JavaScriptCore/Configurations/Version.xcconfig (revision 1404) @@ -32,5 +32,5 @@ // The system version prefix is based on the current system version. -SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR)); +SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR)); SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR. SYSTEM_VERSION_PREFIX_1040 = 4; Index: /trunk/JavaScriptCore/Configurations/DebugRelease.xcconfig =================================================================== --- /trunk/JavaScriptCore/Configurations/DebugRelease.xcconfig (revision 1126) +++ /trunk/JavaScriptCore/Configurations/DebugRelease.xcconfig (revision 1404) @@ -27,5 +27,5 @@ ARCHS_iphoneos = $(ARCHS_UNIVERSAL_IPHONE_OS); ARCHS_iphonesimulator = $(NATIVE_ARCH); -ARCHS_macosx = $(ARCHS_macosx_$(MAC_OS_X_VERSION_MAJOR)); +ARCHS_macosx = $(ARCHS_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ARCHS_macosx_ = $(ARCHS_macosx_1040); ARCHS_macosx_1040 = $(NATIVE_ARCH); @@ -36,5 +36,5 @@ ONLY_ACTIVE_ARCH = YES; -MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR)); +MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)); MACOSX_DEPLOYMENT_TARGET_ = 10.4; MACOSX_DEPLOYMENT_TARGET_1040 = 10.4; Index: /trunk/JavaScriptCore/Configurations/FeatureDefines.xcconfig =================================================================== --- /trunk/JavaScriptCore/Configurations/FeatureDefines.xcconfig (revision 1402) +++ /trunk/JavaScriptCore/Configurations/FeatureDefines.xcconfig (revision 1404) @@ -32,10 +32,10 @@ // Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature. -ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(MAC_OS_X_VERSION_MAJOR)); +ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ENABLE_3D_CANVAS_1050 = ENABLE_3D_CANVAS; ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS; ENABLE_3D_CANVAS_1070 = ENABLE_3D_CANVAS; -ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR)); +ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING; ENABLE_3D_RENDERING_1060 = ENABLE_3D_RENDERING; Index: /trunk/JavaScriptCore/Configurations/Base.xcconfig =================================================================== --- /trunk/JavaScriptCore/Configurations/Base.xcconfig (revision 1126) +++ /trunk/JavaScriptCore/Configurations/Base.xcconfig (revision 1404) @@ -68,4 +68,6 @@ REAL_PLATFORM_NAME_macosx = macosx; +TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); + // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants. @@ -93,7 +95,27 @@ // number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and // XCODE_VERSION_ACTUAL for the full version number. -GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_MINOR)); -GCC_VERSION_ = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL)); -GCC_VERSION_0310 = 4.2; +TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040); +TARGET_GCC_VERSION_1040 = GCC_40; +TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR)); +TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL)); +TARGET_GCC_VERSION_1050_0310 = GCC_42; +TARGET_GCC_VERSION_1050_0320 = GCC_42; +TARGET_GCC_VERSION_1060 = GCC_42; +TARGET_GCC_VERSION_1070 = LLVM_GCC_42; + +GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); +GCC_VERSION_GCC_40 = 4.0; +GCC_VERSION_GCC_42 = 4.2; +GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; + +// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK. +SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +SDKROOT_1050_1040 = macosx10.4; +SDKROOT_1060_1040 = macosx10.4; +SDKROOT_1060_1050 = macosx10.5; +SDKROOT_1070_1040 = macosx10.4; +SDKROOT_1070_1050 = macosx10.5; +SDKROOT_1070_1060 = macosx10.6; @@ -102,5 +124,5 @@ HAVE_DTRACE_iphoneos = 1; HAVE_DTRACE_iphonesimulator = 0; -HAVE_DTRACE_macosx = $(HAVE_DTRACE_macosx_$(MAC_OS_X_VERSION_MAJOR)); +HAVE_DTRACE_macosx = $(HAVE_DTRACE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)); HAVE_DTRACE_macosx_ = $(HAVE_DTRACE_macosx_1040); HAVE_DTRACE_macosx_1040 = 0; Index: /trunk/JavaScriptCore/Configurations/JavaScriptCore.xcconfig =================================================================== --- /trunk/JavaScriptCore/Configurations/JavaScriptCore.xcconfig (revision 1126) +++ /trunk/JavaScriptCore/Configurations/JavaScriptCore.xcconfig (revision 1404) @@ -45,7 +45,6 @@ OTHER_CFLAGS = $(OTHER_CFLAGS_$(CONFIGURATION)_$(CURRENT_VARIANT)); -OTHER_CFLAGS_Release_normal = $(OTHER_CFLAGS_normal_$(XCODE_VERSION_ACTUAL)); -OTHER_CFLAGS_Production_normal = $(OTHER_CFLAGS_normal_$(XCODE_VERSION_ACTUAL)); -OTHER_CFLAGS_normal_0310 = $(OTHER_CFLAGS_normal_GCC_42); -OTHER_CFLAGS_normal_0320 = $(OTHER_CFLAGS_normal_GCC_42); +OTHER_CFLAGS_Release_normal = $(OTHER_CFLAGS_normal_$(TARGET_GCC_VERSION)); +OTHER_CFLAGS_Production_normal = $(OTHER_CFLAGS_normal_$(TARGET_GCC_VERSION)); OTHER_CFLAGS_normal_GCC_42 = -fomit-frame-pointer -funwind-tables; +OTHER_CFLAGS_normal_LLVM_GCC_42 = $(OTHER_CFLAGS_normal_GCC_42); Index: /trunk/JavaScriptCore/JavaScriptCore.exp =================================================================== --- /trunk/JavaScriptCore/JavaScriptCore.exp (revision 1402) +++ /trunk/JavaScriptCore/JavaScriptCore.exp (revision 1404) @@ -93,6 +93,6 @@ __ZN3JSC10Identifier11addSlowCaseEPNS_12JSGlobalDataEPNS_11UStringImplE __ZN3JSC10Identifier11addSlowCaseEPNS_9ExecStateEPNS_11UStringImplE -__ZN3JSC10Identifier24checkSameIdentifierTableEPNS_12JSGlobalDataEPNS_11UStringImplE -__ZN3JSC10Identifier24checkSameIdentifierTableEPNS_9ExecStateEPNS_11UStringImplE +__ZN3JSC10Identifier27checkCurrentIdentifierTableEPNS_12JSGlobalDataE +__ZN3JSC10Identifier27checkCurrentIdentifierTableEPNS_9ExecStateE __ZN3JSC10Identifier3addEPNS_9ExecStateEPKc __ZN3JSC10Identifier4fromEPNS_9ExecStateEi @@ -108,4 +108,5 @@ __ZN3JSC11UStringImpl12sharedBufferEv __ZN3JSC11UStringImpl5emptyEv +__ZN3JSC11UStringImpl6createEN3WTF10PassRefPtrINS1_21CrossThreadRefCountedINS1_16OwnFastMallocPtrIKtEEEEEEPS5_j __ZN3JSC11UStringImplD1Ev __ZN3JSC11checkSyntaxEPNS_9ExecStateERKNS_10SourceCodeE Index: /trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj =================================================================== --- /trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (revision 1391) +++ /trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (revision 1404) @@ -1162,8 +1162,8 @@ BCDD51E90FB8DF74004A8BDC /* JITOpcodes.cpp */, 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */, + A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */, 960626950FB8EC02009798AB /* JITStubCall.h */, 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */, 14A6581A0F4E36F4000150FD /* JITStubs.h */, - A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */, ); path = jit; @@ -1858,4 +1858,5 @@ BC18C4260E16F5CD00B34460 /* JSRetainPtr.h in Headers */, BC18C4270E16F5CD00B34460 /* JSString.h in Headers */, + 86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */, BC18C4280E16F5CD00B34460 /* JSStringRef.h in Headers */, BC18C4290E16F5CD00B34460 /* JSStringRefCF.h in Headers */, @@ -1992,4 +1993,5 @@ 8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */, BC18C4770E16F5CD00B34460 /* UTF8.h in Headers */, + E17FF771112131D200076A19 /* ValueCheck.h in Headers */, BC18C4780E16F5CD00B34460 /* Vector.h in Headers */, BC18C4790E16F5CD00B34460 /* VectorTraits.h in Headers */, @@ -2000,6 +2002,4 @@ BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */, 9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */, - 86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */, - E17FF771112131D200076A19 /* ValueCheck.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2343,4 +2343,5 @@ BCDD51EB0FB8DF74004A8BDC /* JITOpcodes.cpp in Sources */, 86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */, + A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */, 14A23D750F4E1ABB0023CDAD /* JITStubs.cpp in Sources */, 140B7D1D0DC69AF7009C42B8 /* JSActivation.cpp in Sources */, @@ -2442,5 +2443,4 @@ 8698BB3A10D86BAF00D8D01B /* UStringImpl.cpp in Sources */, E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */, - A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; Index: /trunk/cmake/ConfigureBuildSDL.cmake =================================================================== --- /trunk/cmake/ConfigureBuildSDL.cmake (revision 1384) +++ /trunk/cmake/ConfigureBuildSDL.cmake (revision 1404) @@ -51,4 +51,5 @@ set(ENABLE_SVG_USE_ELEMENT ON CACHE BOOLEAN "Enable support for SVG use element (EXPERIMENTAL)" FORCE) +set(ENABLE_TILED_BACKING_STORE ON CACHE BOOLEAN "Enable tiled backing store support" FORCE) set(ENABLE_VIDEO ON CACHE BOOLEAN "Enable HTML5 video support" FORCE) set(ENABLE_WEB_SOCKETS ON CACHE BOOLEAN "Enable Web Sockets support" FORCE) Index: /trunk/cmake/ConfigureBuildQt.cmake =================================================================== --- /trunk/cmake/ConfigureBuildQt.cmake (revision 1387) +++ /trunk/cmake/ConfigureBuildQt.cmake (revision 1404) @@ -25,4 +25,5 @@ set(ENABLE_SVG_USE_ELEMENT ON CACHE BOOLEAN "Enable support for SVG use element (EXPERIMENTAL)" FORCE) +set(ENABLE_TILED_BACKING_STORE ON CACHE BOOLEAN "Enable tiled backing store support" FORCE) set(ENABLE_VIDEO ON CACHE BOOLEAN "Enable HTML5 video support" FORCE) set(ENABLE_WEB_SOCKETS OFF CACHE BOOLEAN "Enable Web Sockets support" FORCE) Index: /trunk/cmake/AddGlobalCompilerFlags.cmake =================================================================== --- /trunk/cmake/AddGlobalCompilerFlags.cmake (revision 1307) +++ /trunk/cmake/AddGlobalCompilerFlags.cmake (revision 1404) @@ -116,4 +116,8 @@ endif(ENABLE_SVG_USE_ELEMENT) +if(ENABLE_TILED_BACKING_STORE) + add_definitions(-DENABLE_TILED_BACKING_STORE=1) +endif(ENABLE_TILED_BACKING_STORE) + if(NOT USE_FONTS_EMBEDDED) add_definitions(-DUSE_FREETYPE=1) Index: /trunk/WebKit/WebKit.xcodeproj/project.pbxproj =================================================================== --- /trunk/WebKit/WebKit.xcodeproj/project.pbxproj (revision 1395) +++ /trunk/WebKit/WebKit.xcodeproj/project.pbxproj (revision 1404) @@ -1366,4 +1366,5 @@ 1AAF5CEE0EDDE1FE008D883D /* NetscapePluginInstanceProxy.h in Headers */, 1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */, + E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */, B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */, 9398109A0824BF01008DF038 /* WebArchive.h in Headers */, @@ -1553,5 +1554,4 @@ 0FD3B0F81076C3F700039B96 /* WebWindowAnimation.h in Headers */, 41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */, - E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1789,4 +1789,5 @@ 1CCFFD130B1F81F2002EE926 /* OldWebAssertions.c in Sources */, 1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */, + E169836C11346D5600894115 /* ProxyRuntimeObject.mm in Sources */, B6CE5C24100BC5CE00219936 /* WebApplicationCache.mm in Sources */, 9398111D0824BF01008DF038 /* WebArchive.mm in Sources */, @@ -1847,4 +1848,5 @@ 9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */, 1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */, + ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */, 5185F62810712B97007AA393 /* WebNavigationData.mm in Sources */, 0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */, @@ -1911,6 +1913,4 @@ 0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */, 41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */, - ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */, - E169836C11346D5600894115 /* ProxyRuntimeObject.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; Index: /trunk/WebKit/chromium/features.gypi =================================================================== --- /trunk/WebKit/chromium/features.gypi (revision 1402) +++ /trunk/WebKit/chromium/features.gypi (revision 1404) @@ -68,4 +68,5 @@ 'ENABLE_SVG_FOREIGN_OBJECT=1', 'ENABLE_SVG_FONTS=1', + 'ENABLE_TOUCH_EVENTS=1', 'ENABLE_VIDEO=1', 'ENABLE_WEB_SOCKETS=1', Index: /trunk/WebKit/chromium/ChangeLog =================================================================== --- /trunk/WebKit/chromium/ChangeLog (revision 1402) +++ /trunk/WebKit/chromium/ChangeLog (revision 1404) @@ -1,3 +1,184 @@ +2010-03-15 Eric Roman + + Reviewed by Adam Barth. + + Add a firstPartyForCookies() property to WebDocument. + https://bugs.webkit.org/show_bug.cgi?id=35592 + + * public/WebDocument.h: + * src/WebDocument.cpp: + (WebKit::WebDocument::firstPartyForCookies): + +2010-03-12 Garret Kelly + + Unreiviewed. + + Fix Chromium Mac build. Last patch did not apply properly. + (Garret assures me this patch will actually work.) + + * src/WebInputEventConversion.cpp: + (WebKit::toPlatformTouchEventType): + (WebKit::toPlatformTouchPointState): + +2010-03-12 Garret Kelly + + Unreviewed. + + Fix Chromium Mac build. This time, with actual fixing goodness. + + * src/WebInputEventConversion.cpp: + (WebKit::toPlatformTouchEventType): + (WebKit::toPlatformTouchPointState): + +2010-03-12 Garret Kelly + + Unreviewed. + + Fix Chromium Mac build. + + * src/WebInputEventConversion.cpp: + (WebKit::toPlatformTouchEventType): + (WebKit::toPlatformTouchPointState): + +2010-03-12 Garret Kelly + + Reviewed by Eric Seidel. + + Enable touch events in Chromium features gypi file. + https://bugs.webkit.org/show_bug.cgi?id=35994 + + * features.gypi: + +2010-03-12 Darin Fisher + + Fix Chromium build bustage. + + Wrap usage of WebPrivatePtr from WebNode.h in a #if + WEBKIT_IMPLEMENTATION guard. + + * public/WebNode.h: + +2010-03-12 Nicolas Weber + + Reviewed by David Levin. + + [Chromium] Cmd-clicking submit buttons should submit in new tab + https://bugs.webkit.org/show_bug.cgi?id=36023 + + Take modifiers into account when clicking form buttons. E.g. + cmd-clicking a submit button will submit in a new background tab, + cmd-shift-clicking in a new foreground tab, shift-clicking in a new + window. (On windows/linux, it's ctrl instead of cmd.) + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::actionSpecifiesNavigationPolicy): + +2010-03-12 Kavita Kanetkar + + Reviewed by Darin Fisher. + + [chromium] Fix memory leak in WebImageDecoder API + https://bugs.webkit.org/show_bug.cgi?id=35946 + + * src/WebImageDecoder.cpp: + (WebKit::WebImageDecoder::setData): + (WebKit::WebImageDecoder::getFrameAtIndex): + +2010-03-11 Aaron Boodman + + Kill WebDocument::applicationID() (part 1). + + Modify interface to WebCore::NotificationPresenter::checkPermission() + and remove implementation of WebDocument::applicationID(). Breaking + API changes will be in a subsequent change. + https://bugs.webkit.org/show_bug.cgi?id=35846 + + * public/WebNotificationPresenter.h: + * src/NotificationPresenterImpl.cpp: + (WebKit::NotificationPresenterImpl::checkPermission): + * src/NotificationPresenterImpl.h: + * src/WebDocument.cpp: + (WebKit::WebDocument::applicationID): + +2010-03-11 Stuart Morgan + + Reviewed by Darin Fisher. + + Fix the screen coordinate conversion of Chromium Mac mouse events for + multiple-moniter setups. Also changes the global coordinate values + to be computed from the event, rather than the instantaneous mouse + location, and reduces code duplication for location conversion. + + Dual-sided patch with http://codereview.chromium.org/751002 + + https://bugs.webkit.org/show_bug.cgi?id=35950 + + * src/mac/WebInputEventFactory.mm: + (WebKit::setWebEventLocationFromEventInView): + (WebKit::WebInputEventFactory::mouseEvent): + (WebKit::WebInputEventFactory::mouseWheelEvent): + +2010-03-11 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * src/ChromeClientImpl.cpp: + * src/ChromeClientImpl.h: + 2010-03-11 Darin Fisher + + Reviewed by Jeremy Orlow. + + Use WebPrivatePtr for WebNode + https://bugs.webkit.org/show_bug.cgi?id=36005 + + * public/WebElement.h: + * public/WebFormElement.h: + * public/WebInputElement.h: + * public/WebLabelElement.h: + * public/WebNode.h: + (WebKit::WebNode::WebNode): + (WebKit::WebNode::isNull): + (WebKit::WebNode::unwrap): + (WebKit::WebNode::constUnwrap): + * public/WebPrivatePtr.h: + (WebKit::WebPrivatePtr::assign): + * src/WebDocument.cpp: + (WebKit::WebDocument::WebDocument): + (WebKit::WebDocument::operator=): + (WebKit::WebDocument::operator PassRefPtr): + * src/WebElement.cpp: + (WebKit::WebElement::hasTagName): + (WebKit::WebElement::WebElement): + (WebKit::WebElement::operator=): + (WebKit::WebElement::operator PassRefPtr): + * src/WebFormElement.cpp: + (WebKit::WebFormElement::WebFormElement): + (WebKit::WebFormElement::operator=): + (WebKit::WebFormElement::operator PassRefPtr): + * src/WebInputElement.cpp: + (WebKit::WebInputElement::WebInputElement): + (WebKit::WebInputElement::operator=): + (WebKit::WebInputElement::operator PassRefPtr): + * src/WebLabelElement.cpp: + (WebKit::WebLabelElement::correspondingControl): + (WebKit::WebLabelElement::operator=): + (WebKit::WebLabelElement::operator PassRefPtr): + * src/WebNode.cpp: + (WebKit::WebNode::reset): + (WebKit::WebNode::assign): + (WebKit::WebNode::equals): + (WebKit::WebNode::parentNode): + (WebKit::WebNode::createMarkup): + (WebKit::WebNode::addEventListener): + (WebKit::WebNode::removeEventListener): + (WebKit::WebNode::simulateClick): + (WebKit::WebNode::WebNode): + (WebKit::WebNode::operator=): + (WebKit::WebNode::operator PassRefPtr): + +2010-03-10 Darin Fisher Reviewed by Jeremy Orlow. Index: /trunk/WebKit/chromium/src/NotificationPresenterImpl.h =================================================================== --- /trunk/WebKit/chromium/src/NotificationPresenterImpl.h (revision 1316) +++ /trunk/WebKit/chromium/src/NotificationPresenterImpl.h (revision 1404) @@ -55,5 +55,5 @@ virtual void cancel(WebCore::Notification* object); virtual void notificationObjectDestroyed(WebCore::Notification* object); - virtual WebCore::NotificationPresenter::Permission checkPermission(const WebCore::KURL& url, WebCore::Document* document); + virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::SecurityOrigin* origin); virtual void requestPermission(WebCore::SecurityOrigin* origin, WTF::PassRefPtr callback); Index: /trunk/WebKit/chromium/src/WebImageDecoder.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebImageDecoder.cpp (revision 1395) +++ /trunk/WebKit/chromium/src/WebImageDecoder.cpp (revision 1404) @@ -1,9 +1,9 @@ /* * Copyright (C) 2010 Google Inc. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. @@ -15,5 +15,5 @@ * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -38,4 +38,9 @@ #include "WebImage.h" #include "WebSize.h" + +#if WEBKIT_USING_SKIA +#include +#include +#endif using namespace WebCore; @@ -63,6 +68,5 @@ { ASSERT(m_private); - RefPtr buffer(SharedBuffer::create(data.data(), data.size())); - m_private->setData(buffer.get(), allDataReceived); + m_private->setData(PassRefPtr(data).get(), allDataReceived); } @@ -107,6 +111,8 @@ return WebImage(); #if WEBKIT_USING_SKIA - return WebImage(*(frameBuffer->asNewNativeImage())); + OwnPtrimage(frameBuffer->asNewNativeImage()); + return WebImage(*image); #elif WEBKIT_USING_CG + // FIXME: Implement CG side of this. return WebImage(frameBuffer->asNewNativeImage()); #endif Index: /trunk/WebKit/chromium/src/ChromeClientImpl.cpp =================================================================== --- /trunk/WebKit/chromium/src/ChromeClientImpl.cpp (revision 1402) +++ /trunk/WebKit/chromium/src/ChromeClientImpl.cpp (revision 1404) @@ -467,9 +467,4 @@ } -void ChromeClientImpl::invalidateContents(const IntRect&, bool) -{ - notImplemented(); -} - void ChromeClientImpl::invalidateWindow(const IntRect&, bool) { @@ -677,4 +672,5 @@ info->itemHeight = popupContainer->menuItemHeight(); + info->itemFontSize = popupContainer->menuItemFontSize(); info->selectedIndex = popupContainer->selectedIndex(); info->items.swap(outputItems); Index: /trunk/WebKit/chromium/src/WebSerializedScriptValue.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebSerializedScriptValue.cpp (revision 1402) +++ /trunk/WebKit/chromium/src/WebSerializedScriptValue.cpp (revision 1404) @@ -39,4 +39,9 @@ namespace WebKit { +WebSerializedScriptValue WebSerializedScriptValue::fromString(const WebString& s) +{ + return SerializedScriptValue::createFromWire(s); +} + void WebSerializedScriptValue::reset() { Index: /trunk/WebKit/chromium/src/ChromeClientImpl.h =================================================================== --- /trunk/WebKit/chromium/src/ChromeClientImpl.h (revision 1402) +++ /trunk/WebKit/chromium/src/ChromeClientImpl.h (revision 1404) @@ -97,5 +97,4 @@ virtual bool tabsToLinks() const; virtual WebCore::IntRect windowResizerRect() const; - virtual void invalidateContents(const WebCore::IntRect&, bool); virtual void invalidateWindow(const WebCore::IntRect&, bool); virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool); Index: /trunk/WebKit/chromium/src/WebInputEventConversion.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebInputEventConversion.cpp (revision 1402) +++ /trunk/WebKit/chromium/src/WebInputEventConversion.cpp (revision 1404) @@ -185,4 +185,5 @@ ASSERT_NOT_REACHED(); } + return TouchStart; } @@ -203,4 +204,5 @@ ASSERT_NOT_REACHED(); } + return PlatformTouchPoint::TouchReleased; } Index: /trunk/WebKit/chromium/src/NotificationPresenterImpl.cpp =================================================================== --- /trunk/WebKit/chromium/src/NotificationPresenterImpl.cpp (revision 1316) +++ /trunk/WebKit/chromium/src/NotificationPresenterImpl.cpp (revision 1404) @@ -34,9 +34,8 @@ #if ENABLE(NOTIFICATIONS) -#include "Document.h" +#include "KURL.h" #include "Notification.h" #include "SecurityOrigin.h" -#include "WebDocument.h" #include "WebNotification.h" #include "WebNotificationPermissionCallback.h" @@ -93,11 +92,12 @@ } -NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(const KURL& url, Document* document) +NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(SecurityOrigin* origin) { - WebDocument webDocument; - if (document) - webDocument = document; + int result = m_presenter->checkPermission(WebSecurityOrigin(origin)); - int result = m_presenter->checkPermission(url, document ? &webDocument : 0); + // FIXME: Remove this once clients are updated to use the above signature. + if (result == NotificationPresenter::PermissionNotAllowed) + result = m_presenter->checkPermission(KURL(KURL(), origin->toString()), 0); + return static_cast(result); } @@ -105,5 +105,7 @@ void NotificationPresenterImpl::requestPermission(SecurityOrigin* origin, PassRefPtr callback) { + // FIXME: Remove the first call once clients are updated to use the second signature. m_presenter->requestPermission(origin->toString(), new VoidCallbackClient(callback)); + m_presenter->requestPermission(WebSecurityOrigin(origin), new VoidCallbackClient(callback)); } Index: /trunk/WebKit/chromium/src/mac/WebInputEventFactory.mm =================================================================== --- /trunk/WebKit/chromium/src/mac/WebInputEventFactory.mm (revision 1234) +++ /trunk/WebKit/chromium/src/mac/WebInputEventFactory.mm (revision 1404) @@ -862,4 +862,27 @@ } +static inline void setWebEventLocationFromEventInView(WebMouseEvent* result, + NSEvent* event, + NSView* view) { + NSPoint windowLocal = [event locationInWindow]; + + NSPoint screenLocal = [[view window] convertBaseToScreen:windowLocal]; + result->globalX = screenLocal.x; + // Flip y. + NSScreen* primaryScreen = ([[NSScreen screens] count] > 0) ? + [[NSScreen screens] objectAtIndex:0] : nil; + if (primaryScreen) + result->globalY = [primaryScreen frame].size.height - screenLocal.y; + else + result->globalY = screenLocal.y; + + NSPoint contentLocal = [view convertPoint:windowLocal fromView:nil]; + result->x = contentLocal.x; + result->y = [view frame].size.height - contentLocal.y; // Flip y. + + result->windowX = result->x; + result->windowY = result->y; +} + WebKeyboardEvent WebInputEventFactory::keyboardEvent(NSEvent* event) { @@ -1022,14 +1045,5 @@ } - NSPoint location = [NSEvent mouseLocation]; // global coordinates - result.globalX = location.x; - result.globalY = [[[view window] screen] frame].size.height - location.y; - - NSPoint windowLocal = [event locationInWindow]; - location = [view convertPoint:windowLocal fromView:nil]; - result.y = [view frame].size.height - location.y; // flip y - result.x = location.x; - result.windowX = result.x; - result.windowY = result.y; + setWebEventLocationFromEventInView(&result, event, view); result.modifiers = modifiersFromEvent(event); @@ -1051,14 +1065,5 @@ result.modifiers = modifiersFromEvent(event); - // Set coordinates by translating event coordinates from screen to client. - NSPoint location = [NSEvent mouseLocation]; // global coordinates - result.globalX = location.x; - result.globalY = location.y; - NSPoint windowLocal = [event locationInWindow]; - location = [view convertPoint:windowLocal fromView:nil]; - result.x = location.x; - result.y = [view frame].size.height - location.y; // flip y - result.windowX = result.x; - result.windowY = result.y; + setWebEventLocationFromEventInView(&result, event, view); // Of Mice and Men Index: /trunk/WebKit/chromium/src/WebElement.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebElement.cpp (revision 1380) +++ /trunk/WebKit/chromium/src/WebElement.cpp (revision 1404) @@ -39,20 +39,4 @@ namespace WebKit { -WebElement::WebElement(const WTF::PassRefPtr& elem) - : WebNode(elem) -{ -} - -WebElement& WebElement::operator=(const WTF::PassRefPtr& elem) -{ - WebNode::assign(elem.releaseRef()); - return *this; -} - -WebElement::operator WTF::PassRefPtr() const -{ - return PassRefPtr(static_cast(m_private)); -} - WebString WebElement::tagName() const { @@ -63,5 +47,5 @@ { return equalIgnoringCase(constUnwrap()->tagName(), - tagName.operator WebCore::String()); + tagName.operator String()); } @@ -88,4 +72,19 @@ } +WebElement::WebElement(const PassRefPtr& elem) + : WebNode(elem) +{ +} + +WebElement& WebElement::operator=(const PassRefPtr& elem) +{ + m_private = elem; + return *this; +} + +WebElement::operator PassRefPtr() const +{ + return static_cast(m_private.get()); +} + } // namespace WebKit - Index: /trunk/WebKit/chromium/src/WebDocument.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebDocument.cpp (revision 1402) +++ /trunk/WebKit/chromium/src/WebDocument.cpp (revision 1404) @@ -33,5 +33,4 @@ #include "Document.h" -#include "DocumentLoader.h" #include "Element.h" #include "HTMLAllCollection.h" @@ -54,20 +53,4 @@ namespace WebKit { -WebDocument::WebDocument(const PassRefPtr& elem) - : WebNode(elem) -{ -} - -WebDocument& WebDocument::operator=(const PassRefPtr& elem) -{ - WebNode::assign(elem.releaseRef()); - return *this; -} - -WebDocument::operator PassRefPtr() const -{ - return PassRefPtr(static_cast(m_private)); -} - WebFrame* WebDocument::frame() const { @@ -83,4 +66,9 @@ { return constUnwrap()->baseURL(); +} + +WebURL WebDocument::firstPartyForCookies() const +{ + return constUnwrap()->firstPartyForCookies(); } @@ -127,32 +115,4 @@ WebString WebDocument::applicationID() const { - const char* kChromeApplicationHeader = "x-chrome-application"; - - // First check if the document's response included a header indicating the - // application it should go with. - const Document* document = constUnwrap(); - Frame* frame = document->frame(); - if (!frame) - return WebString(); - - DocumentLoader* loader = frame->loader()->documentLoader(); - if (!loader) - return WebString(); - - WebString headerValue = - loader->response().httpHeaderField(kChromeApplicationHeader); - if (!headerValue.isEmpty()) - return headerValue; - - // Otherwise, fall back to looking for the meta tag. - RefPtr metaTags = - const_cast(document)->getElementsByTagName("meta"); - for (unsigned i = 0; i < metaTags->length(); ++i) { - Element* element = static_cast(metaTags->item(i)); - if (element->hasAttribute("http-equiv") - && element->getAttribute("http-equiv").lower() == kChromeApplicationHeader) - return element->getAttribute("value"); - } - return WebString(); } @@ -163,3 +123,19 @@ } +WebDocument::WebDocument(const PassRefPtr& elem) + : WebNode(elem) +{ +} + +WebDocument& WebDocument::operator=(const PassRefPtr& elem) +{ + m_private = elem; + return *this; +} + +WebDocument::operator PassRefPtr() const +{ + return static_cast(m_private.get()); +} + } // namespace WebKit Index: /trunk/WebKit/chromium/src/WebLabelElement.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebLabelElement.cpp (revision 1391) +++ /trunk/WebKit/chromium/src/WebLabelElement.cpp (revision 1404) @@ -41,4 +41,9 @@ namespace WebKit { +WebElement WebLabelElement::correspondingControl() +{ + return WebElement(unwrap()->correspondingControl()); +} + WebLabelElement::WebLabelElement(const PassRefPtr& elem) : WebElement(elem) @@ -48,5 +53,5 @@ WebLabelElement& WebLabelElement::operator=(const PassRefPtr& elem) { - WebNode::assign(elem.releaseRef()); + m_private = elem; return *this; } @@ -54,10 +59,5 @@ WebLabelElement::operator PassRefPtr() const { - return PassRefPtr(static_cast(m_private)); -} - -WebElement WebLabelElement::correspondingControl() -{ - return WebElement(unwrap()->correspondingControl()); + return static_cast(m_private.get()); } Index: /trunk/WebKit/chromium/src/WebInputElement.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebInputElement.cpp (revision 1380) +++ /trunk/WebKit/chromium/src/WebInputElement.cpp (revision 1404) @@ -40,20 +40,4 @@ namespace WebKit { - -WebInputElement::WebInputElement(const WTF::PassRefPtr& elem) - : WebElement(elem) -{ -} - -WebInputElement& WebInputElement::operator=(const WTF::PassRefPtr& elem) -{ - WebNode::assign(elem.releaseRef()); - return *this; -} - -WebInputElement::operator WTF::PassRefPtr() const -{ - return PassRefPtr(static_cast(m_private)); -} bool WebInputElement::autoComplete() const @@ -130,3 +114,19 @@ } +WebInputElement::WebInputElement(const PassRefPtr& elem) + : WebElement(elem) +{ +} + +WebInputElement& WebInputElement::operator=(const PassRefPtr& elem) +{ + m_private = elem; + return *this; +} + +WebInputElement::operator PassRefPtr() const +{ + return static_cast(m_private.get()); +} + } // namespace WebKit Index: /trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp =================================================================== --- /trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp (revision 1395) +++ /trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp (revision 1404) @@ -1478,8 +1478,17 @@ WebNavigationPolicy* policy) { - if ((action.type() != NavigationTypeLinkClicked) || !action.event()->isMouseEvent()) + const MouseEvent* event = 0; + if (action.type() == NavigationTypeLinkClicked + && action.event()->isMouseEvent()) + event = static_cast(action.event()); + else if (action.type() == NavigationTypeFormSubmitted + && action.event() + && action.event()->underlyingEvent() + && action.event()->underlyingEvent()->isMouseEvent()) + event = static_cast(action.event()->underlyingEvent()); + + if (!event) return false; - const MouseEvent* event = static_cast(action.event()); return WebViewImpl::navigationPolicyFromMouseEvent( event->button(), event->ctrlKey(), event->shiftKey(), event->altKey(), Index: /trunk/WebKit/chromium/src/WebFormElement.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebFormElement.cpp (revision 1380) +++ /trunk/WebKit/chromium/src/WebFormElement.cpp (revision 1404) @@ -43,23 +43,4 @@ namespace WebKit { - -class WebFormPrivate : public HTMLFormElement { -}; - -WebFormElement::WebFormElement(const WTF::PassRefPtr& e) - : WebElement(e) -{ -} - -WebFormElement& WebFormElement::operator=(const WTF::PassRefPtr& e) -{ - WebNode::assign(e.releaseRef()); - return *this; -} - -WebFormElement::operator WTF::PassRefPtr() const -{ - return PassRefPtr(static_cast(m_private)); -} bool WebFormElement::autoComplete() const @@ -108,3 +89,19 @@ } +WebFormElement::WebFormElement(const PassRefPtr& e) + : WebElement(e) +{ +} + +WebFormElement& WebFormElement::operator=(const PassRefPtr& e) +{ + m_private = e; + return *this; +} + +WebFormElement::operator PassRefPtr() const +{ + return static_cast(m_private.get()); +} + } // namespace WebKit Index: /trunk/WebKit/chromium/src/WebNode.cpp =================================================================== --- /trunk/WebKit/chromium/src/WebNode.cpp (revision 1402) +++ /trunk/WebKit/chromium/src/WebNode.cpp (revision 1404) @@ -49,29 +49,21 @@ #include "markup.h" -#include - using namespace WebCore; namespace WebKit { -class WebNodePrivate : public Node { -}; - void WebNode::reset() { - assign(0); + m_private.reset(); } void WebNode::assign(const WebNode& other) { - WebNodePrivate* p = const_cast(other.m_private); - if (p) - p->ref(); - assign(p); + m_private = other.m_private; } bool WebNode::equals(const WebNode& n) const { - return (m_private == n.m_private); + return (m_private.get() == n.m_private.get()); } @@ -83,5 +75,5 @@ WebNode WebNode::parentNode() const { - return PassRefPtr(const_cast(m_private->parentNode())); + return WebNode(const_cast(m_private->parentNode())); } @@ -101,28 +93,4 @@ m_private->setNodeValue(value, exceptionCode); return !exceptionCode; -} - -WebNode::WebNode(const PassRefPtr& node) - : m_private(static_cast(node.releaseRef())) -{ -} - -WebNode& WebNode::operator=(const PassRefPtr& node) -{ - assign(static_cast(node.releaseRef())); - return *this; -} - -WebNode::operator PassRefPtr() const -{ - return PassRefPtr(const_cast(m_private)); -} - -void WebNode::assign(WebNodePrivate* p) -{ - // p is already ref'd for us by the caller - if (m_private) - m_private->deref(); - m_private = p; } @@ -169,5 +137,5 @@ WebString WebNode::createMarkup() const { - return WebCore::createMarkup(m_private); + return WebCore::createMarkup(m_private.get()); } @@ -185,5 +153,5 @@ { EventListenerWrapper* listenerWrapper = - listener->createEventListenerWrapper(eventType, useCapture, m_private); + listener->createEventListenerWrapper(eventType, useCapture, m_private.get()); // The listenerWrapper is only referenced by the actual Node. Once it goes // away, the wrapper notifies the WebEventListener so it can clear its @@ -195,5 +163,5 @@ { EventListenerWrapper* listenerWrapper = - listener->getEventListenerWrapper(eventType, useCapture, m_private); + listener->getEventListenerWrapper(eventType, useCapture, m_private.get()); m_private->removeEventListener(eventType, listenerWrapper, useCapture); // listenerWrapper is now deleted. @@ -202,8 +170,23 @@ void WebNode::simulateClick() { - ASSERT(m_private); RefPtr noEvent; m_private->dispatchSimulatedClick(noEvent); } +WebNode::WebNode(const PassRefPtr& node) + : m_private(node) +{ +} + +WebNode& WebNode::operator=(const PassRefPtr& node) +{ + m_private = node; + return *this; +} + +WebNode::operator PassRefPtr() const +{ + return m_private.get(); +} + } // namespace WebKit Index: /trunk/WebKit/chromium/DEPS =================================================================== --- /trunk/WebKit/chromium/DEPS (revision 1392) +++ /trunk/WebKit/chromium/DEPS (revision 1404) @@ -37,5 +37,5 @@ # Dependencies' revisions to use: 'chromium_rev': '38580', - 'google-url_rev': '121', + 'google-url_rev': '125', 'gtest_rev': '359', 'gyp_rev': '790', Index: /trunk/WebKit/chromium/public/WebDocument.h =================================================================== --- /trunk/WebKit/chromium/public/WebDocument.h (revision 1402) +++ /trunk/WebKit/chromium/public/WebDocument.h (revision 1404) @@ -64,4 +64,5 @@ WEBKIT_API bool isHTMLDocument() const; WEBKIT_API WebURL baseURL() const; + WEBKIT_API WebURL firstPartyForCookies() const; WEBKIT_API WebElement documentElement() const; WEBKIT_API WebElement body() const; Index: /trunk/WebKit/chromium/public/WebElement.h =================================================================== --- /trunk/WebKit/chromium/public/WebElement.h (revision 1250) +++ /trunk/WebKit/chromium/public/WebElement.h (revision 1404) @@ -36,5 +36,4 @@ #if WEBKIT_IMPLEMENTATION namespace WebCore { class Element; } -namespace WTF { template class PassRefPtr; } #endif Index: /trunk/WebKit/chromium/public/WebPrivatePtr.h =================================================================== --- /trunk/WebKit/chromium/public/WebPrivatePtr.h (revision 1402) +++ /trunk/WebKit/chromium/public/WebPrivatePtr.h (revision 1404) @@ -59,12 +59,4 @@ } - void assign(T* p) - { - // p is already ref'd for us by the caller - if (m_ptr) - m_ptr->deref(); - m_ptr = p; - } - WebPrivatePtr& operator=(const WebPrivatePtr& other) { @@ -95,4 +87,14 @@ private: +#if WEBKIT_IMPLEMENTATION + void assign(T* p) + { + // p is already ref'd for us by the caller + if (m_ptr) + m_ptr->deref(); + m_ptr = p; + } +#endif + T* m_ptr; }; Index: /trunk/WebKit/chromium/public/WebNotificationPresenter.h =================================================================== --- /trunk/WebKit/chromium/public/WebNotificationPresenter.h (revision 1316) +++ /trunk/WebKit/chromium/public/WebNotificationPresenter.h (revision 1404) @@ -32,4 +32,6 @@ #define WebNotificationPresenter_h +#include "WebNotificationPermissionCallback.h" +#include "WebSecurityOrigin.h" #include "WebString.h" @@ -38,5 +40,4 @@ class WebDocument; class WebNotification; -class WebNotificationPermissionCallback; class WebURL; @@ -60,12 +61,33 @@ virtual void objectDestroyed(const WebNotification&) = 0; + // Checks the permission level for the given origin. + // FIXME: This should become abstract when the below is removed. + virtual Permission checkPermission(const WebSecurityOrigin& origin) + { + return PermissionNotAllowed; + }; + // Checks the permission level for the given URL. If the URL is being displayed in a document // (as opposed to a worker or other ScriptExecutionContext), |document| will also be provided. - virtual Permission checkPermission(const WebURL& url, WebDocument* document) = 0; + // FIXME: This method should be removed as clients don't need WebDocument anymore. + virtual Permission checkPermission(const WebURL& url, WebDocument* document) + { + return PermissionNotAllowed; + } // Requests permission for a given origin. This operation is asynchronous and the callback provided // will be invoked when the permission decision is made. Callback pointer must remain // valid until called. - virtual void requestPermission(const WebString& origin, WebNotificationPermissionCallback* callback) = 0; + // FIXME: This method should be removed when clients are moved to the below. + virtual void requestPermission(const WebString& origin, WebNotificationPermissionCallback* callback) + { + callback->permissionRequestComplete(); + } + + // FIXME: This method should be abstract when the above is removed. + virtual void requestPermission(const WebSecurityOrigin& origin, WebNotificationPermissionCallback* callback) + { + callback->permissionRequestComplete(); + } }; Index: /trunk/WebKit/chromium/public/WebLabelElement.h =================================================================== --- /trunk/WebKit/chromium/public/WebLabelElement.h (revision 1391) +++ /trunk/WebKit/chromium/public/WebLabelElement.h (revision 1404) @@ -54,4 +54,5 @@ WEBKIT_API void assign(const WebLabelElement& e) { WebElement::assign(e); } + WEBKIT_API WebElement correspondingControl(); Index: /trunk/WebKit/chromium/public/WebInputElement.h =================================================================== --- /trunk/WebKit/chromium/public/WebInputElement.h (revision 1353) +++ /trunk/WebKit/chromium/public/WebInputElement.h (revision 1404) @@ -36,5 +36,4 @@ #if WEBKIT_IMPLEMENTATION namespace WebCore { class HTMLInputElement; } -namespace WTF { template class PassRefPtr; } #endif @@ -49,10 +48,4 @@ WebInputElement& operator=(const WebInputElement& n) { WebElement::assign(n); return *this; } WEBKIT_API void assign(const WebInputElement& n) { WebElement::assign(n); } - -#if WEBKIT_IMPLEMENTATION - WebInputElement(const WTF::PassRefPtr&); - WebInputElement& operator=(const WTF::PassRefPtr&); - operator WTF::PassRefPtr() const; -#endif enum InputType { @@ -99,4 +92,10 @@ // string if it has no name and no id. WEBKIT_API WebString nameForAutofill() const; + +#if WEBKIT_IMPLEMENTATION + WebInputElement(const WTF::PassRefPtr&); + WebInputElement& operator=(const WTF::PassRefPtr&); + operator WTF::PassRefPtr() const; +#endif }; Index: /trunk/WebKit/chromium/public/WebPopupMenuInfo.h =================================================================== --- /trunk/WebKit/chromium/public/WebPopupMenuInfo.h (revision 1159) +++ /trunk/WebKit/chromium/public/WebPopupMenuInfo.h (revision 1404) @@ -42,4 +42,5 @@ typedef WebMenuItemInfo Item; int itemHeight; + int itemFontSize; int selectedIndex; WebVector items; Index: /trunk/WebKit/chromium/public/WebFormElement.h =================================================================== --- /trunk/WebKit/chromium/public/WebFormElement.h (revision 1199) +++ /trunk/WebKit/chromium/public/WebFormElement.h (revision 1404) @@ -32,5 +32,4 @@ #define WebFormElement_h -#include "WebElement.h" #include "WebInputElement.h" #include "WebVector.h" @@ -38,5 +37,4 @@ #if WEBKIT_IMPLEMENTATION namespace WebCore { class HTMLFormElement; } -namespace WTF { template class PassRefPtr; } #endif @@ -58,10 +56,4 @@ WEBKIT_API void assign(const WebFormElement& e) { WebElement::assign(e); } -#if WEBKIT_IMPLEMENTATION - WebFormElement(const WTF::PassRefPtr&); - WebFormElement& operator=(const WTF::PassRefPtr&); - operator WTF::PassRefPtr() const; -#endif - WEBKIT_API bool autoComplete() const; WEBKIT_API WebString action() const; @@ -72,4 +64,10 @@ WEBKIT_API void getNamedElements(const WebString&, WebVector&); WEBKIT_API void getInputElements(WebVector&) const; + +#if WEBKIT_IMPLEMENTATION + WebFormElement(const WTF::PassRefPtr&); + WebFormElement& operator=(const WTF::PassRefPtr&); + operator WTF::PassRefPtr() const; +#endif }; Index: /trunk/WebKit/chromium/public/WebNode.h =================================================================== --- /trunk/WebKit/chromium/public/WebNode.h (revision 1402) +++ /trunk/WebKit/chromium/public/WebNode.h (revision 1404) @@ -33,10 +33,8 @@ #include "WebCommon.h" +#include "WebPrivatePtr.h" #include "WebString.h" namespace WebCore { class Node; } -#if WEBKIT_IMPLEMENTATION -namespace WTF { template class PassRefPtr; } -#endif namespace WebKit { @@ -52,6 +50,6 @@ virtual ~WebNode() { reset(); } - WebNode() : m_private(0) { } - WebNode(const WebNode& n) : m_private(0) { assign(n); } + WebNode() { } + WebNode(const WebNode& n) { assign(n); } WebNode& operator=(const WebNode& n) { @@ -65,11 +63,5 @@ WEBKIT_API bool equals(const WebNode&) const; - bool isNull() const { return !m_private; } - -#if WEBKIT_IMPLEMENTATION - WebNode(const WTF::PassRefPtr&); - WebNode& operator=(const WTF::PassRefPtr&); - operator WTF::PassRefPtr() const; -#endif + bool isNull() const { return m_private.isNull(); } enum NodeType { @@ -123,18 +115,24 @@ } +#if WEBKIT_IMPLEMENTATION + WebNode(const WTF::PassRefPtr&); + WebNode& operator=(const WTF::PassRefPtr&); + operator WTF::PassRefPtr() const; +#endif + protected: - typedef WebCore::Node WebNodePrivate; - void assign(WebNodePrivate*); - WebNodePrivate* m_private; - +#if WEBKIT_IMPLEMENTATION template T* unwrap() { - return static_cast(m_private); + return static_cast(m_private.get()); } template const T* constUnwrap() const { - return static_cast(m_private); + return static_cast(m_private.get()); } +#endif + + WebPrivatePtr m_private; }; Index: /trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp =================================================================== --- /trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp (revision 1402) +++ /trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp (revision 1404) @@ -328,9 +328,4 @@ } -void ChromeClientQt::invalidateContents(const IntRect&, bool) -{ - notImplemented(); -} - void ChromeClientQt::invalidateWindow(const IntRect&, bool) { Index: /trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp =================================================================== --- /trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp (revision 1324) +++ /trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp (revision 1404) @@ -24,6 +24,6 @@ #include "HostWindow.h" #include "PopupMenuClient.h" +#include "QWebPageClient.h" #include "qgraphicswebview.h" -#include "QWebPageClient.h" #include #include @@ -35,4 +35,10 @@ #include +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) +#include +#include // S60 platform private header file +#include +#endif + namespace WebCore { @@ -94,4 +100,7 @@ void QtFallbackWebPopup::show() { +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) + TRAP_IGNORE(showS60BrowserDialog()); +#else populate(); m_combo->setCurrentIndex(currentIndex()); @@ -125,5 +134,59 @@ Qt::LeftButton, Qt::NoModifier); QCoreApplication::sendEvent(m_combo, &event); -} +#endif +} + +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) + +static void ResetAndDestroy(TAny* aPtr) +{ + RPointerArray* items = reinterpret_cast* >(aPtr); + items->ResetAndDestroy(); +} + +void QtFallbackWebPopup::showS60BrowserDialog() +{ + static MBrCtlDialogsProvider* dialogs = CBrowserDialogsProvider::NewL(0); + if (!dialogs) + return; + + int size = itemCount(); + CArrayFix* options = new CArrayFixFlat(qMax(1, size)); + RPointerArray items(qMax(1, size)); + CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &items)); + + for (int i = 0; i < size; i++) { + if (itemType(i) == Separator) { + TBrCtlSelectOptionData data(_L("----------"), false, false, false); + options->AppendL(data); + } else { + HBufC16* itemStr = HBufC16::NewL(itemText(i).length()); + itemStr->Des().Copy((const TUint16*)itemText(i).utf16(), itemText(i).length()); + CleanupStack::PushL(itemStr); + TBrCtlSelectOptionData data(*itemStr, i == currentIndex(), false, itemIsEnabled(i)); + options->AppendL(data); + items.AppendL(itemStr); + CleanupStack::Pop(); + } + } + + dialogs->DialogSelectOptionL(KNullDesC(), (TBrCtlSelectOptionType)(ESelectTypeSingle | ESelectTypeWithFindPane), *options); + + CleanupStack::PopAndDestroy(&items); + + int newIndex; + for (newIndex = 0; newIndex < options->Count() && !options->At(newIndex).IsSelected(); newIndex++) {} + if (newIndex == options->Count()) + newIndex = currentIndex(); + + m_popupVisible = false; + popupDidHide(); + + if (currentIndex() != newIndex && newIndex >= 0) + valueChanged(newIndex); + + delete options; +} +#endif void QtFallbackWebPopup::hide() Index: /trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h =================================================================== --- /trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h (revision 1402) +++ /trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h (revision 1404) @@ -106,5 +106,4 @@ virtual IntRect windowResizerRect() const; - virtual void invalidateContents(const IntRect&, bool); virtual void invalidateWindow(const IntRect&, bool); virtual void invalidateContentsAndWindow(const IntRect&, bool); Index: /trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h =================================================================== --- /trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h (revision 1308) +++ /trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h (revision 1404) @@ -49,4 +49,7 @@ void populate(); +#if ENABLE(SYMBIAN_DIALOG_PROVIDERS) + void showS60BrowserDialog(); +#endif }; Index: /trunk/WebKit/qt/ChangeLog =================================================================== --- /trunk/WebKit/qt/ChangeLog (revision 1402) +++ /trunk/WebKit/qt/ChangeLog (revision 1404) @@ -1,2 +1,75 @@ +2010-03-15 Chang Shu + + Reviewed by Simon Hausmann. + + [Qt] [Symbian] Use Symbian native dialog providers for combo pupups. + https://bugs.webkit.org/show_bug.cgi?id=35919 + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::show): + (WebCore::ResetAndDestroy): + (WebCore::QtFallbackWebPopup::showS60BrowserDialog): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-03-14 Antti Koivisto + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=35146 + Support tiled backing store + + Implements a basic tiled backing store mechanism. Tiles are created and + deleted on demand. The page content is cached to the tiles. Tile content + is kept in sync with the document. Since the backing store covers area + larger than the currently visible viewport, the document can be scrolled + quickly without having to enter rendering tree painting. + + The tile management code is platform independent. This patch has simple QPixmap + based tile implementation for Qt. + + The feature is behind ENABLE_TILED_BACKING_STORE flag. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::visibleRect): + (QGraphicsWebView::paint): + * Api/qwebframe.cpp: + (QWebFramePrivate::renderContentsLayerAbsoluteCoords): + * Api/qwebframe.h: + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + * Api/qwebsettings.h: + +2010-03-13 Csaba Osztrogonác + + [Qt] Enable accelerated compositing by default + https://bugs.webkit.org/show_bug.cgi?id=35866 + + Unreviewed. Roll-out r55955, because it broke 3 tests: + - animations/fill-mode-transform.html + - animations/play-state.html + - animations/simultaneous-start-left.html + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2010-03-13 Simon Hausmann + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable accelerated compositing by default + https://bugs.webkit.org/show_bug.cgi?id=35866 + + * Api/qwebsettings.cpp: + (QWebSettings::QWebSettings): + +2010-03-11 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebCoreSupport/ChromeClientQt.cpp: + * WebCoreSupport/ChromeClientQt.h: + 2010-03-11 Robert Hogan Index: /trunk/WebKit/qt/Api/qgraphicswebview.cpp =================================================================== --- /trunk/WebKit/qt/Api/qgraphicswebview.cpp (revision 1380) +++ /trunk/WebKit/qt/Api/qgraphicswebview.cpp (revision 1404) @@ -27,5 +27,8 @@ #include "qwebpage_p.h" #include "QWebPageClient.h" -#include +#include "FrameView.h" +#include "GraphicsContext.h" +#include "IntRect.h" +#include "TiledBackingStore.h" #include #include @@ -36,4 +39,5 @@ #include #include +#include #include #if defined(Q_WS_X11) @@ -121,4 +125,5 @@ void updateResizesToContentsForPage(); + QRectF visibleRect() const; void syncLayers(); @@ -341,4 +346,21 @@ } +QRectF QGraphicsWebViewPrivate::visibleRect() const +{ + if (!q->scene()) + return QRectF(); + QList views = q->scene()->views(); + if (views.size() > 1) { + qDebug() << "QGraphicsWebView is in more than one graphics views, unable to compute the visible rect"; + return QRectF(); + } + if (views.size() < 1) + return QRectF(); + + int xPosition = views[0]->horizontalScrollBar()->value(); + int yPosition = views[0]->verticalScrollBar()->value(); + return q->mapRectFromScene(QRectF(QPoint(xPosition, yPosition), views[0]->viewport()->size())); +} + /*! \class QGraphicsWebView @@ -483,4 +505,15 @@ void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*) { +#if ENABLE(TILED_BACKING_STORE) + // FIXME: Scrollbars could be drawn with the overlay layer when using tiling. + if (WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore()) { + // FIXME: We should set the backing store viewpart earlier than in paint. + backingStore->viewportChanged(WebCore::IntRect(d->visibleRect())); + // QWebFrame::render is a public API, bypass it for tiled rendering so behavior does not need to change. + WebCore::GraphicsContext context(painter); + page()->mainFrame()->d->renderContentsLayerAbsoluteCoords(&context, option->exposedRect.toAlignedRect()); + return; + } +#endif #if USE(ACCELERATED_COMPOSITING) page()->mainFrame()->render(painter, d->overlay ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect()); Index: /trunk/WebKit/qt/Api/qwebframe.h =================================================================== --- /trunk/WebKit/qt/Api/qwebframe.h (revision 1380) +++ /trunk/WebKit/qt/Api/qwebframe.h (revision 1404) @@ -223,4 +223,5 @@ private: + friend class QGraphicsWebView; friend class QWebPage; friend class QWebPagePrivate; Index: /trunk/WebKit/qt/Api/qwebsettings.h =================================================================== --- /trunk/WebKit/qt/Api/qwebsettings.h (revision 1402) +++ /trunk/WebKit/qt/Api/qwebsettings.h (revision 1404) @@ -73,5 +73,6 @@ WebGLEnabled, SpatialNavigationEnabled, - LocalContentCanAccessFileUrls + LocalContentCanAccessFileUrls, + TiledBackingStoreEnabled }; enum WebGraphic { Index: /trunk/WebKit/qt/Api/qwebframe.cpp =================================================================== --- /trunk/WebKit/qt/Api/qwebframe.cpp (revision 1392) +++ /trunk/WebKit/qt/Api/qwebframe.cpp (revision 1404) @@ -59,4 +59,5 @@ #include "SubstituteData.h" #include "SVGSMILElement.h" +#include "TiledBackingStore.h" #include "htmlediting.h" #include "markup.h" @@ -340,5 +341,11 @@ WebCore::FrameView* view = frame->view(); - view->layoutIfNeededRecursive(); + +#if ENABLE(TILED_BACKING_STORE) + if (!frame->tiledBackingStore()) + view->layoutIfNeededRecursive(); +#else + view->layoutIfNeededRecursive() +#endif for (int i = 0; i < vector.size(); ++i) { @@ -349,5 +356,12 @@ context->save(); +#if ENABLE(TILED_BACKING_STORE) + if (frame->tiledBackingStore()) + frame->tiledBackingStore()->paint(context, clipRect); + else + view->paintContents(context, clipRect); +#else view->paintContents(context, clipRect); +#endif context->restore(); Index: /trunk/WebKit/qt/Api/qwebsettings.cpp =================================================================== --- /trunk/WebKit/qt/Api/qwebsettings.cpp (revision 1402) +++ /trunk/WebKit/qt/Api/qwebsettings.cpp (revision 1404) @@ -238,4 +238,10 @@ global->attributes.value(QWebSettings::XSSAuditorEnabled)); settings->setXSSAuditorEnabled(value); + +#if ENABLE(TILED_BACKING_STORE) + value = attributes.value(QWebSettings::TiledBackingStoreEnabled, + global->attributes.value(QWebSettings::TiledBackingStoreEnabled)); + settings->setTiledBackingStoreEnabled(value); +#endif settings->setUsesPageCache(WebCore::pageCache()->capacity()); Index: /trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp =================================================================== --- /trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp (revision 1402) +++ /trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp (revision 1404) @@ -343,9 +343,4 @@ } -void ChromeClient::invalidateContents(const IntRect&, bool) -{ - notImplemented(); -} - void ChromeClient::invalidateWindow(const IntRect&, bool) { Index: /trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h =================================================================== --- /trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h (revision 1402) +++ /trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h (revision 1404) @@ -88,5 +88,4 @@ virtual WebCore::IntRect windowResizerRect() const; - virtual void invalidateContents(const WebCore::IntRect&, bool); virtual void invalidateWindow(const WebCore::IntRect&, bool); virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool); Index: /trunk/WebKit/gtk/webkit/webkitwebframe.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitwebframe.cpp (revision 1387) +++ /trunk/WebKit/gtk/webkit/webkitwebframe.cpp (revision 1404) @@ -965,5 +965,5 @@ * @error: #GError for error return * - * Prints the given #WebKitFrame, using the given #GtkPrintOperation + * Prints the given #WebKitWebFrame, using the given #GtkPrintOperation * and #GtkPrintOperationAction. This function wraps a call to * gtk_print_operation_run() for printing the contents of the @@ -1003,5 +1003,5 @@ * @frame: a #WebKitWebFrame * - * Prints the given #WebKitFrame, by presenting a print dialog to the + * Prints the given #WebKitWebFrame, by presenting a print dialog to the * user. If you need more control over the printing process, see * webkit_web_frame_print_full(). Index: /trunk/WebKit/gtk/webkit/webkitsecurityorigin.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitsecurityorigin.cpp (revision 1126) +++ /trunk/WebKit/gtk/webkit/webkitsecurityorigin.cpp (revision 1404) @@ -354,5 +354,5 @@ * Returns a list of all Web Databases in the security origin. * - * Returns: a #Glist of databases in the security origin. + * Returns: a #GList of databases in the security origin. * * Since: 1.1.14 Index: /trunk/WebKit/gtk/webkit/webkitwebdatasource.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitwebdatasource.cpp (revision 1126) +++ /trunk/WebKit/gtk/webkit/webkitwebdatasource.cpp (revision 1404) @@ -419,7 +419,7 @@ * * Gives you a #GList of #WebKitWebResource objects that compose the - * #WebView to which this #WebKitWebDataSource is attached. - * - * Return value: a #GList of #WebKitResource objects; the objects are + * #WebKitWebView to which this #WebKitWebDataSource is attached. + * + * Return value: a #GList of #WebKitWebResource objects; the objects are * owned by WebKit, but the GList must be freed. * Index: /trunk/WebKit/gtk/webkit/webkitwebsettings.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitwebsettings.cpp (revision 1395) +++ /trunk/WebKit/gtk/webkit/webkitwebsettings.cpp (revision 1404) @@ -826,7 +826,7 @@ * WebKitWebSettings:enable-java-applet: * - * Enable or disable support for the Java tag. Keep in + * Enable or disable support for the Java <applet> tag. Keep in * mind that Java content can be still shown in the page through - * or , which are the preferred tags for this task. + * <object> or <embed>, which are the preferred tags for this task. * * Since: 1.1.22 Index: /trunk/WebKit/gtk/webkit/webkitwebinspector.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitwebinspector.cpp (revision 1159) +++ /trunk/WebKit/gtk/webkit/webkitwebinspector.cpp (revision 1404) @@ -126,5 +126,5 @@ * WebKitWebInspector::inspect-web-view: * @web_inspector: the object on which the signal is emitted - * @web_view: the #WebKitWeb which will be inspected + * @web_view: the #WebKitWebView which will be inspected * @return: a newly allocated #WebKitWebView or %NULL * Index: /trunk/WebKit/gtk/webkit/webkitwebview.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitwebview.cpp (revision 1402) +++ /trunk/WebKit/gtk/webkit/webkitwebview.cpp (revision 1404) @@ -1490,5 +1490,5 @@ * @frame: the #WebKitWebFrame that required the navigation * @request: a #WebKitNetworkRequest - * @navigation_action: a #WebKitWebNavigation + * @navigation_action: a #WebKitWebNavigationAction * @policy_decision: a #WebKitWebPolicyDecision * @@ -1537,5 +1537,5 @@ * @frame: the #WebKitWebFrame that required the navigation * @request: a #WebKitNetworkRequest - * @navigation_action: a #WebKitWebNavigation + * @navigation_action: a #WebKitWebNavigationAction * @policy_decision: a #WebKitWebPolicyDecision * @@ -2133,5 +2133,5 @@ * @param: a #GHashTable with additional attributes (strings) * - * The #WebKitWebView::create-plugin signal will be emitted to + * The #WebKitWebView::create-plugin-widget signal will be emitted to * create a plugin widget for embed or object HTML tags. This * allows to embed a GtkWidget as a plugin into HTML content. In @@ -2160,5 +2160,5 @@ * @database: the #WebKitWebDatabase which exceeded the quota of its #WebKitSecurityOrigin * - * The #WebKitWebView::database-exceeded-quota signal will be emitted when + * The #WebKitWebView::database-quota-exceeded signal will be emitted when * a Web Database exceeds the quota of its security origin. This signal * may be used to increase the size of the quota before the originating @@ -3392,5 +3392,5 @@ * @string: a string to look for * @case_sensitive: whether to respect the case of text - * @limit: the maximum number of strings to look for or %0 for all + * @limit: the maximum number of strings to look for or 0 for all * * Attempts to highlight all occurances of #string inside #web_view. @@ -3690,5 +3690,5 @@ * This function returns the list of targets this #WebKitWebView can * provide for clipboard copying and as DND source. The targets in the list are - * added with %info values from the #WebKitWebViewTargetInfo enum, + * added with values from the #WebKitWebViewTargetInfo enum, * using gtk_target_list_add() and * gtk_target_list_add_text_targets(). @@ -3707,5 +3707,5 @@ * This function returns the list of targets this #WebKitWebView can * provide for clipboard pasting and as DND destination. The targets in the list are - * added with %info values from the #WebKitWebViewTargetInfo enum, + * added with values from the #WebKitWebViewTargetInfo enum, * using gtk_target_list_add() and * gtk_target_list_add_text_targets(). Index: /trunk/WebKit/gtk/webkit/webkitwebhistoryitem.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitwebhistoryitem.cpp (revision 1207) +++ /trunk/WebKit/gtk/webkit/webkitwebhistoryitem.cpp (revision 1404) @@ -38,5 +38,5 @@ * A history item consists out of a title and a uri. It can be part of the * #WebKitWebBackForwardList and the global history. The global history is used - * for coloring the links of visited sites. #WebKitHistoryItem's constructed with + * for coloring the links of visited sites. #WebKitWebHistoryItem's constructed with * #webkit_web_history_item_new and #webkit_web_history_item_new_with_data are * automatically added to the global history. Index: /trunk/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp =================================================================== --- /trunk/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp (revision 1126) +++ /trunk/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp (revision 1404) @@ -253,5 +253,5 @@ /** * webkit_web_back_forward_list_get_back_item: - * @web_back_forward_list: a #WebBackForwardList + * @web_back_forward_list: a #WebKitWebBackForwardList * * Returns the item that precedes the current item @@ -384,5 +384,5 @@ * Returns the maximum limit of the back forward list. * - * Return value: a #gint indicating the number of #WebHistoryItem the back forward list can hold + * Return value: a #gint indicating the number of #WebKitWebHistoryItem the back forward list can hold */ gint webkit_web_back_forward_list_get_limit(WebKitWebBackForwardList* webBackForwardList) Index: /trunk/WebKit/gtk/ChangeLog =================================================================== --- /trunk/WebKit/gtk/ChangeLog (revision 1402) +++ /trunk/WebKit/gtk/ChangeLog (revision 1404) @@ -1,2 +1,31 @@ +2010-03-15 Gustavo Noronha Silva + + Rubber-stamped by Kenneth Rohde Christiansen. + + Misc documentation fixes. Fixes (almost) all warnings emitted by + the documentation build process. Only the broken references to JSC + objects remain. + + * webkit/webkitsecurityorigin.cpp: + * webkit/webkitwebbackforwardlist.cpp: + * webkit/webkitwebdatasource.cpp: + * webkit/webkitwebframe.cpp: + * webkit/webkitwebhistoryitem.cpp: + * webkit/webkitwebinspector.cpp: + (webkit_web_inspector_class_init): + * webkit/webkitwebsettings.cpp: + (webkit_web_settings_class_init): + * webkit/webkitwebview.cpp: + (DNDContentsRequest::webkit_web_view_class_init): + +2010-03-11 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebCoreSupport/ChromeClientGtk.cpp: + * WebCoreSupport/ChromeClientGtk.h: + 2010-03-11 Philippe Normand Index: /trunk/WebKit/ChangeLog =================================================================== --- /trunk/WebKit/ChangeLog (revision 1402) +++ /trunk/WebKit/ChangeLog (revision 1404) @@ -1,2 +1,91 @@ +2010-03-15 Leandro Pereira + + Reviewed by Kenneth Rohde Christiansen. + + Add EFL port files to efl/ewk. + http://webkit.org/b/35925 + + * efl/ewk/ewk_history.cpp: Added. + * efl/ewk/ewk_history.h: Added. + +2010-03-13 Leandro Pereira + + Reviewed by Kenneth Rohde Christiansen. + + Add EFL port files to efl/ewk. + http://webkit.org/b/35928 + + * efl/ewk/ewk_main.cpp: Added. + * efl/ewk/ewk_main.h: Added. + +2010-03-13 Leandro Pereira + + Reviewed by Kenneth Rohde Christiansen. + + Add EFL port files to efl/ewk. + http://webkit.org/b/35924 + + * efl/ewk/ewk_frame.cpp: Added. + * efl/ewk/ewk_frame.h: Added. + +2010-03-13 Leandro Pereira + + Reviewed by Kenneth Rohde Christiansen. + + Add EFL port files to efl/ewk. + http://webkit.org/b/35936 + + * efl/ewk/ewk_view_single.c: Added. + +2010-03-13 Leandro Pereira + + Reviewed by Kenneth Rohde Christiansen. + + Add EFL port files to efl/ewk. + http://webkit.org/b/35929 + + * efl/ewk/ewk_util.cpp: Added. + * efl/ewk/ewk_util.h: Added. + +2010-03-13 Leandro Pereira + + Reviewed by Kenneth Rohde Christiansen. + + Add EFL port files to efl/ewk. + http://webkit.org/b/35934 + + * efl/ewk/EWebKit.h: Added. + * efl/ewk/ewk_eapi.h: Added. + * efl/ewk/ewk_logging.h: Added. + * efl/ewk/ewk_private.h: Added. + +2010-03-11 Leandro Pereira + + Reviewed by Gustavo Noronha Silva. + + Add EFL port files to efl/WebCoreSupport. + http://webkit.org/b/35917 + + * efl/WebCoreSupport/InspectorClientEfl.h: Added. + * efl/WebCoreSupport/InspectorClientEfl.cpp: Added. + +2010-03-11 Leandro Pereira + + Reviewed by Gustavo Noronha Silva. + + Add EFL port files to efl/WebCoreSupport. + http://webkit.org/b/35914 + + * efl/WebCoreSupport/DragClientEfl.h: Added. + * efl/WebCoreSupport/DragClientEfl.cpp: Added. + +2010-03-11 Simon Fraser + + Reviewed by Mark Rowe. + + Sort the project file. + + * WebKit.xcodeproj/project.pbxproj: + 2010-03-11 Leandro Pereira Index: /trunk/WebKit/win/WebKitClassFactory.cpp =================================================================== --- /trunk/WebKit/win/WebKitClassFactory.cpp (revision 1316) +++ /trunk/WebKit/win/WebKitClassFactory.cpp (revision 1404) @@ -59,5 +59,4 @@ #pragma warning(push, 0) #include -#include #include #pragma warning(pop) @@ -88,5 +87,4 @@ JSC::initializeThreading(); - WebCore::populateFontDatabase(); gClassCount++; Index: /trunk/WebKit/win/FullscreenVideoController.h =================================================================== --- /trunk/WebKit/win/FullscreenVideoController.h (revision 1267) +++ /trunk/WebKit/win/FullscreenVideoController.h (revision 1404) @@ -129,5 +129,5 @@ void endScrubbing(); - WebCore::IntPoint fullScreenToHUDCoordinates(const WebCore::IntPoint& point) const + WebCore::IntPoint fullscreenToHUDCoordinates(const WebCore::IntPoint& point) const { return WebCore::IntPoint(point.x()- m_hudPosition.x(), point.y() - m_hudPosition.y()); Index: /trunk/WebKit/win/ChangeLog =================================================================== --- /trunk/WebKit/win/ChangeLog (revision 1402) +++ /trunk/WebKit/win/ChangeLog (revision 1404) @@ -1,2 +1,105 @@ +2010-03-15 Dan Bernstein + + Reviewed by Darin Adler. + + WebKit part of removing support for legacy versions of Core Graphics + + * WebKitClassFactory.cpp: + (WebKitClassFactory::WebKitClassFactory): Removed call to populateFontDatabase(). + * WebKitGraphics.cpp: + (makeFont): Ditto. + * WebTextRenderer.cpp: + (WebTextRenderer::registerPrivateFont): Removed call to wkAddFontsAtPath(). + +2010-03-12 Enrica Casucci + + Fixed broken build on Windows. + Added contditional compilation for accelerated compositing. + + * WebView.cpp: + (WebView::deleteBackingStore): + (WebView::addToDirtyRegion): + (WebView::updateBackingStore): + +2010-03-12 Beth Dakin + + Reviewed by Simon Fraser. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=34942 Fullscreen + API naming is inconsistent + -and corresponding- + + + This patch changes all occurrences of "fullScreen" to the more + popular "fullscreen." + + * FullscreenVideoController.cpp: + (FullscreenVideoController::onMouseDown): + (FullscreenVideoController::onMouseMove): + (FullscreenVideoController::onMouseUp): + * FullscreenVideoController.h: + (FullscreenVideoController::fullscreenToHUDCoordinates): + +2010-03-12 Beth Dakin + + Reviewed by Adam Roben. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=33739 Fullscreen + video HUD stays on top when switching to another window (e.g. via + Alt-Tab) + -and corresponding- + + + The HUD was always on top because it had the WS_EX_TOPMOST style. + So I removed the style and made m_videoWindow the owner of + m_hudWindow. This keeps m_hudWindow on top only when m_videoWindow + is the focused window. + + * FullscreenVideoController.cpp: + (FullscreenVideoController::exitFullscreen): ASSERT that movie()->exitFullscreen() also destroyed the hud. + (FullscreenVideoController::createHUDWindow): + +2010-03-12 Enrica Casucci + + Reviewed by Simon Fraser. + + Content of 3D tests appears at the bottom right corner sometimes. + + + + See detailed comments in WebCore/ChangeLog. + + * WebView.cpp: + (WebView::deleteBackingStore): Reset the dirty flag when deleting the backing store. + (WebView::addToDirtyRegion): Set the dirty flag when adding dirty rectangles to the + backing store dirty region. + (WebView::updateBackingStore): Reset the dirty flag after painting into the backing store. + (WebView::setAcceleratedCompositing): Removed unnecessary call to updateRootLayerContents. + (WebView::updateRootLayerContents): Changed the way we pass parameters to setScrollFrame. + We are passing width and height of the view content together with the offset for the scrolling. + It was confusing to pass it all as a rectangle, when it is not a rectangle. + +2010-03-11 Aaron Boodman + + Kill WebDocument::applicationID() (part 1). + + Modify interface to WebCore::NotificationPresenter::checkPermission() + and remove implementation of WebDocument::applicationID(). Breaking + API changes will be in a subsequent change. + https://bugs.webkit.org/show_bug.cgi?id=35846 + + * WebCoreSupport/WebDesktopNotificationsDelegate.cpp: + (WebDesktopNotificationsDelegate::checkPermission): + * WebCoreSupport/WebDesktopNotificationsDelegate.h: + +2010-03-11 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebCoreSupport/WebChromeClient.cpp: + * WebCoreSupport/WebChromeClient.h: + 2010-03-11 Eric Uhrhane Index: /trunk/WebKit/win/WebView.cpp =================================================================== --- /trunk/WebKit/win/WebView.cpp (revision 1402) +++ /trunk/WebKit/win/WebView.cpp (revision 1404) @@ -737,4 +737,8 @@ m_backingStoreBitmap.clear(); m_backingStoreDirtyRegion.clear(); +#if USE(ACCELERATED_COMPOSITING) + if (m_layerRenderer) + m_layerRenderer->setBackingStoreDirty(false); +#endif m_backingStoreSize.cx = m_backingStoreSize.cy = 0; @@ -784,4 +788,9 @@ } else m_backingStoreDirtyRegion.set(newRegion); + +#if USE(ACCELERATED_COMPOSITING) + if (m_layerRenderer) + m_layerRenderer->setBackingStoreDirty(true); +#endif if (m_uiDelegatePrivate) @@ -911,4 +920,8 @@ m_backingStoreDirtyRegion.clear(); +#if USE(ACCELERATED_COMPOSITING) + if (m_layerRenderer) + m_layerRenderer->setBackingStoreDirty(false); +#endif } @@ -6078,5 +6091,4 @@ m_layerRenderer->setHostWindow(m_viewWindow); m_layerRenderer->createRenderer(); - updateRootLayerContents(); } } else { @@ -6117,5 +6129,5 @@ FrameView* frameView = coreFrame->view(); - m_layerRenderer->setScrollFrame(IntRect(frameView->scrollX(), frameView->scrollY(), frameView->layoutWidth(), frameView->layoutHeight())); + m_layerRenderer->setScrollFrame(IntPoint(frameView->scrollX(), frameView->scrollY()), IntSize(frameView->layoutWidth(), frameView->layoutHeight())); } #endif Index: /trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h =================================================================== --- /trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h (revision 1316) +++ /trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h (revision 1404) @@ -52,4 +52,5 @@ virtual void requestPermission(WebCore::SecurityOrigin* origin, PassRefPtr callback); virtual WebCore::NotificationPresenter::Permission checkPermission(const KURL& url, Document* document); + virtual WebCore::NotificationPresenter::Permission checkPermission(const WebCore::SecurityOrigin* origin); private: Index: /trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp =================================================================== --- /trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp (revision 1402) +++ /trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp (revision 1404) @@ -455,10 +455,4 @@ } -void WebChromeClient::invalidateContents(const IntRect& windowRect, bool) -{ - ASSERT(core(m_webView->topLevelFrame())); - m_webView->repaint(windowRect, true /*contentChanged*/, false /*immediate*/, true /*repaintContentOnly*/); -} - void WebChromeClient::invalidateWindow(const IntRect& windowRect, bool immediate) { Index: /trunk/WebKit/win/WebCoreSupport/WebChromeClient.h =================================================================== --- /trunk/WebKit/win/WebCoreSupport/WebChromeClient.h (revision 1402) +++ /trunk/WebKit/win/WebCoreSupport/WebChromeClient.h (revision 1404) @@ -94,5 +94,4 @@ virtual WebCore::IntRect windowResizerRect() const; - virtual void invalidateContents(const WebCore::IntRect&, bool); virtual void invalidateWindow(const WebCore::IntRect&, bool); virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool); Index: /trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp =================================================================== --- /trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp (revision 1316) +++ /trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp (revision 1404) @@ -175,6 +175,11 @@ NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(const KURL& url, Document*) { + return NotificationPresenter::PermissionNotAllowed; +} + +NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(SecurityOrigin* origin) +{ int out = 0; - BString org(SecurityOrigin::create(url)->toString()); + BString org(origin->toString()); if (hasNotificationDelegate()) notificationDelegate()->checkNotificationPermission(org, &out); Index: /trunk/WebKit/win/FullscreenVideoController.cpp =================================================================== --- /trunk/WebKit/win/FullscreenVideoController.cpp (revision 1324) +++ /trunk/WebKit/win/FullscreenVideoController.cpp (revision 1404) @@ -227,10 +227,10 @@ void FullscreenVideoController::exitFullscreen() { + SetWindowLongPtr(m_hudWindow, 0, 0); if (movie()) movie()->exitFullscreen(); + ASSERT(!IsWindow(m_hudWindow)); m_videoWindow = 0; - SetWindowLongPtr(m_hudWindow, 0, 0); - DestroyWindow(m_hudWindow); m_hudWindow = 0; } @@ -369,7 +369,7 @@ registerHUDWindowClass(); - m_hudWindow = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOPMOST | WS_EX_TOOLWINDOW, + m_hudWindow = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, fullscreenVideeoHUDWindowClassName, 0, WS_POPUP | WS_VISIBLE, - m_hudPosition.x(), m_hudPosition.y(), 0, 0, 0, 0, gInstance, 0); + m_hudPosition.x(), m_hudPosition.y(), 0, 0, m_videoWindow, 0, gInstance, 0); ASSERT(::IsWindow(m_hudWindow)); SetWindowLongPtr(m_hudWindow, 0, reinterpret_cast(this)); @@ -514,5 +514,5 @@ void FullscreenVideoController::onMouseDown(const IntPoint& point) { - IntPoint convertedPoint(fullScreenToHUDCoordinates(point)); + IntPoint convertedPoint(fullscreenToHUDCoordinates(point)); // Don't bother hit testing if we're outside the bounds of the window @@ -553,5 +553,5 @@ void FullscreenVideoController::onMouseMove(const IntPoint& point) { - IntPoint convertedPoint(fullScreenToHUDCoordinates(point)); + IntPoint convertedPoint(fullscreenToHUDCoordinates(point)); if (m_hitWidget) { @@ -568,5 +568,5 @@ void FullscreenVideoController::onMouseUp(const IntPoint& point) { - IntPoint convertedPoint(fullScreenToHUDCoordinates(point)); + IntPoint convertedPoint(fullscreenToHUDCoordinates(point)); m_movingWindow = false; Index: /trunk/WebKit/win/WebKitGraphics.cpp =================================================================== --- /trunk/WebKit/win/WebKitGraphics.cpp (revision 1387) +++ /trunk/WebKit/win/WebKitGraphics.cpp (revision 1404) @@ -35,5 +35,4 @@ #include #include -#include #include #include @@ -53,5 +52,4 @@ { AtomicString::init(); - populateFontDatabase(); String fontFamilyString(description.family, description.familyLength); Index: /trunk/WebKit/win/WebTextRenderer.cpp =================================================================== --- /trunk/WebKit/win/WebTextRenderer.cpp (revision 1126) +++ /trunk/WebKit/win/WebTextRenderer.cpp (revision 1404) @@ -31,10 +31,4 @@ #include "WebKitDLL.h" - -#include -#if PLATFORM(CG) -#include -#endif -#include WebTextRenderer* WebTextRenderer::createInstance() @@ -92,8 +86,4 @@ return E_FAIL; - RetainPtr string(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast(fontFilePath), static_cast(wcslen(fontFilePath)))); -#if PLATFORM(CG) - wkAddFontsAtPath(string.get()); -#endif return S_OK; } Index: /trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h =================================================================== --- /trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h (revision 1402) +++ /trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h (revision 1404) @@ -103,5 +103,4 @@ virtual void updateBackingStore(); - virtual void invalidateContents(const IntRect&, bool); virtual void invalidateWindow(const IntRect&, bool); virtual void invalidateContentsAndWindow(const IntRect&, bool); Index: /trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp =================================================================== --- /trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp (revision 1402) +++ /trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp (revision 1404) @@ -337,9 +337,4 @@ } -void ChromeClientWx::invalidateContents(const IntRect& rect, bool) -{ - notImplemented(); -} - void ChromeClientWx::invalidateWindow(const IntRect& rect, bool immediate) { Index: /trunk/WebKit/wx/ChangeLog =================================================================== --- /trunk/WebKit/wx/ChangeLog (revision 1402) +++ /trunk/WebKit/wx/ChangeLog (revision 1404) @@ -1,2 +1,11 @@ +2010-03-15 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebKitSupport/ChromeClientWx.cpp: + * WebKitSupport/ChromeClientWx.h: + 2010-03-11 Adam Treat Index: /trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm =================================================================== --- /trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm (revision 1402) +++ /trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm (revision 1404) @@ -83,5 +83,5 @@ #define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification" #define WKNVSupportsCompositingCoreAnimationPluginsBool 74656 /* TRUE if the browser supports hardware compositing of Core Animation plug-ins */ -static const int WKNVSilverlightFullScreenPerformanceIssueFixed = 7288546; /* TRUE if Siverlight addressed its underlying bug in */ +static const int WKNVSilverlightFullscreenPerformanceIssueFixed = 7288546; /* TRUE if Siverlight addressed its underlying bug in */ using namespace WebCore; @@ -2311,11 +2311,11 @@ // 2) Enough Silverlight users update to the new Silverlight. // For now, we'll distinguish older broken versions of Silverlight by asking the plug-in if it resolved its full screen badness. -- (void)_workaroundSilverlightFullScreenBug:(BOOL)initializedPlugin +- (void)_workaroundSilverlightFullscreenBug:(BOOL)initializedPlugin { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) ASSERT(_isSilverlight); - NPBool isFullScreenPerformanceIssueFixed = 0; + NPBool isFullscreenPerformanceIssueFixed = 0; NPPluginFuncs *pluginFuncs = [_pluginPackage.get() pluginFuncs]; - if (pluginFuncs->getvalue && pluginFuncs->getvalue(plugin, static_cast(WKNVSilverlightFullScreenPerformanceIssueFixed), &isFullScreenPerformanceIssueFixed) == NPERR_NO_ERROR && isFullScreenPerformanceIssueFixed) + if (pluginFuncs->getvalue && pluginFuncs->getvalue(plugin, static_cast(WKNVSilverlightFullscreenPerformanceIssueFixed), &isFullscreenPerformanceIssueFixed) == NPERR_NO_ERROR && isFullscreenPerformanceIssueFixed) return; @@ -2358,5 +2358,5 @@ [[self class] setCurrentPluginView:nil]; if (_isSilverlight) - [self _workaroundSilverlightFullScreenBug:YES]; + [self _workaroundSilverlightFullscreenBug:YES]; LOG(Plugins, "NPP_New: %d", npErr); return npErr; @@ -2368,5 +2368,5 @@ if (_isSilverlight) - [self _workaroundSilverlightFullScreenBug:NO]; + [self _workaroundSilverlightFullscreenBug:NO]; NPError npErr; Index: /trunk/WebKit/mac/Plugins/WebPluginController.mm =================================================================== --- /trunk/WebKit/mac/Plugins/WebPluginController.mm (revision 1126) +++ /trunk/WebKit/mac/Plugins/WebPluginController.mm (revision 1404) @@ -352,10 +352,4 @@ } -// For compatibility only. -- (void)showURL:(NSURL *)URL inFrame:(NSString *)target -{ - [self webPlugInContainerLoadRequest:[NSURLRequest requestWithURL:URL] inFrame:target]; -} - - (void)webPlugInContainerShowStatus:(NSString *)message { Index: /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm =================================================================== --- /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (revision 1402) +++ /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (revision 1404) @@ -1353,24 +1353,16 @@ void NetscapePluginInstanceProxy::retainLocalObject(JSC::JSValue value) { - if (!value.isObject()) + if (!value.isObject() || value.inherits(&ProxyRuntimeObject::s_info)) return; - JSObject* object = asObject(value); - if (object->classInfo() == &RuntimeObject::s_info) + m_localObjects.retain(asObject(value)); +} + +void NetscapePluginInstanceProxy::releaseLocalObject(JSC::JSValue value) +{ + if (!value.isObject() || value.inherits(&ProxyRuntimeObject::s_info)) return; - m_localObjects.retain(object); -} - -void NetscapePluginInstanceProxy::releaseLocalObject(JSC::JSValue value) -{ - if (!value.isObject()) - return; - - JSObject* object = asObject(value); - if (object->classInfo() == &RuntimeObject::s_info) - return; - - m_localObjects.release(object); + m_localObjects.release(asObject(value)); } Index: /trunk/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs =================================================================== --- /trunk/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs (revision 1380) +++ /trunk/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs (revision 1404) @@ -235,5 +235,5 @@ panelData :data_t); -simpleroutine PCSetFullScreenWindowIsShowing(clientPort :mach_port_t; +simpleroutine PCSetFullscreenWindowIsShowing(clientPort :mach_port_t; isShowing :boolean_t); Index: /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm =================================================================== --- /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm (revision 1380) +++ /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm (revision 1404) @@ -96,5 +96,5 @@ , m_isModal(false) , m_menuBarIsVisible(true) - , m_fullScreenWindowIsShowing(false) + , m_fullscreenWindowIsShowing(false) , m_pluginHostPSN(pluginHostPSN) , m_processingRequests(0) @@ -203,10 +203,10 @@ } -void NetscapePluginHostProxy::didEnterFullScreen() const +void NetscapePluginHostProxy::didEnterFullscreen() const { SetFrontProcess(&m_pluginHostPSN); } -void NetscapePluginHostProxy::didExitFullScreen() const +void NetscapePluginHostProxy::didExitFullscreen() const { // If the plug-in host is the current application then we should bring ourselves to the front when it exits full-screen mode. @@ -224,14 +224,14 @@ } -void NetscapePluginHostProxy::setFullScreenWindowIsShowing(bool isShowing) -{ - if (m_fullScreenWindowIsShowing == isShowing) +void NetscapePluginHostProxy::setFullscreenWindowIsShowing(bool isShowing) +{ + if (m_fullscreenWindowIsShowing == isShowing) return; - m_fullScreenWindowIsShowing = isShowing; - if (m_fullScreenWindowIsShowing) - didEnterFullScreen(); + m_fullscreenWindowIsShowing = isShowing; + if (m_fullscreenWindowIsShowing) + didEnterFullscreen(); else - didExitFullScreen(); + didExitFullscreen(); } @@ -893,11 +893,11 @@ } -kern_return_t WKPCSetFullScreenWindowIsShowing(mach_port_t clientPort, boolean_t fullScreenWindowIsShowing) -{ - NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); - if (!hostProxy) - return KERN_FAILURE; - - hostProxy->setFullScreenWindowIsShowing(fullScreenWindowIsShowing); +kern_return_t WKPCSetFullscreenWindowIsShowing(mach_port_t clientPort, boolean_t fullscreenWindowIsShowing) +{ + NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); + if (!hostProxy) + return KERN_FAILURE; + + hostProxy->setFullscreenWindowIsShowing(fullscreenWindowIsShowing); return KERN_SUCCESS; Index: /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h =================================================================== --- /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h (revision 1274) +++ /trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h (revision 1404) @@ -55,6 +55,6 @@ void setMenuBarVisible(bool); - bool isFullScreenWindowShowing() const { return m_fullScreenWindowIsShowing; } - void setFullScreenWindowIsShowing(bool); + bool isFullscreenWindowShowing() const { return m_fullscreenWindowIsShowing; } + void setFullscreenWindowIsShowing(bool); void setModal(bool); @@ -74,6 +74,6 @@ void endModal(); - void didEnterFullScreen() const; - void didExitFullScreen() const; + void didEnterFullscreen() const; + void didExitFullscreen() const; static void deadNameNotificationCallback(CFMachPortRef, void *msg, CFIndex size, void *info); @@ -97,5 +97,5 @@ unsigned m_isModal; bool m_menuBarIsVisible; - bool m_fullScreenWindowIsShowing; + bool m_fullscreenWindowIsShowing; const ProcessSerialNumber m_pluginHostPSN; Index: /trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.mm =================================================================== --- /trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.mm (revision 1391) +++ /trunk/WebKit/mac/Plugins/Hosted/ProxyInstance.mm (revision 1404) @@ -164,6 +164,8 @@ NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec); - for (unsigned i = 0; i < args.size(); i++) - m_instanceProxy->releaseLocalObject(args.at(i)); + if (m_instanceProxy) { + for (unsigned i = 0; i < args.size(); i++) + m_instanceProxy->releaseLocalObject(args.at(i)); + } if (!reply.get() || !reply->m_returnValue) @@ -430,5 +432,6 @@ m_objectID, serverIdentifier, valueData, valueLength); mig_deallocate(reinterpret_cast(valueData), valueLength); - m_instanceProxy->releaseLocalObject(value); + if (m_instanceProxy) + m_instanceProxy->releaseLocalObject(value); if (kr != KERN_SUCCESS) return; Index: /trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm =================================================================== --- /trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm (revision 1402) +++ /trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm (revision 1404) @@ -440,8 +440,4 @@ } -void WebChromeClient::invalidateContents(const IntRect&, bool) -{ -} - void WebChromeClient::invalidateWindow(const IntRect&, bool immediate) { Index: /trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h =================================================================== --- /trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h (revision 1402) +++ /trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h (revision 1404) @@ -92,5 +92,4 @@ virtual WebCore::IntRect windowResizerRect() const; - virtual void invalidateContents(const WebCore::IntRect&, bool); virtual void invalidateWindow(const WebCore::IntRect&, bool); virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool); Index: /trunk/WebKit/mac/ChangeLog =================================================================== --- /trunk/WebKit/mac/ChangeLog (revision 1402) +++ /trunk/WebKit/mac/ChangeLog (revision 1404) @@ -1,2 +1,128 @@ +2010-03-15 Darin Adler + + Reviewed by Mark Rowe. + + Remove unneeded dependency on non-string identifier for an NSTableColumn + https://bugs.webkit.org/show_bug.cgi?id=36106 + + * WebView/WebTextCompletionController.mm: + (-[WebTextCompletionController _buildUI]): Use init instead of initWithIdentifier: + because the table has only one column and that column does not need an identifier. + +2010-03-12 Beth Dakin + + Reviewed by Simon Fraser. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=34942 Fullscreen + API naming is inconsistent + -and corresponding- + + + This patch changes all occurrences of "fullScreen" to the more + popular "fullscreen." + + * Plugins/Hosted/NetscapePluginHostProxy.h: + (WebKit::NetscapePluginHostProxy::isFullscreenWindowShowing): + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + (WebKit::NetscapePluginHostProxy::didEnterFullscreen): + (WebKit::NetscapePluginHostProxy::didExitFullscreen): + (WebKit::NetscapePluginHostProxy::setFullscreenWindowIsShowing): + (WKPCSetFullscreenWindowIsShowing): + * Plugins/Hosted/WebKitPluginClient.defs: + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView _workaroundSilverlightFullscreenBug:]): + (-[WebNetscapePluginView _createPlugin]): + (-[WebNetscapePluginView _destroyPlugin]): + * WebView/WebVideoFullscreenHUDWindowController.mm: + (-[WebVideoFullscreenHUDWindowController windowDidLoad]): + +2010-03-12 Andy Estes + + Reviewed by Brady Eidson. + + Expose WebPDFView's underlying PDFDocument. + + https://bugs.webkit.org/show_bug.cgi?id=36045 + + * WebView/WebDocumentPrivate.h: Create a new protocol called + WebDocumentPDF. + * WebView/WebPDFView.h: Have WebPDFView implement said protocol. + * WebView/WebPDFView.mm: + (-[WebPDFView PDFDocument]): Expose WebPDFView's underlying + PDFDocument by implementing -(PDFDocument*)PDFDocument from + WebDocumentPDF. + +2010-03-12 Andy Estes + + Reviewed by Brady Eidson. + + Remove an unused method. + + https://bugs.webkit.org/show_bug.cgi?id=35940 + + * Plugins/WebPluginController.mm: + removed - (void)showURL:(NSURL *) inFrame:(NSString *) + +2010-03-11 Mark Rowe + + Reviewed by David Kilzer. + + Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version + + Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version. + + * Configurations/Base.xcconfig: + +2010-03-11 Mark Rowe + + Reviewed by Tim Hatcher. + + Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version + + Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted. It defaults to the + current Mac OS X version unless otherwise specified. + + Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR. + + Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice + may not be usable when targetting a different Mac OS X version. + + Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off + MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used. + + * Configurations/Base.xcconfig: + * Configurations/DebugRelease.xcconfig: + * Configurations/FeatureDefines.xcconfig: + * Configurations/Version.xcconfig: + +2010-03-11 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + +2010-03-11 Alexey Proskuryakov + + Reviewed by Geoff Garen. + + https://bugs.webkit.org/show_bug.cgi?id=35965 + Crash when passing an object returned from plug-in back to the plug-in + + Test: plugins/round-trip-npobject.html + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::retainLocalObject): Corrected the check - there is + now a separate ProxyRuntimeObject class for proxy pbjects. + (WebKit::NetscapePluginInstanceProxy::releaseLocalObject): Ditto. + + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyInstance::invoke): Check if m_instanceProxy is still non-zero. The plug-in + could have crashed while we were waiting for response. + (WebKit::ProxyInstance::setFieldValue): Ditto. + 2010-03-11 Simon Fraser Index: /trunk/WebKit/mac/Configurations/Version.xcconfig =================================================================== --- /trunk/WebKit/mac/Configurations/Version.xcconfig (revision 1402) +++ /trunk/WebKit/mac/Configurations/Version.xcconfig (revision 1404) @@ -32,5 +32,5 @@ // The system version prefix is based on the current system version. -SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR)); +SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR)); SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR. SYSTEM_VERSION_PREFIX_1040 = 4; Index: /trunk/WebKit/mac/Configurations/DebugRelease.xcconfig =================================================================== --- /trunk/WebKit/mac/Configurations/DebugRelease.xcconfig (revision 1126) +++ /trunk/WebKit/mac/Configurations/DebugRelease.xcconfig (revision 1404) @@ -24,5 +24,5 @@ #include "Base.xcconfig" -ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR)); +ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ARCHS_ = $(ARCHS_1040); ARCHS_1040 = $(NATIVE_ARCH); @@ -33,5 +33,5 @@ ONLY_ACTIVE_ARCH = YES; -MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR)); +MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)); MACOSX_DEPLOYMENT_TARGET_ = 10.4; MACOSX_DEPLOYMENT_TARGET_1040 = 10.4; @@ -44,5 +44,5 @@ SECTORDER_FLAGS = ; -WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(MAC_OS_X_VERSION_MAJOR)); +WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR)); WEBKIT_SYSTEM_INTERFACE_LIBRARY_ = WebKitSystemInterfaceTiger; WEBKIT_SYSTEM_INTERFACE_LIBRARY_1040 = WebKitSystemInterfaceTiger; Index: /trunk/WebKit/mac/Configurations/FeatureDefines.xcconfig =================================================================== --- /trunk/WebKit/mac/Configurations/FeatureDefines.xcconfig (revision 1402) +++ /trunk/WebKit/mac/Configurations/FeatureDefines.xcconfig (revision 1404) @@ -32,10 +32,10 @@ // Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature. -ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(MAC_OS_X_VERSION_MAJOR)); +ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ENABLE_3D_CANVAS_1050 = ENABLE_3D_CANVAS; ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS; ENABLE_3D_CANVAS_1070 = ENABLE_3D_CANVAS; -ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR)); +ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING; ENABLE_3D_RENDERING_1060 = ENABLE_3D_RENDERING; Index: /trunk/WebKit/mac/Configurations/Base.xcconfig =================================================================== --- /trunk/WebKit/mac/Configurations/Base.xcconfig (revision 1126) +++ /trunk/WebKit/mac/Configurations/Base.xcconfig (revision 1404) @@ -54,4 +54,6 @@ REAL_PLATFORM_NAME_macosx = macosx; +TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); + // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants. @@ -79,5 +81,25 @@ // number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and // XCODE_VERSION_ACTUAL for the full version number. -GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_MINOR)); -GCC_VERSION_ = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL)); -GCC_VERSION_0310 = 4.2; +TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040); +TARGET_GCC_VERSION_1040 = GCC_40; +TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR)); +TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL)); +TARGET_GCC_VERSION_1050_0310 = GCC_42; +TARGET_GCC_VERSION_1050_0320 = GCC_42; +TARGET_GCC_VERSION_1060 = GCC_42; +TARGET_GCC_VERSION_1070 = LLVM_GCC_42; + +GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION)); +GCC_VERSION_GCC_40 = 4.0; +GCC_VERSION_GCC_42 = 4.2; +GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42; + +// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK. +SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); +SDKROOT_1050_1040 = macosx10.4; +SDKROOT_1060_1040 = macosx10.4; +SDKROOT_1060_1050 = macosx10.5; +SDKROOT_1070_1040 = macosx10.4; +SDKROOT_1070_1050 = macosx10.5; +SDKROOT_1070_1060 = macosx10.6; Index: /trunk/WebKit/mac/WebView/WebTextCompletionController.mm =================================================================== --- /trunk/WebKit/mac/WebView/WebTextCompletionController.mm (revision 1126) +++ /trunk/WebKit/mac/WebView/WebTextCompletionController.mm (revision 1404) @@ -85,6 +85,5 @@ NSRect tableFrame = NSZeroRect; tableFrame.size = [NSScrollView contentSizeForFrameSize:scrollFrame.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder]; - // Added cast to work around problem with multiple Foundation initWithIdentifier: methods with different parameter types. - NSTableColumn *column = [(NSTableColumn *)[NSTableColumn alloc] initWithIdentifier:[NSNumber numberWithInt:0]]; + NSTableColumn *column = [[NSTableColumn alloc] init]; [column setWidth:tableFrame.size.width]; [column setEditable:NO]; Index: /trunk/WebKit/mac/WebView/WebDocumentPrivate.h =================================================================== --- /trunk/WebKit/mac/WebView/WebDocumentPrivate.h (revision 1126) +++ /trunk/WebKit/mac/WebView/WebDocumentPrivate.h (revision 1404) @@ -31,4 +31,5 @@ @class DOMDocument; +@class PDFDocument; @protocol WebDocumentImage @@ -65,4 +66,8 @@ @end +@protocol WebDocumentPDF +- (PDFDocument *)PDFDocument; +@end + @protocol WebDocumentIncrementalSearching /*! Index: /trunk/WebKit/mac/WebView/WebPDFView.mm =================================================================== --- /trunk/WebKit/mac/WebView/WebPDFView.mm (revision 1126) +++ /trunk/WebKit/mac/WebView/WebPDFView.mm (revision 1404) @@ -183,4 +183,9 @@ } +- (PDFDocument *)PDFDocument +{ + return [PDFSubview document]; +} + #pragma mark NSObject OVERRIDES Index: /trunk/WebKit/mac/WebView/WebPDFView.h =================================================================== --- /trunk/WebKit/mac/WebView/WebPDFView.h (revision 1126) +++ /trunk/WebKit/mac/WebView/WebPDFView.h (revision 1404) @@ -33,5 +33,5 @@ @class WebDataSource; -@interface WebPDFView : NSView +@interface WebPDFView : NSView { NSView *previewView; @@ -52,4 +52,5 @@ - (void)setPDFDocument:(PDFDocument *)doc; +- (PDFDocument *)PDFDocument; @end Index: /trunk/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm =================================================================== --- /trunk/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm (revision 1324) +++ /trunk/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm (revision 1404) @@ -347,7 +347,7 @@ static const CGFloat volumeUpButtonLeftMargin = 4; static const CGFloat volumeControlsTopMargin = 13; - static const CGFloat exitFullScreenButtonWidth = 25; - static const CGFloat exitFullScreenButtonHeight = 21; - static const CGFloat exitFullScreenButtonTopMargin = 11; + static const CGFloat exitFullscreenButtonWidth = 25; + static const CGFloat exitFullscreenButtonHeight = 21; + static const CGFloat exitFullscreenButtonTopMargin = 11; static const CGFloat timelineWidth = 315; static const CGFloat timelineHeight = 14; @@ -381,6 +381,6 @@ [contentView addSubview:_playButton]; - CGFloat closeToRight = windowWidth - horizontalMargin - exitFullScreenButtonWidth; - NSControl *exitFullscreenButton = createControlWithMediaUIControlType(WKMediaUIControlExitFullscreenButton, NSMakeRect(closeToRight, windowHeight - exitFullScreenButtonTopMargin - exitFullScreenButtonHeight, exitFullScreenButtonWidth, exitFullScreenButtonHeight)); + CGFloat closeToRight = windowWidth - horizontalMargin - exitFullscreenButtonWidth; + NSControl *exitFullscreenButton = createControlWithMediaUIControlType(WKMediaUIControlExitFullscreenButton, NSMakeRect(closeToRight, windowHeight - exitFullscreenButtonTopMargin - exitFullscreenButtonHeight, exitFullscreenButtonWidth, exitFullscreenButtonHeight)); [exitFullscreenButton setAction:@selector(exitFullscreen:)]; [exitFullscreenButton setTarget:self]; Index: /trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp =================================================================== --- /trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp (revision 1402) +++ /trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp (revision 1404) @@ -254,9 +254,4 @@ } -void ChromeClientHaiku::invalidateContents(const IntRect&, bool) -{ - notImplemented(); -} - void ChromeClientHaiku::invalidateWindow(const IntRect&, bool) { Index: /trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h =================================================================== --- /trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h (revision 1402) +++ /trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h (revision 1404) @@ -103,5 +103,4 @@ IntRect windowResizerRect() const; - void invalidateContents(const IntRect&, bool); void invalidateWindow(const IntRect&, bool); void invalidateContentsAndWindow(const IntRect&, bool); Index: /trunk/WebKit/haiku/ChangeLog =================================================================== --- /trunk/WebKit/haiku/ChangeLog (revision 1402) +++ /trunk/WebKit/haiku/ChangeLog (revision 1404) @@ -1,2 +1,11 @@ +2010-03-15 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * WebCoreSupport/ChromeClientHaiku.cpp: + * WebCoreSupport/ChromeClientHaiku.h: + 2010-03-11 Adam Treat Index: /trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.h =================================================================== --- /trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.h (revision 1404) +++ /trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.h (revision 1404) @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia + * Copyright (C) 2009-2010 ProFUSION embedded systems + * Copyright (C) 2009-2010 Samsung Electronics + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef InspectorClientEfl_h +#define InspectorClientEfl_h + +#include "InspectorClient.h" + +namespace WebCore { +class Node; +class Page; +class String; + +class InspectorClientEfl : public WebCore::InspectorClient { +public: + virtual void inspectorDestroyed(); + + virtual WebCore::Page* createPage(); + + virtual WebCore::String localizedStringsURL(); + + virtual String hiddenPanels(); + + virtual void showWindow(); + virtual void closeWindow(); + + virtual void attachWindow(); + virtual void detachWindow(); + + virtual void setAttachedWindowHeight(unsigned height); + + virtual void highlight(WebCore::Node*); + virtual void hideHighlight(); + virtual void inspectedURLChanged(const WebCore::String& newURL); + + virtual void inspectorWindowObjectCleared(); + virtual void populateSetting(const WebCore::String& key, WebCore::String*); + virtual void storeSetting(const WebCore::String& key, const WebCore::String&); + virtual void removeSetting(const WebCore::String& key); +}; +} + +#endif // InspectorClientEfl_h Index: /trunk/WebKit/efl/WebCoreSupport/DragClientEfl.cpp =================================================================== --- /trunk/WebKit/efl/WebCoreSupport/DragClientEfl.cpp (revision 1404) +++ /trunk/WebKit/efl/WebCoreSupport/DragClientEfl.cpp (revision 1404) @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia + * Copyright (C) 2009-2010 ProFUSION embedded systems + * Copyright (C) 2009-2010 Samsung Electronics + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "DragClientEfl.h" + +#include "NotImplemented.h" + +using namespace WebCore; + +namespace WebCore { + +void DragClientEfl::willPerformDragDestinationAction(DragDestinationAction, DragData*) +{ + notImplemented(); +} + +void DragClientEfl::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) +{ + notImplemented(); +} + +DragDestinationAction DragClientEfl::actionMaskForDrag(DragData*) +{ + return DragDestinationActionAny; +} + +DragSourceAction DragClientEfl::dragSourceActionMaskForPoint(const IntPoint&) +{ + return DragSourceActionAny; +} + +void DragClientEfl::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool) +{ + notImplemented(); +} + +DragImageRef DragClientEfl::createDragImageForLink(KURL&, const String& label, Frame*) +{ + return 0; +} + +void DragClientEfl::dragControllerDestroyed() +{ + delete this; +} + +} Index: /trunk/WebKit/efl/WebCoreSupport/DragClientEfl.h =================================================================== --- /trunk/WebKit/efl/WebCoreSupport/DragClientEfl.h (revision 1404) +++ /trunk/WebKit/efl/WebCoreSupport/DragClientEfl.h (revision 1404) @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007 Holger Hans Peter Freyther + * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia + * Copyright (C) 2009-2010 ProFUSION embedded systems + * Copyright (C) 2009-2010 Samsung Electronics + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef DragClientEfl_h +#define DragClientEfl_h + +#include "DragClient.h" + +namespace WebCore { +class DragClientEfl : public WebCore::DragClient { +public: + virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*); + virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*); + virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*); + + virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); + + virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); + + virtual void dragControllerDestroyed(); +}; +} + +#endif // DragClientEfl_h Index: /trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp =================================================================== --- /trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp (revision 1404) +++ /trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp (revision 1404) @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia + * Copyright (C) 2009-2010 ProFUSION embedded systems + * Copyright (C) 2009-2010 Samsung Electronics + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" +#include "InspectorClientEfl.h" + +#include "NotImplemented.h" +#include "PlatformString.h" + +using namespace WebCore; + +namespace WebCore { + +void InspectorClientEfl::inspectorDestroyed() +{ + delete this; +} + +Page* InspectorClientEfl::createPage() +{ + notImplemented(); + return 0; +} + +String InspectorClientEfl::localizedStringsURL() +{ + notImplemented(); + return String(); +} + +String InspectorClientEfl::hiddenPanels() +{ + notImplemented(); + return String(); +} + +void InspectorClientEfl::showWindow() +{ + notImplemented(); +} + +void InspectorClientEfl::closeWindow() +{ + notImplemented(); +} + +void InspectorClientEfl::attachWindow() +{ + notImplemented(); +} + +void InspectorClientEfl::detachWindow() +{ + notImplemented(); +} + +void InspectorClientEfl::setAttachedWindowHeight(unsigned) +{ + notImplemented(); +} + +void InspectorClientEfl::highlight(Node* node) +{ + notImplemented(); +} + +void InspectorClientEfl::hideHighlight() +{ + notImplemented(); +} + +void InspectorClientEfl::inspectedURLChanged(const String&) +{ + notImplemented(); +} + +void InspectorClientEfl::inspectorWindowObjectCleared() +{ + notImplemented(); +} + +void InspectorClientEfl::populateSetting(const String&, String*) +{ + notImplemented(); +} + +void InspectorClientEfl::storeSetting(const String&, const String&) +{ + notImplemented(); +} + +void InspectorClientEfl::removeSetting(const String&) +{ + notImplemented(); +} + +} Index: /trunk/WebKit/efl/ewk/EWebKit.h =================================================================== --- /trunk/WebKit/efl/ewk/EWebKit.h (revision 1404) +++ /trunk/WebKit/efl/ewk/EWebKit.h (revision 1404) @@ -0,0 +1,34 @@ +/* + Copyright (C) 2008-2009 INdT - Instituto Nokia de Tecnologia + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef EWebKit_h +#define EWebKit_h + +#include "ewk_eapi.h" +#include "ewk_frame.h" +#include "ewk_history.h" +#include "ewk_main.h" +#include "ewk_settings.h" +#include "ewk_view.h" + +#include + +#endif // EWebKit_h Index: /trunk/WebKit/efl/ewk/ewk_main.h =================================================================== --- /trunk/WebKit/efl/ewk/ewk_main.h (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_main.h (revision 1404) @@ -0,0 +1,36 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_main_h +#define ewk_main_h + +#include "ewk_eapi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +EAPI int ewk_init(void); +EAPI int ewk_shutdown(void); + +#ifdef __cplusplus +} +#endif +#endif // ewk_main_h Index: /trunk/WebKit/efl/ewk/ewk_frame.cpp =================================================================== --- /trunk/WebKit/efl/ewk/ewk_frame.cpp (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_frame.cpp (revision 1404) @@ -0,0 +1,1844 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// Uncomment to view frame regions and debug messages +// #define EWK_FRAME_DEBUG + +#include "config.h" +#include "ewk_frame.h" + +#include "CString.h" +#include "EWebKit.h" +#include "EventHandler.h" +#include "FocusController.h" +#include "FrameLoaderClientEfl.h" +#include "FrameTree.h" +#include "FrameView.h" +#include "HTMLPlugInElement.h" +#include "HitTestResult.h" +#include "KURL.h" +#include "KeyboardCodes.h" +#include "PlatformKeyboardEvent.h" +#include "PlatformMouseEvent.h" +#include "PlatformWheelEvent.h" +#include "ProgressTracker.h" +#include "RefPtr.h" +#include "RenderTheme.h" +#include "ResourceRequest.h" +#include "ScriptValue.h" +#include "SharedBuffer.h" +#include "SubstituteData.h" +#include "ewk_private.h" + +#include +#include +#include + +static const char EWK_FRAME_TYPE_STR[] = "EWK_Frame"; + +struct Ewk_Frame_Smart_Data { + Evas_Object_Smart_Clipped_Data base; + Evas_Object* self; + Evas_Object* view; +#ifdef EWK_FRAME_DEBUG + Evas_Object* region; +#endif + WebCore::Frame* frame; + const char* theme; + const char* title; + const char* uri; + const char* name; + struct { + Evas_Coord w, h; + } contents_size; + Eina_Bool zoom_text_only:1; + Eina_Bool editable:1; +}; + +struct Eina_Iterator_Ewk_Frame { + Eina_Iterator base; + Evas_Object* obj; + WebCore::Frame* last; +}; + +#ifndef EWK_TYPE_CHECK +#define EWK_FRAME_TYPE_CHECK(o, ...) do { } while (0) +#else +#define EWK_FRAME_TYPE_CHECK(o, ...) \ + do { \ + const char* _tmp_otype = evas_object_type_get(o); \ + if (EINA_UNLIKELY(_tmp_otype != EWK_FRAME_TYPE_STR)) { \ + EINA_LOG_CRIT \ + ("%p (%s) is not of an ewk_frame!", o, \ + _tmp_otype ? _tmp_otype : "(null)"); \ + return __VA_ARGS__; \ + } \ + } while (0) +#endif + +#define EWK_FRAME_SD_GET(o, ptr) \ + Ewk_Frame_Smart_Data* ptr = (Ewk_Frame_Smart_Data*)evas_object_smart_data_get(o) + +#define EWK_FRAME_SD_GET_OR_RETURN(o, ptr, ...) \ + EWK_FRAME_TYPE_CHECK(o, __VA_ARGS__); \ + EWK_FRAME_SD_GET(o, ptr); \ + if (!ptr) { \ + CRITICAL("no smart data for object %p (%s)", \ + o, evas_object_type_get(o)); \ + return __VA_ARGS__; \ + } + +static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; + +#ifdef EWK_FRAME_DEBUG +static inline void _ewk_frame_debug(Evas_Object* o) +{ + Evas_Object* clip, *parent; + Evas_Coord x, y, w, h, cx, cy, cw, ch; + int r, g, b, a, cr, cg, cb, ca; + + evas_object_color_get(o, &r, &g, &b, &a); + evas_object_geometry_get(o, &x, &y, &w, &h); + + clip = evas_object_clip_get(o); + evas_object_color_get(clip, &cr, &cg, &cb, &ca); + evas_object_geometry_get(clip, &cx, &cy, &cw, &ch); + + fprintf(stderr, "%p: type=%s name=%s, visible=%d, color=%02x%02x%02x%02x, %d,%d+%dx%d, clipper=%p (%d, %02x%02x%02x%02x, %d,%d+%dx%d)\n", + o, evas_object_type_get(o), evas_object_name_get(o), evas_object_visible_get(o), + r, g, b, a, x, y, w, h, + clip, evas_object_visible_get(clip), cr, cg, cb, ca, cx, cy, cw, ch); + parent = evas_object_smart_parent_get(o); + if (!parent) + fprintf(stderr, "\n"); + else + _ewk_frame_debug(parent); +} +#endif + +static WebCore::FrameLoaderClientEfl* _ewk_frame_loader_efl_get(WebCore::Frame* frame) +{ + return static_cast(frame->loader()->client()); +} + +static inline Evas_Object* kit(WebCore::Frame* frame) +{ + if (!frame) + return 0; + WebCore::FrameLoaderClientEfl* fl = _ewk_frame_loader_efl_get(frame); + if (!fl) + return 0; + return fl->webFrame(); +} + +static Eina_Bool _ewk_frame_children_iterator_next(Eina_Iterator_Ewk_Frame* it, Evas_Object** data) +{ + EWK_FRAME_SD_GET_OR_RETURN(it->obj, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + + WebCore::FrameTree* tree = sd->frame->tree(); // check if it's still valid + EINA_SAFETY_ON_NULL_RETURN_VAL(tree, EINA_FALSE); + + WebCore::Frame* frame; + if (it->last) + frame = it->last->tree()->nextSibling(); + else + frame = tree->firstChild(); + + if (!frame) + return EINA_FALSE; + + *data = kit(frame); + return EINA_TRUE; +} + +static Evas_Object* _ewk_frame_children_iterator_get_container(Eina_Iterator_Ewk_Frame* it) +{ + return it->obj; +} + +static void _ewk_frame_smart_add(Evas_Object* o) +{ + EWK_FRAME_SD_GET(o, sd); + + if (!sd) { + sd = (Ewk_Frame_Smart_Data*)calloc(1, sizeof(Ewk_Frame_Smart_Data)); + if (!sd) + CRITICAL("could not allocate Ewk_Frame_Smart_Data"); + else + evas_object_smart_data_set(o, sd); + } + + sd->self = o; + + _parent_sc.add(o); + evas_object_move(sd->base.clipper, 0, 0); + evas_object_resize(sd->base.clipper, 0, 0); + +#ifdef EWK_FRAME_DEBUG + sd->region = evas_object_rectangle_add(sd->base.evas); + static int i = 0; + switch (i) { + case 0: + evas_object_color_set(sd->region, 128, 0, 0, 128); + break; + case 1: + evas_object_color_set(sd->region, 0, 128, 0, 128); + break; + case 2: + evas_object_color_set(sd->region, 0, 0, 128, 128); + break; + case 3: + evas_object_color_set(sd->region, 128, 0, 0, 128); + break; + case 4: + evas_object_color_set(sd->region, 128, 128, 0, 128); + break; + case 5: + evas_object_color_set(sd->region, 128, 0, 128, 128); + break; + case 6: + evas_object_color_set(sd->region, 0, 128, 128, 128); + break; + default: + break; + } + i++; + if (i > 6) + i = 0; + + evas_object_smart_member_add(sd->region, o); + evas_object_hide(sd->region); +#endif +} + +static void _ewk_frame_smart_del(Evas_Object* o) +{ + WRN("o=%p", o); // XXX REMOVE ME LATER + EWK_FRAME_SD_GET(o, sd); + + if (sd) { + if (sd->frame) { + WebCore::FrameLoaderClientEfl* flc = _ewk_frame_loader_efl_get(sd->frame); + flc->setWebFrame(0); + sd->frame->loader()->cancelAndClear(); + sd->frame = 0; + } + + eina_stringshare_del(sd->title); + eina_stringshare_del(sd->uri); + eina_stringshare_del(sd->name); + } + + _parent_sc.del(o); +} + +static void _ewk_frame_smart_resize(Evas_Object* o, Evas_Coord w, Evas_Coord h) +{ + EWK_FRAME_SD_GET(o, sd); + evas_object_resize(sd->base.clipper, w, h); + +#ifdef EWK_FRAME_DEBUG + evas_object_resize(sd->region, w, h); + Evas_Coord x, y; + evas_object_geometry_get(sd->region, &x, &y, &w, &h); + INF("region=%p, visible=%d, geo=%d,%d + %dx%d", + sd->region, evas_object_visible_get(sd->region), x, y, w, h); + _ewk_frame_debug(o); +#endif +} + +static void _ewk_frame_smart_set(Evas_Smart_Class* api) +{ + evas_object_smart_clipped_smart_set(api); + api->add = _ewk_frame_smart_add; + api->del = _ewk_frame_smart_del; + api->resize = _ewk_frame_smart_resize; +} + +static inline Evas_Smart* _ewk_frame_smart_class_new(void) +{ + static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION(EWK_FRAME_TYPE_STR); + static Evas_Smart* smart = 0; + + if (EINA_UNLIKELY(!smart)) { + evas_object_smart_clipped_smart_set(&_parent_sc); + _ewk_frame_smart_set(&sc); + smart = evas_smart_class_new(&sc); + } + + return smart; +} + +/** + * @internal + * + * Creates a new EFL WebKit Frame object. + * + * Frames are low level entries contained in a page that is contained + * by a view. Usually one operates on the view and not directly on the + * frame. + * + * @param e canvas where to create the frame object. + * + * @return frame object or @c NULL if errors. + */ +Evas_Object* ewk_frame_add(Evas* e) +{ + return evas_object_smart_add(e, _ewk_frame_smart_class_new()); +} + +/** + * Retrieves the ewk_view object that owns this frame. + * + * @param o frame object to get view from. + * + * @return view object or @c NULL if errors. + */ +Evas_Object* ewk_frame_view_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + return sd->view; +} + +/** + * Set the theme path to be used by this frame. + * + * Frames inherit theme from their parent, this will have all frames + * with unset theme to use this one. + * + * @param o frame object to change theme. + * @param path theme path, may be @c NULL to reset to default or inherit parent. + */ +void ewk_frame_theme_set(Evas_Object* o, const char* path) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + if (!eina_stringshare_replace(&sd->theme, path)) + return; + if (sd->frame && sd->frame->view()) { + sd->frame->view()->setEdjeTheme(WebCore::String(path)); + sd->frame->page()->theme()->themeChanged(); + } +} + +/** + * Gets the immediate theme set on this frame. + * + * This returns the value set by ewk_frame_theme_set(). Note that if + * it is @c NULL, the frame will inherit parent's theme. + * + * @param o frame object to get theme path. + * + * @return theme path, may be @c NULL if not set. + */ +const char* ewk_frame_theme_get(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + return sd->theme; +} + +/** + * Returns a new iterator over all direct children frames. + * + * Keep frame object intact while iteration happens otherwise frame + * may be destroyed while iterated. + * + * Iteration results are Evas_Object*, so give eina_iterator_next() a + * pointer to it. + * + * @return a newly allocated iterator, free using + * eina_iterator_free(). If not possible to create the + * iterator, @c NULL is returned. + */ +Eina_Iterator* ewk_frame_children_iterator_new(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + Eina_Iterator_Ewk_Frame* it = (Eina_Iterator_Ewk_Frame*) + calloc(1, sizeof(Eina_Iterator_Ewk_Frame)); + if (!it) + return 0; + + EINA_MAGIC_SET(&it->base, EINA_MAGIC_ITERATOR); + it->base.next = FUNC_ITERATOR_NEXT(_ewk_frame_children_iterator_next); + it->base.get_container = FUNC_ITERATOR_GET_CONTAINER(_ewk_frame_children_iterator_get_container); + it->base.free = FUNC_ITERATOR_FREE(free); + it->obj = o; + return &it->base; +} + +/** + * Finds a child frame by its name, recursively. + * + * For pre-defined names, returns @a o if @a name is "_self" or + * "_current", returns @a o's parent frame if @a name is "_parent", + * and returns the main frame if @a name is "_top". Also returns @a o + * if it is the main frame and @a name is either "_parent" or + * "_top". For other names, this function returns the first frame that + * matches @a name. This function searches @a o and its descendents + * first, then @a o's parent and its children moving up the hierarchy + * until a match is found. If no match is found in @a o's hierarchy, + * this function will search for a matching frame in other main frame + * hierarchies. + * + * @return object if found, @c NULL if nothing with that name. + */ +Evas_Object* ewk_frame_child_find(Evas_Object* o, const char* name) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(name, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); + WebCore::String s = WebCore::String::fromUTF8(name); + return kit(sd->frame->tree()->find(WebCore::AtomicString(s))); +} + +/** + * Ask main frame to load the given URI. + * + * @param o frame object to load uri. + * @param uri uniform resource identifier to load. + */ +Eina_Bool ewk_frame_uri_set(Evas_Object* o, const char* uri) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(uri)); + WebCore::ResourceRequest req(kurl); + WebCore::FrameLoader* loader = sd->frame->loader(); + loader->load(req, false); + return EINA_TRUE; +} + +/** + * Gets the uri of this frame. + * + * @param o frame object to get uri. + * + * @return frame uri or @c NULL. It's a internal string and should + * not be modified. The string is guaranteed to be stringshared. + */ +const char* ewk_frame_uri_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + return sd->uri; +} + +/** + * Gets the title of this frame. + * + * @param o frame object to get title. + * + * @return frame title or @c NULL. It's a internal string and should + * not be modified. The string is guaranteed to be stringshared. + */ +const char* ewk_frame_title_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + return sd->title; +} + +/** + * Gets the name of this frame. + * + * @param o frame object to get name. + * + * @return frame name or @c NULL. It's a internal string and should + * not be modified. The string is guaranteed to be stringshared. + */ +const char* ewk_frame_name_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + + if (sd->name) + return sd->name; + + if (!sd->frame) { + ERR("could not get name of uninitialized frame."); + return 0; + } + + WebCore::String s = sd->frame->tree()->name(); + WebCore::CString cs = s.utf8(); + sd->name = eina_stringshare_add_length(cs.data(), cs.length()); + return sd->name; +} + +/** + * Get last known contents size. + * + * @param o frame object to get contents size. + * @param w where to store contents size width. May be @c NULL. + * @param h where to store contents size height. May be @c NULL. + * + * @return @c EINA_TRUE on success or @c EINA_FALSE on failure and + * @a w and @a h will be zeroed. + */ +Eina_Bool ewk_frame_contents_size_get(const Evas_Object* o, Evas_Coord* w, Evas_Coord* h) +{ + if (w) + *w = 0; + if (h) + *h = 0; + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + if (w) + *w = sd->contents_size.w; + if (h) + *h = sd->contents_size.h; + return EINA_TRUE; +} + +static Eina_Bool _ewk_frame_contents_set_internal(Ewk_Frame_Smart_Data *sd, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri) +{ + if (contents_size < 1) + contents_size = strlen(contents); + if (!mime_type) + mime_type = "text/html"; + if (!encoding) + encoding = "UTF-8"; + if (!base_uri) + base_uri = "about:blank"; + + WebCore::KURL baseKURL(WebCore::KURL(), WebCore::String::fromUTF8(base_uri)); + WebCore::KURL unreachableKURL; + if (unreachable_uri) + unreachableKURL = WebCore::KURL(WebCore::KURL(), WebCore::String::fromUTF8(unreachable_uri)); + else + unreachableKURL = WebCore::KURL(); + + WTF::RefPtr buffer = WebCore::SharedBuffer::create(contents, contents_size); + WebCore::SubstituteData substituteData + (buffer.release(), + WebCore::String::fromUTF8(mime_type), + WebCore::String::fromUTF8(encoding), + baseKURL, unreachableKURL); + WebCore::ResourceRequest request(baseKURL); + + sd->frame->loader()->load(request, substituteData, false); + return EINA_TRUE; +} + +/** + * Requests loading the given contents in this frame. + * + * @param o frame object to load document. + * @param contents what to load into frame. Must not be @c NULL. + * @param contents_size byte size of data in @a contents. + * If zero, strlen() is used. + * @param mime_type type of @a contents data. If @c NULL "text/html" is assumed. + * @param encoding used for @a contents data. If @c NULL "UTF-8" is assumed. + * @param base_uri base uri to use for relative resources. May be @c NULL. + * If provided must be an absolute uri. + * + * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors. + */ +Eina_Bool ewk_frame_contents_set(Evas_Object* o, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(contents, EINA_FALSE); + return _ewk_frame_contents_set_internal + (sd, contents, contents_size, mime_type, encoding, base_uri, 0); +} + +/** + * Requests loading alternative contents for unreachable URI in this frame. + * + * This is similar to ewk_frame_contents_set(), but is used when some + * URI failed to load, using the provided content instead. The main + * difference is that back-forward navigation list is not changed. + * + * @param o frame object to load document. + * @param contents what to load into frame. Must not be @c NULL. + * @param contents_size byte size of data in @a contents. + * If zero, strlen() is used. + * @param mime_type type of @a contents data. If @c NULL "text/html" is assumed. + * @param encoding used for @a contents data. If @c NULL "UTF-8" is assumed. + * @param base_uri base uri to use for relative resources. May be @c NULL. + * If provided must be an absolute uri. + * @param unreachable_uri the URI that failed to load and is getting the + * alternative representation. + * + * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors. + */ +Eina_Bool ewk_frame_contents_alternate_set(Evas_Object* o, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(contents, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(unreachable_uri, EINA_FALSE); + return _ewk_frame_contents_set_internal + (sd, contents, contents_size, mime_type, encoding, base_uri, + unreachable_uri); +} + +/** + * Requests execution of given script. + * + * @param o frame object to execute script. + * @param script java script to execute. + * + * @return @c EINA_TRUE if request was done, @c EINA_FALSE on errors. + */ +Eina_Bool ewk_frame_script_execute(Evas_Object* o, const char* script) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(script, EINA_FALSE); + sd->frame->script()->executeScript(WebCore::String::fromUTF8(script), true); + return EINA_TRUE; +} + +/** + * Gets if frame is editable. + * + * @param o frame object to get editable state. + * + * @return @c EINA_TRUE if editable, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_editable_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return sd->editable; +} + +/** + * Sets if frame is editable. + * + * @param o frame object to set editable state. + * @param editable new state. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_editable_set(Evas_Object* o, Eina_Bool editable) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + editable = !!editable; + if (sd->editable == editable) + return EINA_TRUE; + if (editable) + sd->frame->applyEditingStyleToBodyElement(); + else + sd->frame->removeEditingStyleFromBodyElement(); + return EINA_TRUE; +} + +/** + * Get the copy of the selection text. + * + * @param o frame object to get selection text. + * + * @return newly allocated string or @c NULL if nothing is selected or failure. + */ +char* ewk_frame_selection_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); + WebCore::CString s = sd->frame->selectedText().utf8(); + if (s.isNull()) + return 0; + return strdup(s.data()); +} + +static inline Eina_Bool _ewk_frame_editor_command(Ewk_Frame_Smart_Data* sd, const char* command) +{ + return sd->frame->editor()->command(WebCore::String::fromUTF8(command)).execute(); +} + +/** + * Unselects whatever was selected. + * + * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_select_none(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return _ewk_frame_editor_command(sd, "Unselect"); +} + +/** + * Selects everything. + * + * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_select_all(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return _ewk_frame_editor_command(sd, "SelectAll"); +} + +/** + * Selects the current paragrah. + * + * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_select_paragraph(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return _ewk_frame_editor_command(sd, "SelectParagraph"); +} + +/** + * Selects the current sentence. + * + * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_select_sentence(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return _ewk_frame_editor_command(sd, "SelectSentence"); +} + +/** + * Selects the current line. + * + * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_select_line(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return _ewk_frame_editor_command(sd, "SelectLine"); +} + +/** + * Selects the current word. + * + * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_select_word(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return _ewk_frame_editor_command(sd, "SelectWord"); +} + +/** + * Search the given text string in document. + * + * @param o frame object where to search text. + * @param string reference string to search. + * @param case_sensitive if search should be case sensitive or not. + * @param forward if search is from cursor and on or backwards. + * @param wrap if search should wrap at end. + * + * @return @c EINA_TRUE if found, @c EINA_FALSE if not or failure. + */ +Eina_Bool ewk_frame_text_search(const Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(string, EINA_FALSE); + + return sd->frame->findString(WebCore::String::fromUTF8(string), forward, case_sensitive, wrap, true); +} + +/** + * Mark matches the given text string in document. + * + * @param o frame object where to search text. + * @param string reference string to match. + * @param case_sensitive if match should be case sensitive or not. + * @param highlight if matches should be highlighted. + * @param limit maximum amount of matches, or zero to unlimited. + * + * @return number of matches. + */ +unsigned int ewk_frame_text_matches_mark(Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); + + sd->frame->setMarkedTextMatchesAreHighlighted(highlight); + return sd->frame->markAllMatchesForText(WebCore::String::fromUTF8(string), case_sensitive, limit); +} + +/** + * Reverses the effect of ewk_frame_text_matches_mark() + * + * @param o frame object where to search text. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE for failure. + */ +Eina_Bool ewk_frame_text_matches_unmark_all(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + + sd->frame->document()->removeMarkers(WebCore::DocumentMarker::TextMatch); + return EINA_TRUE; +} + +/** + * Set if should highlight matches marked with ewk_frame_text_matches_mark(). + * + * @param o frame object where to set if matches are highlighted or not. + * @param highlight if @c EINA_TRUE, matches will be highlighted. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE for failure. + */ +Eina_Bool ewk_frame_text_matches_highlight_set(Evas_Object* o, Eina_Bool highlight) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + sd->frame->setMarkedTextMatchesAreHighlighted(highlight); + return EINA_TRUE; +} + +/** + * Get if should highlight matches marked with ewk_frame_text_matches_mark(). + * + * @param o frame object to query if matches are highlighted or not. + * + * @return @c EINA_TRUE if they are highlighted, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + return sd->frame->markedTextMatchesAreHighlighted(); +} + +/** + * Ask frame to stop loading. + * + * @param o frame object to stop loading. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_stop(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + sd->frame->loader()->stopAllLoaders(); + return EINA_TRUE; +} + +/** + * Ask frame to reload current document. + * + * @param o frame object to reload. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + * + * @see ewk_frame_reload_full() + */ +Eina_Bool ewk_frame_reload(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + sd->frame->loader()->reload(); + return EINA_TRUE; +} + +/** + * Ask frame to fully reload current document, using no previous caches. + * + * @param o frame object to reload. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_reload_full(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + sd->frame->loader()->reload(true); + return EINA_TRUE; +} + +/** + * Ask frame to navigate back in history. + * + * @param o frame object to navigate back. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + * + * @see ewk_frame_navigate() + */ +Eina_Bool ewk_frame_back(Evas_Object* o) +{ + return ewk_frame_navigate(o, -1); +} + +/** + * Ask frame to navigate forward in history. + * + * @param o frame object to navigate forward. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + * + * @see ewk_frame_navigate() + */ +Eina_Bool ewk_frame_forward(Evas_Object* o) +{ + return ewk_frame_navigate(o, 1); +} + +/** + * Navigate back or forward in history. + * + * @param o frame object to navigate. + * @param steps if positive navigates that amount forwards, if negative + * does backwards. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_navigate(Evas_Object* o, int steps) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + WebCore::Page* page = sd->frame->page(); + if (!page->canGoBackOrForward(steps)) + return EINA_FALSE; + page->goBackOrForward(steps); + return EINA_TRUE; +} + +/** + * Check if it is possible to navigate backwards one item in history. + * + * @param o frame object to check if backward navigation is possible. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise. + * + * @see ewk_frame_navigate_possible() + */ +Eina_Bool ewk_frame_back_possible(Evas_Object* o) +{ + return ewk_frame_navigate_possible(o, -1); +} + +/** + * Check if it is possible to navigate forwards one item in history. + * + * @param o frame object to check if forward navigation is possible. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise. + * + * @see ewk_frame_navigate_possible() + */ +Eina_Bool ewk_frame_forward_possible(Evas_Object* o) +{ + return ewk_frame_navigate_possible(o, 1); +} + +/** + * Check if it is possible to navigate given @a steps in history. + * + * @param o frame object to navigate. + * @param steps if positive navigates that amount forwards, if negative + * does backwards. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_navigate_possible(Evas_Object* o, int steps) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + WebCore::Page* page = sd->frame->page(); + return page->canGoBackOrForward(steps); +} + +/** + * Get current zoom level used by this frame. + * + * @param o frame object to query zoom level. + * + * @return zoom level or -1.0 on failure. + */ +float ewk_frame_zoom_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, -1.0); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, -1.0); + return sd->frame->zoomFactor(); +} + +/** + * Set current zoom level used by this frame. + * + * @param o frame object to change zoom level. + * @param zoom new level. + * + * @return @c EINA_TRUE on success or @c EINA_FALSE on failure. + * + * @see ewk_frame_zoom_text_only_set() + */ +Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + sd->frame->setZoomFactor(zoom, sd->zoom_text_only); + return EINA_TRUE; +} + +/** + * Query if zoom level just applies to text and not other elements. + * + * @param o frame to query setting. + * + * @return @c EINA_TRUE if just text are scaled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_zoom_text_only_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + return sd->zoom_text_only; +} + +/** + * Set if zoom level just applies to text and not other elements. + * + * @param o frame to change setting. + * @param setting @c EINA_TRUE if zoom should just be applied to text. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_zoom_text_only_set(Evas_Object* o, Eina_Bool setting) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + setting = !!setting; + if (sd->zoom_text_only == setting) + return EINA_TRUE; + + sd->zoom_text_only = setting; + sd->frame->setZoomFactor(sd->frame->zoomFactor(), setting); + return EINA_TRUE; +} + +/** + * Free hit test created with ewk_frame_hit_test_new(). + * + * @param hit_test instance. Must @b not be @c NULL. + */ +void ewk_frame_hit_test_free(Ewk_Hit_Test* hit_test) +{ + EINA_SAFETY_ON_NULL_RETURN(hit_test); + eina_stringshare_del(hit_test->title); + eina_stringshare_del(hit_test->alternate_text); + eina_stringshare_del(hit_test->link.text); + eina_stringshare_del(hit_test->link.url); + eina_stringshare_del(hit_test->link.title); + free(hit_test); +} + +/** + * Creates a new hit test for given frame and point. + * + * @param o frame to do hit test on. + * @param x horizontal position to query. + * @param y vertical position to query. + * + * @return a newly allocated hit test on success, @c NULL otherwise. + * Free memory with ewk_frame_hit_test_free() + */ +Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* o, int x, int y) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); + + WebCore::FrameView* view = sd->frame->view(); + EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->contentRenderer(), 0); + + WebCore::HitTestResult result = sd->frame->eventHandler()->hitTestResultAtPoint + (view->windowToContents(WebCore::IntPoint(x, y)), + /*allowShadowContent*/ false, /*ignoreClipping*/ true); + + if (result.scrollbar()) + return 0; + if (!result.innerNode()) + return 0; + + Ewk_Hit_Test* hit_test = (Ewk_Hit_Test*)calloc(1, sizeof(Ewk_Hit_Test)); + if (!hit_test) { + CRITICAL("Could not allocate memory for hit test."); + return 0; + } + + hit_test->x = result.point().x(); + hit_test->y = result.point().y(); +#if 0 + // FIXME + hit_test->bounding_box.x = result.boundingBox().x(); + hit_test->bounding_box.y = result.boundingBox().y(); + hit_test->bounding_box.w = result.boundingBox().width(); + hit_test->bounding_box.h = result.boundingBox().height(); +#else + hit_test->bounding_box.x = 0; + hit_test->bounding_box.y = 0; + hit_test->bounding_box.w = 0; + hit_test->bounding_box.h = 0; +#endif + + WebCore::TextDirection dir; + hit_test->title = eina_stringshare_add(result.title(dir).utf8().data()); + hit_test->alternate_text = eina_stringshare_add(result.altDisplayString().utf8().data()); + if (result.innerNonSharedNode() && result.innerNonSharedNode()->document() + && result.innerNonSharedNode()->document()->frame()) + hit_test->frame = kit(result.innerNonSharedNode()->document()->frame()); + + hit_test->link.text = eina_stringshare_add(result.textContent().utf8().data()); + hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL().prettyURL().utf8().data()); + hit_test->link.title = eina_stringshare_add(result.titleDisplayString().utf8().data()); + hit_test->link.target_frame = kit(result.targetFrame()); + + hit_test->flags.editable = result.isContentEditable(); + hit_test->flags.selected = result.isSelected(); + + return hit_test; +} + +/** + * Relative scroll of given frame. + * + * @param o frame object to scroll. + * @param dx horizontal offset to scroll. + * @param dy vertical offset to scroll. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise. + */ +Eina_Bool +ewk_frame_scroll_add(Evas_Object* o, int dx, int dy) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); + sd->frame->view()->scrollBy(IntSize(dx, dy)); + return EINA_TRUE; +} + +/** + * Set absolute scroll of given frame. + * + * Both values are from zero to the contents size minus the viewport + * size. See ewk_frame_scroll_size_get(). + * + * @param o frame object to scroll. + * @param x horizontal position to scroll. + * @param y vertical position to scroll. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise. + */ +Eina_Bool +ewk_frame_scroll_set(Evas_Object* o, int x, int y) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); + sd->frame->view()->setScrollPosition(WebCore::IntPoint(x, y)); + return EINA_TRUE; +} + +/** + * Get the possible scroll size of given frame. + * + * Possible scroll size is contents size minus the viewport + * size. It's the last allowed value for ewk_frame_scroll_set() + * + * @param o frame object to scroll. + * @param w where to return horizontal size that is possible to + * scroll. May be @c NULL. + * @param h where to return vertical size that is possible to scroll. + * May be @c NULL. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise and + * values are zeroed. + */ +Eina_Bool +ewk_frame_scroll_size_get(const Evas_Object* o, int* w, int* h) +{ + if (w) + *w = 0; + if (h) + *h = 0; + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); + WebCore::IntPoint point = sd->frame->view()->maximumScrollPosition(); + if (w) + *w = point.x(); + if (h) + *h = point.y(); + return EINA_TRUE; +} + +/** + * Get the current scroll position of given frame. + * + * @param o frame object to scroll. + * @param x where to return horizontal position. May be @c NULL. + * @param y where to return vertical position. May be @c NULL. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise and + * values are zeroed. + */ +Eina_Bool +ewk_frame_scroll_pos_get(const Evas_Object* o, int* x, int* y) +{ + if (x) + *x = 0; + if (y) + *y = 0; + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); + WebCore::IntPoint pos = sd->frame->view()->scrollPosition(); + if (x) + *x = pos.x(); + if (y) + *y = pos.y(); + return EINA_TRUE; +} + +/** + * Get the current frame visible content geometry. + * + * @param o frame object to query visible content geometry. + * @param include_scrollbars whenever to include scrollbars size. + * @param x horizontal position. May be @c NULL. + * @param y vertical position. May be @c NULL. + * @param w width. May be @c NULL. + * @param h height. May be @c NULL. + * + * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise and + * values are zeroed. + */ +Eina_Bool ewk_frame_visible_content_geometry_get(const Evas_Object* o, Eina_Bool include_scrollbars, int* x, int* y, int* w, int* h) +{ + if (x) + *x = 0; + if (y) + *y = 0; + if (w) + *w = 0; + if (h) + *h = 0; + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); + WebCore::IntRect rect = sd->frame->view()->visibleContentRect(include_scrollbars); + if (x) + *x = rect.x(); + if (y) + *y = rect.y(); + if (w) + *w = rect.width(); + if (h) + *h = rect.height(); + return EINA_TRUE; +} + +/** + * Get the current paintsEntireContents flag. + * + * This flag tells if dirty areas should be repainted even if they are + * out of the screen. + * + * @param o frame object to query paintsEntireContents flag. + * + * @return @c EINA_TRUE if repainting any dirty area, @c EINA_FALSE + * otherwise. + */ +Eina_Bool ewk_frame_paint_full_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); + return sd->frame->view()->paintsEntireContents(); +} + +/** + * Set the current paintsEntireContents flag. + * + * This flag tells if dirty areas should be repainted even if they are + * out of the screen. + * + * @param o frame object to set paintsEntireContents flag. + * @param flag @c EINA_TRUE if want to always repaint any dirty area, + * @c EINA_FALSE otherwise. + */ +void ewk_frame_paint_full_set(Evas_Object* o, Eina_Bool flag) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + EINA_SAFETY_ON_NULL_RETURN(sd->frame); + EINA_SAFETY_ON_NULL_RETURN(sd->frame->view()); + sd->frame->view()->setPaintsEntireContents(flag); +} + +/** + * Feed the focus in signal to this frame. + * + * @param o frame object to focus. + * + * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_feed_focus_in(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + WebCore::FocusController* c = sd->frame->page()->focusController(); + c->setFocusedFrame(sd->frame); + return EINA_TRUE; +} + +/** + * Feed the focus out signal to this frame. + * + * @param o frame object to remove focus. + */ +Eina_Bool ewk_frame_feed_focus_out(Evas_Object* o) +{ + // TODO: what to do on focus out? + ERR("what to do?"); + return EINA_FALSE; +} + +/** + * Feed the mouse wheel event to the frame. + * + * @param o frame object to feed event. + * @param ev mouse wheel event. + * + * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object* o, const Evas_Event_Mouse_Wheel* ev) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE); + + WebCore::FrameView* view = sd->frame->view(); + DBG("o=%p, view=%p, direction=%d, z=%d, pos=%d,%d", + o, view, ev->direction, ev->z, ev->canvas.x, ev->canvas.y); + EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); + + WebCore::PlatformWheelEvent event(ev); + return sd->frame->eventHandler()->handleWheelEvent(event); +} + +/** + * Feed the mouse down event to the frame. + * + * @param o frame object to feed event. + * @param ev mouse down event. + * + * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_feed_mouse_down(Evas_Object* o, const Evas_Event_Mouse_Down* ev) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE); + + WebCore::FrameView* view = sd->frame->view(); + DBG("o=%p, view=%p, button=%d, pos=%d,%d", + o, view, ev->button, ev->canvas.x, ev->canvas.y); + EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); + + Evas_Coord x, y; + evas_object_geometry_get(sd->view, &x, &y, 0, 0); + + WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y)); + return sd->frame->eventHandler()->handleMousePressEvent(event); +} + +/** + * Feed the mouse up event to the frame. + * + * @param o frame object to feed event. + * @param ev mouse up event. + * + * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_feed_mouse_up(Evas_Object* o, const Evas_Event_Mouse_Up* ev) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE); + + WebCore::FrameView* view = sd->frame->view(); + DBG("o=%p, view=%p, button=%d, pos=%d,%d", + o, view, ev->button, ev->canvas.x, ev->canvas.y); + EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); + + Evas_Coord x, y; + evas_object_geometry_get(sd->view, &x, &y, 0, 0); + + WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y)); + return sd->frame->eventHandler()->handleMouseReleaseEvent(event); +} + +/** + * Feed the mouse move event to the frame. + * + * @param o frame object to feed event. + * @param ev mouse move event. + * + * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_feed_mouse_move(Evas_Object* o, const Evas_Event_Mouse_Move* ev) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE); + + WebCore::FrameView* view = sd->frame->view(); + DBG("o=%p, view=%p, pos: old=%d,%d, new=%d,%d, buttons=%d", + o, view, ev->cur.canvas.x, ev->cur.canvas.y, + ev->prev.canvas.x, ev->prev.canvas.y, ev->buttons); + EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); + + Evas_Coord x, y; + evas_object_geometry_get(sd->view, &x, &y, 0, 0); + + WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y)); + return sd->frame->eventHandler()->mouseMoved(event); +} + +static inline Eina_Bool _ewk_frame_handle_key_scrolling(WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent &event) +{ + WebCore::ScrollDirection direction; + WebCore::ScrollGranularity granularity; + + int keyCode = event.windowsVirtualKeyCode(); + + switch (keyCode) { + case WebCore::VK_SPACE: + granularity = WebCore::ScrollByPage; + if (event.shiftKey()) + direction = WebCore::ScrollUp; + else + direction = WebCore::ScrollDown; + break; + case WebCore::VK_NEXT: + granularity = WebCore::ScrollByPage; + direction = WebCore::ScrollDown; + break; + case WebCore::VK_PRIOR: + granularity = WebCore::ScrollByPage; + direction = WebCore::ScrollUp; + break; + case WebCore::VK_HOME: + granularity = WebCore::ScrollByDocument; + direction = WebCore::ScrollUp; + break; + case WebCore::VK_END: + granularity = WebCore::ScrollByDocument; + direction = WebCore::ScrollDown; + break; + case WebCore::VK_LEFT: + granularity = WebCore::ScrollByLine; + direction = WebCore::ScrollLeft; + break; + case WebCore::VK_RIGHT: + granularity = WebCore::ScrollByLine; + direction = WebCore::ScrollRight; + break; + case WebCore::VK_UP: + direction = WebCore::ScrollUp; + if (event.ctrlKey()) + granularity = WebCore::ScrollByDocument; + else + granularity = WebCore::ScrollByLine; + break; + case WebCore::VK_DOWN: + direction = WebCore::ScrollDown; + if (event.ctrlKey()) + granularity = WebCore::ScrollByDocument; + else + granularity = WebCore::ScrollByLine; + break; + default: + return EINA_FALSE; + } + + if (frame->eventHandler()->scrollOverflow(direction, granularity)) + return EINA_FALSE; + + frame->view()->scroll(direction, granularity); + return EINA_TRUE; +} + +/** + * Feed the keyboard key down event to the frame. + * + * @param o frame object to feed event. + * @param ev keyboard key down event. + * + * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_feed_key_down(Evas_Object* o, const Evas_Event_Key_Down* ev) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE); + + DBG("o=%p keyname=%s (key=%s, string=%s)", + o, ev->keyname, ev->key ? ev->key : "", ev->string ? ev->string : ""); + + WebCore::PlatformKeyboardEvent event(ev); + if (sd->frame->eventHandler()->keyEvent(event)) + return EINA_TRUE; + + return _ewk_frame_handle_key_scrolling(sd->frame, event); +} + +/** + * Feed the keyboard key up event to the frame. + * + * @param o frame object to feed event. + * @param ev keyboard key up event. + * + * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_frame_feed_key_up(Evas_Object* o, const Evas_Event_Key_Up* ev) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE); + + DBG("o=%p keyname=%s (key=%s, string=%s)", + o, ev->keyname, ev->key ? ev->key : "", ev->string ? ev->string : ""); + + WebCore::PlatformKeyboardEvent event(ev); + return sd->frame->eventHandler()->keyEvent(event); +} + +/* internal methods ****************************************************/ + +/** + * @internal + * + * Initialize frame based on actual WebKit frame. + * + * This is internal and should never be called by external users. + */ +Eina_Bool ewk_frame_init(Evas_Object* o, Evas_Object* view, WebCore::Frame* frame) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + if (!sd->frame) { + WebCore::FrameLoaderClientEfl* flc = _ewk_frame_loader_efl_get(frame); + flc->setWebFrame(o); + sd->frame = frame; + sd->view = view; + frame->init(); + return EINA_TRUE; + } + + ERR("frame %p already set for %p, ignored new %p", + sd->frame, o, frame); + return EINA_FALSE; +} + +Evas_Object* ewk_frame_child_add(Evas_Object* o, WTF::PassRefPtr child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + char buf[256]; + Evas_Object* frame; + WebCore::Frame* cf; + + frame = ewk_frame_add(sd->base.evas); + if (!frame) { + ERR("Could not create ewk_frame object."); + return 0; + } + + cf = child.get(); + sd->frame->tree()->appendChild(child); + if (cf->tree()) + cf->tree()->setName(name); + else + ERR("no tree for child object"); + + if (!ewk_frame_init(frame, sd->view, cf)) { + evas_object_del(frame); + return 0; + } + snprintf(buf, sizeof(buf), "EWK_Frame:child/%s", name.utf8().data()); + evas_object_name_set(frame, buf); + evas_object_smart_member_add(frame, o); + evas_object_show(frame); + + if (!cf->page()) + goto died; + + cf->loader()->loadURLIntoChildFrame(url, referrer, cf); + if (!cf->tree()->parent()) + goto died; + + // TODO: announce frame was created? + return frame; + +died: + CRITICAL("does this work: BEGIN"); + ewk_frame_core_gone(frame); // CONFIRM + evas_object_del(frame); // CONFIRM + CRITICAL("does this work: END"); + return 0; +} + +/** + * @internal + * Frame was destroyed by loader, remove internal reference. + */ +void ewk_frame_core_gone(Evas_Object* o) +{ + DBG("o=%p", o); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + sd->frame = 0; +} + +/** + * @internal + * Retrieve WebCore::Frame associated with this object. + * + * Avoid using this call from outside, add specific ewk_frame_* + * actions instead. + */ +WebCore::Frame* ewk_frame_core_get(const Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + return sd->frame; +} + + +/** + * @internal + * Reports the frame started loading something. + * + * Emits signal: "load,started" with no parameters. + */ +void ewk_frame_load_started(Evas_Object* o) +{ + Evas_Object* main_frame; + DBG("o=%p", o); + evas_object_smart_callback_call(o, "load,started", 0); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + ewk_view_load_started(sd->view); + + main_frame = ewk_view_frame_main_get(sd->view); + if (main_frame == o) + ewk_view_frame_main_load_started(sd->view); +} + +/** + * @internal + * Reports load finished, optionally with error information. + * + * Emits signal: "load,finished" with pointer to Ewk_Frame_Load_Error + * if any error, or @c NULL if successful load. + * + * @note there should notbe any error stuff here, but trying to be + * compatible with previous WebKit. + */ +void ewk_frame_load_finished(Evas_Object* o, const char* error_domain, int error_code, Eina_Bool is_cancellation, const char* error_description, const char* failing_url) +{ + Ewk_Frame_Load_Error buf, *error; + if (!error_domain) { + DBG("o=%p, success.", o); + error = 0; + } else { + DBG("o=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s", + o, error_domain, error_code, is_cancellation, + error_description, failing_url); + + buf.domain = error_domain; + buf.code = error_code; + buf.is_cancellation = is_cancellation; + buf.description = error_description; + buf.failing_url = failing_url; + buf.frame = o; + error = &buf; + } + evas_object_smart_callback_call(o, "load,finished", error); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + ewk_view_load_finished(sd->view, error); +} + +/** + * @internal + * Reports load failed with error information. + * + * Emits signal: "load,error" with pointer to Ewk_Frame_Load_Error. + */ +void ewk_frame_load_error(Evas_Object* o, const char* error_domain, int error_code, Eina_Bool is_cancellation, const char* error_description, const char* failing_url) +{ + Ewk_Frame_Load_Error error; + + DBG("o=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s", + o, error_domain, error_code, is_cancellation, + error_description, failing_url); + + EINA_SAFETY_ON_NULL_RETURN(error_domain); + + error.code = error_code; + error.is_cancellation = is_cancellation; + error.domain = error_domain; + error.description = error_description; + error.failing_url = failing_url; + error.frame = o; + evas_object_smart_callback_call(o, "load,error", &error); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + ewk_view_load_error(sd->view, &error); +} + +/** + * @internal + * Reports load progress changed. + * + * Emits signal: "load,progress" with pointer to a double from 0.0 to 1.0. + */ +void ewk_frame_load_progress_changed(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + EINA_SAFETY_ON_NULL_RETURN(sd->frame); + + // TODO: this is per page, there should be a way to have per-frame. + double progress = sd->frame->page()->progress()->estimatedProgress(); + + DBG("o=%p (p=%0.3f)", o, progress); + + evas_object_smart_callback_call(o, "load,progress", &progress); + ewk_view_load_progress_changed(sd->view); +} + + +/** + * @internal + * + * Reports contents size changed. + */ +void ewk_frame_contents_size_changed(Evas_Object* o, Evas_Coord w, Evas_Coord h) +{ + DBG("o=%p: %dx%d", o, w, h); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + if (sd->contents_size.w == w && sd->contents_size.h == h) + return; + sd->contents_size.w = w; + sd->contents_size.h = h; + // TODO: update something else internally? + + Evas_Coord size[2] = {w, h}; + evas_object_smart_callback_call(o, "contents,size,changed", size); +} + +/** + * @internal + * + * Reports title changed. + */ +void ewk_frame_title_set(Evas_Object* o, const char* title) +{ + DBG("o=%p, title=%s", o, title ? title : "(null)"); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + if (!eina_stringshare_replace(&sd->title, title)) + return; + evas_object_smart_callback_call(o, "title,changed", (void*)sd->title); +} + +void ewk_frame_view_create_for_view(Evas_Object* o, Evas_Object* view) +{ + DBG("o=%p, view=%p", o, view); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + EINA_SAFETY_ON_NULL_RETURN(sd->frame); + Evas_Coord w, h; + + if (sd->frame->view()) + return; + + evas_object_geometry_get(view, 0, 0, &w, &h); + + WebCore::IntSize size(w, h); + int r, g, b, a; + WebCore::Color bg; + + ewk_view_bg_color_get(view, &r, &g, &b, &a); + if (!a) + bg = WebCore::Color(0, 0, 0, 0); + else if (a == 255) + bg = WebCore::Color(r, g, b, a); + else + bg = WebCore::Color(r * 255 / a, g * 255 / a, b * 255 / a, a); + + sd->frame->createView(size, bg, !a, WebCore::IntSize(), false); + if (!sd->frame->view()) + return; + sd->frame->view()->setEdjeTheme(sd->theme); + sd->frame->view()->setEvasObject(o); +} + +/** + * @internal + * Reports uri changed and swap internal string reference. + * + * Emits signal: "uri,changed" with new uri as parameter. + */ +Eina_Bool ewk_frame_uri_changed(Evas_Object* o) +{ + EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); + WebCore::CString uri(sd->frame->loader()->url().prettyURL().utf8()); + + INF("uri=%s", uri.data()); + if (!uri.data()) { + ERR("no uri"); + return EINA_FALSE; + } + + eina_stringshare_replace(&sd->uri, uri.data()); + evas_object_smart_callback_call(o, "uri,changed", (void*)sd->uri); + return EINA_TRUE; +} + +void ewk_frame_force_layout(Evas_Object* o) +{ + DBG("o=%p", o); + EWK_FRAME_SD_GET_OR_RETURN(o, sd); + EINA_SAFETY_ON_NULL_RETURN(sd->frame); + WebCore::FrameView* view = sd->frame->view(); + if (view) + view->forceLayout(true); +} + +WTF::PassRefPtr ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector& paramNames, const WTF::Vector& paramValues, const WebCore::String& mimeType, bool loadManually) +{ + DBG("o=%p, size=%dx%d, element=%p, url=%s, mimeType=%s", + o, pluginSize.width(), pluginSize.height(), element, + url.prettyURL().utf8().data(), mimeType.utf8().data()); + + EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); + + // TODO: emit signal and ask webkit users if something else should be done. + // like creating another x window (see gtk, it allows users to create + // GtkPluginWidget. + + WTF::RefPtr pluginView = WebCore::PluginView::create + (sd->frame, pluginSize, element, url, paramNames, paramValues, + mimeType, loadManually); + + if (pluginView->status() == WebCore::PluginStatusLoadedSuccessfully) + return pluginView; + + return 0; +} Index: /trunk/WebKit/efl/ewk/ewk_logging.h =================================================================== --- /trunk/WebKit/efl/ewk/ewk_logging.h (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_logging.h (revision 1404) @@ -0,0 +1,31 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_logging_h +#define ewk_logging_h + +extern int _ewk_log_dom; +#define CRITICAL(...) EINA_LOG_DOM_CRIT(_ewk_log_dom, __VA_ARGS__) +#define ERR(...) EINA_LOG_DOM_ERR(_ewk_log_dom, __VA_ARGS__) +#define WRN(...) EINA_LOG_DOM_WARN(_ewk_log_dom, __VA_ARGS__) +#define INF(...) EINA_LOG_DOM_INFO(_ewk_log_dom, __VA_ARGS__) +#define DBG(...) EINA_LOG_DOM_DBG(_ewk_log_dom, __VA_ARGS__) + +#endif // ewk_logging_h Index: /trunk/WebKit/efl/ewk/ewk_view_single.c =================================================================== --- /trunk/WebKit/efl/ewk/ewk_view_single.c (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_view_single.c (revision 1404) @@ -0,0 +1,585 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "ewk_view.h" + +#include "ewk_frame.h" +#include "ewk_logging.h" + +#include +#include +#include + +static Ewk_View_Smart_Class _parent_sc = EWK_VIEW_SMART_CLASS_INIT_NULL; + +static void _ewk_view_single_on_del(void *data, Evas *e, Evas_Object *o, void *event_info) +{ + Evas_Object *clip = (Evas_Object*)data; + evas_object_del(clip); +} + +static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd) +{ + Evas_Object *bs = evas_object_image_add(sd->base.evas); + Evas_Object *clip = evas_object_rectangle_add(sd->base.evas); + evas_object_image_alpha_set(bs, EINA_FALSE); + evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale); + evas_object_clip_set(bs, clip); + evas_object_show(clip); + + evas_object_event_callback_add + (bs, EVAS_CALLBACK_DEL, _ewk_view_single_on_del, clip); + + return bs; +} + +static void _ewk_view_single_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h) +{ + Ewk_View_Smart_Data *sd = (Ewk_View_Smart_Data*)evas_object_smart_data_get(o); + _parent_sc.sc.resize(o, w, h); + + // these should be queued and processed in calculate as well! + evas_object_image_size_set(sd->backing_store, w, h); + if (sd->animated_zoom.zoom.current < 0.00001) { + Evas_Object *clip = evas_object_clip_get(sd->backing_store); + Evas_Coord x, y, cw, ch; + evas_object_image_fill_set(sd->backing_store, 0, 0, w, h); + evas_object_geometry_get(sd->backing_store, &x, &y, 0, 0); + evas_object_move(clip, x, y); + ewk_frame_contents_size_get(sd->main_frame, &cw, &ch); + if (w > cw) + w = cw; + if (h > ch) + h = ch; + evas_object_resize(clip, w, h); + } +} + +static inline void _ewk_view_4b_move_region_up(uint32_t *image, size_t rows, size_t x, size_t y, size_t w, size_t h, size_t rowsize) +{ + uint32_t *src; + uint32_t *dst; + + dst = image + x + y * rowsize; + src = dst + rows * rowsize; + h -= rows; + + for (; h > 0; h--, dst += rowsize, src += rowsize) + memcpy(dst, src, w * 4); +} + +static inline void _ewk_view_4b_move_region_down(uint32_t *image, size_t rows, size_t x, size_t y, size_t w, size_t h, size_t rowsize) +{ + uint32_t *src; + uint32_t *dst; + + h -= rows; + src = image + x + (y + h - 1) * rowsize; + dst = src + rows * rowsize; + + for (; h > 0; h--, dst -= rowsize, src -= rowsize) + memcpy(dst, src, w * 4); +} + +static inline void _ewk_view_4b_move_line_left(uint32_t *dst, const uint32_t *src, size_t count) +{ + uint32_t *dst_end = dst + count; + /* no memcpy() as it does not allow overlapping regions */ + /* no memmove() as it will copy to a temporary buffer */ + /* TODO: loop unrolling, copying up to quad-words would help */ + for (; dst < dst_end; dst++, src++) + *dst = *src; +} + +static inline void _ewk_view_4b_move_line_right(uint32_t *dst, uint32_t *src, size_t count) +{ + uint32_t *dst_end = dst - count; + /* no memcpy() as it does not allow overlapping regions */ + /* no memmove() as it will copy to a temporary buffer */ + /* TODO: loop unrolling, copying up to quad-words would help */ + for (; dst > dst_end; dst--, src--) + *dst = *src; +} + +static inline void _ewk_view_4b_move_region_left(uint32_t *image, size_t cols, size_t x, size_t y, size_t w, size_t h, size_t rowsize) +{ + uint32_t *src; + uint32_t *dst; + + dst = image + x + y * rowsize; + src = dst + cols; + w -= cols; + + for (; h > 0; h--, dst += rowsize, src += rowsize) + _ewk_view_4b_move_line_left(dst, src, w); +} + +static inline void _ewk_view_4b_move_region_right(uint32_t *image, size_t cols, size_t x, size_t y, size_t w, size_t h, size_t rowsize) +{ + uint32_t *src; + uint32_t *dst; + + w -= cols; + src = image + (x + w - 1) + y * rowsize; + dst = src + cols; + + for (; h > 0; h--, dst += rowsize, src += rowsize) + _ewk_view_4b_move_line_right(dst, src, w); +} + +/* catch-all function, not as optimized as the others, but does the work. */ +static inline void _ewk_view_4b_move_region(uint32_t *image, int dx, int dy, size_t x, size_t y, size_t w, size_t h, size_t rowsize) +{ + uint32_t *src; + uint32_t *dst; + + if (dy < 0) { + h += dy; + dst = image + x + y * rowsize; + src = dst - dy * rowsize; + if (dx <= 0) { + w += dx; + src -= dx; + for (; h > 0; h--, dst += rowsize, src += rowsize) + _ewk_view_4b_move_line_left(dst, src, w); + } else { + w -= dx; + src += w - 1; + dst += w + dx -1; + for (; h > 0; h--, dst += rowsize, src += rowsize) + _ewk_view_4b_move_line_right(dst, src, w); + } + } else { + h -= dy; + src = image + x + (y + h - 1) * rowsize; + dst = src + dy * rowsize; + if (dx <= 0) { + w += dx; + src -= dx; + for (; h > 0; h--, dst -= rowsize, src -= rowsize) + _ewk_view_4b_move_line_left(dst, src, w); + } else { + w -= dx; + src += w - 1; + dst += w + dx - 1; + for (; h > 0; h--, dst -= rowsize, src -= rowsize) + _ewk_view_4b_move_line_right(dst, src, w); + } + } +} + +static inline void _ewk_view_single_scroll_process_single(Ewk_View_Smart_Data *sd, void *pixels, Evas_Coord ow, Evas_Coord oh, const Ewk_Scroll_Request *sr) +{ + Evas_Coord sx, sy, sw, sh; + + DBG("%d,%d + %d,%d %+03d,%+03d, store: %p %dx%d", + sr->x, sr->y, sr->w, sr->h, sr->dx, sr->dy, pixels, ow, oh); + + sx = sr->x; + sy = sr->y; + sw = sr->w; + sh = sr->h; + + if (abs(sr->dx) >= sw || abs(sr->dy) >= sh) { + /* doubt webkit would be so stupid... */ + DBG("full page scroll %+03d,%+03d. convert to repaint %d,%d + %dx%d", + sr->dx, sr->dy, sx, sy, sw, sh); + ewk_view_repaint_add(sd->_priv, sx, sy, sw, sh); + return; + } + + if (sx < 0) { + sw += sx; + sx = 0; + } + if (sy < 0) { + sh += sy; + sy = 0; + } + + if (sx + sw > ow) + sw = ow - sx; + if (sy + sh > oh) + sh = oh - sy; + + if (sw < 0) + sw = 0; + if (sh < 0) + sh = 0; + + EINA_SAFETY_ON_TRUE_RETURN(!sw || !sh); + if (!sr->dx) { + if (sr->dy < 0) { + DBG("scroll up: %+03d,%+03d update=%d,%d+%dx%d, " + "repaint=%d,%d+%dx%d", + sr->dx, sr->dy, sx, sy, sw, sh + sr->dy, + sx, sy + sh + sr->dy, sw, -sr->dy); + + _ewk_view_4b_move_region_up + ((uint32_t*)pixels, -sr->dy, sx, sy, sw, sh, ow); + evas_object_image_data_update_add + (sd->backing_store, sx, sy, sw, sh + sr->dy); + + ewk_view_repaint_add(sd->_priv, sx, sy + sh + sr->dy, sw, -sr->dy); + } else if (sr->dy > 0) { + DBG("scroll down: %+03d,%+03d update=%d,%d+%dx%d, " + "repaint=%d,%d+%dx%d", + sr->dx, sr->dy, sx, sy + sr->dy, sw, sh - sr->dy, + sx, sy, sw, sr->dy); + + _ewk_view_4b_move_region_down + ((uint32_t*)pixels, sr->dy, sx, sy, sw, sh, ow); + evas_object_image_data_update_add + (sd->backing_store, sx, sy + sr->dy, sw, sh - sr->dy); + + ewk_view_repaint_add(sd->_priv, sx, sy, sw, sr->dy); + } + } else if (!sr->dy) { + if (sr->dx < 0) { + DBG("scroll left: %+03d,%+03d update=%d,%d+%dx%d, " + "repaint=%d,%d+%dx%d", + sr->dx, sr->dy, sx, sy, sw + sr->dx, sh, + sx + sw + sr->dx, sy, -sr->dx, sh); + + _ewk_view_4b_move_region_left + ((uint32_t*)pixels, -sr->dx, sx, sy, sw, sh, ow); + evas_object_image_data_update_add + (sd->backing_store, sx, sy, sw + sr->dx, sh); + + ewk_view_repaint_add(sd->_priv, sx + sw + sr->dx, sy, -sr->dx, sh); + } else if (sr->dx > 0) { + DBG("scroll up: %+03d,%+03d update=%d,%d+%dx%d, " + "repaint=%d,%d+%dx%d", + sr->dx, sr->dy, sx + sr->dx, sy, sw - sr->dx, sh, + sx, sy, sr->dx, sh); + + _ewk_view_4b_move_region_right + ((uint32_t*)pixels, sr->dx, sx, sy, sw, sh, ow); + evas_object_image_data_update_add + (sd->backing_store, sx + sr->dx, sy, sw - sr->dx, sh); + + ewk_view_repaint_add(sd->_priv, sx, sy, sr->dx, sh); + } + } else { + Evas_Coord mx, my, mw, mh, ax, ay, aw, ah, bx, by, bw, bh; + + if (sr->dx < 0) { + mx = sx; + mw = sw + sr->dx; + ax = mx + mw; + aw = -sr->dx; + } else { + ax = sx; + aw = sr->dx; + mx = ax + aw; + mw = sw - sr->dx; + } + + if (sr->dy < 0) { + my = sy; + mh = sh + sr->dy; + by = my + mh; + bh = -sr->dy; + } else { + by = sy; + bh = sr->dy; + my = by + bh; + mh = sh - sr->dy; + } + + ay = my; + ah = mh; + bx = sx; + bw = sw; + + DBG("scroll diagonal: %+03d,%+03d update=%d,%d+%dx%d, " + "repaints: h=%d,%d+%dx%d v=%d,%d+%dx%d", + sr->dx, sr->dy, mx, my, mw, mh, ax, ay, aw, ah, bx, by, bw, bh); + + _ewk_view_4b_move_region + ((uint32_t*)pixels, sr->dx, sr->dy, sx, sy, sw, sh, ow); + + evas_object_image_data_update_add(sd->backing_store, mx, my, mw, mh); + ewk_view_repaint_add(sd->_priv, ax, ay, aw, ah); + ewk_view_repaint_add(sd->_priv, bx, by, bw, bh); + } +} + +static Eina_Bool _ewk_view_single_smart_scrolls_process(Ewk_View_Smart_Data *sd) +{ + const Ewk_Scroll_Request *sr; + const Ewk_Scroll_Request *sr_end; + Evas_Coord ow, oh; + size_t count; + void *pixels = evas_object_image_data_get(sd->backing_store, 1); + evas_object_image_size_get(sd->backing_store, &ow, &oh); + + sr = ewk_view_scroll_requests_get(sd->_priv, &count); + sr_end = sr + count; + for (; sr < sr_end; sr++) + _ewk_view_single_scroll_process_single(sd, pixels, ow, oh, sr); + + return EINA_TRUE; +} + +static Eina_Bool _ewk_view_single_smart_repaints_process(Ewk_View_Smart_Data *sd) +{ + Ewk_View_Paint_Context *ctxt; + Evas_Coord ow, oh; + void *pixels; + Eina_Rectangle r = {0, 0, 0, 0}; + const Eina_Rectangle *pr; + const Eina_Rectangle *pr_end; + Eina_Tiler *tiler; + Eina_Iterator *itr; + cairo_status_t status; + cairo_surface_t *surface; + cairo_format_t format; + cairo_t *cairo; + size_t count; + Eina_Bool ret = EINA_TRUE; + + if (sd->animated_zoom.zoom.current < 0.00001) { + Evas_Object *clip = evas_object_clip_get(sd->backing_store); + Evas_Coord w, h, cw, ch; + // reset effects of zoom_weak_set() + evas_object_image_fill_set + (sd->backing_store, 0, 0, sd->view.w, sd->view.h); + evas_object_move(clip, sd->view.x, sd->view.y); + + w = sd->view.w; + h = sd->view.h; + + ewk_frame_contents_size_get(sd->main_frame, &cw, &ch); + if (w > cw) + w = cw; + if (h > ch) + h = ch; + evas_object_resize(clip, w, h); + } + + pixels = evas_object_image_data_get(sd->backing_store, 1); + evas_object_image_size_get(sd->backing_store, &ow, &oh); + + if (sd->bg_color.a < 255) + format = CAIRO_FORMAT_ARGB32; + else + format = CAIRO_FORMAT_RGB24; + + surface = cairo_image_surface_create_for_data + ((unsigned char*)pixels, format, ow, oh, ow * 4); + status = cairo_surface_status(surface); + if (status != CAIRO_STATUS_SUCCESS) { + ERR("could not create surface from data %dx%d: %s", + ow, oh, cairo_status_to_string(status)); + ret = EINA_FALSE; + goto error_cairo_surface; + } + cairo = cairo_create(surface); + status = cairo_status(cairo); + if (status != CAIRO_STATUS_SUCCESS) { + ERR("could not create cairo from surface %dx%d: %s", + ow, oh, cairo_status_to_string(status)); + ret = EINA_FALSE; + goto error_cairo; + } + + ctxt = ewk_view_paint_context_new(sd->_priv, cairo); + if (!ctxt) { + ERR("could not create paint context"); + ret = EINA_FALSE; + goto error_paint_context; + } + + tiler = eina_tiler_new(ow, oh); + if (!tiler) { + ERR("could not create tiler %dx%d", ow, oh); + ret = EINA_FALSE; + goto error_tiler; + } + + pr = ewk_view_repaints_get(sd->_priv, &count); + pr_end = pr + count; + for (; pr < pr_end; pr++) + eina_tiler_rect_add(tiler, pr); + + itr = eina_tiler_iterator_new(tiler); + if (!itr) { + ERR("could not get iterator for tiler"); + ret = EINA_FALSE; + goto error_iterator; + } + + int sx, sy; + ewk_frame_scroll_pos_get(sd->main_frame, &sx, &sy); + + EINA_ITERATOR_FOREACH(itr, r) { + Eina_Rectangle scrolled_rect = { + r.x + sx, r.y + sy, + r.w, r.h + }; + + ewk_view_paint_context_save(ctxt); + + if ((sx) || (sy)) + ewk_view_paint_context_translate(ctxt, -sx, -sy); + + ewk_view_paint_context_clip(ctxt, &scrolled_rect); + ewk_view_paint_context_paint_contents(ctxt, &scrolled_rect); + + ewk_view_paint_context_restore(ctxt); + evas_object_image_data_update_add + (sd->backing_store, r.x, r.y, r.w, r.h); + } + eina_iterator_free(itr); + +error_iterator: + eina_tiler_free(tiler); +error_tiler: + ewk_view_paint_context_free(ctxt); +error_paint_context: + cairo_destroy(cairo); +error_cairo: + cairo_surface_destroy(surface); +error_cairo_surface: + evas_object_image_data_set(sd->backing_store, pixels); /* dec refcount */ + + return ret; +} + +static Eina_Bool _ewk_view_single_smart_zoom_weak_set(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy) +{ + // TODO: review + float scale = zoom / sd->animated_zoom.zoom.start; + Evas_Coord w = sd->view.w * scale; + Evas_Coord h = sd->view.h * scale; + Evas_Coord dx, dy, cw, ch; + Evas_Object *clip = evas_object_clip_get(sd->backing_store); + + ewk_frame_contents_size_get(sd->main_frame, &cw, &ch); + if (sd->view.w > 0 && sd->view.h > 0) { + dx = (w * (sd->view.w - cx)) / sd->view.w; + dy = (h * (sd->view.h - cy)) / sd->view.h; + } else { + dx = 0; + dy = 0; + } + + evas_object_image_fill_set(sd->backing_store, cx + dx, cy + dy, w, h); + + if (sd->view.w > 0 && sd->view.h > 0) { + dx = ((sd->view.w - w) * cx) / sd->view.w; + dy = ((sd->view.h - h) * cy) / sd->view.h; + } else { + dx = 0; + dy = 0; + } + evas_object_move(clip, sd->view.x + dx, sd->view.y + dy); + + if (cw < sd->view.w) + w = cw * scale; + if (ch < sd->view.h) + h = ch * scale; + evas_object_resize(clip, w, h); + return EINA_TRUE; +} + +static void _ewk_view_single_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data *sd, Eina_Bool smooth_scale) +{ + evas_object_image_smooth_scale_set(sd->backing_store, smooth_scale); +} + +static void _ewk_view_single_smart_bg_color_set(Ewk_View_Smart_Data *sd, unsigned char r, unsigned char g, unsigned char b, unsigned char a) +{ + evas_object_image_alpha_set(sd->backing_store, a < 255); +} + +/** + * Sets the smart class api using single backing store, enabling view + * to be inherited. + * + * @param api class definition to be set, all members with the + * exception of Evas_Smart_Class->data may be overridden. Must + * @b not be @c NULL. + * + * @note Evas_Smart_Class->data is used to implement type checking and + * is not supposed to be changed/overridden. If you need extra + * data for your smart class to work, just extend + * Ewk_View_Smart_Class instead. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably + * version mismatch). + * + * @see ewk_view_base_smart_set() + */ +Eina_Bool ewk_view_single_smart_set(Ewk_View_Smart_Class *api) +{ + if (!ewk_view_base_smart_set(api)) + return EINA_FALSE; + + if (EINA_UNLIKELY(!_parent_sc.sc.add)) + ewk_view_base_smart_set(&_parent_sc); + + api->sc.resize = _ewk_view_single_smart_resize; + + api->backing_store_add = _ewk_view_single_smart_backing_store_add; + api->scrolls_process = _ewk_view_single_smart_scrolls_process; + api->repaints_process = _ewk_view_single_smart_repaints_process; + api->zoom_weak_set = _ewk_view_single_smart_zoom_weak_set; + api->zoom_weak_smooth_scale_set = _ewk_view_single_smart_zoom_weak_smooth_scale_set; + api->bg_color_set = _ewk_view_single_smart_bg_color_set; + + return EINA_TRUE; +} + +static inline Evas_Smart *_ewk_view_single_smart_class_new(void) +{ + static Ewk_View_Smart_Class api = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("Ewk_View_Single"); + static Evas_Smart *smart = 0; + + if (EINA_UNLIKELY(!smart)) { + ewk_view_single_smart_set(&api); + smart = evas_smart_class_new(&api.sc); + } + + return smart; +} + +/** + * Creates a new EFL WebKit View object. + * + * View objects are the recommended way to deal with EFL WebKit as it + * abstracts the complex pieces of the process. + * + * Each view is composed by a set of frames. The set has at least one + * frame, called 'main_frame'. See ewk_view_frame_main_get() and + * ewk_view_frame_focused_get(). + * + * @param e canvas where to create the view object. + * + * @return view object or @c NULL if errors. + * + * @see ewk_view_uri_set() + */ +Evas_Object *ewk_view_single_add(Evas *e) +{ + return evas_object_smart_add(e, _ewk_view_single_smart_class_new()); +} Index: /trunk/WebKit/efl/ewk/ewk_util.cpp =================================================================== --- /trunk/WebKit/efl/ewk/ewk_util.cpp (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_util.cpp (revision 1404) @@ -0,0 +1,98 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "ewk_util.h" + +#include "ewk_private.h" +#include + +Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t* surface) +{ + cairo_status_t status; + cairo_surface_type_t type; + cairo_format_t format; + int w, h, stride; + Evas_Object* image; + const void* src; + void* dst; + + EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0); + + status = cairo_surface_status(surface); + if (status != CAIRO_STATUS_SUCCESS) { + ERR("cairo surface is invalid: %s", cairo_status_to_string(status)); + return 0; + } + + type = cairo_surface_get_type(surface); + if (type != CAIRO_SURFACE_TYPE_IMAGE) { + ERR("unknown surface type %d, required %d (CAIRO_SURFACE_TYPE_IMAGE).", + type, CAIRO_SURFACE_TYPE_IMAGE); + return 0; + } + + format = cairo_image_surface_get_format(surface); + if (format != CAIRO_FORMAT_ARGB32 && format != CAIRO_FORMAT_RGB24) { + ERR("unknown surface format %d, expected %d or %d.", + format, CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24); + return 0; + } + + w = cairo_image_surface_get_width(surface); + h = cairo_image_surface_get_height(surface); + stride = cairo_image_surface_get_stride(surface); + if (w <= 0 || h <= 0 || stride <= 0) { + ERR("invalid image size %dx%d, stride=%d", w, h, stride); + return 0; + } + + src = cairo_image_surface_get_data(surface); + if (!src) { + ERR("could not get source data."); + return 0; + } + + image = evas_object_image_filled_add(canvas); + if (!image) { + ERR("could not add image to canvas."); + return 0; + } + + evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888); + evas_object_image_size_set(image, w, h); + evas_object_image_alpha_set(image, format == CAIRO_FORMAT_ARGB32); + + if (evas_object_image_stride_get(image) * 4 != stride) { + ERR("evas' stride %d diverges from cairo's %d.", + evas_object_image_stride_get(image) * 4, stride); + evas_object_del(image); + return 0; + } + + dst = evas_object_image_data_get(image, EINA_TRUE); + memcpy(dst, src, h * stride); + evas_object_image_data_set(image, dst); + + evas_object_resize(image, w, h); // helpful but not really required + + return image; +} Index: /trunk/WebKit/efl/ewk/ewk_frame.h =================================================================== --- /trunk/WebKit/efl/ewk/ewk_frame.h (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_frame.h (revision 1404) @@ -0,0 +1,184 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_frame_h +#define ewk_frame_h + +#include "ewk_eapi.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file + * + * WebKit frame smart object. + * + * This object is the low level access to WebKit-EFL browser + * component. It represents both the main and internal frames that + * HTML pages contain. + * + * Every ewk_view has at least one frame, called "main frame" and + * retrieved with ewk_view_frame_main_get(). One can retrieve frame's + * owner view with ewk_frame_view_get(). Parent frame can be retrieved + * with standard smart object's evas_object_smart_parent_get(). + * Children can be accessed with ewk_frame_children_iterator_new() or + * ewk_frame_child_find(). + * + * The following signals (see evas_object_smart_callback_add()) are emitted: + * + * - "title,changed", const char*: title of the main frame changed. + * - "uri,changed", const char*: uri of the main frame changed. + * - "load,started", void: frame started loading. + * - "load,progress", double*: load progress changed (overall value + * from 0.0 to 1.0, connect to individual frames for fine grained). + * - "load,finished", const Ewk_Frame_Load_Error*: reports load + * finished and as argument @c NULL if successfully or pointer to + * structure defining the error. + * - "load,error", const Ewk_Frame_Load_Error*: reports load failed + * and as argument a pointer to structure defining the error. + * - "contents,size,changed", Evas_Coord[2]: reports contents size + * changed due new layout, script actions or any other events. + */ + + +/** + * Structure used to report load errors. + * + * Load errors are reported as signal by ewk_view. All the strings are + * temporary references and should @b not be used after the signal + * callback returns. If required, make copies with strdup() or + * eina_stringshare_add() (they are not even guaranteed to be + * stringshared, so must use eina_stringshare_add() and not + * eina_stringshare_ref()). + */ +typedef struct _Ewk_Frame_Load_Error Ewk_Frame_Load_Error; +struct _Ewk_Frame_Load_Error { + int code; /**< numeric error code */ + Eina_Bool is_cancellation; /**< if load failed because it was canceled */ + const char *domain; /**< error domain name */ + const char *description; /**< error description already localized */ + const char *failing_url; /**< the url that failed to load */ + Evas_Object *frame; /**< frame where the failure happened */ +}; + +/** + * Structure used to report hit test results. + */ +typedef struct _Ewk_Hit_Test Ewk_Hit_Test; +struct _Ewk_Hit_Test { + int x, y; + struct { + int x, y, w, h; + } bounding_box; + const char *title; + const char *alternate_text; /**< for image, area, input and applet */ + Evas_Object *frame; + struct { + const char *text; + const char *url; + const char *title; + Evas_Object *target_frame; + } link; + struct { + Eina_Bool editable:1; + Eina_Bool selected:1; + } flags; +}; + + +EAPI Evas_Object *ewk_frame_view_get(const Evas_Object *o); +EAPI void ewk_frame_theme_set(Evas_Object *o, const char *path); +EAPI const char *ewk_frame_theme_get(Evas_Object *o); + +EAPI Eina_Iterator *ewk_frame_children_iterator_new(Evas_Object *o); +EAPI Evas_Object *ewk_frame_child_find(Evas_Object *o, const char *name); + +EAPI Eina_Bool ewk_frame_uri_set(Evas_Object *o, const char *uri); +EAPI const char *ewk_frame_uri_get(const Evas_Object *o); +EAPI const char *ewk_frame_title_get(const Evas_Object *o); +EAPI const char *ewk_frame_name_get(const Evas_Object *o); +EAPI Eina_Bool ewk_frame_contents_size_get(const Evas_Object *o, Evas_Coord *w, Evas_Coord *h); + +EAPI Eina_Bool ewk_frame_contents_set(Evas_Object *o, const char *contents, size_t contents_size, const char *mime_type, const char *encoding, const char *base_uri); +EAPI Eina_Bool ewk_frame_contents_alternate_set(Evas_Object *o, const char *contents, size_t contents_size, const char *mime_type, const char *encoding, const char *base_uri, const char *unreachable_uri); + +EAPI Eina_Bool ewk_frame_script_execute(Evas_Object *o, const char *script); + +EAPI Eina_Bool ewk_frame_editable_get(const Evas_Object *o); +EAPI Eina_Bool ewk_frame_editable_set(Evas_Object *o, Eina_Bool editable); + +EAPI char *ewk_frame_selection_get(const Evas_Object *o); + +EAPI Eina_Bool ewk_frame_text_search(const Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap); + +EAPI unsigned int ewk_frame_text_matches_mark(Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit); +EAPI Eina_Bool ewk_frame_text_matches_unmark_all(Evas_Object *o); +EAPI Eina_Bool ewk_frame_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight); +EAPI Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object *o); + +EAPI Eina_Bool ewk_frame_stop(Evas_Object *o); +EAPI Eina_Bool ewk_frame_reload(Evas_Object *o); +EAPI Eina_Bool ewk_frame_reload_full(Evas_Object *o); + +EAPI Eina_Bool ewk_frame_back(Evas_Object *o); +EAPI Eina_Bool ewk_frame_forward(Evas_Object *o); +EAPI Eina_Bool ewk_frame_navigate(Evas_Object *o, int steps); + +EAPI Eina_Bool ewk_frame_back_possible(Evas_Object *o); +EAPI Eina_Bool ewk_frame_forward_possible(Evas_Object *o); +EAPI Eina_Bool ewk_frame_navigate_possible(Evas_Object *o, int steps); + +EAPI float ewk_frame_zoom_get(const Evas_Object *o); +EAPI Eina_Bool ewk_frame_zoom_set(Evas_Object *o, float zoom); +EAPI Eina_Bool ewk_frame_zoom_text_only_get(const Evas_Object *o); +EAPI Eina_Bool ewk_frame_zoom_text_only_set(Evas_Object *o, Eina_Bool setting); + +EAPI void ewk_frame_hit_test_free(Ewk_Hit_Test *hit_test); +EAPI Ewk_Hit_Test *ewk_frame_hit_test_new(const Evas_Object *o, int x, int y); + +EAPI Eina_Bool ewk_frame_scroll_add(Evas_Object *o, int dx, int dy); +EAPI Eina_Bool ewk_frame_scroll_set(Evas_Object *o, int x, int y); + +EAPI Eina_Bool ewk_frame_scroll_size_get(const Evas_Object *o, int *w, int *h); +EAPI Eina_Bool ewk_frame_scroll_pos_get(const Evas_Object *o, int *x, int *y); + +EAPI Eina_Bool ewk_frame_visible_content_geometry_get(const Evas_Object *o, Eina_Bool include_scrollbars, int *x, int *y, int *w, int *h); + +EAPI Eina_Bool ewk_frame_paint_full_get(const Evas_Object *o); +EAPI void ewk_frame_paint_full_set(Evas_Object *o, Eina_Bool flag); + +EAPI Eina_Bool ewk_frame_feed_focus_in(Evas_Object *o); +EAPI Eina_Bool ewk_frame_feed_focus_out(Evas_Object *o); + +EAPI Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object *o, const Evas_Event_Mouse_Wheel *ev); +EAPI Eina_Bool ewk_frame_feed_mouse_down(Evas_Object *o, const Evas_Event_Mouse_Down *ev); +EAPI Eina_Bool ewk_frame_feed_mouse_up(Evas_Object *o, const Evas_Event_Mouse_Up *ev); +EAPI Eina_Bool ewk_frame_feed_mouse_move(Evas_Object *o, const Evas_Event_Mouse_Move *ev); +EAPI Eina_Bool ewk_frame_feed_key_down(Evas_Object *o, const Evas_Event_Key_Down *ev); +EAPI Eina_Bool ewk_frame_feed_key_up(Evas_Object *o, const Evas_Event_Key_Up *ev); + + +#ifdef __cplusplus +} +#endif +#endif // ewk_frame_h Index: /trunk/WebKit/efl/ewk/ewk_private.h =================================================================== --- /trunk/WebKit/efl/ewk/ewk_private.h (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_private.h (revision 1404) @@ -0,0 +1,115 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_private_h +#define ewk_private_h + +#include "BackForwardList.h" +#include "EWebKit.h" +#include "Frame.h" +#include "Page.h" +#include "Settings.h" +#include "Widget.h" +#include "ewk_logging.h" +#include "ewk_util.h" + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// If defined, ewk will do type checking to ensure objects are of correct type +#define EWK_TYPE_CHECK 1 + +void ewk_view_ready(Evas_Object *o); +void ewk_view_title_set(Evas_Object *o, const char *title); +void ewk_view_uri_changed(Evas_Object *o); +void ewk_view_load_started(Evas_Object *o); +void ewk_view_frame_main_load_started(Evas_Object *o); +void ewk_view_load_finished(Evas_Object *o, const Ewk_Frame_Load_Error *error); +void ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error); +void ewk_view_load_progress_changed(Evas_Object *o); + +void ewk_view_mouse_link_hover_in(Evas_Object *o, void *data); +void ewk_view_mouse_link_hover_out(Evas_Object *o); + +void ewk_view_toolbars_visible_set(Evas_Object *o, Eina_Bool visible); +void ewk_view_toolbars_visible_get(Evas_Object *o, Eina_Bool *visible); + +void ewk_view_statusbar_visible_set(Evas_Object *o, Eina_Bool visible); +void ewk_view_statusbar_visible_get(Evas_Object *o, Eina_Bool *visible); +void ewk_view_statusbar_text_set(Evas_Object *o, const char *text); + +void ewk_view_scrollbars_visible_set(Evas_Object *o, Eina_Bool visible); +void ewk_view_scrollbars_visible_get(Evas_Object *o, Eina_Bool *visible); + +void ewk_view_menubar_visible_set(Evas_Object *o, Eina_Bool visible); +void ewk_view_menubar_visible_get(Evas_Object *o, Eina_Bool *visible); + +void ewk_view_tooltip_text_set(Evas_Object *o, const char *text); + +void ewk_view_add_console_message(Evas_Object *o, const char *message, unsigned int lineNumber, const char *sourceID); + +void ewk_view_run_javascript_alert(Evas_Object *o, Evas_Object *frame, const char *message); +Eina_Bool ewk_view_run_javascript_confirm(Evas_Object *o, Evas_Object *frame, const char *message); +Eina_Bool ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *frame, const char *message, const char *defaultValue, char **value); +Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object *o); +void ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName); + +void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); +void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame); +WebCore::Page *ewk_view_core_page_get(const Evas_Object *o); + +WTF::PassRefPtr ewk_view_frame_create(Evas_Object *o, Evas_Object *frame, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WebCore::String& referrer); + +WTF::PassRefPtr ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector& paramNames, const WTF::Vector& paramValues, const WebCore::String& mimeType, bool loadManually); + +Ewk_History *ewk_history_new(WebCore::BackForwardList *history); +void ewk_history_free(Ewk_History *history); + +Evas_Object *ewk_frame_add(Evas *e); +Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame); +Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer); + +WebCore::Frame *ewk_frame_core_get(const Evas_Object *o); +void ewk_frame_core_gone(Evas_Object *o); + +void ewk_frame_load_started(Evas_Object *o); +void ewk_frame_load_finished(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url); +void ewk_frame_load_error(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url); +void ewk_frame_load_progress_changed(Evas_Object *o); + +void ewk_frame_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h); +void ewk_frame_title_set(Evas_Object *o, const char *title); + +void ewk_frame_view_create_for_view(Evas_Object *o, Evas_Object *view); +Eina_Bool ewk_frame_uri_changed(Evas_Object *o); +void ewk_frame_force_layout(Evas_Object *o); + +WTF::PassRefPtr ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector& paramNames, const WTF::Vector& paramValues, const WebCore::String& mimeType, bool loadManually); + +#ifdef __cplusplus + +} +#endif +#endif // ewk_private_h Index: /trunk/WebKit/efl/ewk/ewk_history.cpp =================================================================== --- /trunk/WebKit/efl/ewk/ewk_history.cpp (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_history.cpp (revision 1404) @@ -0,0 +1,704 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "ewk_history.h" + +#include "BackForwardList.h" +#include "CString.h" +#include "EWebKit.h" +#include "HistoryItem.h" +#include "Image.h" +#include "ewk_private.h" + +#include +#include + +struct _Ewk_History { + WebCore::BackForwardList *core; +}; + +#define EWK_HISTORY_CORE_GET_OR_RETURN(history, core_, ...) \ + if (!(history)) { \ + CRITICAL("history is NULL."); \ + return __VA_ARGS__; \ + } \ + if (!(history)->core) { \ + CRITICAL("history->core is NULL."); \ + return __VA_ARGS__; \ + } \ + if (!(history)->core->enabled()) { \ + ERR("history->core is disabled!."); \ + return __VA_ARGS__; \ + } \ + WebCore::BackForwardList *core_ = (history)->core + + +struct _Ewk_History_Item { + WebCore::HistoryItem *core; + + const char *title; + const char *alternate_title; + const char *uri; + const char *original_uri; +}; + +#define EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core_, ...) \ + if (!(item)) { \ + CRITICAL("item is NULL."); \ + return __VA_ARGS__; \ + } \ + if (!(item)->core) { \ + CRITICAL("item->core is NULL."); \ + return __VA_ARGS__; \ + } \ + WebCore::HistoryItem *core_ = (item)->core + + +static inline Ewk_History_Item *_ewk_history_item_new(WebCore::HistoryItem *core) +{ + Ewk_History_Item* item; + + if (!core) { + ERR("WebCore::HistoryItem is NULL."); + return 0; + } + + item = (Ewk_History_Item *)calloc(1, sizeof(Ewk_History_Item)); + if (!item) { + CRITICAL("Could not allocate item memory."); + return 0; + } + + core->ref(); + item->core = core; + + return item; +} + +static inline Eina_List *_ewk_history_item_list_get(const WebCore::HistoryItemVector &core_items) +{ + Eina_List* ret = 0; + unsigned int i, size; + + size = core_items.size(); + for (i = 0; i < size; i++) { + Ewk_History_Item* item = _ewk_history_item_new(core_items[i].get()); + if (item) + ret = eina_list_append(ret, item); + } + + return ret; +} + +/** + * Go forward in history one item, if possible. + * + * @param history which history instance to modify. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. + */ +Eina_Bool ewk_history_forward(Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE); + if (core->forwardListCount() < 1) + return EINA_FALSE; + core->goForward(); + return EINA_TRUE; +} + +/** + * Go back in history one item, if possible. + * + * @param history which history instance to modify. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. + */ +Eina_Bool ewk_history_back(Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE); + if (core->backListCount() < 1) + return EINA_FALSE; + core->goBack(); + return EINA_TRUE; +} + +/** + * Adds the given item to history. + * + * Memory handling: This will not modify or even take references to + * given item (Ewk_History_Item), so you should still handle it with + * ewk_history_item_free(). + * + * @param history which history instance to modify. + * @param item reference to add to history. Unmodified. Must @b not be @c NULL. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. + */ +Eina_Bool ewk_history_history_item_add(Ewk_History* history, const Ewk_History_Item* item) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, history_core, EINA_FALSE); + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, item_core, EINA_FALSE); + history_core->addItem(item_core); + return EINA_TRUE; +} + +/** + * Sets the given item as current in history (go to item). + * + * Memory handling: This will not modify or even take references to + * given item (Ewk_History_Item), so you should still handle it with + * ewk_history_item_free(). + * + * @param history which history instance to modify. + * @param item reference to go to history. Unmodified. Must @b not be @c NULL. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE on failure. + */ +Eina_Bool ewk_history_history_item_set(Ewk_History* history, const Ewk_History_Item* item) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, history_core, EINA_FALSE); + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, item_core, EINA_FALSE); + history_core->goToItem(item_core); + return EINA_TRUE; +} + +/** + * Get the first item from back list, if any. + * + * @param history which history instance to query. + * + * @return the @b newly allocated item instance. This memory must be + * released with ewk_history_item_free() after use. + */ +Ewk_History_Item* ewk_history_history_item_back_get(const Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + return _ewk_history_item_new(core->backItem()); +} + +/** + * Get the current item in history, if any. + * + * @param history which history instance to query. + * + * @return the @b newly allocated item instance. This memory must be + * released with ewk_history_item_free() after use. + */ +Ewk_History_Item* ewk_history_history_item_current_get(const Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + return _ewk_history_item_new(core->currentItem()); +} + +/** + * Get the first item from forward list, if any. + * + * @param history which history instance to query. + * + * @return the @b newly allocated item instance. This memory must be + * released with ewk_history_item_free() after use. + */ +Ewk_History_Item* ewk_history_history_item_forward_get(const Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + return _ewk_history_item_new(core->forwardItem()); +} + +/** + * Get item at given position, if any at that index. + * + * @param history which history instance to query. + * @param index position of item to get. + * + * @return the @b newly allocated item instance. This memory must be + * released with ewk_history_item_free() after use. + */ +Ewk_History_Item* ewk_history_history_item_nth_get(const Ewk_History* history, int index) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + return _ewk_history_item_new(core->itemAtIndex(index)); +} + +/** + * Queries if given item is in history. + * + * Memory handling: This will not modify or even take references to + * given item (Ewk_History_Item), so you should still handle it with + * ewk_history_item_free(). + * + * @param history which history instance to modify. + * @param item reference to check in history. Must @b not be @c NULL. + * + * @return @c EINA_TRUE if in history, @c EINA_FALSE if not or failure. + */ +Eina_Bool ewk_history_history_item_contains(const Ewk_History* history, const Ewk_History_Item* item) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, history_core, EINA_FALSE); + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, item_core, EINA_FALSE); + return history_core->containsItem(item_core); +} + +/** + * Get the whole forward list. + * + * @param history which history instance to query. + * + * @return a newly allocated list of @b newly allocated item + * instance. This memory of each item must be released with + * ewk_history_item_free() after use. use + * ewk_history_item_list_free() for convenience. + * + * @see ewk_history_item_list_free() + * @see ewk_history_forward_list_get_with_limit() + */ +Eina_List* ewk_history_forward_list_get(const Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + WebCore::HistoryItemVector items; + int limit = core->forwardListCount(); + core->forwardListWithLimit(limit, items); + return _ewk_history_item_list_get(items); +} + +/** + * Get the forward list within the given limit. + * + * @param history which history instance to query. + * @param limit the maximum number of items to return. + * + * @return a newly allocated list of @b newly allocated item + * instance. This memory of each item must be released with + * ewk_history_item_free() after use. use + * ewk_history_item_list_free() for convenience. + * + * @see ewk_history_item_list_free() + * @see ewk_history_forward_list_length() + * @see ewk_history_forward_list_get() + */ +Eina_List* ewk_history_forward_list_get_with_limit(const Ewk_History* history, int limit) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + WebCore::HistoryItemVector items; + core->forwardListWithLimit(limit, items); + return _ewk_history_item_list_get(items); +} + +/** + * Get the whole size of forward list. + * + * @param history which history instance to query. + * + * @return number of elements in whole list. + * + * @see ewk_history_forward_list_get_with_limit() + */ +int ewk_history_forward_list_length(const Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + return core->forwardListCount(); +} + +/** + * Get the whole back list. + * + * @param history which history instance to query. + * + * @return a newly allocated list of @b newly allocated item + * instance. This memory of each item must be released with + * ewk_history_item_free() after use. use + * ewk_history_item_list_free() for convenience. + * + * @see ewk_history_item_list_free() + * @see ewk_history_back_list_get_with_limit() + */ +Eina_List* ewk_history_back_list_get(const Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + WebCore::HistoryItemVector items; + int limit = core->backListCount(); + core->backListWithLimit(limit, items); + return _ewk_history_item_list_get(items); +} + +/** + * Get the back list within the given limit. + * + * @param history which history instance to query. + * @param limit the maximum number of items to return. + * + * @return a newly allocated list of @b newly allocated item + * instance. This memory of each item must be released with + * ewk_history_item_free() after use. use + * ewk_history_item_list_free() for convenience. + * + * @see ewk_history_item_list_free() + * @see ewk_history_back_list_length() + * @see ewk_history_back_list_get() + */ +Eina_List* ewk_history_back_list_get_with_limit(const Ewk_History* history, int limit) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + WebCore::HistoryItemVector items; + core->backListWithLimit(limit, items); + return _ewk_history_item_list_get(items); +} + +/** + * Get the whole size of back list. + * + * @param history which history instance to query. + * + * @return number of elements in whole list. + * + * @see ewk_history_back_list_get_with_limit() + */ +int ewk_history_back_list_length(const Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + return core->backListCount(); +} + +/** + * Get maximum capacity of given history. + * + * @param history which history instance to query. + * + * @return maximum number of entries this history will hold. + */ +int ewk_history_limit_get(Ewk_History* history) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0); + return core->capacity(); +} + +/** + * Set maximum capacity of given history. + * + * @param history which history instance to modify. + * @param limit maximum size to allow. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_history_limit_set(const Ewk_History* history, int limit) +{ + EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE); + core->setCapacity(limit); + return EINA_TRUE; +} + +/** + * Create a new history item with given URI and title. + * + * @param uri where this resource is located. + * @param title resource title. + * + * @return newly allocated history item or @c NULL on errors. You must + * free this item with ewk_history_item_free(). + */ +Ewk_History_Item* ewk_history_item_new(const char* uri, const char* title) +{ + WebCore::String u = WebCore::String::fromUTF8(uri); + WebCore::String t = WebCore::String::fromUTF8(title); + WTF::RefPtr core = WebCore::HistoryItem::create(u, t, 0); + Ewk_History_Item* item = _ewk_history_item_new(core.release().releaseRef()); + return item; +} + +static inline void _ewk_history_item_free(Ewk_History_Item* item, WebCore::HistoryItem* core) +{ + core->deref(); + free(item); +} + +/** + * Free given history item instance. + * + * @param item what to free. + */ +void ewk_history_item_free(Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core); + _ewk_history_item_free(item, core); +} + +/** + * Free given list and associated history items instances. + * + * @param history_items list of items to free (both list nodes and + * item instances). + */ +void ewk_history_item_list_free(Eina_List* history_items) +{ + void* d; + EINA_LIST_FREE(history_items, d) { + Ewk_History_Item* item = (Ewk_History_Item*)d; + _ewk_history_item_free(item, item->core); + } +} + +/** + * Query title for given history item. + * + * @param item history item to query. + * + * @return the title pointer, that may be @c NULL. This pointer is + * guaranteed to be eina_stringshare, so whenever possible + * save yourself some cpu cycles and use + * eina_stringshare_ref() instead of eina_stringshare_add() or + * strdup(). + */ +const char* ewk_history_item_title_get(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); + // hide the following optimzation from outside + Ewk_History_Item* i = (Ewk_History_Item*)item; + eina_stringshare_replace(&i->title, core->title().utf8().data()); + return i->title; +} + +/** + * Query alternate title for given history item. + * + * @param item history item to query. + * + * @return the alternate title pointer, that may be @c NULL. This + * pointer is guaranteed to be eina_stringshare, so whenever + * possible save yourself some cpu cycles and use + * eina_stringshare_ref() instead of eina_stringshare_add() or + * strdup(). + */ +const char* ewk_history_item_title_alternate_get(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); + // hide the following optimzation from outside + Ewk_History_Item* i = (Ewk_History_Item*)item; + eina_stringshare_replace(&i->alternate_title, + core->alternateTitle().utf8().data()); + return i->alternate_title; +} + +/** + * Set alternate title for given history item. + * + * @param item history item to query. + * @param title new alternate title to use for given item. No + * references are kept after this function returns. + */ +void ewk_history_item_title_alternate_set(Ewk_History_Item* item, const char* title) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core); + if (!eina_stringshare_replace(&item->alternate_title, title)) + return; + core->setAlternateTitle(WebCore::String::fromUTF8(title)); +} + +/** + * Query URI for given history item. + * + * @param item history item to query. + * + * @return the URI pointer, that may be @c NULL. This pointer is + * guaranteed to be eina_stringshare, so whenever possible + * save yourself some cpu cycles and use + * eina_stringshare_ref() instead of eina_stringshare_add() or + * strdup(). + */ +const char* ewk_history_item_uri_get(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); + // hide the following optimzation from outside + Ewk_History_Item* i = (Ewk_History_Item*)item; + eina_stringshare_replace(&i->uri, core->urlString().utf8().data()); + return i->uri; +} + +/** + * Query original URI for given history item. + * + * @param item history item to query. + * + * @return the original URI pointer, that may be @c NULL. This pointer + * is guaranteed to be eina_stringshare, so whenever possible + * save yourself some cpu cycles and use + * eina_stringshare_ref() instead of eina_stringshare_add() or + * strdup(). + */ +const char* ewk_history_item_uri_original_get(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); + // hide the following optimzation from outside + Ewk_History_Item* i = (Ewk_History_Item*)item; + eina_stringshare_replace(&i->original_uri, + core->originalURLString().utf8().data()); + return i->original_uri; +} + +/** + * Query last visited time for given history item. + * + * @param item history item to query. + * + * @return the time in seconds this item was visited. + */ +double ewk_history_item_time_last_visited_get(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0.0); + return core->lastVisitedTime(); +} + +/** + * Get the icon (aka favicon) associated with this history item. + * + * @note in order to have this working, one must open icon database + * with ewk_settings_icon_database_path_set(). + * + * @param item history item to query. + * + * @return the surface reference or @c NULL on errors. Note that the + * reference may be to a standard fallback icon. + */ +cairo_surface_t* ewk_history_item_icon_surface_get(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); + WebCore::Image* icon = core->icon(); + if (!icon) { + ERR("icon is NULL."); + return 0; + } + return icon->nativeImageForCurrentFrame(); +} + +/** + * Add an Evas_Object of type 'image' to given canvas with history item icon. + * + * This is an utility function that creates an Evas_Object of type + * image set to have fill always match object size + * (evas_object_image_filled_add()), saving some code to use it from Evas. + * + * @note in order to have this working, one must open icon database + * with ewk_settings_icon_database_path_set(). + * + * @param item history item to query. + * @param canvas evas instance where to add resulting object. + * + * @return newly allocated Evas_Object instance or @c NULL on + * errors. Delete the object with evas_object_del(). + */ +Evas_Object* ewk_history_item_icon_object_add(const Ewk_History_Item* item, Evas* canvas) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); + WebCore::Image* icon = core->icon(); + cairo_surface_t* surface; + + if (!icon) { + ERR("icon is NULL."); + return 0; + } + + surface = icon->nativeImageForCurrentFrame(); + return ewk_util_image_from_cairo_surface_add(canvas, surface); +} + +/** + * Query if given item is still in page cache. + * + * @param item history item to query. + * + * @return @c EINA_TRUE if in cache, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_history_item_page_cache_exists(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, EINA_FALSE); + return core->isInPageCache(); +} + +/** + * Query number of times item was visited. + * + * @param item history item to query. + * + * @return number of visits. + */ +int ewk_history_item_visit_count(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); + return core->visitCount(); +} + +/** + * Query if last visit to item was failure or not. + * + * @param item history item to query. + * + * @return @c EINA_TRUE if last visit was failure, @c EINA_FALSE if it + * was fine. + */ +Eina_Bool ewk_history_item_visit_last_failed(const Ewk_History_Item* item) +{ + EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, EINA_TRUE); + return core->lastVisitWasFailure(); +} + + +/* internal methods ****************************************************/ +/** + * @internal + * + * Creates history for given view. Called internally by ewk_view and + * should never be called from outside. + * + * @param core WebCore::BackForwardList instance to use internally. + * + * @return newly allocated history instance or @c NULL on errors. + */ +Ewk_History* ewk_history_new(WebCore::BackForwardList* core) +{ + Ewk_History* history; + EINA_SAFETY_ON_NULL_RETURN_VAL(core, 0); + DBG("core=%p", core); + + history = (Ewk_History*)malloc(sizeof(Ewk_History)); + if (!history) { + CRITICAL("Could not allocate history memory."); + return 0; + } + + core->ref(); + history->core = core; + + return history; +} + +/** + * @internal + * + * Destroys previously allocated history instance. This is called + * automatically by ewk_view and should never be called from outside. + * + * @param history instance to free + */ +void ewk_history_free(Ewk_History* history) +{ + DBG("history=%p", history); + history->core->deref(); + free(history); +} Index: /trunk/WebKit/efl/ewk/ewk_util.h =================================================================== --- /trunk/WebKit/efl/ewk/ewk_util.h (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_util.h (revision 1404) @@ -0,0 +1,29 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_util_h +#define ewk_util_h + +#include +#include + +Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t* surface); + +#endif // ewk_util_h Index: /trunk/WebKit/efl/ewk/ewk_eapi.h =================================================================== --- /trunk/WebKit/efl/ewk/ewk_eapi.h (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_eapi.h (revision 1404) @@ -0,0 +1,50 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_eapi_h +#define ewk_eapi_h + +#ifdef EAPI +# undef EAPI +#endif + +#ifdef _WIN32 +# ifdef BUILDING_WEBKIT +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else +# define EAPI +# endif /* ! DLL_EXPORT */ +# else +# define EAPI __declspec(dllimport) +# endif /* ! EFL_EINA_BUILD */ +#else +# ifdef __GNUC__ +# if __GNUC__ >= 4 +# define EAPI __attribute__ ((visibility("default"))) +# else +# define EAPI +# endif +# else +# define EAPI +# endif +#endif + +#endif // ewk_eapi_h Index: /trunk/WebKit/efl/ewk/ewk_main.cpp =================================================================== --- /trunk/WebKit/efl/ewk/ewk_main.cpp (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_main.cpp (revision 1404) @@ -0,0 +1,152 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "ewk_main.h" + +#include "EWebKit.h" +#include "Logging.h" +#include "PageCache.h" +#include "PageGroup.h" +#include "ewk_private.h" +#include "runtime/InitializeThreading.h" + +#include +#include +#include +#include +#include + +#ifdef ENABLE_GLIB_SUPPORT +#include +#include + +#ifdef ENABLE_GTK_PLUGINS_SUPPORT +#include +#endif + +#endif + +// REMOVE-ME: see todo below +#include "ResourceHandle.h" +#include + +static int _ewk_init_count = 0; +int _ewk_log_dom = -1; + +int ewk_init(void) +{ + if (_ewk_init_count) + return ++_ewk_init_count; + + if (!eina_init()) + goto error_eina; + + _ewk_log_dom = eina_log_domain_register("ewebkit", EINA_COLOR_ORANGE); + if (_ewk_log_dom < 0) { + EINA_LOG_CRIT("could not register log domain 'ewebkit'"); + goto error_log_domain; + } + + if (!evas_init()) { + CRITICAL("could not init evas."); + goto error_evas; + } + + if (!ecore_init()) { + CRITICAL("could not init ecore."); + goto error_ecore; + } + + if (!ecore_evas_init()) { + CRITICAL("could not init ecore_evas."); + goto error_ecore_evas; + } + + if (!edje_init()) { + CRITICAL("could not init edje."); + goto error_edje; + } + +#ifdef ENABLE_GLIB_SUPPORT + g_type_init(); + + if (!g_thread_supported()) + g_thread_init(0); + +#ifdef ENABLE_GTK_PLUGINS_SUPPORT + gdk_threads_init(); + if (!gtk_init_check(0, 0)) + WRN("Could not initialize GTK support."); +#endif + + if (!ecore_main_loop_glib_integrate()) + WRN("Ecore was not compiled with GLib support, some plugins will not " + "work (ie: Adobe Flash)"); +#endif + + JSC::initializeThreading(); + WebCore::InitializeLoggingChannelsIfNecessary(); + + // Page cache capacity (in pages). Comment from Mac port: + // (Research indicates that value / page drops substantially after 3 pages.) + // FIXME: Expose this with an API and/or calculate based on available resources + WebCore::pageCache()->setCapacity(3); + WebCore::PageGroup::setShouldTrackVisitedLinks(true); + + // TODO: this should move to WebCore, already reported to webkit-gtk folks: + if (1) { + SoupSession* session = WebCore::ResourceHandle::defaultSession(); + soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER); + } + + return ++_ewk_init_count; + +error_edje: + ecore_evas_shutdown(); +error_ecore_evas: + ecore_shutdown(); +error_ecore: + evas_shutdown(); +error_evas: + eina_log_domain_unregister(_ewk_log_dom); + _ewk_log_dom = -1; +error_log_domain: + eina_shutdown(); +error_eina: + return 0; +} + +int ewk_shutdown(void) +{ + _ewk_init_count--; + if (_ewk_init_count) + return _ewk_init_count; + + ecore_evas_shutdown(); + ecore_shutdown(); + evas_shutdown(); + eina_log_domain_unregister(_ewk_log_dom); + _ewk_log_dom = -1; + eina_shutdown(); + + return 0; +} + Index: /trunk/WebKit/efl/ewk/ewk_history.h =================================================================== --- /trunk/WebKit/efl/ewk/ewk_history.h (revision 1404) +++ /trunk/WebKit/efl/ewk/ewk_history.h (revision 1404) @@ -0,0 +1,96 @@ +/* + Copyright (C) 2009-2010 ProFUSION embedded systems + Copyright (C) 2009-2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_history_h +#define ewk_history_h + +#include "ewk_eapi.h" + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The history (back-forward list) associated with a given ewk_view. + * + * Changing the history affects immediately the view, changing the + * current uri, for example. + * + * When ewk_view is navigated or uris are set, history automatically + * updates. That's why no direct access to history structure is + * allowed. + */ +typedef struct _Ewk_History Ewk_History; + +/** + * Represents one item from Ewk_History. + */ +typedef struct _Ewk_History_Item Ewk_History_Item; + + + +EAPI Eina_Bool ewk_history_forward(Ewk_History *history); +EAPI Eina_Bool ewk_history_back(Ewk_History *history); + +EAPI Eina_Bool ewk_history_history_item_add(Ewk_History *history, const Ewk_History_Item *item); +EAPI Eina_Bool ewk_history_history_item_set(Ewk_History *history, const Ewk_History_Item *item); +EAPI Ewk_History_Item *ewk_history_history_item_back_get(const Ewk_History *history); +EAPI Ewk_History_Item *ewk_history_history_item_current_get(const Ewk_History *history); +EAPI Ewk_History_Item *ewk_history_history_item_forward_get(const Ewk_History *history); +EAPI Ewk_History_Item *ewk_history_history_item_nth_get(const Ewk_History *history, int index); +EAPI Eina_Bool ewk_history_history_item_contains(const Ewk_History *history, const Ewk_History_Item *item); + +EAPI Eina_List *ewk_history_forward_list_get(const Ewk_History *history); +EAPI Eina_List *ewk_history_forward_list_get_with_limit(const Ewk_History *history, int limit); +EAPI int ewk_history_forward_list_length(const Ewk_History *history); + +EAPI Eina_List *ewk_history_back_list_get(const Ewk_History *history); +EAPI Eina_List *ewk_history_back_list_get_with_limit(const Ewk_History *history, int limit); +EAPI int ewk_history_back_list_length(const Ewk_History *history); + +EAPI int ewk_history_limit_get(Ewk_History *history); +EAPI Eina_Bool ewk_history_limit_set(const Ewk_History *history, int limit); + +EAPI Ewk_History_Item *ewk_history_item_new(const char *uri, const char *title); +EAPI void ewk_history_item_free(Ewk_History_Item *item); +EAPI void ewk_history_item_list_free(Eina_List *history_items); + +EAPI const char *ewk_history_item_title_get(const Ewk_History_Item *item); +EAPI const char *ewk_history_item_title_alternate_get(const Ewk_History_Item *item); +EAPI void ewk_history_item_title_alternate_set(Ewk_History_Item *item, const char *title); +EAPI const char *ewk_history_item_uri_get(const Ewk_History_Item *item); +EAPI const char *ewk_history_item_uri_original_get(const Ewk_History_Item *item); +EAPI double ewk_history_item_time_last_visited_get(const Ewk_History_Item *item); + +EAPI cairo_surface_t *ewk_history_item_icon_surface_get(const Ewk_History_Item *item); +EAPI Evas_Object *ewk_history_item_icon_object_add(const Ewk_History_Item *item, Evas *canvas); + +EAPI Eina_Bool ewk_history_item_page_cache_exists(const Ewk_History_Item *item); +EAPI int ewk_history_item_visit_count(const Ewk_History_Item *item); +EAPI Eina_Bool ewk_history_item_visit_last_failed(const Ewk_History_Item *item); + +#ifdef __cplusplus +} +#endif +#endif // ewk_history_h Index: /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebDesktopNotificationsDelegate.h =================================================================== --- /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebDesktopNotificationsDelegate.h (revision 1316) +++ /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebDesktopNotificationsDelegate.h (revision 1404) @@ -37,4 +37,5 @@ class Document; class KURL; + class SecurityOrigin; } @@ -49,4 +50,5 @@ virtual void requestPermission(WebCore::SecurityOrigin* origin, PassRefPtr callback); virtual WebCore::NotificationPresenter::Permission checkPermission(const WebCore::KURL& url, WebCore::Document* document); + virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::SecurityOrigin* origin); private: Index: /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebChromeClient.cpp =================================================================== --- /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebChromeClient.cpp (revision 1402) +++ /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebChromeClient.cpp (revision 1404) @@ -492,10 +492,4 @@ } -void WebChromeClient::invalidateContents(const IntRect& windowRect, bool) -{ - ASSERT(core(m_webView->topLevelFrame())); - m_webView->repaint(windowRect, true /*contentChanged*/, false /*immediate*/, true /*repaintContentOnly*/); -} - void WebChromeClient::invalidateWindow(const IntRect& windowRect, bool immediate) { Index: /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebChromeClient.h =================================================================== --- /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebChromeClient.h (revision 1402) +++ /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebChromeClient.h (revision 1404) @@ -100,5 +100,4 @@ virtual WebCore::IntRect windowResizerRect() const; - virtual void invalidateContents(const WebCore::IntRect&, bool); virtual void invalidateWindow(const WebCore::IntRect&, bool); virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool); Index: /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebDesktopNotificationsDelegate.cpp =================================================================== --- /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebDesktopNotificationsDelegate.cpp (revision 1316) +++ /trunk/WebKit/OrigynWebBrowser/WebCoreSupport/WebDesktopNotificationsDelegate.cpp (revision 1404) @@ -78,3 +78,8 @@ } +NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(SecurityOrigin* origin) +{ + return NotificationPresenter::PermissionNotAllowed; +} + #endif // ENABLE(NOTIFICATIONS) Index: /trunk/WebCore/DerivedSources.cpp =================================================================== --- /trunk/WebCore/DerivedSources.cpp (revision 1306) +++ /trunk/WebCore/DerivedSources.cpp (revision 1404) @@ -144,4 +144,5 @@ #include "JSHTMLParamElement.cpp" #include "JSHTMLPreElement.cpp" +#include "JSHTMLProgressElement.cpp" #include "JSHTMLQuoteElement.cpp" #include "JSHTMLScriptElement.cpp" Index: /trunk/WebCore/WebCore.pri =================================================================== --- /trunk/WebCore/WebCore.pri (revision 1402) +++ /trunk/WebCore/WebCore.pri (revision 1404) @@ -55,4 +55,5 @@ !contains(DEFINES, ENABLE_RUBY=.): DEFINES += ENABLE_RUBY=1 !contains(DEFINES, ENABLE_SANDBOX=.): DEFINES += ENABLE_SANDBOX=1 +!contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1 !contains(DEFINES, ENABLE_BLOB_SLICE=.): DEFINES += ENABLE_BLOB_SLICE=0 @@ -79,4 +80,7 @@ !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1 +# Tiled Backing Store support +!contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1 + # Nescape plugins support (NPAPI) !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) { @@ -105,4 +109,7 @@ } } + +# Bearer management is part of Qt 4.7 +!lessThan(QT_MINOR_VERSION, 7):!contains(DEFINES, ENABLE_QT_BEARER=.):DEFINES += ENABLE_QT_BEARER=1 DEFINES += WTF_CHANGES=1 @@ -149,4 +156,5 @@ contains(DEFINES, ENABLE_WEB_SOCKETS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1 contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1 +contains(DEFINES, ENABLE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TILED_BACKING_STORE=1 @@ -362,4 +370,5 @@ html/HTMLParamElement.idl \ html/HTMLPreElement.idl \ + html/HTMLProgressElement.idl \ html/HTMLQuoteElement.idl \ html/HTMLScriptElement.idl \ Index: /trunk/WebCore/dom/Clipboard.h =================================================================== --- /trunk/WebCore/dom/Clipboard.h (revision 1344) +++ /trunk/WebCore/dom/Clipboard.h (revision 1404) @@ -44,6 +44,7 @@ bool isForDragging() const { return m_forDragging; } - String dropEffect() const { return m_dropEffect; } + String dropEffect() const { return dropEffectIsUninitialized() ? "none" : m_dropEffect; } void setDropEffect(const String&); + bool dropEffectIsUninitialized() const { return m_dropEffect == "uninitialized"; } String effectAllowed() const { return m_effectAllowed; } void setEffectAllowed(const String&); Index: /trunk/WebCore/dom/Clipboard.cpp =================================================================== --- /trunk/WebCore/dom/Clipboard.cpp (revision 1282) +++ /trunk/WebCore/dom/Clipboard.cpp (revision 1404) @@ -37,5 +37,5 @@ Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging) : m_policy(policy) - , m_dropEffect("none") + , m_dropEffect("uninitialized") , m_effectAllowed("uninitialized") , m_dragStarted(false) @@ -111,5 +111,5 @@ { DragOperation op = dragOpFromIEOp(m_dropEffect); - ASSERT(op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationGeneric || op == DragOperationMove); + ASSERT(op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationGeneric || op == DragOperationMove || op == DragOperationEvery); return op; } Index: /trunk/WebCore/WebCore.pro =================================================================== --- /trunk/WebCore/WebCore.pro (revision 1402) +++ /trunk/WebCore/WebCore.pro (revision 1404) @@ -667,4 +667,5 @@ html/HTMLPlugInImageElement.cpp \ html/HTMLPreElement.cpp \ + html/HTMLProgressElement.cpp \ html/HTMLQuoteElement.cpp \ html/HTMLScriptElement.cpp \ @@ -832,4 +833,5 @@ platform/graphics/SegmentedFontData.cpp \ platform/graphics/SimpleFontData.cpp \ + platform/graphics/TiledBackingStore.cpp \ platform/graphics/transforms/AffineTransform.cpp \ platform/graphics/transforms/TransformationMatrix.cpp \ @@ -930,4 +932,5 @@ rendering/RenderPart.cpp \ rendering/RenderPartObject.cpp \ + rendering/RenderProgress.cpp \ rendering/RenderReplaced.cpp \ rendering/RenderReplica.cpp \ @@ -1368,4 +1371,5 @@ html/HTMLPlugInImageElement.h \ html/HTMLPreElement.h \ + html/HTMLProgressElement.h \ html/HTMLQuoteElement.h \ html/HTMLScriptElement.h \ @@ -1548,4 +1552,7 @@ platform/graphics/SegmentedFontData.h \ platform/graphics/SimpleFontData.h \ + platform/graphics/Tile.h \ + platform/graphics/TiledBackingStore.h \ + platform/graphics/TiledBackingStoreClient.h \ platform/graphics/transforms/Matrix3DTransformOperation.h \ platform/graphics/transforms/MatrixTransformOperation.h \ @@ -1671,4 +1678,5 @@ rendering/RenderPartObject.h \ rendering/RenderPath.h \ + rendering/RenderProgress.h \ rendering/RenderReplaced.h \ rendering/RenderReplica.h \ @@ -2041,4 +2049,5 @@ platform/graphics/qt/GlyphPageTreeNodeQt.cpp \ platform/graphics/qt/SimpleFontDataQt.cpp \ + platform/graphics/qt/TileQt.cpp \ platform/qt/KURLQt.cpp \ platform/qt/Localizations.cpp \ @@ -2799,4 +2808,11 @@ } +contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) { + # this feature requires the S60 platform private BrowserDialogsProvider.h header file + # and is therefore not enabled by default but only meant for platform builds. + symbian { + LIBS += -lbrowserdialogsprovider + } +} include($$PWD/../WebKit/qt/Api/headers.pri) @@ -2865,5 +2881,5 @@ } -CONFIG(standalone_package):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) { +CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) { # start with 4.5 # Remove the following 2 lines if you want debug information in WebCore Index: /trunk/WebCore/ChangeLog =================================================================== --- /trunk/WebCore/ChangeLog (revision 1402) +++ /trunk/WebCore/ChangeLog (revision 1404) @@ -1,2 +1,1256 @@ +2010-03-15 Chang Shu + + Reviewed by Simon Hausmann. + + [Qt] [Symbian] Added block for ENABLE_SYMBIAN_DIALOG_PROVIDERS + on Symbian platform. + https://bugs.webkit.org/show_bug.cgi?id=35919 + + * WebCore.pro: + +2010-03-14 Yael Aharon + + Reviewed by Darin Adler. + + Support for HTMLProgressElement + https://bugs.webkit.org/show_bug.cgi?id=35937 + + Added support for HTMLProgressElement. + This implementation is enabled only for Qt, because only RenderThemeQt + was modified to actually draw the progress element. + The labels attribute of the progress element will be implemented in a + separate patch. + + Tests: fast/dom/HTMLProgressElement/progress-element.html + fast/dom/HTMLProgressElement/set-progress-properties.html + + * DerivedSources.cpp: + * DerivedSources.make: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pri: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * css/CSSPrimitiveValueMappings.h: + (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): + * css/CSSSelector.cpp: + (WebCore::CSSSelector::extractPseudoType): + * css/CSSValueKeywords.in: + * css/html.css: + * html/HTMLElement.cpp: + (WebCore::inlineTagList): + * html/HTMLElementsAllInOne.cpp: + * html/HTMLFormControlElement.cpp: + (WebCore::HTMLFormControlElement::HTMLFormControlElement): + * html/HTMLFormControlElement.h: + * html/HTMLProgressElement.cpp: Added. + (WebCore::HTMLProgressElement::HTMLProgressElement): + (WebCore::HTMLProgressElement::create): + (WebCore::HTMLProgressElement::createRenderer): + (WebCore::HTMLProgressElement::formControlType): + (WebCore::HTMLProgressElement::parseMappedAttribute): + (WebCore::HTMLProgressElement::value): + (WebCore::HTMLProgressElement::setValue): + (WebCore::HTMLProgressElement::max): + (WebCore::HTMLProgressElement::setMax): + (WebCore::HTMLProgressElement::position): + * html/HTMLProgressElement.h: Added. + (WebCore::HTMLProgressElement::isOptionalFormControl): + * html/HTMLProgressElement.idl: Added. + * html/HTMLTagNames.in: + * page/DOMWindow.idl: + * platform/ThemeTypes.h: + * platform/qt/RenderThemeQt.cpp: + (WebCore::RenderThemeQt::adjustProgressBarStyle): + (WebCore::RenderThemeQt::paintProgressBar): + * platform/qt/RenderThemeQt.h: + * rendering/RenderObject.h: + (WebCore::RenderObject::isProgress): + * rendering/RenderProgress.cpp: Added. + (WebCore::RenderProgress::RenderProgress): + (WebCore::RenderProgress::baselinePosition): + (WebCore::RenderProgress::calcPrefWidths): + (WebCore::RenderProgress::layout): + (WebCore::RenderProgress::updateFromElement): + * rendering/RenderProgress.h: Added. + (WebCore::RenderProgress::renderName): + (WebCore::RenderProgress::isProgress): + (WebCore::toRenderProgress): + * rendering/RenderTheme.cpp: + (WebCore::RenderTheme::adjustStyle): + (WebCore::RenderTheme::paint): + (WebCore::RenderTheme::paintBorderOnly): + (WebCore::RenderTheme::paintDecorations): + (WebCore::RenderTheme::adjustProgressBarStyle): + * rendering/RenderTheme.h: + (WebCore::RenderTheme::paintProgressBar): + +2010-03-14 Oliver Hunt + + Reviewed by Darin Adler. + + REGRESSION(r53287): drop event is not fired if dataTransfer.dropEffect is not explicitly set + https://bugs.webkit.org/show_bug.cgi?id=36095 + + The issue here is that while dropEffect is meant to be initialized + to "none", the behaviour of the drag is differs between dragEffect + not being set and dragEffect being explicitly set to "none" + + This patch corrects this behaviour by making Clipboard distinguish + between the initial "none" value of dropEffect and an explicit "none". + This alone is insufficient for correct behaviour, we also need to + resurrect the removed defaultOperationForDrag function, but we now + use the function only when dragEffect is uninitialized. There are a + few tweaks to the behaviour of the defaultOperationForDrag as well + to ensure exactly the same set of outcomes for all cases that we + may hit it. + + * dom/Clipboard.cpp: + (WebCore::Clipboard::Clipboard): + (WebCore::dragOpFromIEOp): + (WebCore::Clipboard::destinationOperation): + * dom/Clipboard.h: + (WebCore::Clipboard::dropEffect): + (WebCore::Clipboard::dropEffectIsUninitialized): + * page/DragController.cpp: + (WebCore::defaultOperationForDrag): + (WebCore::DragController::tryDHTMLDrag): + +2010-03-14 Antti Koivisto + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=35146 + Support tiled backing store + + Implements a basic tiled backing store mechanism. Tiles are created and + deleted on demand. The page content is cached to the tiles. Tile content + is kept in sync with the document. Since the backing store covers area + larger than the currently visible viewport, the document can be scrolled + quickly without having to enter rendering tree painting. + + The tile management code is platform independent. This patch has simple QPixmap + based tile implementation for Qt. + + The feature is behind ENABLE_TILED_BACKING_STORE flag. + + * WebCore.pri: + * WebCore.pro: + * page/Frame.cpp: + (WebCore::Frame::Frame): + (WebCore::Frame::setTiledBackingStoreEnabled): + (WebCore::Frame::tiledBackingStorePaintBegin): + (WebCore::Frame::tiledBackingStorePaint): + (WebCore::Frame::tiledBackingStorePaintEnd): + (WebCore::Frame::tiledBackingStoreContentsRect): + * page/Frame.h: + (WebCore::Frame::tiledBackingStore): + * page/FrameView.cpp: + (WebCore::FrameView::repaintContentRectangle): + (WebCore::FrameView::doDeferredRepaints): + * page/Settings.cpp: + (WebCore::Settings::Settings): + (WebCore::Settings::setTiledBackingStoreEnabled): + * page/Settings.h: + (WebCore::Settings::tiledBackingStoreEnabled): + * platform/graphics/Tile.h: Added. + (WebCore::Tile::create): + (WebCore::Tile::coordinate): + (WebCore::Tile::rect): + * platform/graphics/TiledBackingStore.cpp: Added. + (WebCore::TiledBackingStore::TiledBackingStore): + (WebCore::TiledBackingStore::~TiledBackingStore): + (WebCore::TiledBackingStore::invalidate): + (WebCore::TiledBackingStore::updateTileBuffers): + (WebCore::TiledBackingStore::paint): + (WebCore::TiledBackingStore::viewportChanged): + (WebCore::TiledBackingStore::setContentsScale): + (WebCore::TiledBackingStore::tileDistance): + (WebCore::TiledBackingStore::createTiles): + (WebCore::TiledBackingStore::dropOverhangingTiles): + (WebCore::TiledBackingStore::dropTilesOutsideRect): + (WebCore::TiledBackingStore::tileAt): + (WebCore::TiledBackingStore::setTile): + (WebCore::TiledBackingStore::removeTile): + (WebCore::TiledBackingStore::mapToContents): + (WebCore::TiledBackingStore::mapFromContents): + (WebCore::TiledBackingStore::contentsRect): + (WebCore::TiledBackingStore::tileRectForCoordinate): + (WebCore::TiledBackingStore::tileCoordinateForPoint): + (WebCore::TiledBackingStore::startTileBufferUpdateTimer): + (WebCore::TiledBackingStore::tileBufferUpdateTimerFired): + (WebCore::TiledBackingStore::startTileCreationTimer): + (WebCore::TiledBackingStore::tileCreationTimerFired): + (WebCore::TiledBackingStore::setContentsFrozen): + * platform/graphics/TiledBackingStore.h: Added. + (WebCore::TiledBackingStore::contentsScale): + (WebCore::TiledBackingStore::contentsFrozen): + * platform/graphics/TiledBackingStoreClient.h: Added. + * platform/graphics/qt/TileQt.cpp: Added. + (WebCore::checkeredPixmap): + (WebCore::Tile::Tile): + (WebCore::Tile::~Tile): + (WebCore::Tile::isDirty): + (WebCore::Tile::isReadyToPaint): + (WebCore::Tile::invalidate): + (WebCore::Tile::updateBackBuffer): + (WebCore::Tile::swapBackBufferToFront): + (WebCore::Tile::paint): + (WebCore::Tile::paintCheckerPattern): + +2010-03-14 Dan Bernstein + + Reviewed by Darin Adler. + + WebCore part of removing support for legacy versions of Core Graphics + + * WebCore.vcproj/WebCore.vcproj: Removed FontDatabase.{cpp,h} + * platform/graphics/win/FontCGWin.cpp: + (WebCore::Font::drawGlyphs): Removed call to wkCanCreateCGFontWithLOGFONT(), + as it is now always true. + * platform/graphics/win/FontCacheWin.cpp: + (WebCore::FontCache::createFontPlatformData): Ditto. + * platform/graphics/win/FontCustomPlatformData.cpp: + (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Updated for + the removal of m_cgFont. + (WebCore::FontCustomPlatformData::fontPlatformData): Removed call to + wkCanCreateCGFontWithLOGFONT(), as it is now always true. + (WebCore::createFontCustomPlatformData): Ditto. Also updated for change to + the FontCustomPlatformData constructor. + * platform/graphics/win/FontCustomPlatformData.h: Removed m_cgFont member. + (WebCore::FontCustomPlatformData::FontCustomPlatformData): Removed cgFont + parameter. + * platform/graphics/win/FontDatabase.cpp: Removed. + * platform/graphics/win/FontDatabase.h: Removed. + * platform/graphics/win/FontPlatformDataCGWin.cpp: + (WebCore::FontPlatformData::platformDataInit): Removed call to + wkCanCreateCGFontWithLOGFONT(), as it is now always true. + * platform/win/TemporaryLinkStubs.cpp: + (WebCore::populateFontDatabase): Removed stub. + +2010-03-14 Jessie Berlin + + Reviewed by Sam Weinig. + + "event.ctrlKey" is always false when dragging an element with "ctrl" key down + https://bugs.webkit.org/show_bug.cgi?id=17113 + + No new tests. + + * page/DragController.cpp: + (WebCore::createMouseEvent): + Use the current state of the shift, ctrl, alt, and meta keys when creating the drag mouse event. + +2010-03-13 Antonio Gomes + + Not reviewed identation fix. + + * manual-tests/spatial-navigation/spatial-navigation-test-cases.html: + +2010-03-13 Kim Grönholm + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] GraphicsLayer: Opacity change from zero to non-zero doesn't always have effect with AC + https://bugs.webkit.org/show_bug.cgi?id=36034 + + * platform/graphics/qt/GraphicsLayerQt.cpp: + (WebCore::OpacityAnimationQt::applyFrame): + +2010-03-13 Kim Grönholm + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] GraphicsLayer: Opacity transitions end with begin value + https://bugs.webkit.org/show_bug.cgi?id=36019 + + * platform/graphics/qt/GraphicsLayerQt.cpp: + (WebCore::AnimationQt::updateCurrentTime): + +2010-03-13 Dirk Schulze + + No review, rolling out r55927. + http://trac.webkit.org/changeset/55927 + https://bugs.webkit.org/show_bug.cgi?id=35793 + + Breaks Gtk build bots. + + * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: + (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): + (WebCore::MediaPlayerPrivate::load): + (WebCore::MediaPlayerPrivate::setPreload): + * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: + +2010-03-12 Dirk Schulze + + Reviewed by Nikolas Zimmermann. + + SVG Glyphs - transform path not context + https://bugs.webkit.org/show_bug.cgi?id=36070 + + SVGFont should transform the path of a glyph, not the context. Modifying + the context causes wrong gradient transformations. This bug doesn't + influence CG because we generally fill or stroke texts with a mask image. + All other platforms provide a direct way to make the drawings. + + * svg/SVGFont.cpp: + (WebCore::Font::drawTextUsingSVGFont): + +2010-03-12 Beth Dakin + + Reviewed by Simon Fraser. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=34942 Fullscreen + API naming is inconsistent + -and corresponding- + + + This patch changes all occurrences of "fullScreen" to the more + popular "fullscreen." webkitEnterFullScreen and + webkitExitFullScreen have been maintained for now for backwards + compatibility. + + * html/HTMLVideoElement.cpp: + (WebCore::HTMLVideoElement::webkitEnterFullscreen): + (WebCore::HTMLVideoElement::webkitExitFullscreen): + * html/HTMLVideoElement.h: + (WebCore::HTMLVideoElement::webkitEnterFullScreen): + (WebCore::HTMLVideoElement::webkitExitFullScreen): + * html/HTMLVideoElement.idl: + * platform/graphics/mac/MediaPlayerProxy.h: + +2010-03-12 James Robinson + + Reviewed by Adam Barth. + + Add virtual destructor to DOMWrapperWorld + https://bugs.webkit.org/show_bug.cgi?id=36077 + + DOMWrapperWorld is RefCounted. IsolatedWorld + inherits from DOMWrapperWorld and has member variables + with destructors, so DOMWrapperWorld needs to have a declared virtual + d'tor to ensure that its derived class's destructors are called. + + No new tests, no change in behavior + + * bindings/v8/DOMWrapperWorld.h: + (WebCore::DOMWrapperWorld::~DOMWrapperWorld): + + +2010-03-11 Gavin Barraclough + + Reviewed by Oliver Hunt. + + Bug 36075 - Clean up screwyness re static string impls & Identifiers. + + * platform/text/StringImpl.cpp: + (WebCore::StringImpl::~StringImpl): Add ASSERT + (WebCore::StringImpl::sharedBuffer): Add ASSERT + * platform/text/StringImpl.h: + (WebCore::StringImpl::setHash): Add ASSERT + (WebCore::StringImpl::isStatic): added. + +2010-03-12 Enrica Casucci + + Reviewed by Simon Fraser. + + Content of 3D tests appears at the bottom right corner sometimes. + + + + There were two problems to solve here: + - the incorrect anchoring of the rootChildLayer that was causing the composited + content to be positioned incorrectly + - the failure to paint the non composited content into the backing store when + animating composited content. + + The first problem has been solved by leaving the original anchor point for the + rootChildLayer and splitting the tasks of clipping and scrolling using two separate layers. + The second problem has been solved leveraging the knowledge that WebView has of the dirty region + of the backing store to pass this information to the layer renderer. This allows the renderer to force + a paint into the backing store before moving to the compositing. + + Tests: compositing/geometry/horizontal-scroll-composited.html + compositing/geometry/vertical-scroll-composited.html + + * manual-tests/win/horizontal-scroll-composited.html: Removed. This is now a layout test. + * manual-tests/win/milliondollar.html: Added. + * platform/graphics/win/WKCACFLayerRenderer.cpp: + (WebCore::WKCACFLayerRenderer::WKCACFLayerRenderer): Added initialization of dirty flag. + (WebCore::WKCACFLayerRenderer::setScrollFrame): + (WebCore::WKCACFLayerRenderer::updateScrollFrame): Updated to resize and position the clip and scroll layers. + (WebCore::WKCACFLayerRenderer::setRootChildLayer): + (WebCore::WKCACFLayerRenderer::createRenderer): Added new layer hierarchy. + (WebCore::WKCACFLayerRenderer::destroyRenderer): Remove clip layer on destroy. + (WebCore::WKCACFLayerRenderer::resize): + (WebCore::WKCACFLayerRenderer::paint): Forcing paint massage to trigger paint into the backing store. + * platform/graphics/win/WKCACFLayerRenderer.h: + (WebCore::WKCACFLayerRenderer::setBackingStoreDirty): Added. + +2010-03-12 Robert Hogan + + Not reviewed, build fix. + + Revert http://trac.webkit.org/projects/webkit/changeset/55374 which broke + the !ENABLE(DATABASE) build on all platforms when attempting to fix the + --minimal build on Qt. + + Support for SQLite now seems to be non-negotiable for the Qt build but making + it mandatory requires review, so re-break --minimal Qt build for now. + + Qt build issue now tracked at https://bugs.webkit.org/show_bug.cgi?id=36073 + + * page/GeolocationPositionCache.cpp: + +2010-03-12 Dan Bernstein + + Reviewed by Alexey Proskuryakov. + + REGRESSION: toolbar is missing at http://www.glom.org/ + https://bugs.webkit.org/show_bug.cgi?id=35507 + + * css/CSSImportRule.cpp: + (WebCore::CSSImportRule::setCSSStyleSheet): Extend the change made in + to detect the two variants of + KHTMLFixes.css in @import rules as well as in elements. + +2010-03-12 Gavin Barraclough + + Reviewed by Geoff Garen. + + Bug 36052 - [Qt] REGRESSION(55878) 63 test cases crash + + r55878 changed UStringImpl::empty()->characters() to be non-null, + so TextBreakIteratorQt.cpp now should check the length of strings + (previously was assuming all strings with a non-null data pointer + had a length of at least 1). + + * platform/text/qt/TextBreakIteratorQt.cpp: + (WebCore::wordBreakIterator): + (WebCore::characterBreakIterator): + (WebCore::lineBreakIterator): + (WebCore::sentenceBreakIterator): + +2010-03-12 Dirk Schulze + + Reviewed by Nikolas Zimmermann. + + SVG fallback color doesn't work for bogus gradients. + https://bugs.webkit.org/show_bug.cgi?id=35479 + + Use a given fallback color on ignored gradients if present. Gradients + must be ignored, if one dimension of the objects boundingBox is zero. + + Test: svg/custom/gradient-with-1d-boundingbox.svg + + * svg/graphics/SVGPaintServer.cpp: + (WebCore::SVGPaintServer::strokePaintServer): + * svg/graphics/SVGPaintServerGradient.cpp: + (WebCore::SVGPaintServerGradient::setup): + +2010-03-12 David Hyatt + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=36069 + + Eliminate InlineRunBox. + + * WebCore.xcodeproj/project.pbxproj: + * rendering/InlineFlowBox.cpp: + (WebCore::InlineFlowBox::adjustPosition): + (WebCore::InlineFlowBox::paintFillLayer): + (WebCore::InlineFlowBox::paintBoxDecorations): + (WebCore::InlineFlowBox::paintMask): + * rendering/InlineFlowBox.h: + (WebCore::InlineFlowBox::InlineFlowBox): + (WebCore::InlineFlowBox::prevLineBox): + (WebCore::InlineFlowBox::nextLineBox): + (WebCore::InlineFlowBox::setNextLineBox): + (WebCore::InlineFlowBox::setPreviousLineBox): + * rendering/InlineRunBox.h: Removed. + * rendering/InlineTextBox.h: + (WebCore::InlineTextBox::InlineTextBox): + (WebCore::InlineTextBox::prevTextBox): + (WebCore::InlineTextBox::nextTextBox): + (WebCore::InlineTextBox::setNextTextBox): + (WebCore::InlineTextBox::setPreviousTextBox): + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::destroy): + (WebCore::RenderBlock::rightmostPosition): + (WebCore::RenderBlock::leftmostPosition): + * rendering/RenderInline.cpp: + (WebCore::RenderInline::destroy): + (WebCore::RenderInline::absoluteRects): + (WebCore::RenderInline::absoluteQuads): + (WebCore::RenderInline::linesBoundingBox): + (WebCore::RenderInline::linesVisibleOverflowBoundingBox): + (WebCore::RenderInline::addFocusRingRects): + (WebCore::RenderInline::paintOutline): + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::localBoundingBox): + * rendering/RenderLineBoxList.cpp: + (WebCore::RenderLineBoxList::deleteLineBoxTree): + (WebCore::RenderLineBoxList::extractLineBox): + (WebCore::RenderLineBoxList::attachLineBox): + (WebCore::RenderLineBoxList::removeLineBox): + (WebCore::RenderLineBoxList::deleteLineBoxes): + (WebCore::RenderLineBoxList::dirtyLineBoxes): + (WebCore::RenderLineBoxList::paint): + (WebCore::RenderLineBoxList::hitTest): + (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild): + (WebCore::RenderLineBoxList::checkConsistency): + * rendering/RenderSVGInline.cpp: + (WebCore::RenderSVGInline::absoluteRects): + (WebCore::RenderSVGInline::absoluteQuads): + * rendering/RenderSVGText.cpp: + (WebCore::RenderSVGText::absoluteRects): + (WebCore::RenderSVGText::absoluteQuads): + (WebCore::RenderSVGText::objectBoundingBox): + * rendering/RenderText.cpp: + (WebCore::RenderText::extractTextBox): + (WebCore::RenderText::attachTextBox): + (WebCore::RenderText::removeTextBox): + (WebCore::RenderText::createInlineTextBox): + (WebCore::RenderText::positionLineBox): + * rendering/RootInlineBox.h: + (WebCore::RootInlineBox::nextRootBox): + (WebCore::RootInlineBox::prevRootBox): + +2010-03-12 Gustavo Noronha Silva + + Reviewed by Eric Carlson. + + media/video-preload.html fails + https://bugs.webkit.org/show_bug.cgi?id=35793 + + Only effectively load, and start buffering when playing, or when + the preload attribute is set. + + Test: media/video-preload.html + + * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: + (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): + (WebCore::MediaPlayerPrivate::load): + (WebCore::MediaPlayerPrivate::commitLoad): + (WebCore::MediaPlayerPrivate::prepareToPlay): + (WebCore::MediaPlayerPrivate::setPreload): + * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: + +2010-03-12 Dmitry Titov + + Not reviewed, build fix. + + Reverts 55920 and 55921. Landing for Jian Li. + + * Android.derived.jscbindings.mk: + * Android.derived.v8bindings.mk: + * DerivedSources.cpp: + * DerivedSources.make: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pri: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * bindings/js/JSDOMFormDataCustom.cpp: Removed. + * bindings/js/JSXMLHttpRequestCustom.cpp: + (WebCore::JSXMLHttpRequest::send): + * bindings/scripts/CodeGeneratorJS.pm: + * bindings/v8/V8Index.h: + * bindings/v8/custom/V8DOMFormDataCustom.cpp: Removed. + * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: + (WebCore::V8XMLHttpRequest::sendCallback): + * html/DOMFormData.idl: Removed. + * page/DOMWindow.idl: + +2010-03-12 Jakob Petsovits + + Reviewed by Dirk Schulze. + + [OpenVG] Add support for drawing text to PainterOpenVG + https://bugs.webkit.org/show_bug.cgi?id=35581 + + Doesn't come with any actual font classes, as OpenVG + by itself doesn't provide any access to platform fonts + but just the means to draw glyphs that have been loaded + manually before. + + * platform/graphics/openvg/PainterOpenVG.cpp: + (WebCore::PlatformPainterState::PlatformPainterState): + (WebCore::PlatformPainterState::copyPaintState): + (WebCore::PainterOpenVG::textDrawingMode): + (WebCore::PainterOpenVG::setTextDrawingMode): + (WebCore::PainterOpenVG::drawText): + * platform/graphics/openvg/PainterOpenVG.h: + +2010-03-12 Jakob Petsovits + + Reviewed by Dirk Schulze. + + [OpenVG] Use masks to implement non-rectilinear clipping + https://bugs.webkit.org/show_bug.cgi?id=35544 + + Requires some additional context switching logic to + make sure the right context is current when dealing + with the mask, because we don't store it by ourselves. + + Initial version of this code was written by + Eli Fidler , I did a couple of + bug fixes and efficiency improvements since then. + + * platform/graphics/openvg/GraphicsContextOpenVG.cpp: + (WebCore::GraphicsContext::clipPath): + (WebCore::GraphicsContext::clip): + (WebCore::GraphicsContext::clipOut): + (WebCore::GraphicsContext::clipOutEllipseInRect): + (WebCore::GraphicsContext::addInnerRoundedRectClip): + * platform/graphics/openvg/PainterOpenVG.cpp: + (WebCore::PlatformPainterState::PlatformPainterState): + (WebCore::PlatformPainterState::~PlatformPainterState): + (WebCore::PlatformPainterState::maskingEnabled): + (WebCore::PlatformPainterState::applyState): + (WebCore::PlatformPainterState::saveMaskIfNecessary): + (WebCore::PainterOpenVG::intersectClipRect): + (WebCore::PainterOpenVG::clipPath): + (WebCore::PainterOpenVG::save): + * platform/graphics/openvg/PainterOpenVG.h: + (WebCore::PainterOpenVG::): + * platform/graphics/openvg/SurfaceOpenVG.cpp: + (WebCore::SurfaceOpenVG::makeCurrent): + (WebCore::SurfaceOpenVG::makeCompatibleCurrent): + * platform/graphics/openvg/SurfaceOpenVG.h: + (WebCore::SurfaceOpenVG::): + +2010-03-12 Jian Li + + Reviewed by Sam Weinig. + + Add DOMFormData.idl to expose FormData interface. + https://bugs.webkit.org/show_bug.cgi?id=36024 + + The implementation is based on XMLHttpRequest 2 spec: + http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#formdata + + Test: http/tests/local/send-form-data.html + + * Android.derived.jscbindings.mk: + * Android.derived.v8bindings.mk: + * DerivedSources.cpp: + * DerivedSources.make: + * GNUmakefile.am: + * WebCore.pri: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * bindings/js/JSDOMFormDataCustom.cpp: Added. + * bindings/js/JSXMLHttpRequestCustom.cpp: + (WebCore::JSXMLHttpRequest::send): + * bindings/scripts/CodeGeneratorJS.pm: + * html/DOMFormData.idl: Added. + * page/DOMWindow.idl: + +2010-03-12 Jakob Petsovits + + Reviewed by Dirk Schulze. + + [OpenVG] Add a SurfaceOpenVG constructor for EGL client buffer surfaces + https://bugs.webkit.org/show_bug.cgi?id=35538 + + SurfaceOpenVG can now not only encapsulate pbuffer + and window surfaces but also VGImage-based ones. + + * platform/graphics/openvg/EGLDisplayOpenVG.cpp: + (WebCore::EGLDisplayOpenVG::createPbufferFromClientBuffer): + * platform/graphics/openvg/EGLDisplayOpenVG.h: + * platform/graphics/openvg/SurfaceOpenVG.cpp: + (WebCore::SurfaceOpenVG::SurfaceOpenVG): + * platform/graphics/openvg/SurfaceOpenVG.h: + +2010-03-12 Alpha Lam + + Reviewed by Eric Carlson. + + Fix a crash when resource loading of media element is canceled. + https://bugs.webkit.org/show_bug.cgi?id=35992 + + Use of HTMLMediaElement::duration() after resource loading was canceled + will cause a crash. This is because HTMLMediaElement::m_player is used + when NULL. + Test: http/tests/media/video-cancel-load.html + + * html/HTMLMediaElement.cpp: + (WebCore::HTMLMediaElement::duration): + Avoid calling to m_player when it is null. + (WebCore::HTMLMediaElement::userCancelledLoad): + Set m_readyState to HAVE_NOTHING. + +2010-03-12 Dan Bernstein + + Reviewed by Darin Adler. + + CSSPrimitiveValue::parserValue() returns deleted memory + https://bugs.webkit.org/show_bug.cgi?id=20069 + + No test added, since with the CSS variables feature disabled, the pointer + to the freed memory is never dereferenced. + + * css/CSSPrimitiveValue.cpp: + (WebCore::valueOrPropertyName): Changed to return a const AtomicString& from + a static table. + (WebCore::CSSPrimitiveValue::parserValue): Updated for the above change. + +2010-03-12 Dan Bernstein + + Build fix. + + * platform/chromium/PlatformKeyboardEventChromium.cpp: + +2010-03-12 Dan Bernstein + + Reviewed by Darin Adler. + + Hover states not updated when overflow section scrolls under stationary mouse pointer + https://bugs.webkit.org/show_bug.cgi?id=35949 + + Test: fast/events/overflow-scroll-fake-mouse-move.html + + Soon after an overflow section scrolls under the mouse pointer, dispatch + a fake mouse move event. This is similar to how frame scrolling is handled + in WebKit, and has the effect of updating hover state, dispatching DOM mouse + events, and updating the tool tip. + + * page/EventHandler.cpp: + (WebCore::EventHandler::EventHandler): Initialize m_fakeMouseMoveEventTimer. + (WebCore::EventHandler::~EventHandler): Assert that the timer is not active. + (WebCore::EventHandler::clear): Stop the timer. + (WebCore::EventHandler::handleMousePressEvent): Cancel pending fake mouse + move events. + (WebCore::EventHandler::handleMouseMoveEvent): Ditto. + (WebCore::EventHandler::dispatchFakeMouseMoveEventSoonInQuad): If the mouse + is in the passed-in quad, ensure that a fake mouse move event is scheduled + to fire soon. + (WebCore::EventHandler::cancelFakeMouseMoveEvent): Does what the name says. + (WebCore::EventHandler::fakeMouseMoveEventTimerFired): Constructs a + PlatformMouseEvent with the current mouse location, modifier key state and + time stamp and calls mouseMoved(). + * page/EventHandler.h: + * platform/PlatformKeyboardEvent.h: Declared getCurrentModifierState(). + * platform/android/KeyEventAndroid.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out. + * platform/brew/PlatformKeyboardEventBrew.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. + * platform/chromium/PlatformKeyboardEventChromium.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added. + * platform/efl/PlatformKeyboardEventEfl.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out. + * platform/gtk/KeyEventGtk.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. + * platform/haiku/PlatformKeyboardEventHaiku.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added. + * platform/mac/KeyEventMac.mm: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. + * platform/qt/PlatformKeyboardEventQt.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out. + * platform/win/KeyEventWin.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added. + * platform/wx/KeyboardEventWx.cpp: + (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::scrollToOffset): Call + EventHandler::dispatchFakeMouseMoveEventSoonInQuad(). Moved things around + a little to avoid computing the repaint rect twice. + +2010-03-12 Kent Hansen + + Reviewed by Darin Adler. + + Webkit doesn't build with workers on and database off + https://bugs.webkit.org/show_bug.cgi?id=35997 + + Added missing ENABLE(DATABASE) guards. + + * workers/WorkerThread.cpp: + (WebCore::WorkerThreadShutdownStartTask::performTask): + +2010-03-12 Dan Winship + + Reviewed by Gustavo Noronha. + + Make the defaultCookieJar use a no-third-party policy. Most + applications set their own cookie jar, but DumpRenderTree doesn't, + so it was failing the new third-party-cookie test. + + * platform/network/soup/CookieJarSoup.cpp: + (WebCore::defaultCookieJar): + +2010-03-11 Simon Hausmann + + Reviewed by Laszlo Gombos. + + [Qt] Enable network state notifier when compiling against Qt 4.7 + https://bugs.webkit.org/show_bug.cgi?id=35983 + + * WebCore.pri: + * platform/network/qt/NetworkStateNotifierPrivate.h: + * platform/network/qt/NetworkStateNotifierQt.cpp: + +2010-03-11 Benjamin Poulain + + Reviewed by Adam Treat. + + Do not render the full frame when there is some elements with fixed positioning + https://bugs.webkit.org/show_bug.cgi?id=33150 + + The frame view take into acount the list of fixed object when scrolling + the view. If the number of object is lower than a certain threshold, the pixel + are blitted, and the invalidated area updated. + + * page/FrameView.cpp: + (WebCore::FrameView::FrameView): + (WebCore::FrameView::useSlowRepaints): + (WebCore::FrameView::useSlowRepaintsIfNotOverlapped): + (WebCore::FrameView::addFixedObject): + (WebCore::FrameView::removeFixedObject): + (WebCore::FrameView::scrollContentsFastPath): + * page/FrameView.h: + * platform/ScrollView.cpp: + (WebCore::ScrollView::scrollContents): + (WebCore::ScrollView::scrollContentsFastPath): + * platform/ScrollView.h: + * rendering/RenderBlock.h: + (WebCore::RenderBlock::positionedObjects): + * rendering/RenderBox.cpp: + (WebCore::RenderBox::styleWillChange): + * rendering/RenderObject.cpp: + (WebCore::RenderObject::styleWillChange): + +2010-03-11 Aaron Boodman + + Kill WebDocument::applicationID() (part 1). + + Modify interface to WebCore::NotificationPresenter::checkPermission() + and remove implementation of WebDocument::applicationID(). Breaking + API changes will be in a subsequent change. + https://bugs.webkit.org/show_bug.cgi?id=35846 + + * notifications/Notification.cpp: + (WebCore::Notification::Notification): + * notifications/NotificationCenter.cpp: + (WebCore::NotificationCenter::checkPermission): + * notifications/NotificationPresenter.h: + +2010-03-11 Dmitry Titov + + Reviewed by David Levin. + + [v8] Remove obsolete code for delayed dereferencing of DOM objects for single-heap, multithread v8 usage. + https://bugs.webkit.org/show_bug.cgi?id=36043 + + No new tests, no changes in functionality. + + * bindings/v8/DOMData.cpp: + (WebCore::DOMData::DOMData): + * bindings/v8/DOMData.h: + (WebCore::DOMData::handleWeakObject): + * bindings/v8/DOMDataStore.cpp: + * bindings/v8/DOMDataStore.h: + (WebCore::DOMDataStore::domObjectMap): + (WebCore::DOMDataStore::activeDomObjectMap): + (WebCore::DOMDataStore::domSvgElementInstanceMap): + (WebCore::DOMDataStore::domSvgObjectWithContextMap): + * bindings/v8/ScopedDOMDataStore.cpp: + (WebCore::ScopedDOMDataStore::ScopedDOMDataStore): + * bindings/v8/StaticDOMDataStore.cpp: + (WebCore::StaticDOMDataStore::StaticDOMDataStore): + * bindings/v8/StaticDOMDataStore.h: + * bindings/v8/V8DOMMap.cpp: + (WebCore::removeAllDOMObjectsInCurrentThread): + +2010-03-11 Gavin Barraclough + + Rubber stamped by Oliver Hunt. + + Remove nonsense comments used in development & commited in error. + + * platform/text/StringImpl.h: + +2010-03-11 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=36041 + Remove unnecessary differences in common code between WebCore::StringImpl & JSC::UStringImpl + + Much of the code in WebCore::StringImpl and JSC::UStringImpl is now very similar, + but has trivial and unnecessary formatting differences, such as the exact wording + of comments, missing ASSERTs, functions implemented in the .h vs .cpp etc. + + * platform/text/StringImpl.cpp: + (WebCore::StringImpl::empty): Reordered in file, made empty()->characters() return a non-null value to match JSC. + (WebCore::StringImpl::createUninitialized): Added overflow check. + (WebCore::StringImpl::create): Reordered in file. + (WebCore::StringImpl::sharedBuffer): Reordered in file. + * platform/text/StringImpl.h: + (WebCore::StringImpl::): Remove ThreadGlobalData as friend, move SharableUChar & SharedUChar to WebCore namespace. + (WebCore::StringImpl::StringImpl): Made static constructor method (used to create empty string) take arguments, to match JSC & prevent accidental use. + (WebCore::StringImpl::setHash): Added missing ASSERT. + (WebCore::StringImpl::adopt): Make adpot work with Vectors with a non-zero inline capacity. + (WebCore::StringImpl::characters): Mark as const to match JSC. + (WebCore::StringImpl::hash): Use !m_hash instead of m_hash == 0. + (WebCore::StringImpl::computeHash): Remove redundant 'inline'. + +2010-03-11 Mark Rowe + + Reviewed by David Kilzer. + + Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version + + Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version. + + * Configurations/Base.xcconfig: + +2010-03-11 Jungshik Shin + + [Chromium]: Plane 2 characters are rendered "blank" + (not even empty boxes) on Windows even when there are fonts to + cover them. + + https://bugs.webkit.org/show_bug.cgi?id=35605 + + Test:LayoutTests/fast/text/international/plane2.html + + * platform/graphics/chromium/FontCacheChromiumWin.cpp: + (WebCore::LookupAltName): Add two ExtB fonts to the array (namePairs) that are used for Plane 2 character rendering. + (WebCore::FontCache::getFontDataForCharacters): Add two more fonts to the fallback font list + * platform/graphics/chromium/FontUtilsChromiumWin.cpp: + (WebCore::getFallbackFamily): Fix the fallback font lookup to cover Plane 2 (CJK ExtB). + +2010-03-11 Leandro Pereira + + Reviewed by Holger Freyther. + + Add EFL port files to platform/efl. + http://webkit.org/b/35889 + + * platform/efl/SystemTimeEfl.cpp: Added. + +2010-03-11 Mark Rowe + + Reviewed by Tim Hatcher. + + Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version + + Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted. It defaults to the + current Mac OS X version unless otherwise specified. + + Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR. + + Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice + may not be usable when targetting a different Mac OS X version. + + Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off + MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used. + + * Configurations/Base.xcconfig: + * Configurations/DebugRelease.xcconfig: + * Configurations/FeatureDefines.xcconfig: + * Configurations/Version.xcconfig: + * Configurations/WebCore.xcconfig: + +2010-03-11 Anders Carlsson + + Reviewed by David Hyatt. + + Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents. + + * loader/EmptyClients.h: + * page/Chrome.cpp: + * page/Chrome.h: + * page/ChromeClient.h: + * platform/HostWindow.h: + +2010-03-11 Nate Chapin + + Reviewed by Dimitri Glazkov. + + [V8] Remove DOMObjectsInclude.h and update headers accordingly. + + https://bugs.webkit.org/show_bug.cgi?id=36036 + + * WebCore.gypi: + * bindings/v8/DOMData.h: + * bindings/v8/DOMDataStore.h: + * bindings/v8/DOMObjectsInclude.h: Removed. + * bindings/v8/V8DOMMap.cpp: + * bindings/v8/V8DOMWindowShell.cpp: + * bindings/v8/V8DOMWrapper.cpp: + * bindings/v8/V8GCController.cpp: + * bindings/v8/V8Proxy.cpp: + +2010-03-11 Simon Fraser + + Reviewed by Mark Rowe. + + Remove duplicate entries revealed after sorting. + + * WebCore.xcodeproj/project.pbxproj: + +2010-03-11 Simon Fraser + + Reviewed by Mark Rowe. + + Sort the project file (also removing some bogus spaces that caused Xcode to rewrite the file + every time you opened it). + + * WebCore.xcodeproj/project.pbxproj: + +2010-03-11 Nate Chapin + + Reviewed by Dimitri Glazkov. + + Fix style issues and improve comments from + http://trac.webkit.org/changeset/55853. + + https://bugs.webkit.org/show_bug.cgi?id=36029 + + * platform/animation/TimingFunction.h: + (WebCore::TimingFunction::TimingFunction): + +2010-03-11 Chris Fleizach + + Reviewed by Beth Dakin. + + accessibilityIsIgnoredBase() needs to respect when platform says include + https://bugs.webkit.org/show_bug.cgi?id=36025 + + Changed accessibilityIsIgnoredBase() to return a policy instead of a yes/no + answer. This allows the platform to make a yes decision on an element. + + * accessibility/AccessibilityList.cpp: + (WebCore::AccessibilityList::accessibilityIsIgnored): + * accessibility/AccessibilityListBox.cpp: + (WebCore::AccessibilityListBox::accessibilityIsIgnored): + * accessibility/AccessibilityObject.h: + (WebCore::): + (WebCore::AccessibilityObject::accessibilityIgnoreAttachment): + (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase): + (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): + * accessibility/AccessibilityRenderObject.h: + * accessibility/AccessibilitySlider.cpp: + (WebCore::AccessibilitySlider::accessibilityIsIgnored): + * accessibility/AccessibilityTable.cpp: + (WebCore::AccessibilityTable::accessibilityIsIgnored): + * accessibility/AccessibilityTableCell.cpp: + (WebCore::AccessibilityTableCell::accessibilityIsIgnored): + * accessibility/AccessibilityTableRow.cpp: + (WebCore::AccessibilityTableRow::accessibilityIsIgnored): + * accessibility/chromium/AccessibilityObjectChromium.cpp: + (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): + * accessibility/gtk/AccessibilityObjectAtk.cpp: + (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): + * accessibility/mac/AccessibilityObjectMac.mm: + (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): + * accessibility/qt/AccessibilityObjectQt.cpp: + (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): + * accessibility/win/AccessibilityObjectWin.cpp: + (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): + * accessibility/wx/AccessibilityObjectWx.cpp: + (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): + +2010-03-11 Kenneth Russell + + Reviewed by Dimitri Glazkov. + + Fix build breakage with ENABLE_3D_CANVAS=0 + https://bugs.webkit.org/show_bug.cgi?id=35995 + + No new tests; verified in Chromium that WebGL is disabled in + ENABLE_3D_CANVAS=0 builds. + + * bindings/v8/custom/V8DocumentCustom.cpp: + * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp: + +2010-03-11 Nate Chapin + + Unreviewed, Chromium mac build fix. + + Add an explicit copy constructor to TimingFunction. + http://trac.webkit.org/changeset/55835 trigged an inlining + bug in gcc that the copy constructor resolves. + + * platform/animation/TimingFunction.h: + (WebCore::TimingFunction::TimingFunction): + +2010-03-11 Chris Fleizach + + Fixing GTK. No review. + + support lang attribute on