diff options
258 files changed, 4483 insertions, 1536 deletions
@@ -1,3 +1,55 @@ +2012-11-26 Laszlo Gombos <l.gombos@samsung.com> + + [CMake] Allow user specified compiler flags to take precedence + https://bugs.webkit.org/show_bug.cgi?id=103101 + + Reviewed by Brent Fulgham. + + Make sure that compiler and linker flags specified by the build system + are always prepended to the variables that can be specified by the + environment and the user as well. + + * Source/cmake/OptionsCommon.cmake: + * Source/cmake/OptionsWindows.cmake: + * Source/cmake/WebKitHelpers.cmake: + +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Protect the new feature behind a feature flag. + + * Source/cmake/WebKitFeatures.cmake: + * Source/cmakeconfig.h.cmake: + * configure.ac: + +2012-11-23 Patrick Gansterer <paroga@webkit.org> + + [CMake] Add support for winflexbison distribution + https://bugs.webkit.org/show_bug.cgi?id=102551 + + Reviewed by Laszlo Gombos. + + Since GnuWin32 does not provide recent versions of bision and flex supporting + the alternative winflexbison distribution is the prefered option. + + * Source/cmake/WebKitMacros.cmake: + +2012-11-23 Laszlo Gombos <l.gombos@samsung.com> + + [EFL] Define WTF_PLATFORM_EFL in Platform.h + https://bugs.webkit.org/show_bug.cgi?id=101482 + + Reviewed by Kenneth Rohde Christiansen. + + Remove the definition of WTF_PLATFORM_EFL from the build system to + make the EFL port consistent with other ports. + + * Source/cmake/OptionsEfl.cmake: + 2012-11-23 Krzysztof Czech <k.czech@samsung.com> [EFL] Platform support for Accessibility feature. diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index 6172c5531..ba2979bc2 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,78 @@ +2012-11-21 Filip Pizlo <fpizlo@apple.com> + + Any function that can log things should be able to easily log them to a memory buffer as well + https://bugs.webkit.org/show_bug.cgi?id=103000 + + Reviewed by Sam Weinig. + + Change all users of WTF::dataFile() to expect a PrintStream& rather than a FILE*. + + * bytecode/Operands.h: + (JSC::OperandValueTraits::dump): + (JSC::dumpOperands): + (JSC): + * dfg/DFGAbstractState.cpp: + (JSC::DFG::AbstractState::dump): + * dfg/DFGAbstractState.h: + (AbstractState): + * dfg/DFGAbstractValue.h: + (JSC::DFG::AbstractValue::dump): + * dfg/DFGCommon.h: + (JSC::DFG::NodeIndexTraits::dump): + * dfg/DFGStructureAbstractValue.h: + (JSC::DFG::StructureAbstractValue::dump): + * dfg/DFGVariableEvent.cpp: + (JSC::DFG::VariableEvent::dump): + (JSC::DFG::VariableEvent::dumpFillInfo): + (JSC::DFG::VariableEvent::dumpSpillInfo): + * dfg/DFGVariableEvent.h: + (VariableEvent): + * disassembler/Disassembler.h: + (JSC): + (JSC::tryToDisassemble): + * disassembler/UDis86Disassembler.cpp: + (JSC::tryToDisassemble): + +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Protect the new feature behind a feature flag. + + * Configurations/FeatureDefines.xcconfig: + +2012-11-23 Gabor Ballabas <gaborb@inf.u-szeged.hu> + + Fix the ARM traditional build after r135330 + https://bugs.webkit.org/show_bug.cgi?id=102871 + + Reviewed by Zoltan Herczeg. + + Added missing functionality to traditional ARM architecture. + + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::revertJump): + (ARMAssembler): + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::startOfPatchableBranchPtrWithPatchOnAddress): + (JSC::MacroAssemblerARM::startOfBranchPtrWithPatchOnRegister): + (MacroAssemblerARM): + (JSC::MacroAssemblerARM::revertJumpReplacementToBranchPtrWithPatch): + +2012-11-16 Yury Semikhatsky <yurys@chromium.org> + + Memory instrumentation: extract MemoryObjectInfo declaration into a separate file + https://bugs.webkit.org/show_bug.cgi?id=102510 + + Reviewed by Pavel Feldman. + + Added new symbols for the methods that have moved into .../wtf/MemoryInstrumentation.cpp + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + 2012-11-23 Julien BRIANCEAU <jbrianceau@nds.com> [sh4] JavaScriptCore JIT build is broken since r130839 diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig index 0e1b15340..588ddb80b 100644 --- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig +++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig @@ -48,6 +48,7 @@ ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS; ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS; ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION; ENABLE_CSS_VARIABLES = ; +ENABLE_CSS3_BACKGROUND = ; ENABLE_CSS3_CONDITIONAL_RULES = ; ENABLE_CSS3_TEXT = ; ENABLE_CUSTOM_SCHEME_HANDLER = ; @@ -157,4 +158,5 @@ ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); + diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def index 94b8c2371..7aa5673d8 100755 --- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def +++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def @@ -12,6 +12,7 @@ EXPORTS ??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z ??0ErrorHandlingMode@Interpreter@JSC@@QAE@PAVExecState@2@@Z ??1ErrorHandlingMode@Interpreter@JSC@@QAE@XZ + ??0InstrumentedPointerBase@MemoryInstrumentation@WTF@@QAE@PAVMemoryObjectInfo@2@@Z ??0InternalFunction@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@@Z ??0JSGlobalObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@PBUGlobalObjectMethodTable@1@@Z ??0JSLockHolder@JSC@@QAE@AAVJSGlobalData@1@@Z @@ -19,6 +20,7 @@ EXPORTS ??0JSLockHolder@JSC@@QAE@PAVJSGlobalData@1@@Z ??0MD5@WTF@@QAE@XZ ??0MediaTime@WTF@@QAE@_JHI@Z + ??0MemoryInstrumentation@WTF@@QAE@PAVMemoryInstrumentationClient@1@@Z ??0Mutex@WTF@@QAE@XZ ??0ParallelEnvironment@WTF@@QAE@P6AXPAX@ZIH@Z ??0RefCountedLeakCounter@WTF@@QAE@PBD@Z @@ -38,6 +40,7 @@ EXPORTS ??1JSGlobalObject@JSC@@QAE@XZ ??1JSLockHolder@JSC@@QAE@XZ ??1MediaTime@WTF@@QAE@XZ + ??1MemoryInstrumentation@WTF@@UAE@XZ ??1Mutex@WTF@@QAE@XZ ??1RefCountedLeakCounter@WTF@@QAE@XZ ??1SourceProviderCache@JSC@@QAE@XZ @@ -65,6 +68,8 @@ EXPORTS ?addPropertyTransition@Structure@JSC@@SAPAV12@AAVJSGlobalData@2@PAV12@VPropertyName@2@IPAVJSCell@2@AAH@Z ?addPropertyTransitionToExistingStructure@Structure@JSC@@SAPAV12@PAV12@VPropertyName@2@IPAVJSCell@2@AAH@Z ?addPropertyWithoutTransition@Structure@JSC@@QAEHAAVJSGlobalData@2@VPropertyName@2@IPAVJSCell@2@@Z + ?addPrivateBuffer@MemoryClassInfo@WTF@@QAEXIPBD@Z + ?addRawBuffer@MemoryClassInfo@WTF@@QAEXABQBXI@Z ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVJSGlobalData@2@PAVStringImpl@4@@Z ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z @@ -94,6 +99,7 @@ EXPORTS ?callHostFunctionAsConstructor@JSC@@YI_JPAVExecState@1@@Z ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z ?callOnMainThreadAndWait@WTF@@YAXP6AXPAX@Z0@Z + ?callReportObjectInfo@MemoryInstrumentation@WTF@@CAXPAVMemoryObjectInfo@2@PBXPBDI@Z ?cancelCallOnMainThread@WTF@@YAXP6AXPAX@Z0@Z ?canShrink@StringBuilder@WTF@@QBE_NXZ ?capacity@Heap@JSC@@QAEIXZ @@ -220,6 +226,7 @@ EXPORTS ?getCallData@JSCell@JSC@@SA?AW4CallType@2@PAV12@AATCallData@2@@Z ?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ + ?getObjectType@MemoryInstrumentation@WTF@@CAPBDPAVMemoryObjectInfo@2@@Z ?getOwnNonIndexPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z ?getOwnNonIndexPropertyNames@JSSymbolTableObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@SA_NPAVJSObject@2@PAVExecState@2@VPropertyName@2@AAVPropertyDescriptor@2@@Z @@ -251,6 +258,7 @@ EXPORTS ?indefiniteTime@MediaTime@WTF@@SAABV12@XZ ?init@AtomicString@WTF@@SAXXZ ?init@JSGlobalObject@JSC@@AAEXPAVJSObject@2@@Z + ?init@MemoryClassInfo@WTF@@AAEXPBXPBDI@Z ?initialize@double_conversion@WTF@@YAXXZ ?initializeMainThread@WTF@@YAXXZ ?initializeThreading@JSC@@YAXXZ @@ -292,6 +300,7 @@ EXPORTS ?parseDateFromNullTerminatedCharacters@WTF@@YANPBD@Z ?parseDoubleFromLongString@Internal@WTF@@YANPB_WIAAI@Z ?positiveInfiniteTime@MediaTime@WTF@@SAABV12@XZ + ?process@InstrumentedPointerBase@MemoryInstrumentation@WTF@@QAEXPAV23@@Z ?profiler@Profiler@JSC@@SAPAV12@XZ ?protect@Heap@JSC@@QAEXVJSValue@2@@Z ?protectedGlobalObjectCount@Heap@JSC@@QAEIXZ diff --git a/Source/JavaScriptCore/assembler/ARMAssembler.h b/Source/JavaScriptCore/assembler/ARMAssembler.h index 38d0c5e6d..ebab46d98 100644 --- a/Source/JavaScriptCore/assembler/ARMAssembler.h +++ b/Source/JavaScriptCore/assembler/ARMAssembler.h @@ -402,6 +402,13 @@ namespace JSC { emitInstruction(toARMWord(cc) | MOV | SetConditionalCodes, rd, ARMRegisters::r0, op2); } + static void revertJump(void* instructionStart, RegisterID rd, ARMWord imm) + { + ARMWord* insn = reinterpret_cast<ARMWord*>(instructionStart); + ARMWord* address = getLdrImmAddress(insn); + *address = imm; + } + void bic(int rd, int rn, ARMWord op2, Condition cc = AL) { emitInstruction(toARMWord(cc) | BIC, rd, rn, op2); diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h index 0ebdbda0c..9c77e9349 100644 --- a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h +++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h @@ -1268,12 +1268,22 @@ public: static bool canJumpReplacePatchableBranchPtrWithPatch() { return false; } - static CodeLocationLabel startOfPatchableBranchPtrWithPatch(CodeLocationDataLabelPtr label) + static CodeLocationLabel startOfPatchableBranchPtrWithPatchOnAddress(CodeLocationDataLabelPtr) { UNREACHABLE_FOR_PLATFORM(); return CodeLocationLabel(); } + static CodeLocationLabel startOfBranchPtrWithPatchOnRegister(CodeLocationDataLabelPtr label) + { + return label.labelAtOffset(0); + } + + static void revertJumpReplacementToBranchPtrWithPatch(CodeLocationLabel instructionStart, RegisterID reg, void* initialValue) + { + ARMAssembler::revertJump(instructionStart.dataLocation(), reg, reinterpret_cast<uintptr_t>(initialValue) & 0xffff); + } + static void revertJumpReplacementToPatchableBranchPtrWithPatch(CodeLocationLabel instructionStart, Address, void* initialValue) { UNREACHABLE_FOR_PLATFORM(); diff --git a/Source/JavaScriptCore/bytecode/Operands.h b/Source/JavaScriptCore/bytecode/Operands.h index 0cea096cf..20f79ffd1 100644 --- a/Source/JavaScriptCore/bytecode/Operands.h +++ b/Source/JavaScriptCore/bytecode/Operands.h @@ -28,7 +28,7 @@ #include "CallFrame.h" #include "JSObject.h" - +#include <wtf/PrintStream.h> #include <wtf/Vector.h> namespace JSC { @@ -43,7 +43,7 @@ template<typename T> struct OperandValueTraits; template<typename T> struct OperandValueTraits { static T defaultValue() { return T(); } - static void dump(const T& value, FILE* out) { value.dump(out); } + static void dump(const T& value, PrintStream& out) { value.dump(out); } }; template<typename T, typename Traits = OperandValueTraits<T> > @@ -190,17 +190,17 @@ private: }; template<typename T, typename Traits> -void dumpOperands(const Operands<T, Traits>& operands, FILE* out) +void dumpOperands(const Operands<T, Traits>& operands, PrintStream& out) { for (size_t argument = 0; argument < operands.numberOfArguments(); ++argument) { if (argument) - fprintf(out, " "); + out.printf(" "); Traits::dump(operands.argument(argument), out); } - fprintf(out, " : "); + out.printf(" : "); for (size_t local = 0; local < operands.numberOfLocals(); ++local) { if (local) - fprintf(out, " "); + out.printf(" "); Traits::dump(operands.local(local), out); } } diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp index 23b84cedf..89b2a971b 100644 --- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp +++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp @@ -1942,7 +1942,7 @@ inline bool AbstractState::mergeVariableBetweenBlocks(AbstractValue& destination return destination.merge(source); } -void AbstractState::dump(FILE* out) +void AbstractState::dump(PrintStream& out) { bool first = true; for (size_t i = 0; i < m_block->size(); ++i) { @@ -1953,8 +1953,8 @@ void AbstractState::dump(FILE* out) if (first) first = false; else - fprintf(out, " "); - fprintf(out, "@%lu:", static_cast<unsigned long>(index)); + out.printf(" "); + out.printf("@%lu:", static_cast<unsigned long>(index)); value.dump(out); } } diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.h b/Source/JavaScriptCore/dfg/DFGAbstractState.h index 230cd836c..40dc50248 100644 --- a/Source/JavaScriptCore/dfg/DFGAbstractState.h +++ b/Source/JavaScriptCore/dfg/DFGAbstractState.h @@ -180,7 +180,7 @@ public: // MergeToSuccessors. bool mergeToSuccessors(Graph&, BasicBlock*); - void dump(FILE* out); + void dump(PrintStream& out); private: void clobberWorld(const CodeOrigin&, unsigned indexInBlock); diff --git a/Source/JavaScriptCore/dfg/DFGAbstractValue.h b/Source/JavaScriptCore/dfg/DFGAbstractValue.h index c60b792f6..fd3220494 100644 --- a/Source/JavaScriptCore/dfg/DFGAbstractValue.h +++ b/Source/JavaScriptCore/dfg/DFGAbstractValue.h @@ -371,15 +371,15 @@ struct AbstractValue { // complexity of the code. } - void dump(FILE* out) const + void dump(PrintStream& out) const { - fprintf(out, "(%s, %s, ", speculationToString(m_type), arrayModesToString(m_arrayModes)); + out.printf("(%s, %s, ", speculationToString(m_type), arrayModesToString(m_arrayModes)); m_currentKnownStructure.dump(out); - dataLogF(", "); + out.printf(", "); m_futurePossibleStructure.dump(out); if (!!m_value) - fprintf(out, ", %s", m_value.description()); - fprintf(out, ")"); + out.printf(", %s", m_value.description()); + out.printf(")"); } // A great way to think about the difference between m_currentKnownStructure and diff --git a/Source/JavaScriptCore/dfg/DFGCommon.h b/Source/JavaScriptCore/dfg/DFGCommon.h index 2c0556d60..14c47cefc 100644 --- a/Source/JavaScriptCore/dfg/DFGCommon.h +++ b/Source/JavaScriptCore/dfg/DFGCommon.h @@ -92,12 +92,12 @@ static const BlockIndex NoBlock = UINT_MAX; struct NodeIndexTraits { static NodeIndex defaultValue() { return NoNode; } - static void dump(NodeIndex value, FILE* out) + static void dump(NodeIndex value, PrintStream& out) { if (value == NoNode) - fprintf(out, "-"); + out.printf("-"); else - fprintf(out, "@%u", value); + out.printf("@%u", value); } }; diff --git a/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h index b3082de1a..25606b9be 100644 --- a/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h +++ b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h @@ -298,17 +298,17 @@ public: return m_structure == other.m_structure; } - void dump(FILE* out) const + void dump(PrintStream& out) const { if (isTop()) { - fprintf(out, "TOP"); + out.printf("TOP"); return; } - fprintf(out, "["); + out.printf("["); if (m_structure) - fprintf(out, "%p", m_structure); - fprintf(out, "]"); + out.printf("%p", m_structure); + out.printf("]"); } private: diff --git a/Source/JavaScriptCore/dfg/DFGVariableEvent.cpp b/Source/JavaScriptCore/dfg/DFGVariableEvent.cpp index 3e84a6ba1..8ea568b23 100644 --- a/Source/JavaScriptCore/dfg/DFGVariableEvent.cpp +++ b/Source/JavaScriptCore/dfg/DFGVariableEvent.cpp @@ -33,11 +33,11 @@ namespace JSC { namespace DFG { -void VariableEvent::dump(FILE* out) const +void VariableEvent::dump(PrintStream& out) const { switch (kind()) { case Reset: - fprintf(out, "Reset"); + out.printf("Reset"); break; case BirthToFill: dumpFillInfo("BirthToFill", out); @@ -52,13 +52,13 @@ void VariableEvent::dump(FILE* out) const dumpSpillInfo("Spill", out); break; case Death: - fprintf(out, "Death(@%u)", nodeIndex()); + out.printf("Death(@%u)", nodeIndex()); break; case MovHint: - fprintf(out, "MovHint(@%u, r%d)", nodeIndex(), operand()); + out.printf("MovHint(@%u, r%d)", nodeIndex(), operand()); break; case SetLocalEvent: - fprintf(out, "SetLocal(r%d, %s)", operand(), dataFormatToString(dataFormat())); + out.printf("SetLocal(r%d, %s)", operand(), dataFormatToString(dataFormat())); break; default: ASSERT_NOT_REACHED(); @@ -66,23 +66,23 @@ void VariableEvent::dump(FILE* out) const } } -void VariableEvent::dumpFillInfo(const char* name, FILE* out) const +void VariableEvent::dumpFillInfo(const char* name, PrintStream& out) const { - fprintf(out, "%s(@%u, ", name, nodeIndex()); + out.printf("%s(@%u, ", name, nodeIndex()); if (dataFormat() == DataFormatDouble) - fprintf(out, "%s", FPRInfo::debugName(fpr())); + out.printf("%s", FPRInfo::debugName(fpr())); #if USE(JSVALUE32_64) else if (dataFormat() & DataFormatJS) - fprintf(out, "%s:%s", GPRInfo::debugName(tagGPR()), GPRInfo::debugName(payloadGPR())); + out.printf("%s:%s", GPRInfo::debugName(tagGPR()), GPRInfo::debugName(payloadGPR())); #endif else - fprintf(out, "%s", GPRInfo::debugName(gpr())); - fprintf(out, ", %s)", dataFormatToString(dataFormat())); + out.printf("%s", GPRInfo::debugName(gpr())); + out.printf(", %s)", dataFormatToString(dataFormat())); } -void VariableEvent::dumpSpillInfo(const char* name, FILE* out) const +void VariableEvent::dumpSpillInfo(const char* name, PrintStream& out) const { - fprintf(out, "%s(@%u, r%d, %s)", name, nodeIndex(), virtualRegister(), dataFormatToString(dataFormat())); + out.printf("%s(@%u, r%d, %s)", name, nodeIndex(), virtualRegister(), dataFormatToString(dataFormat())); } } } // namespace JSC::DFG diff --git a/Source/JavaScriptCore/dfg/DFGVariableEvent.h b/Source/JavaScriptCore/dfg/DFGVariableEvent.h index a491a3ebf..0d1fe0a99 100644 --- a/Source/JavaScriptCore/dfg/DFGVariableEvent.h +++ b/Source/JavaScriptCore/dfg/DFGVariableEvent.h @@ -240,11 +240,11 @@ public: const VariableRepresentation& variableRepresentation() const { return u; } - void dump(FILE*) const; + void dump(PrintStream&) const; private: - void dumpFillInfo(const char* name, FILE*) const; - void dumpSpillInfo(const char* name, FILE*) const; + void dumpFillInfo(const char* name, PrintStream&) const; + void dumpSpillInfo(const char* name, PrintStream&) const; NodeIndex m_index; diff --git a/Source/JavaScriptCore/disassembler/Disassembler.cpp b/Source/JavaScriptCore/disassembler/Disassembler.cpp index 84bf2ec17..3fed2cdab 100644 --- a/Source/JavaScriptCore/disassembler/Disassembler.cpp +++ b/Source/JavaScriptCore/disassembler/Disassembler.cpp @@ -31,12 +31,12 @@ namespace JSC { -void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, FILE* out) +void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out) { if (tryToDisassemble(codePtr, size, prefix, out)) return; - fprintf(out, "%sdisassembly not available for range %p...%p\n", prefix, codePtr.executableAddress(), static_cast<char*>(codePtr.executableAddress()) + size); + out.printf("%sdisassembly not available for range %p...%p\n", prefix, codePtr.executableAddress(), static_cast<char*>(codePtr.executableAddress()) + size); } } // namespace JSC diff --git a/Source/JavaScriptCore/disassembler/Disassembler.h b/Source/JavaScriptCore/disassembler/Disassembler.h index b87f3d33a..a087a657b 100644 --- a/Source/JavaScriptCore/disassembler/Disassembler.h +++ b/Source/JavaScriptCore/disassembler/Disassembler.h @@ -26,18 +26,17 @@ #ifndef Disassembler_h #define Disassembler_h -#include <stdio.h> #include <wtf/Platform.h> -#include <wtf/StdLibExtras.h> +#include <wtf/PrintStream.h> namespace JSC { class MacroAssemblerCodePtr; #if ENABLE(DISASSEMBLER) -bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, FILE* out); +bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, PrintStream&); #else -inline bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char*, FILE*) +inline bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char*, PrintStream&) { return false; } @@ -45,7 +44,7 @@ inline bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char*, // Prints either the disassembly, or a line of text indicating that disassembly failed and // the range of machine code addresses. -void disassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, FILE* out); +void disassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, PrintStream& out); } // namespace JSC diff --git a/Source/JavaScriptCore/disassembler/UDis86Disassembler.cpp b/Source/JavaScriptCore/disassembler/UDis86Disassembler.cpp index b6baed4a2..63c235b92 100644 --- a/Source/JavaScriptCore/disassembler/UDis86Disassembler.cpp +++ b/Source/JavaScriptCore/disassembler/UDis86Disassembler.cpp @@ -33,7 +33,7 @@ namespace JSC { -bool tryToDisassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, FILE* out) +bool tryToDisassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out) { ud_t disassembler; ud_init(&disassembler); @@ -50,7 +50,7 @@ bool tryToDisassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const c while (ud_disassemble(&disassembler)) { char pcString[20]; snprintf(pcString, sizeof(pcString), "0x%lx", static_cast<unsigned long>(currentPC)); - fprintf(out, "%s%16s: %s\n", prefix, pcString, ud_insn_asm(&disassembler)); + out.printf("%s%16s: %s\n", prefix, pcString, ud_insn_asm(&disassembler)); currentPC = disassembler.pc; } diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog index 39d9ad1fb..5dd0e9b82 100644 --- a/Source/WTF/ChangeLog +++ b/Source/WTF/ChangeLog @@ -1,3 +1,179 @@ +2012-11-24 Adam Barth <abarth@webkit.org> + + Chromium should use TCMalloc on Mac to go fast + https://bugs.webkit.org/show_bug.cgi?id=102866 + + Reviewed by Eric Seidel. + + This patch enables TCMalloc for some WebKit objects. It improves + dom-modify on Mac by 5-10%. + + On non-Mac platforms, Chromium already uses TCMalloc throughout the + project. Unfortunately, we haven't yet figured out how to turn TCMalloc + on globally on Mac because the approach we use for other platforms makes + some OS X APIs sad. + + The next best thing would be to enable TCMalloc for WebKit by + overriding the global new and delete operator, as is done on apple-mac + and other platforms. Unfortunately, we cannot use that approach either + because the Chromium WebKit API is not memory tight. + + Fortunately, WebKit has a mechanism for selectively enabling TCMalloc + for a selection of objects by overriding the new and delete operators + on those objects. This patch opts chromium-mac into that scheme by + setting the appropriate preprocessor macros. + + * WTF.gyp/WTF.gyp: + * wtf/Platform.h: + +2012-11-21 Filip Pizlo <fpizlo@apple.com> + + Any function that can log things should be able to easily log them to a memory buffer as well + https://bugs.webkit.org/show_bug.cgi?id=103000 + + Reviewed by Sam Weinig. + + We have a number of places where we pass around a FILE* as a target to which to print + some logging information. But the purpose of passing FILE* instead of always assuming + that we should dump to stderr is that it may be sometimes useful to send the logging + information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome + to use it to send logging to a string, for example. + + We could get around this by using <iostream> and <sstream>, but so far this aspect of + C++ has not been part of the WebKit coding conventions. Personally I find <iostream> + awkward due to its abuse of operator overloading. + + So this patch introduces the PrintStream abstract class, which offers printf-like + functionality while completely abstracting the destination and mechanism of the printing + output. It would be trivial to implement a StringPrintStream, for example. This will feed + into work on https://bugs.webkit.org/show_bug.cgi?id=102999. + + This also sets us up for creating templatized print() and println() methods that will + allow us to say things like out.print("count = ", count, "\n"), but that is the topic + of https://bugs.webkit.org/show_bug.cgi?id=103009. + + This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile() + now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed + to expect a PrintStream&. + + * GNUmakefile.list.am: + * WTF.pro: + * WTF.vcproj/WTF.vcproj: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/DataLog.cpp: + (WTF): + (WTF::initializeLogFileOnce): + (WTF::initializeLogFile): + (WTF::dataFile): + (WTF::dataLogV): + (WTF::dataLogString): + * wtf/DataLog.h: + (WTF): + * wtf/FilePrintStream.cpp: Added. + (WTF): + (WTF::FilePrintStream::FilePrintStream): + (WTF::FilePrintStream::~FilePrintStream): + (WTF::FilePrintStream::vprintf): + (WTF::FilePrintStream::flush): + * wtf/FilePrintStream.h: Added. + (WTF): + (FilePrintStream): + (WTF::FilePrintStream::file): + * wtf/PrintStream.cpp: Added. + (WTF): + (WTF::PrintStream::PrintStream): + (WTF::PrintStream::~PrintStream): + (WTF::PrintStream::printf): + (WTF::PrintStream::print): + (WTF::PrintStream::println): + (WTF::PrintStream::flush): + (WTF::print): + * wtf/PrintStream.h: Added. + (WTF): + (PrintStream): + (WTF::print): + (WTF::println): + +2012-11-23 Robert Kroeger <rjkroege@chromium.org> + + Remove unused ScrollByPixelVelocity + https://bugs.webkit.org/show_bug.cgi?id=102840 + + Reviewed by Sam Weinig. + + The GESTURE_ANIMATION feature turns on code in WebCore is unused. + Remove it. + + No new tests: code removal/cleanup. + + * wtf/Platform.h: + +2012-11-23 Laszlo Gombos <l.gombos@samsung.com> + + [EFL] Define WTF_PLATFORM_EFL in Platform.h + https://bugs.webkit.org/show_bug.cgi?id=101482 + + Reviewed by Kenneth Rohde Christiansen. + + Define WTF_PLATFORM_EFL in Platform.h to be consistent with + other ports. + + * wtf/Platform.h: + +2012-11-16 Yury Semikhatsky <yurys@chromium.org> + + Memory instrumentation: extract MemoryObjectInfo declaration into a separate file + https://bugs.webkit.org/show_bug.cgi?id=102510 + + Reviewed by Pavel Feldman. + + Moved MemoryObjectInfo into separate header. Moved definition of MemoryInstrumentation + methods that depend on MemoryObjectInfo declaration into MemoryInstrumentation.cpp to + make MemoryInstrumentation require only forward declaration of MemoryObjectInfo. + + * GNUmakefile.list.am: + * WTF.gypi: + * WTF.pro: + * WTF.vcproj/WTF.vcproj: + * wtf/CMakeLists.txt: + * wtf/MemoryInstrumentation.cpp: Added. + (WTF): + (WTF::MemoryInstrumentation::MemoryInstrumentation): + (WTF::MemoryInstrumentation::~MemoryInstrumentation): + (WTF::MemoryInstrumentation::getObjectType): this method allows to get object type without + pulling in MemoryObjectInfo.h and all its dependencies. + (WTF::MemoryInstrumentation::callReportObjectInfo): + (WTF::MemoryInstrumentation::InstrumentedPointerBase::InstrumentedPointerBase): + (WTF::MemoryInstrumentation::InstrumentedPointerBase::process): + (WTF::MemoryClassInfo::init): + (WTF::MemoryClassInfo::addRawBuffer): + (WTF::MemoryClassInfo::addPrivateBuffer): + * wtf/MemoryInstrumentation.h: + (MemoryInstrumentation): + (WTF::MemoryInstrumentation::addRootObject): + (InstrumentedPointerBase): + (WTF::MemoryInstrumentation::reportObjectMemoryUsage): + (InstrumentedPointer): + (WTF::MemoryInstrumentation::addObject): we now pass owner's MemoryObjectInfo in all places + where we report objects pointed by the owner. + (WTF::MemoryInstrumentation::OwningTraits::addObject): + (WTF::MemoryClassInfo::MemoryClassInfo): + (WTF::MemoryClassInfo::addMember): + (MemoryClassInfo): + (WTF::MemoryInstrumentation::addObjectImpl): + (WTF::::InstrumentedPointer): + (WTF::::callReportMemoryUsage): + * wtf/MemoryObjectInfo.h: Added. + (WTF): + (MemoryObjectInfo): + (WTF::MemoryObjectInfo::MemoryObjectInfo): + (WTF::MemoryObjectInfo::objectType): + (WTF::MemoryObjectInfo::objectSize): + (WTF::MemoryObjectInfo::reportedPointer): + (WTF::MemoryObjectInfo::memoryInstrumentation): + (WTF::MemoryObjectInfo::reportObjectInfo): + 2012-11-23 Krzysztof Czech <k.czech@samsung.com> [EFL] Platform support for Accessibility feature. diff --git a/Source/WTF/GNUmakefile.list.am b/Source/WTF/GNUmakefile.list.am index 9d4f0d7e5..a9337b789 100644 --- a/Source/WTF/GNUmakefile.list.am +++ b/Source/WTF/GNUmakefile.list.am @@ -47,6 +47,8 @@ wtf_sources += \ Source/WTF/wtf/FastBitVector.h \ Source/WTF/wtf/FastMalloc.cpp \ Source/WTF/wtf/FastMalloc.h \ + Source/WTF/wtf/FilePrintStream.cpp \ + Source/WTF/wtf/FilePrintStream.h \ Source/WTF/wtf/FixedArray.h \ Source/WTF/wtf/Float32Array.h \ Source/WTF/wtf/Float64Array.h \ @@ -80,6 +82,7 @@ wtf_sources += \ Source/WTF/wtf/MathExtras.h \ Source/WTF/wtf/MediaTime.h \ Source/WTF/wtf/MediaTime.cpp \ + Source/WTF/wtf/MemoryInstrumentation.cpp \ Source/WTF/wtf/MemoryInstrumentation.h \ Source/WTF/wtf/MemoryInstrumentationArrayBufferView.h \ Source/WTF/wtf/MemoryInstrumentationHashCountedSet.h \ @@ -90,6 +93,7 @@ wtf_sources += \ Source/WTF/wtf/MemoryInstrumentationSequence.h \ Source/WTF/wtf/MemoryInstrumentationString.h \ Source/WTF/wtf/MemoryInstrumentationVector.h \ + Source/WTF/wtf/MemoryObjectInfo.h \ Source/WTF/wtf/MessageQueue.h \ Source/WTF/wtf/MetaAllocator.cpp \ Source/WTF/wtf/MetaAllocator.h \ @@ -126,6 +130,8 @@ wtf_sources += \ Source/WTF/wtf/PassTraits.h \ Source/WTF/wtf/Platform.h \ Source/WTF/wtf/PossiblyNull.h \ + Source/WTF/wtf/PrintStream.cpp \ + Source/WTF/wtf/PrintStream.h \ Source/WTF/wtf/RandomNumber.cpp \ Source/WTF/wtf/RandomNumber.h \ Source/WTF/wtf/RandomNumberSeed.h \ diff --git a/Source/WTF/WTF.gyp/WTF.gyp b/Source/WTF/WTF.gyp/WTF.gyp index 9aeb4e986..2a71b025f 100644 --- a/Source/WTF/WTF.gyp/WTF.gyp +++ b/Source/WTF/WTF.gyp/WTF.gyp @@ -65,9 +65,6 @@ # Turns on #if PLATFORM(CHROMIUM) 'BUILDING_CHROMIUM__=1', - # Controls wtf/FastMalloc - # FIXME: consider moving into config.h - 'USE_SYSTEM_MALLOC=1', ], 'conditions': [ ['OS=="win"', { @@ -83,7 +80,6 @@ }], ['OS=="mac"', { 'defines': [ - # Use USE_NEW_THEME on Mac. 'WTF_USE_NEW_THEME=1', ], }], @@ -130,7 +126,6 @@ ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx|Efl)\\.(cpp|mm)$'], ['exclude', 'wtf/OSRandomSource\\.cpp$'], ['exclude', 'wtf/MainThread.cpp$'], - ['exclude', 'wtf/TC.*\\.(cpp|h)$'], ], 'direct_dependent_settings': { 'include_dirs': [ @@ -181,6 +176,12 @@ }], ], }], + ['OS!="mac"', { + 'sources/': [ + # mac is the only OS that uses WebKit's copy of TCMalloc. + ['exclude', 'wtf/TC.*\\.(cpp|h)$'], + ], + }], ], }, ] diff --git a/Source/WTF/WTF.gypi b/Source/WTF/WTF.gypi index f54077d84..34b7f4b85 100644 --- a/Source/WTF/WTF.gypi +++ b/Source/WTF/WTF.gypi @@ -31,6 +31,7 @@ 'wtf/Encoder.h', 'wtf/FastAllocBase.h', 'wtf/FastMalloc.h', + 'wtf/FilePrintStream.h', 'wtf/FixedArray.h', 'wtf/Forward.h', 'wtf/Functional.h', @@ -50,6 +51,7 @@ 'wtf/MD5.h', 'wtf/MainThread.h', 'wtf/MathExtras.h', + 'wtf/MemoryInstrumentation.cpp', 'wtf/MemoryInstrumentation.h', 'wtf/MemoryInstrumentationArrayBufferView.h', 'wtf/MemoryInstrumentationHashCountedSet.h', @@ -60,6 +62,7 @@ 'wtf/MemoryInstrumentationSequence.h', 'wtf/MemoryInstrumentationString.h', 'wtf/MemoryInstrumentationVector.h', + 'wtf/MemoryObjectInfo.h', 'wtf/MessageQueue.h', 'wtf/NonCopyingSort.h', 'wtf/Noncopyable.h', @@ -80,6 +83,7 @@ 'wtf/Platform.h', 'wtf/Platform.h', 'wtf/PossiblyNull.h', + 'wtf/PrintStream.h', 'wtf/RandomNumber.h', 'wtf/RefCounted.h', 'wtf/RefCountedLeakCounter.h', @@ -155,6 +159,7 @@ 'wtf/DynamicAnnotations.cpp', 'wtf/DynamicAnnotations.h', 'wtf/FastMalloc.cpp', + 'wtf/FilePrintStream.cpp', 'wtf/Float32Array.h', 'wtf/Float64Array.h', 'wtf/GregorianDateTime.cpp', @@ -184,6 +189,7 @@ 'wtf/ParallelJobsGeneric.h', 'wtf/ParallelJobsLibdispatch.h', 'wtf/ParallelJobsOpenMP.h', + 'wtf/PrintStream.cpp', 'wtf/RandomNumber.cpp', 'wtf/RandomNumberSeed.h', 'wtf/RefCountedLeakCounter.cpp', diff --git a/Source/WTF/WTF.pro b/Source/WTF/WTF.pro index 8bd303b1c..90286c20b 100644 --- a/Source/WTF/WTF.pro +++ b/Source/WTF/WTF.pro @@ -61,6 +61,7 @@ HEADERS += \ ExportMacros.h \ FastAllocBase.h \ FastMalloc.h \ + FilePrintStream.h \ FixedArray.h \ Float32Array.h \ Float64Array.h \ @@ -97,6 +98,7 @@ HEADERS += \ MemoryInstrumentationSequence.h \ MemoryInstrumentationString.h \ MemoryInstrumentationVector.h \ + MemoryObjectInfo.h \ MessageQueue.h \ MetaAllocator.h \ MetaAllocatorHandle.h \ @@ -126,6 +128,7 @@ HEADERS += \ PassTraits.h \ Platform.h \ PossiblyNull.h \ + PrintStream.h \ RandomNumber.h \ RandomNumberSeed.h \ RedBlackTree.h \ @@ -207,6 +210,7 @@ SOURCES += \ dtoa/fixed-dtoa.cc \ dtoa/strtod.cc \ FastMalloc.cpp \ + FilePrintStream.cpp \ GregorianDateTime.cpp \ gobject/GOwnPtr.cpp \ gobject/GRefPtr.cpp \ @@ -214,6 +218,7 @@ SOURCES += \ MD5.cpp \ MainThread.cpp \ MediaTime.cpp \ + MemoryInstrumentation.cpp \ MetaAllocator.cpp \ NullPtr.cpp \ NumberOfCores.cpp \ @@ -224,6 +229,7 @@ SOURCES += \ PageAllocationAligned.cpp \ PageBlock.cpp \ ParallelJobsGeneric.cpp \ + PrintStream.cpp \ RandomNumber.cpp \ RefCountedLeakCounter.cpp \ SHA1.cpp \ diff --git a/Source/WTF/WTF.vcproj/WTF.vcproj b/Source/WTF/WTF.vcproj/WTF.vcproj index ed219e732..73024bd15 100644 --- a/Source/WTF/WTF.vcproj/WTF.vcproj +++ b/Source/WTF/WTF.vcproj/WTF.vcproj @@ -781,6 +781,14 @@ >
</File>
<File
+ RelativePath="..\wtf\FilePrintStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\wtf\FilePrintStream.h"
+ >
+ </File>
+ <File
RelativePath="..\wtf\FixedArray.h"
>
</File>
@@ -905,6 +913,10 @@ >
</File>
<File
+ RelativePath="..\wtf\MemoryInstrumentation.cpp"
+ >
+ </File>
+ <File
RelativePath="..\wtf\MemoryInstrumentation.h"
>
</File>
@@ -941,6 +953,10 @@ >
</File>
<File
+ RelativePath="..\wtf\MemoryObjectInfo.h"
+ >
+ </File>
+ <File
RelativePath="..\wtf\MessageQueue.h"
>
</File>
@@ -1089,6 +1105,14 @@ >
</File>
<File
+ RelativePath="..\wtf\PrintStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\wtf\PrintStream.h"
+ >
+ </File>
+ <File
RelativePath="..\wtf\RandomNumber.cpp"
>
</File>
diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj index 8aeebed69..58cda1645 100644 --- a/Source/WTF/WTF.xcodeproj/project.pbxproj +++ b/Source/WTF/WTF.xcodeproj/project.pbxproj @@ -21,6 +21,10 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 0F9D3360165DBA73005AD387 /* FilePrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */; }; + 0F9D3361165DBA73005AD387 /* FilePrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335C165DBA73005AD387 /* FilePrintStream.h */; }; + 0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335D165DBA73005AD387 /* PrintStream.cpp */; }; + 0F9D3363165DBA73005AD387 /* PrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335E165DBA73005AD387 /* PrintStream.h */; }; 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; }; 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; }; 143F61201565F0F900DB514A /* RAMSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 143F611E1565F0F900DB514A /* RAMSize.h */; settings = {ATTRIBUTES = (); }; }; @@ -293,6 +297,8 @@ CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; }; CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; }; EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; }; + F322CCDF165699FF004852DD /* MemoryInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F322CCDE165699FF004852DD /* MemoryInstrumentation.cpp */; }; + F322CCE116569A10004852DD /* MemoryObjectInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = F322CCE016569A10004852DD /* MemoryObjectInfo.h */; }; F3525E2A16149FF400278BC1 /* MemoryInstrumentationListHashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = F3525E2916149FF400278BC1 /* MemoryInstrumentationListHashSet.h */; }; F3525E461619A4EE00278BC1 /* MemoryInstrumentationHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = F3525E451619A4EE00278BC1 /* MemoryInstrumentationHashMap.h */; }; F3FBC71E161AF7BF00BB4BD4 /* MemoryInstrumentationHashCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FBC71D161AF7BF00BB4BD4 /* MemoryInstrumentationHashCountedSet.h */; }; @@ -312,6 +318,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilePrintStream.cpp; sourceTree = "<group>"; }; + 0F9D335C165DBA73005AD387 /* FilePrintStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilePrintStream.h; sourceTree = "<group>"; }; + 0F9D335D165DBA73005AD387 /* PrintStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintStream.cpp; sourceTree = "<group>"; }; + 0F9D335E165DBA73005AD387 /* PrintStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintStream.h; sourceTree = "<group>"; }; 0FD81AC4154FB22E00983E72 /* FastBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastBitVector.h; sourceTree = "<group>"; }; 143F611D1565F0F900DB514A /* RAMSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RAMSize.cpp; sourceTree = "<group>"; }; 143F611E1565F0F900DB514A /* RAMSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAMSize.h; sourceTree = "<group>"; }; @@ -593,6 +603,8 @@ CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; }; CD5497AB15857D0300B5BC30 /* MediaTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTime.h; sourceTree = "<group>"; }; EB95E1EF161A72410089A2F5 /* ByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteOrder.h; sourceTree = "<group>"; }; + F322CCDE165699FF004852DD /* MemoryInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryInstrumentation.cpp; sourceTree = "<group>"; }; + F322CCE016569A10004852DD /* MemoryObjectInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryObjectInfo.h; sourceTree = "<group>"; }; F3525E2916149FF400278BC1 /* MemoryInstrumentationListHashSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationListHashSet.h; sourceTree = "<group>"; }; F3525E451619A4EE00278BC1 /* MemoryInstrumentationHashMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationHashMap.h; sourceTree = "<group>"; }; F3FBC71D161AF7BF00BB4BD4 /* MemoryInstrumentationHashCountedSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationHashCountedSet.h; sourceTree = "<group>"; }; @@ -707,6 +719,8 @@ 0FD81AC4154FB22E00983E72 /* FastBitVector.h */, A8A472A1151A825A004123FF /* FastMalloc.cpp */, A8A472A2151A825A004123FF /* FastMalloc.h */, + 0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */, + 0F9D335C165DBA73005AD387 /* FilePrintStream.h */, A8A472A3151A825A004123FF /* FixedArray.h */, A8A472A4151A825A004123FF /* Float32Array.h */, A8A472A5151A825A004123FF /* Float64Array.h */, @@ -740,6 +754,7 @@ A8A472CB151A825B004123FF /* MD5.h */, CD5497AA15857D0300B5BC30 /* MediaTime.cpp */, CD5497AB15857D0300B5BC30 /* MediaTime.h */, + F322CCDE165699FF004852DD /* MemoryInstrumentation.cpp */, 4F1D115315FF11BE0026E908 /* MemoryInstrumentation.h */, 4FD8554616133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h */, F3FBC71D161AF7BF00BB4BD4 /* MemoryInstrumentationHashCountedSet.h */, @@ -750,6 +765,7 @@ F3FBC71F161AF7CD00BB4BD4 /* MemoryInstrumentationSequence.h */, 4FCF27E016172E8600CBF037 /* MemoryInstrumentationString.h */, 4FCB7109160A1A07008425EC /* MemoryInstrumentationVector.h */, + F322CCE016569A10004852DD /* MemoryObjectInfo.h */, A8A472CC151A825B004123FF /* MessageQueue.h */, A8A472CD151A825B004123FF /* MetaAllocator.cpp */, A8A472CE151A825B004123FF /* MetaAllocator.h */, @@ -783,8 +799,9 @@ A8A472ED151A825B004123FF /* PassRefPtr.h */, A8A472EE151A825B004123FF /* PassTraits.h */, A8A472EF151A825B004123FF /* Platform.h */, - A876DBD7151816E500DADB95 /* Platform.h */, A8A472F3151A825B004123FF /* PossiblyNull.h */, + 0F9D335D165DBA73005AD387 /* PrintStream.cpp */, + 0F9D335E165DBA73005AD387 /* PrintStream.h */, 143F611D1565F0F900DB514A /* RAMSize.cpp */, 143F611E1565F0F900DB514A /* RAMSize.h */, A8A472FB151A825B004123FF /* RandomNumber.cpp */, @@ -848,6 +865,7 @@ A8A47372151A825B004123FF /* VMTags.h */, A8A4737A151A825B004123FF /* WTFThreadData.cpp */, A8A4737B151A825B004123FF /* WTFThreadData.h */, + A876DBD7151816E500DADB95 /* Platform.h */, ); path = wtf; sourceTree = "<group>"; @@ -1109,6 +1127,7 @@ F3FBC720161AF7CD00BB4BD4 /* MemoryInstrumentationSequence.h in Headers */, 4FCF27E116172E8600CBF037 /* MemoryInstrumentationString.h in Headers */, 4FCB710A160A1A07008425EC /* MemoryInstrumentationVector.h in Headers */, + F322CCE116569A10004852DD /* MemoryObjectInfo.h in Headers */, A8A473EB151A825B004123FF /* MessageQueue.h in Headers */, A8A473ED151A825B004123FF /* MetaAllocator.h in Headers */, A8A473EE151A825B004123FF /* MetaAllocatorHandle.h in Headers */, @@ -1216,6 +1235,8 @@ A8A47480151A825B004123FF /* VMTags.h in Headers */, A8A47446151A825B004123FF /* WTFString.h in Headers */, A8A47487151A825B004123FF /* WTFThreadData.h in Headers */, + 0F9D3361165DBA73005AD387 /* FilePrintStream.h in Headers */, + 0F9D3363165DBA73005AD387 /* PrintStream.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1336,6 +1357,7 @@ A8A473E4151A825B004123FF /* MainThreadMac.mm in Sources */, A8A473E9151A825B004123FF /* MD5.cpp in Sources */, CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */, + F322CCDF165699FF004852DD /* MemoryInstrumentation.cpp in Sources */, A8A473EC151A825B004123FF /* MetaAllocator.cpp in Sources */, A8A473F2151A825B004123FF /* NullPtr.cpp in Sources */, A8A473F4151A825B004123FF /* NumberOfCores.cpp in Sources */, @@ -1383,6 +1405,8 @@ A8A47469151A825B004123FF /* UTF8.cpp in Sources */, A8A47445151A825B004123FF /* WTFString.cpp in Sources */, A8A47486151A825B004123FF /* WTFThreadData.cpp in Sources */, + 0F9D3360165DBA73005AD387 /* FilePrintStream.cpp in Sources */, + 0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt index da8ded93b..4f822a548 100644 --- a/Source/WTF/wtf/CMakeLists.txt +++ b/Source/WTF/wtf/CMakeLists.txt @@ -26,6 +26,7 @@ SET(WTF_HEADERS Encoder.h FastAllocBase.h FastMalloc.h + FilePrintStream.h FixedArray.h Forward.h GetPtr.h @@ -46,6 +47,17 @@ SET(WTF_HEADERS MallocZoneSupport.h MathExtras.h MediaTime.h + MemoryInstrumentation.h + MemoryInstrumentationArrayBufferView.h + MemoryInstrumentationHashCountedSet.h + MemoryInstrumentationHashMap.h + MemoryInstrumentationHashSet.h + MemoryInstrumentationListHashSet.h + MemoryInstrumentationParsedURL.h + MemoryInstrumentationSequence.h + MemoryInstrumentationString.h + MemoryInstrumentationVector.h + MemoryObjectInfo.h MessageQueue.h MetaAllocator.h MetaAllocatorHandle.h @@ -75,6 +87,7 @@ SET(WTF_HEADERS ParallelJobsOpenMP.h Platform.h PossiblyNull.h + PrintStream.h RandomNumber.h RandomNumberSeed.h RedBlackTree.h @@ -150,6 +163,7 @@ SET(WTF_SOURCES DecimalNumber.cpp DynamicAnnotations.cpp FastMalloc.cpp + FilePrintStream.cpp GregorianDateTime.cpp HashTable.cpp MD5.cpp @@ -157,11 +171,13 @@ SET(WTF_SOURCES MediaTime.cpp MetaAllocator.cpp OSRandomSource.cpp + MemoryInstrumentation.cpp NumberOfCores.cpp RAMSize.cpp PageAllocationAligned.cpp PageBlock.cpp ParallelJobsGeneric.cpp + PrintStream.cpp RandomNumber.cpp RefCountedLeakCounter.cpp SHA1.cpp diff --git a/Source/WTF/wtf/DataLog.cpp b/Source/WTF/wtf/DataLog.cpp index 523567c45..97e0e972e 100644 --- a/Source/WTF/wtf/DataLog.cpp +++ b/Source/WTF/wtf/DataLog.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "DataLog.h" #include <stdarg.h> +#include <wtf/FilePrintStream.h> #include <wtf/Threading.h> #define DATA_LOG_TO_FILE 0 @@ -35,34 +36,37 @@ namespace WTF { -#if DATA_LOG_TO_FILE -static FILE* file; +#if USE(PTHREADS) +static pthread_once_t initializeLogFileOnceKey = PTHREAD_ONCE_INIT; +#endif + +static FilePrintStream* file; static void initializeLogFileOnce() { +#if DATA_LOG_TO_FILE #ifdef DATA_LOG_FILENAME const char* filename = DATA_LOG_FILENAME; #else const char* filename = getenv("WTF_DATA_LOG_FILENAME"); #endif if (filename) { - file = fopen(filename, "w"); - if (!file) + FILE* rawFile = fopen(filename, "w"); + if (rawFile) + file = new FilePrintStream(rawFile); + else fprintf(stderr, "Warning: Could not open log file %s for writing.\n", filename); } +#endif // DATA_LOG_TO_FILE if (!file) - file = stderr; + file = new FilePrintStream(stderr, FilePrintStream::Borrow); - setvbuf(file, 0, _IONBF, 0); // Prefer unbuffered output, so that we get a full log upon crash or deadlock. + setvbuf(file->file(), 0, _IONBF, 0); // Prefer unbuffered output, so that we get a full log upon crash or deadlock. } -#if OS(DARWIN) -static pthread_once_t initializeLogFileOnceKey = PTHREAD_ONCE_INIT; -#endif - static void initializeLogFile() { -#if OS(DARWIN) +#if USE(PTHREADS) pthread_once(&initializeLogFileOnceKey, initializeLogFileOnce); #else if (!file) @@ -70,21 +74,15 @@ static void initializeLogFile() #endif } -FILE* dataFile() +FilePrintStream& dataFile() { initializeLogFile(); - return file; + return *file; } -#else // DATA_LOG_TO_FILE -FILE* dataFile() -{ - return stderr; -} -#endif // DATA_LOG_TO_FILE void dataLogFV(const char* format, va_list argList) { - vfprintf(dataFile(), format, argList); + dataFile().vprintf(format, argList); } void dataLogF(const char* format, ...) @@ -97,7 +95,7 @@ void dataLogF(const char* format, ...) void dataLogFString(const char* str) { - fputs(str, dataFile()); + dataFile().printf("%s", str); } } // namespace WTF diff --git a/Source/WTF/wtf/DataLog.h b/Source/WTF/wtf/DataLog.h index 12dd5237c..ebb7cbeab 100644 --- a/Source/WTF/wtf/DataLog.h +++ b/Source/WTF/wtf/DataLog.h @@ -28,12 +28,13 @@ #include <stdarg.h> #include <stdio.h> +#include <wtf/FilePrintStream.h> #include <wtf/Platform.h> #include <wtf/StdLibExtras.h> namespace WTF { -WTF_EXPORT_PRIVATE FILE* dataFile(); +WTF_EXPORT_PRIVATE FilePrintStream& dataFile(); WTF_EXPORT_PRIVATE void dataLogFV(const char* format, va_list) WTF_ATTRIBUTE_PRINTF(1, 0); WTF_EXPORT_PRIVATE void dataLogF(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2); diff --git a/Source/WTF/wtf/FilePrintStream.cpp b/Source/WTF/wtf/FilePrintStream.cpp new file mode 100644 index 000000000..2deea6899 --- /dev/null +++ b/Source/WTF/wtf/FilePrintStream.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2012 Apple 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: + * 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 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 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 "FilePrintStream.h" + +namespace WTF { + +FilePrintStream::FilePrintStream(FILE* file, AdoptionMode adoptionMode) + : m_file(file) + , m_adoptionMode(adoptionMode) +{ +} + +FilePrintStream::~FilePrintStream() +{ + if (m_adoptionMode == Borrow) + return; + fclose(m_file); +} + +void FilePrintStream::vprintf(const char* format, va_list argList) +{ + vfprintf(m_file, format, argList); +} + +void FilePrintStream::flush() +{ + fflush(m_file); +} + +} // namespace WTF + diff --git a/Source/WTF/wtf/FilePrintStream.h b/Source/WTF/wtf/FilePrintStream.h new file mode 100644 index 000000000..c9af344ae --- /dev/null +++ b/Source/WTF/wtf/FilePrintStream.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2012 Apple 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: + * 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 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 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. + */ + +#ifndef FilePrintStream_h +#define FilePrintStream_h + +#include <stdio.h> +#include <wtf/PrintStream.h> + +namespace WTF { + +class FilePrintStream : public PrintStream { +public: + enum AdoptionMode { + Adopt, + Borrow + }; + + FilePrintStream(FILE*, AdoptionMode = Adopt); + virtual ~FilePrintStream(); + + FILE* file() { return m_file; } + + void vprintf(const char* format, va_list) WTF_ATTRIBUTE_PRINTF(2, 0); + void flush(); + +private: + FILE* m_file; + AdoptionMode m_adoptionMode; +}; + +} // namespace WTF + +using WTF::FilePrintStream; + +#endif // FilePrintStream_h + diff --git a/Source/WTF/wtf/MemoryInstrumentation.cpp b/Source/WTF/wtf/MemoryInstrumentation.cpp new file mode 100644 index 000000000..d4be2b6dc --- /dev/null +++ b/Source/WTF/wtf/MemoryInstrumentation.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2012 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. + * * 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. + * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "MemoryInstrumentation.h" + +#include <wtf/MemoryObjectInfo.h> + +#if DEBUG_POINTER_INSTRUMENTATION +#include <stdio.h> +#include <wtf/Assertions.h> +#endif + +namespace WTF { + +MemoryInstrumentation::MemoryInstrumentation(MemoryInstrumentationClient* client) + : m_client(client) + , m_rootObjectInfo(adoptPtr(new MemoryObjectInfo(this, 0))) +{ +} + +MemoryInstrumentation::~MemoryInstrumentation() +{ +} + +MemoryObjectType MemoryInstrumentation::getObjectType(MemoryObjectInfo* objectInfo) +{ + return objectInfo->objectType(); +} + +void MemoryInstrumentation::callReportObjectInfo(MemoryObjectInfo* memoryObjectInfo, const void* pointer, MemoryObjectType objectType, size_t objectSize) +{ + memoryObjectInfo->reportObjectInfo(pointer, objectType, objectSize); +} + +MemoryInstrumentation::InstrumentedPointerBase::InstrumentedPointerBase(MemoryObjectInfo* memoryObjectInfo) + : m_ownerObjectType(memoryObjectInfo->objectType()) +{ +#if DEBUG_POINTER_INSTRUMENTATION + m_callStackSize = s_maxCallStackSize; + WTFGetBacktrace(m_callStack, &m_callStackSize); +#endif +} + +void MemoryInstrumentation::InstrumentedPointerBase::process(MemoryInstrumentation* memoryInstrumentation) +{ + MemoryObjectInfo memoryObjectInfo(memoryInstrumentation, m_ownerObjectType); + const void* originalPointer = callReportMemoryUsage(&memoryObjectInfo); + + const void* pointer = memoryObjectInfo.reportedPointer(); + ASSERT(pointer); + if (pointer != originalPointer && memoryInstrumentation->visited(pointer)) + return; + memoryInstrumentation->countObjectSize(pointer, memoryObjectInfo.objectType(), memoryObjectInfo.objectSize()); + if (!memoryInstrumentation->checkCountedObject(pointer)) { +#if DEBUG_POINTER_INSTRUMENTATION + fputs("Unknown object counted:\n", stderr); + WTFPrintBacktrace(m_callStack, m_callStackSize); +#endif + } +} + +void MemoryClassInfo::init(const void* pointer, MemoryObjectType objectType, size_t actualSize) +{ + m_memoryObjectInfo->reportObjectInfo(pointer, objectType, actualSize); + m_memoryInstrumentation = m_memoryObjectInfo->memoryInstrumentation(); + m_objectType = m_memoryObjectInfo->objectType(); +} + +void MemoryClassInfo::addRawBuffer(const void* const& buffer, size_t size) +{ + m_memoryInstrumentation->addRawBuffer(buffer, m_objectType, size); +} + +void MemoryClassInfo::addPrivateBuffer(size_t size, MemoryObjectType ownerObjectType) +{ + if (!size) + return; + if (!ownerObjectType) + ownerObjectType = m_objectType; + m_memoryInstrumentation->countObjectSize(0, ownerObjectType, size); +} + +} // namespace WTF diff --git a/Source/WTF/wtf/MemoryInstrumentation.h b/Source/WTF/wtf/MemoryInstrumentation.h index 1c38243e6..2a6832b71 100644 --- a/Source/WTF/wtf/MemoryInstrumentation.h +++ b/Source/WTF/wtf/MemoryInstrumentation.h @@ -37,11 +37,6 @@ #define DEBUG_POINTER_INSTRUMENTATION 0 -#if DEBUG_POINTER_INSTRUMENTATION -#include <wtf/Assertions.h> -#include <stdio.h> -#endif - namespace WTF { class MemoryClassInfo; @@ -55,43 +50,6 @@ enum MemoryOwningType { byReference }; -class MemoryObjectInfo { -public: - MemoryObjectInfo(MemoryInstrumentation* memoryInstrumentation, MemoryObjectType ownerObjectType) - : m_memoryInstrumentation(memoryInstrumentation) - , m_objectType(ownerObjectType) - , m_objectSize(0) - , m_pointer(0) - { } - - typedef MemoryClassInfo ClassInfo; - - MemoryObjectType objectType() const { return m_objectType; } - size_t objectSize() const { return m_objectSize; } - const void* reportedPointer() const { return m_pointer; } - - MemoryInstrumentation* memoryInstrumentation() { return m_memoryInstrumentation; } - -private: - friend class MemoryClassInfo; - friend class MemoryInstrumentation; - - void reportObjectInfo(const void* pointer, MemoryObjectType objectType, size_t objectSize) - { - if (!m_objectSize) { - m_pointer = pointer; - m_objectSize = objectSize; - if (objectType) - m_objectType = objectType; - } - } - - MemoryInstrumentation* m_memoryInstrumentation; - MemoryObjectType m_objectType; - size_t m_objectSize; - const void* m_pointer; -}; - template<typename T> void reportMemoryUsage(const T* const&, MemoryObjectInfo*); class MemoryInstrumentationClient { @@ -104,20 +62,32 @@ public: class MemoryInstrumentation { public: - explicit MemoryInstrumentation(MemoryInstrumentationClient* client) : m_client(client) { } - virtual ~MemoryInstrumentation() { } + WTF_EXPORT_PRIVATE explicit MemoryInstrumentation(MemoryInstrumentationClient*); + WTF_EXPORT_PRIVATE virtual ~MemoryInstrumentation(); - template <typename T> void addRootObject(const T& t, MemoryObjectType objectType = 0) + template <typename T> void addRootObject(const T& t) { - addObject(t, objectType); + addObject(t, m_rootObjectInfo.get()); processDeferredInstrumentedPointers(); } protected: class InstrumentedPointerBase { public: + WTF_EXPORT_PRIVATE explicit InstrumentedPointerBase(MemoryObjectInfo*); virtual ~InstrumentedPointerBase() { } - virtual void process(MemoryInstrumentation*) = 0; + WTF_EXPORT_PRIVATE void process(MemoryInstrumentation*); + + protected: + virtual const void* callReportMemoryUsage(MemoryObjectInfo*) = 0; + + private: + const MemoryObjectType m_ownerObjectType; +#if DEBUG_POINTER_INSTRUMENTATION + static const int s_maxCallStackSize = 32; + void* m_callStack[s_maxCallStackSize]; + int m_callStackSize; +#endif }; private: @@ -128,6 +98,8 @@ private: virtual void deferInstrumentedPointer(PassOwnPtr<InstrumentedPointerBase>) = 0; virtual void processDeferredInstrumentedPointers() = 0; + WTF_EXPORT_PRIVATE static MemoryObjectType getObjectType(MemoryObjectInfo*); + friend class MemoryClassInfo; template<typename T> friend void reportMemoryUsage(const T* const&, MemoryObjectInfo*); @@ -148,29 +120,22 @@ private: template<typename T, typename Type> static void reportObjectMemoryUsage(const T* const& object, MemoryObjectInfo* memoryObjectInfo, ...) { - memoryObjectInfo->reportObjectInfo(object, 0, sizeof(T)); + callReportObjectInfo(memoryObjectInfo, object, 0, sizeof(T)); } - - template<typename T> - static void countNotInstrumentedObject(const T* const&, MemoryObjectInfo*); + WTF_EXPORT_PRIVATE static void callReportObjectInfo(MemoryObjectInfo*, const void* pointer, MemoryObjectType, size_t objectSize); template<typename T> class InstrumentedPointer : public InstrumentedPointerBase { public: - InstrumentedPointer(const T* pointer, MemoryObjectType ownerObjectType); - virtual void process(MemoryInstrumentation*) OVERRIDE; + InstrumentedPointer(const T* pointer, MemoryObjectInfo* ownerObjectInfo); + + protected: + virtual const void* callReportMemoryUsage(MemoryObjectInfo*) OVERRIDE; private: const T* m_pointer; - const MemoryObjectType m_ownerObjectType; - -#if DEBUG_POINTER_INSTRUMENTATION - static const int s_maxCallStackSize = 32; - void* m_callStack[s_maxCallStackSize]; - int m_callStackSize; -#endif }; - template<typename T> void addObject(const T& t, MemoryObjectType ownerObjectType) { OwningTraits<T>::addObject(this, t, ownerObjectType); } + template<typename T> void addObject(const T& t, MemoryObjectInfo* ownerObjectInfo) { OwningTraits<T>::addObject(this, t, ownerObjectInfo); } void addRawBuffer(const void* const& buffer, MemoryObjectType ownerObjectType, size_t size) { if (!buffer || visited(buffer)) @@ -180,49 +145,48 @@ private: template<typename T> struct OwningTraits { // Default byReference implementation. - static void addObject(MemoryInstrumentation* instrumentation, const T& t, MemoryObjectType ownerObjectType) + static void addObject(MemoryInstrumentation* instrumentation, const T& t, MemoryObjectInfo* ownerObjectInfo) { - instrumentation->addObjectImpl(&t, ownerObjectType, byReference); + instrumentation->addObjectImpl(&t, ownerObjectInfo, byReference); } }; template<typename T> struct OwningTraits<T*> { // Custom byPointer implementation. - static void addObject(MemoryInstrumentation* instrumentation, const T* const& t, MemoryObjectType ownerObjectType) + static void addObject(MemoryInstrumentation* instrumentation, const T* const& t, MemoryObjectInfo* ownerObjectInfo) { - instrumentation->addObjectImpl(t, ownerObjectType, byPointer); + instrumentation->addObjectImpl(t, ownerObjectInfo, byPointer); } }; - template<typename T> void addObjectImpl(const T* const&, MemoryObjectType, MemoryOwningType); - template<typename T> void addObjectImpl(const OwnPtr<T>* const&, MemoryObjectType, MemoryOwningType); - template<typename T> void addObjectImpl(const RefPtr<T>* const&, MemoryObjectType, MemoryOwningType); + template<typename T> void addObjectImpl(const T* const&, MemoryObjectInfo*, MemoryOwningType); + template<typename T> void addObjectImpl(const OwnPtr<T>* const&, MemoryObjectInfo*, MemoryOwningType); + template<typename T> void addObjectImpl(const RefPtr<T>* const&, MemoryObjectInfo*, MemoryOwningType); MemoryInstrumentationClient* m_client; + OwnPtr<MemoryObjectInfo> m_rootObjectInfo; }; class MemoryClassInfo { public: template<typename T> - MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T* pointer, MemoryObjectType objectType = 0, size_t actualSize = 0) + MemoryClassInfo(MemoryObjectInfo* memoryObjectInfo, const T* pointer, MemoryObjectType objectType = 0, size_t actualSize = sizeof(T)) : m_memoryObjectInfo(memoryObjectInfo) - , m_memoryInstrumentation(memoryObjectInfo->memoryInstrumentation()) + , m_memoryInstrumentation(0) + , m_objectType(0) { - m_memoryObjectInfo->reportObjectInfo(pointer, objectType, actualSize ? actualSize : sizeof(T)); - m_objectType = memoryObjectInfo->objectType(); + init(pointer, objectType, actualSize); } - template<typename M> void addMember(const M& member) { m_memoryInstrumentation->addObject(member, m_objectType); } - void addRawBuffer(const void* const& buffer, size_t size) { m_memoryInstrumentation->addRawBuffer(buffer, m_objectType, size); } - void addPrivateBuffer(size_t size, MemoryObjectType ownerObjectType = 0) - { - if (size) - m_memoryInstrumentation->countObjectSize(0, ownerObjectType ? ownerObjectType : m_objectType, size); - } + template<typename M> void addMember(const M& member) { m_memoryInstrumentation->addObject(member, m_memoryObjectInfo); } + WTF_EXPORT_PRIVATE void addRawBuffer(const void* const& buffer, size_t); + WTF_EXPORT_PRIVATE void addPrivateBuffer(size_t, MemoryObjectType ownerObjectType = 0); void addWeakPointer(void*) { } private: + WTF_EXPORT_PRIVATE void init(const void* pointer, MemoryObjectType, size_t actualSize); + MemoryObjectInfo* m_memoryObjectInfo; MemoryInstrumentation* m_memoryInstrumentation; MemoryObjectType m_objectType; @@ -235,62 +199,45 @@ void reportMemoryUsage(const T* const& object, MemoryObjectInfo* memoryObjectInf } template<typename T> -void MemoryInstrumentation::addObjectImpl(const T* const& object, MemoryObjectType ownerObjectType, MemoryOwningType owningType) +void MemoryInstrumentation::addObjectImpl(const T* const& object, MemoryObjectInfo* ownerObjectInfo, MemoryOwningType owningType) { - if (owningType == byReference) { - MemoryObjectInfo memoryObjectInfo(this, ownerObjectType); - reportMemoryUsage(object, &memoryObjectInfo); - } else { + if (owningType == byReference) + reportMemoryUsage(object, ownerObjectInfo); + else { if (!object || visited(object)) return; - deferInstrumentedPointer(adoptPtr(new InstrumentedPointer<T>(object, ownerObjectType))); + deferInstrumentedPointer(adoptPtr(new InstrumentedPointer<T>(object, ownerObjectInfo))); } } template<typename T> -void MemoryInstrumentation::addObjectImpl(const OwnPtr<T>* const& object, MemoryObjectType ownerObjectType, MemoryOwningType owningType) +void MemoryInstrumentation::addObjectImpl(const OwnPtr<T>* const& object, MemoryObjectInfo* ownerObjectInfo, MemoryOwningType owningType) { if (owningType == byPointer && !visited(object)) - countObjectSize(object, ownerObjectType, sizeof(*object)); - addObjectImpl(object->get(), ownerObjectType, byPointer); + countObjectSize(object, getObjectType(ownerObjectInfo), sizeof(*object)); + addObjectImpl(object->get(), ownerObjectInfo, byPointer); } template<typename T> -void MemoryInstrumentation::addObjectImpl(const RefPtr<T>* const& object, MemoryObjectType ownerObjectType, MemoryOwningType owningType) +void MemoryInstrumentation::addObjectImpl(const RefPtr<T>* const& object, MemoryObjectInfo* ownerObjectInfo, MemoryOwningType owningType) { if (owningType == byPointer && !visited(object)) - countObjectSize(object, ownerObjectType, sizeof(*object)); - addObjectImpl(object->get(), ownerObjectType, byPointer); + countObjectSize(object, getObjectType(ownerObjectInfo), sizeof(*object)); + addObjectImpl(object->get(), ownerObjectInfo, byPointer); } template<typename T> -MemoryInstrumentation::InstrumentedPointer<T>::InstrumentedPointer(const T* pointer, MemoryObjectType ownerObjectType) - : m_pointer(pointer) - , m_ownerObjectType(ownerObjectType) +MemoryInstrumentation::InstrumentedPointer<T>::InstrumentedPointer(const T* pointer, MemoryObjectInfo* ownerObjectInfo) + : InstrumentedPointerBase(ownerObjectInfo) + , m_pointer(pointer) { -#if DEBUG_POINTER_INSTRUMENTATION - m_callStackSize = s_maxCallStackSize; - WTFGetBacktrace(m_callStack, &m_callStackSize); -#endif } template<typename T> -void MemoryInstrumentation::InstrumentedPointer<T>::process(MemoryInstrumentation* memoryInstrumentation) +const void* MemoryInstrumentation::InstrumentedPointer<T>::callReportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) { - MemoryObjectInfo memoryObjectInfo(memoryInstrumentation, m_ownerObjectType); - reportMemoryUsage(m_pointer, &memoryObjectInfo); - - const void* pointer = memoryObjectInfo.reportedPointer(); - ASSERT(pointer); - if (pointer != m_pointer && memoryInstrumentation->visited(pointer)) - return; - memoryInstrumentation->countObjectSize(pointer, memoryObjectInfo.objectType(), memoryObjectInfo.objectSize()); - if (!memoryInstrumentation->checkCountedObject(pointer)) { -#if DEBUG_POINTER_INSTRUMENTATION - fputs("Unknown object counted:\n", stderr); - WTFPrintBacktrace(m_callStack, m_callStackSize); -#endif - } + reportMemoryUsage(m_pointer, memoryObjectInfo); + return m_pointer; } // Link time guard for classes with external memory instrumentation. @@ -329,6 +276,4 @@ void reportMemoryUsage(const URLString* const&, MemoryObjectInfo*); } // namespace WTF -#undef DEBUG_POINTER_INSTRUMENTATION - #endif // !defined(MemoryInstrumentation_h) diff --git a/Source/WTF/wtf/MemoryObjectInfo.h b/Source/WTF/wtf/MemoryObjectInfo.h new file mode 100644 index 000000000..1c7fe6c83 --- /dev/null +++ b/Source/WTF/wtf/MemoryObjectInfo.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2012 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. + * * 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. + * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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. + */ + +#ifndef MemoryObjectInfo_h +#define MemoryObjectInfo_h + +namespace WTF { + +class MemoryClassInfo; +class MemoryInstrumentation; + +typedef const char* MemoryObjectType; + +class MemoryObjectInfo { +public: + MemoryObjectInfo(MemoryInstrumentation* memoryInstrumentation, MemoryObjectType ownerObjectType) + : m_memoryInstrumentation(memoryInstrumentation) + , m_objectType(ownerObjectType) + , m_objectSize(0) + , m_pointer(0) + { } + + typedef MemoryClassInfo ClassInfo; + + MemoryObjectType objectType() const { return m_objectType; } + size_t objectSize() const { return m_objectSize; } + const void* reportedPointer() const { return m_pointer; } + + MemoryInstrumentation* memoryInstrumentation() { return m_memoryInstrumentation; } + +private: + friend class MemoryClassInfo; + friend class MemoryInstrumentation; + + void reportObjectInfo(const void* pointer, MemoryObjectType objectType, size_t objectSize) + { + if (!m_objectSize) { + m_pointer = pointer; + m_objectSize = objectSize; + if (objectType) + m_objectType = objectType; + } + } + + MemoryInstrumentation* m_memoryInstrumentation; + MemoryObjectType m_objectType; + size_t m_objectSize; + const void* m_pointer; +}; + +} // namespace WTF + +#endif // !defined(MemoryObjectInfo_h) diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index 446dcd0bc..12ffbf207 100644 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -432,6 +432,7 @@ /* PLATFORM(CHROMIUM) */ /* PLATFORM(QT) */ /* PLATFORM(WX) */ +/* PLATFORM(EFL) */ /* PLATFORM(GTK) */ /* PLATFORM(BLACKBERRY) */ /* PLATFORM(MAC) */ @@ -442,6 +443,8 @@ #define WTF_PLATFORM_QT 1 #elif defined(BUILDING_WX__) #define WTF_PLATFORM_WX 1 +#elif defined(BUILDING_EFL__) +#define WTF_PLATFORM_EFL 1 #elif defined(BUILDING_GTK__) #define WTF_PLATFORM_GTK 1 #elif defined(BUILDING_BLACKBERRY__) @@ -572,10 +575,21 @@ #if PLATFORM(CHROMIUM) && OS(DARWIN) #define WTF_USE_CF 1 #define WTF_USE_PTHREADS 1 - #define WTF_USE_WK_SCROLLBAR_PAINTER 1 #endif +#if PLATFORM(CHROMIUM) +#if OS(DARWIN) +/* We can't override the global operator new and delete on OS(DARWIN) because + * some object are allocated by WebKit and deallocated by the embedder. */ +#define ENABLE_GLOBAL_FASTMALLOC_NEW 0 +#else /* !OS(DARWIN) */ +/* On non-OS(DARWIN), the "system malloc" is actually TCMalloc anyway, so there's + * no need to use WebKit's copy of TCMalloc. */ +#define USE_SYSTEM_MALLOC 1 +#endif /* OS(DARWIN) */ +#endif /* PLATFORM(CHROMIUM) */ + #if PLATFORM(IOS) #define DONT_FINALIZE_ON_MAIN_THREAD 1 #endif @@ -821,14 +835,6 @@ #endif #endif -#if !defined(ENABLE_GESTURE_ANIMATION) -#if PLATFORM(QT) || !ENABLE(SMOOTH_SCROLLING) -#define ENABLE_GESTURE_ANIMATION 0 -#else -#define ENABLE_GESTURE_ANIMATION 1 -#endif -#endif - #if !defined(ENABLE_SATURATED_LAYOUT_ARITHMETIC) #define ENABLE_SATURATED_LAYOUT_ARITHMETIC 0 #endif diff --git a/Source/WTF/wtf/PrintStream.cpp b/Source/WTF/wtf/PrintStream.cpp new file mode 100644 index 000000000..5d77a83c6 --- /dev/null +++ b/Source/WTF/wtf/PrintStream.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2012 Apple 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: + * 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 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 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 "PrintStream.h" + +#include <stdio.h> +#include <wtf/text/CString.h> +#include <wtf/text/WTFString.h> + +namespace WTF { + +PrintStream::PrintStream() { } +PrintStream::~PrintStream() { } // Force the vtable to be in this module + +void PrintStream::printf(const char* format, ...) +{ + va_list argList; + va_start(argList, format); + vprintf(format, argList); + va_end(argList); +} + +void PrintStream::flush() +{ +} + +} // namespace WTF + diff --git a/Source/WTF/wtf/PrintStream.h b/Source/WTF/wtf/PrintStream.h new file mode 100644 index 000000000..3158488a5 --- /dev/null +++ b/Source/WTF/wtf/PrintStream.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2012 Apple 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: + * 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 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 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. + */ + +#ifndef PrintStream_h +#define PrintStream_h + +#include <stdarg.h> +#include <wtf/FastAllocBase.h> +#include <wtf/Noncopyable.h> +#include <wtf/Platform.h> +#include <wtf/StdLibExtras.h> + +namespace WTF { + +class CString; +class String; + +class PrintStream { + WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(PrintStream); +public: + PrintStream(); + virtual ~PrintStream(); + + void printf(const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3); + virtual void vprintf(const char* format, va_list) WTF_ATTRIBUTE_PRINTF(2, 0) = 0; + + // Typically a no-op for many subclasses of PrintStream, this is a hint that + // the implementation should flush its buffers if it had not done so already. + virtual void flush(); +}; + +} // namespace WTF + +using WTF::PrintStream; + +#endif // PrintStream_h + diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt index 7f48a8400..6a99fa26b 100644 --- a/Source/WebCore/CMakeLists.txt +++ b/Source/WebCore/CMakeLists.txt @@ -1146,7 +1146,6 @@ SET(WebCore_SOURCES dom/DocumentOrderedMap.cpp dom/DocumentStyleSheetCollection.cpp dom/DocumentType.cpp - dom/DynamicNodeList.cpp dom/Element.cpp dom/ElementAttributeData.cpp dom/ElementRareData.cpp @@ -1168,6 +1167,7 @@ SET(WebCore_SOURCES dom/IconURL.cpp dom/IdTargetObserver.cpp dom/IdTargetObserverRegistry.cpp + dom/LiveNodeList.cpp dom/KeyboardEvent.cpp dom/MessageChannel.cpp dom/MessageEvent.cpp diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 5d35714fa..45f8cf911 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,1168 @@ +2012-11-26 Hajime Morrita <morrita@google.com> + + [Refactoring] Some Node::isDescendant calls can be replaced with Node::contains() + https://bugs.webkit.org/show_bug.cgi?id=103211 + + Reviewed by Daniel Bates. + + A couple of call sites of isDescendant() does same as Node::contains(). + This change replaces these locations with Node::contains(). + + No new tests, no behavior change. + + * dom/Node.cpp: + (WebCore::checkAcceptChild): + * dom/Range.cpp: + (WebCore::Range::surroundContents): + +2012-11-26 Kunihiko Sakamoto <ksakamoto@chromium.org> + + [Chromium] Enable input type datetime-local + https://bugs.webkit.org/show_bug.cgi?id=103213 + + Reviewed by Kent Tamura. + + This patch enables <input type=datetime-local> for Chromium. + + No new tests. Covered by existing tests. + + * bindings/generic/RuntimeEnabledFeatures.cpp: + (WebCore): Changed RuntimeEnabledFeatures::isInputTypeDateTimeLocalEnabled to true + if INPUT_TYPE_DATETIMELOCAL is enabled. + +2012-11-26 Hajime Morrita <morrita@google.com> + + [Shadow DOM] Implement Element::createShadowRoot() + https://bugs.webkit.org/show_bug.cgi?id=102911 + + Reviewed by Kentaro Hara. + + Added an API implementation and exposed it. + + This is basically an alias of the ShadowRoot constructor, which + will be removed as bug 102913. + + Test: fast/dom/shadow/shadow-aware-create-shdow-root.html + + * bindings/gobject/GNUmakefile.am: + * dom/Element.cpp: + (WebCore::Element::createShadowRoot): + (WebCore): + * dom/Element.h: + (Element): + * dom/Element.idl: + +2012-11-26 Jon Lee <jonlee@apple.com> + + Extend EventDispatcher::dispatchSimulatedClick to allow sending a mouseover event + https://bugs.webkit.org/show_bug.cgi?id=102610 + <rdar://problem/12725663> + + Reviewed by Darin Adler. + + Update the dispatchSimulatedClick() to take option enums for dispatching events. + + * dom/SimulatedClickOptions.h: Added. Define two options enums. One tracks which mouse + events to send. The other determines whether to force the element to repaint. + + * dom/EventDispatcher.cpp: + (WebCore::EventDispatcher::dispatchSimulatedClick): Refactor to use the option enums. + * dom/EventDispatcher.h: + (EventDispatcher): Update function signature. + + * dom/Node.cpp: Refactor parameters to use the options enums rather than booleans. + (WebCore::Node::dispatchSimulatedClick): + * dom/Node.h: + + Refactor. Remove redundant comments. + * html/BaseCheckableInputType.cpp: + (WebCore::BaseCheckableInputType::accessKeyAction): + * html/BaseClickableWithKeyInputType.cpp: + (WebCore::BaseClickableWithKeyInputType::accessKeyAction): + * html/HTMLAnchorElement.cpp: + (WebCore::HTMLAnchorElement::accessKeyAction): + * html/HTMLButtonElement.cpp: + (WebCore::HTMLButtonElement::accessKeyAction): + * html/HTMLElement.cpp: + (WebCore::HTMLElement::click): + (WebCore::HTMLElement::accessKeyAction): + * html/HTMLSelectElement.cpp: + (WebCore::HTMLSelectElement::accessKeyAction): + * html/RadioInputType.cpp: + (WebCore::RadioInputType::handleKeydownEvent): + * html/RangeInputType.cpp: + (WebCore::RangeInputType::accessKeyAction): + + Add SimulatedClickOptions.h. + * GNUmakefile.list.am: + * Target.pri: + * WebCore.gypi: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + +2012-11-26 Shinya Kawanaka <shinyak@chromium.org> + + [Shadow] Attaching children of a shadow host takes O(N^2) where N is the number of host children + https://bugs.webkit.org/show_bug.cgi?id=103017 + + Reviewed by Hajime Morita. + + Since ContentDistribution was just a Vector, ContentDistribution::find() took O(N). Each child of shadow host calls it. + As a result, attaching children of shadow host takes O(N^2) at all. + + In this patch, we make ContentDistribution::find() O(1) amortizedly. We introduce HashMap from a Node to Vector index, + and use it for ContentDistribution::find(). + + No new tests, covered by existing tests. + + * html/shadow/ContentDistributor.cpp: + (WebCore::ContentDistribution::swap): + (WebCore): + (WebCore::ContentDistribution::append): + (WebCore::ContentDistribution::find): + (WebCore::ContentDistributor::distributeSelectionsTo): + * html/shadow/ContentDistributor.h: + (ContentDistribution): ContentDistribution now contains Vector and a reverse map. + (WebCore::ContentDistribution::first): + (WebCore::ContentDistribution::last): + (WebCore::ContentDistribution::at): + (WebCore::ContentDistribution::size): + (WebCore::ContentDistribution::isEmpty): + (WebCore::ContentDistribution::clear): + (WebCore::ContentDistribution::contains): + (WebCore::ContentDistribution::nodes): + +2012-11-26 Dan Carney <dcarney@google.com> + + [V8] Give isolated shells a lifecycle like that of main shells + https://bugs.webkit.org/show_bug.cgi?id=96522 + + Reviewed by Adam Barth. + + Refactored the isolated shells in ScriptController + to be cleaned up the same way the main shell is. + + No new tests. No change in functionality. + + * bindings/v8/ScriptController.cpp: + (WebCore::ScriptController::~ScriptController): + (WebCore::ScriptController::clearForOutOfMemory): + (WebCore::ScriptController::clearForClose): + (WebCore::ScriptController::clearWindowShell): + * bindings/v8/ScriptController.h: + (ScriptController): + * bindings/v8/V8DOMWindowShell.cpp: + (WebCore::V8DOMWindowShell::destroyIsolatedShell): + (WebCore::V8DOMWindowShell::clearForClose): + * bindings/v8/V8DOMWindowShell.h: + (V8DOMWindowShell): + +2012-11-25 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135656. + http://trac.webkit.org/changeset/135656 + https://bugs.webkit.org/show_bug.cgi?id=103218 + + Made a few SVG tests crash on all platforms (Requested by + apavlov on #webkit). + + * css/CSSComputedStyleDeclaration.cpp: + (WebCore::valueForFamily): + * css/CSSValuePool.cpp: + (WebCore::CSSValuePool::createFontFamilyValue): + +2012-11-25 Takashi Sakamoto <tasak@google.com> + + WebCore::RenderBlock::determineStartPosition crash + https://bugs.webkit.org/show_bug.cgi?id=98993 + + Reviewed by Brent Fulgham. + + If we move some node and the node has some text, + InlineFlowBox::removeChild() is invoked. The method invokes + RootInlineBox::childRemoved(). childRemoved() checks whether the + removed inlinebox has the renderer of its parent's line break object. + If so, use setLineBreakInfo to make the parent's line break info to + be 0. However in RenderBlock::determineStartPosition(), the code + assume that all line break info is solved, i.e. + prevRootBox->lineBreakObj()->isText(). Since lineBreakObj() returns 0 + because of removeChild(), determineStartPosition crash occurs. + + Test: fast/inline/inline-box-append-child-crash.html + + * rendering/RenderBlockLineLayout.cpp: + (WebCore::RenderBlock::determineStartPosition): + Checks whether lineBreakObj() is 0 or not before using lineBreakObj(). + +2012-11-25 Nikita Vasilyev <me@elv1s.ru> + + Web Inspector: use native Element.prototype.normalize instead of custom defined Element.prototype.pruneEmptyTextNodes + https://bugs.webkit.org/show_bug.cgi?id=103205 + + Reviewed by Pavel Feldman. + + * inspector/front-end/DOMExtension.js: + * inspector/front-end/TextPrompt.js: + (WebInspector.TextPrompt.prototype.clearAutoComplete): + (WebInspector.TextPrompt.prototype._completionsReady): + (WebInspector.TextPrompt.prototype.applySuggestion): + +2012-11-25 Nikita Vasilyev <me@elv1s.ru> + + Web Inspector: remove unused DOM methods + https://bugs.webkit.org/show_bug.cgi?id=103204 + + Reviewed by Pavel Feldman. + + * inspector/front-end/DOMExtension.js: + +2012-11-25 Nikita Vasilyev <me@elv1s.ru> + + Web Inspector: Remove unused Array.convert method + https://bugs.webkit.org/show_bug.cgi?id=103202 + + Reviewed by Daniel Bates. + + * inspector/front-end/utilities.js: + +2012-11-25 Chris Fleizach <cfleizach@apple.com> + + AX: file upload input cannot be activated with VoiceOver + https://bugs.webkit.org/show_bug.cgi?id=100343 + + Reviewed by Sam Weinig. + + Simulated events were not allowed to be processed in the file input type in the DOMActivate handler. + This was a problem for accessibility clients which rely on simulated events. + + The solution is to mark the UserGestureIndicator as definitely processing an event. + + Test: accessibility/file-upload-button-with-axpress.html + + * accessibility/AccessibilityObject.cpp: + (WebCore::AccessibilityObject::press): + +2012-11-25 Nikita Vasilyev <me@elv1s.ru> + + Web Inspector: dispatch an event upon heap snapshot filter change + https://bugs.webkit.org/show_bug.cgi?id=103201 + + Reviewed by Pavel Feldman. + + Dispatch heapSnapshotFilterChanged event so it can be received by third parties. + + * inspector/front-end/HeapSnapshotView.js: + (WebInspector.HeapSnapshotView.prototype._changeFilter): + * inspector/front-end/UserMetrics.js: + +2012-11-25 Kent Tamura <tkent@chromium.org> + + Refactoring: Move the content of HTMLInputElement::subtreeHasChanged to TextFieldInputType + https://bugs.webkit.org/show_bug.cgi?id=103195 + + Reviewed by Kentaro Hara. + + HTMLInputElement::subtreeHasChanged is called only if the input is + a text field. The code should be moved to TextFieldInputType. + + No new tests. This should not change any behavior. + + * html/HTMLInputElement.cpp: + - Remove unnecessary NumberInputType.h inclusion. + - Remove convertFromVisibleValue. It was used only by subtreeHasChanged. + (WebCore::HTMLInputElement::subtreeHasChanged): + Move the code to TextFieldInputType::subtreeHasChanged except + calculateAndAdjustDirectionality, which is a protected member of + HTMLElement. + * html/HTMLInputElement.h: + (HTMLInputElement): Remove convertFromVisibleValue. + + * html/InputType.cpp: + Move convertFromVisibleValue to TextFieldInputType. + (WebCore::InputType::subtreeHasChanged): + Add ASSERT_NOT_REACHED. + * html/InputType.h: + (InputType): Remove convertFromVisibleValue. + + * html/TextFieldInputType.cpp: + (WebCore::TextFieldInputType::convertFromVisibleValue): + Moved from InputType. + (WebCore::TextFieldInputType::subtreeHasChanged): + Moved from HTMLInputElement. A latter part is moved to + didSetValueByUserEdit to be hooked by SearchInputType. + (WebCore::TextFieldInputType::didSetValueByUserEdit): + Moved from HTMLInputElement::subtreeHasChanged, and clean up the code. + * html/TextFieldInputType.h: + (TextFieldInputType): + - Move convertFromVisibleValue from InputType. + - Add didSetValueByUserEdit and subtreeHasChanged. + + * html/SearchInputType.cpp: + (WebCore::SearchInputType::didSetValueByUserEdit): + Renamed from subtreeHasChanged, and calls TextFieldInputType::didSetValueByUserEdit. + * html/SearchInputType.h: + (SearchInputType): Rename subtreeHasChanged to didSetValueByUserEdit. + +2012-11-22 Kentaro Hara <haraken@chromium.org> + + [V8] Move WorkerExecutionContextProxy::initializeIfNeeded() to V8Initializer + https://bugs.webkit.org/show_bug.cgi?id=103061 + + Reviewed by Adam Barth. + + This is an incremental step to remove WorkerExecutionContextProxy. + This patch moves WorkerExecutionContextProxy::initializeIfNeeded() to V8Initializer. + This patch also renames methods so that the names become consistent + between the main thread and workers. + + No tests. No change in behavior. + + * bindings/v8/V8Initializer.cpp: + (WebCore::reportFatalErrorInMainThread): + (WebCore::messageHandlerInMainThread): + (WebCore::failedAccessCheckCallbackInMainThread): + (WebCore::V8Initializer::initializeMainThreadIfNeeded): + (WebCore::reportFatalErrorInWorker): + (WebCore): + (WebCore::messageHandlerInWorker): + (WebCore::V8Initializer::initializeWorkerIfNeeded): + * bindings/v8/V8Initializer.h: + (V8Initializer): + * bindings/v8/WorkerContextExecutionProxy.cpp: + (WebCore::WorkerContextExecutionProxy::WorkerContextExecutionProxy): + * bindings/v8/WorkerContextExecutionProxy.h: + (WorkerContextExecutionProxy): + +2012-11-25 Christophe Dumez <christophe.dumez@intel.com> + + [EFL] Refactor RenderThemeEfl::ThemePartCacheEntry::reuse() + https://bugs.webkit.org/show_bug.cgi?id=103189 + + Reviewed by Kenneth Rohde Christiansen. + + Check if the entry size and type changed in + RenderThemeEfl::ThemePartCacheEntry::reuse() to avoid + useless processing if one of them did not change. + + Remove useless call to cairo_surface_finish() since + we are using a smart pointer for the surface. + + Resize the edge object *after* loading its content + from the theme file as it seems more logical this + way. + + No new tests, no behavior change for layout tests. + + * platform/efl/RenderThemeEfl.cpp: + (WebCore::RenderThemeEfl::ThemePartCacheEntry::reuse): + * platform/efl/RenderThemeEfl.h: + (ThemePartCacheEntry): + +2012-11-25 Ryosuke Niwa <rniwa@webkit.org> + + Rename DynamicNodeList to LiveNodeList + https://bugs.webkit.org/show_bug.cgi?id=103197 + + Reviewed by Ojan Vafai. + + Rename DynamicNodeList to LiveNodeList to match the terminology used in DOM4 working draft: + http://www.w3.org/TR/2012/WD-dom-20120405/#concept-collection-live + "A collection (either NodeList or HTMLCollection) can be either live or static". + + Also rename DynamicNodeListCacheBase to LiveNodeListBase, and merge DynamicSubtreeNodeList + into LiveNodeList (old DynamicNodeList) now that the only difference between those two classes + is the former calling registerNodeListCache and unregisterNodeListCache on Document. + + This patch completes the series of simplification of NodeList/HTMLCollection classes. + + * CMakeLists.txt: + * GNUmakefile.list.am: + * Target.pri: + * WebCore.gypi: + * WebCore.xcodeproj/project.pbxproj: + * bindings/js/JSHTMLOptionsCollectionCustom.cpp: + (WebCore::getNamedItems): + * bindings/js/JSNodeListCustom.cpp: + (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots): + * bindings/v8/custom/V8NodeListCustom.cpp: + (WebCore::V8NodeList::opaqueRootForGC): + * dom/ChildNodeList.cpp: + (WebCore::ChildNodeList::ChildNodeList): + (WebCore::ChildNodeList::nodeMatches): + * dom/ChildNodeList.h: + * dom/ClassNodeList.cpp: + (WebCore::ClassNodeList::ClassNodeList): + * dom/ClassNodeList.h: + * dom/DOMAllInOne.cpp: + * dom/Document.cpp: + (WebCore::Document::registerNodeListCache): + (WebCore::Document::unregisterNodeListCache): + (WebCore): + * dom/Document.h: + (WebCore): + (Document): + * dom/DynamicNodeList.cpp: Removed. + * dom/DynamicNodeList.h: Removed. + * dom/LiveNodeList.cpp: Copied from Source/WebCore/dom/DynamicNodeList.cpp. + (WebCore::LiveNodeListBase::rootNode): + (WebCore::LiveNodeListBase::invalidateCache): + (WebCore::LiveNodeListBase::invalidateIdNameCacheMaps): + (WebCore::LiveNodeListBase::reportMemoryUsage): + (WebCore::LiveNodeList::namedItem): + * dom/LiveNodeList.h: Copied from Source/WebCore/dom/DynamicNodeList.h. + (WebCore::LiveNodeListBase::LiveNodeListBase): + (WebCore::LiveNodeListBase::shouldInvalidateTypeOnAttributeChange): + (WebCore::LiveNodeList::LiveNodeList): + (WebCore::LiveNodeList::~LiveNodeList): + (LiveNodeList): + * dom/MicroDataItemList.cpp: + (WebCore::MicroDataItemList::MicroDataItemList): + * dom/MicroDataItemList.h: + * dom/NameNodeList.cpp: + (WebCore::NameNodeList::NameNodeList): + * dom/NameNodeList.h: + * dom/Node.cpp: + (WebCore::shouldInvalidateNodeListCachesForAttr): + (WebCore::Document::invalidateNodeListCaches): + * dom/Node.h: + (WebCore): + * dom/NodeList.h: + (WebCore::NodeList::isLiveNodeList): + * dom/NodeRareData.h: + (NodeListsNodeData): + (WebCore::NodeListsNodeData::removeCacheWithAtomicName): + (WebCore::NodeListsNodeData::removeCacheWithName): + (WebCore::NodeListsNodeData::removeCacheWithQualifiedName): + (WebCore::NodeListsNodeData::adoptTreeScope): + * dom/PropertyNodeList.cpp: + (WebCore::PropertyNodeList::PropertyNodeList): + * dom/PropertyNodeList.h: + * dom/TagNodeList.cpp: + (WebCore::TagNodeList::TagNodeList): + * dom/TagNodeList.h: + * html/HTMLCollection.cpp: + (WebCore::HTMLCollection::HTMLCollection): + (WebCore::LiveNodeListBase::iterateForNextNode): + (WebCore::LiveNodeListBase::itemBeforeOrAfter): + (WebCore::LiveNodeListBase::itemBefore): + (WebCore::LiveNodeListBase::itemAfter): + (WebCore::LiveNodeListBase::isLastItemCloserThanLastOrCachedItem): + (WebCore::LiveNodeListBase::isFirstItemCloserThanCachedItem): + (WebCore::LiveNodeListBase::setItemCache): + (WebCore::LiveNodeListBase::length): + (WebCore::LiveNodeListBase::item): + (WebCore::LiveNodeListBase::itemBeforeOrAfterCachedItem): + * html/HTMLCollection.h: + * html/LabelsNodeList.cpp: + (WebCore::LabelsNodeList::LabelsNodeList): + * html/LabelsNodeList.h: + * html/RadioNodeList.cpp: + (WebCore::RadioNodeList::RadioNodeList): + * html/RadioNodeList.h: + +2012-10-08 Robert Hogan <robert@webkit.org> + + Changing position:relative to position:static results in mis-positioned div + https://bugs.webkit.org/show_bug.cgi?id=26397 + + Reviewed by Ojan Vafai. + + When a block changes position from relative to static it is no longer the containing block for any + positioned objects it may have. If any of those positioned objects actually have a position specified + they are going to need a layout as their new containing block will likely have a different location they + need to offset from. Positioned objects without a specified position always get a layout anyway + in layoutPositionedObjects() so no need to worry about them in this situation. + + Test: fast/block/abspos-child-container-changes-from-relative-to-static-expected.html + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::styleWillChange): + (WebCore::RenderBlock::layoutPositionedObjects): + (WebCore::RenderBlock::removePositionedObjects): + * rendering/RenderBlock.h: + (RenderBlock): + +2012-11-24 Antti Koivisto <antti@apple.com> + + Make renderer construction less generic + https://bugs.webkit.org/show_bug.cgi?id=103175 + + Reviewed by Ojan Vafai. + + The renderer construction code currently operates on Nodes and is very generic. In reality + only Element and Text nodes can have renderers and the Text case is much simpler. + + This patch separates the Text and Element renderer construction paths and makes it statically + known that other Node types can't have renderers. Less generic code is less branchy and enables + further optimizations. + + * dom/CharacterData.cpp: + (WebCore::CharacterData::parserAppendData): + (WebCore::CharacterData::setDataAndUpdate): + (WebCore): + (WebCore::CharacterData::rendererIsNeeded): + (WebCore::CharacterData::createRenderer): + + Only Text subclass of CharacterData can have renderers. + + * dom/CharacterData.h: + (CharacterData): + * dom/ContainerNode.h: + (WebCore::ContainerNode::childShouldCreateRenderer): + + Move childShouldCreateRenderer from Node to ContainerNode. + + (ContainerNode): + * dom/Element.cpp: + (WebCore::Element::rendererIsNeeded): + (WebCore): + (WebCore::Element::attach): + (WebCore::Element::childShouldCreateRenderer): + * dom/Element.h: + + Move rendererIsNeeded and createRenderer from Node to Element. + + (Element): + * dom/Node.cpp: + (WebCore::Node::attach): + (WebCore): + * dom/Node.h: + (Node): + * dom/NodeRenderingContext.cpp: + (WebCore::NodeRenderingContext::createRendererForElementIfNeeded): + (WebCore::NodeRenderingContext::createRendererForTextIfNeeded): + + Separate the Element and Text renderer creation paths. Both are less branchy. + The Text path is much simpler and avoids a bunch of virtual calls. + + (WebCore): + * dom/NodeRenderingContext.h: + (NodeRenderingContext): + * dom/Text.cpp: + (WebCore::Text::textRendererIsNeeded): + (WebCore::Text::createTextRendererIfNeeded): + (WebCore): + (WebCore::Text::createTextRenderer): + (WebCore::Text::attach): + (WebCore::Text::updateTextRenderer): + * dom/Text.h: + + Add non-virtual Text specific functions. + + (WebCore): + (Text): + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::clone): + +2012-11-22 Ryosuke Niwa <rniwa@webkit.org> + + REGRESSION(r135493): HTMLCollection and DynamicNodeList have two vtable pointers + https://bugs.webkit.org/show_bug.cgi?id=103096 + + Reviewed by Sam Weinig. + + Co-authored by Ilya Tikhonovsky. + + Made DynamicNodeListCacheBase inherit from NodeList. While HTMLCollection doesn't inherit + from NodeList in IDL, it makes a lot of sense for the C++ implementation to do so via + DynamicNodeListCacheBase since HTMLCollection and live NodeList share a lot of code in + DynamicNodeListCacheBase. + + This lets remove proxies for item() and length() in DynamicNodeList and HTMLCollection + and directly implement them in DynamicNodeListCacheBase which used to provide itemCommon() + and lengthCommon(). + + Also renamed NodeList::itemWithName() to NodeList::namedItem() to match HTMLCollection's + naming convention. + + Finally, removed reportMemoryUsage in DynamicNodeList::reportMemoryUsage since DynamicNodeList + now uses single inheritance. + + * bindings/js/JSNodeListCustom.cpp: + (WebCore::JSNodeList::canGetItemsForName): Calls namedItem, which has been renamed from + itemWithName. + (WebCore::JSNodeList::nameGetter): Ditto. + * bindings/v8/custom/V8NodeListCustom.cpp: + (WebCore::V8NodeList::namedPropertyGetter): Ditto. + * bindings/v8/custom/V8NamedNodesCollection.cpp: + (WebCore::V8NamedNodesCollection::namedItem): Renamed from itemWithName. + * bindings/v8/custom/V8NamedNodesCollection.h: + * dom/ChildNodeList.cpp: + (WebCore::ChildNodeList::nodeMatches): Updated comment. + * dom/DynamicNodeList.cpp: + (WebCore::DynamicNodeList::namedItem): Renamed from itemWithName. + * dom/DynamicNodeList.h: + (DynamicNodeListCacheBase): Inhertis from NodeList and renamed lengthCommon and itemCommon + to virtual length and item respectively. + (DynamicNodeList): Now inherits from just DynamicNodeListCacheBase instead of NodeList + and DynamicNodeListCacheBase since the former now inhertis from NodeList. Also removed + length() and item() since they're implemented in DynamicNodeListCacheBase now and renamed + itemWithName() to namedItem() to match HTMLCollection's naming convention. + * dom/NodeList.h: + (NodeList::namedItem): Renamed from itemWithName. Note that this member function is not + exposed via IDL. It's merely used in the binding code. + * dom/StaticHashSetNodeList.cpp: + (WebCore::StaticHashSetNodeList::namedItem): Ditto. + * dom/StaticHashSetNodeList.h: + (StaticHashSetNodeList::namedItem): Ditto. + * dom/StaticNodeList.cpp: + (WebCore::StaticNodeList::namedItem): Ditto. + * dom/StaticNodeList.h: + (StaticNodeList::namedItem): Ditto. + * html/HTMLCollection.cpp: + (WebCore::DynamicNodeListCacheBase::length): Renamed from lengthCommon. + (WebCore::DynamicNodeListCacheBase::item): Renamed from itemCommon. + * html/HTMLCollection.h: + (HTMLCollection): Inherits from DynamicNodeListCacheBase since DynamicNodeListCacheBase + is already RefCount'ed and NodeList, from which DynamicNodeListCacheBase inherits, + inherits from ScriptWrappable. + +2012-11-24 Christophe Dumez <christophe.dumez@intel.com> + + [EFL] Refactor RenderThemeEfl::paintThemePart() + https://bugs.webkit.org/show_bug.cgi?id=103192 + + Reviewed by Kenneth Rohde Christiansen. + + Refactor RenderThemeEfl::paintThemePart() so that: + - Some C'ism is removed + - RTL related code is moved to applyEdjeRTLState() + - evas_render() is called instead of evas_render_updates() + to avoid creating uselessly update rects. + + No new tests, no behavior change for layout tests. + + * platform/efl/RenderThemeEfl.cpp: + (WebCore::RenderThemeEfl::applyEdjeRTLState): + (WebCore): + (WebCore::RenderThemeEfl::paintThemePart): + * platform/efl/RenderThemeEfl.h: + (RenderThemeEfl): + +2012-11-24 Brent Fulgham <bfulgham@webkit.org> + + [WinCairo] Avoid access violation when frame is NULL. + https://bugs.webkit.org/show_bug.cgi?id=68753 + + BitmapImage::drawFrameMatchingSourceSize causes an access violation + if BitmapImage::frameAtIndex returns NULL. (Found by David Delaune). + + Reviewed by Simon Fraser. + + * platform/graphics/win/ImageCairoWin.cpp: + (WebCore::BitmapImage::drawFrameMatchingSourceSize): Check for null + cairo_surface_t pointer and avoid dereferencing. + +2012-11-24 Christophe Dumez <christophe.dumez@intel.com> + + [EFL] Refactor RenderThemeEfl::getThemePartFromCache() + https://bugs.webkit.org/show_bug.cgi?id=103186 + + Reviewed by Kenneth Rohde Christiansen. + + Refactor getThemePartFromCache() so that a list is used + for the cache instead of a vector. The function moves + items to the head of the container which is much more + efficient with a list than a vector. + + The list ordering is also slightly altered so that the + cached parts that were used last come first. Previously, + they were sorted by creation time which may cause an + item to be removed from the cache because it is older + even if is was used recently. + + This patch also gets rid of some code duplication at the + end of the function. + + No new tests, no behavior change. + + * platform/efl/RenderThemeEfl.cpp: + (WebCore::RenderThemeEfl::ThemePartCacheEntry::create): Return + a smart pointer instead of a raw pointer. + (WebCore::RenderThemeEfl::getThemePartFromCache): + (WebCore::RenderThemeEfl::clearThemePartCache): Rename + flushThemePartCache to clearThemePartCache for clarity. + (WebCore::RenderThemeEfl::loadTheme): + (WebCore::RenderThemeEfl::RenderThemeEfl): + (WebCore::RenderThemeEfl::~RenderThemeEfl): + * platform/efl/RenderThemeEfl.h: + (ThemePartCacheEntry): + (RenderThemeEfl): + +2012-11-24 Liam Quinn <lquinn@rim.com> + + [BlackBerry] RTSP should use the same MediaDocument as HTTP videos. + https://bugs.webkit.org/show_bug.cgi?id=103185 + RIM PR 250114 + + Reviewed by George Staikos. + + Make our MediaPlayer implementation indicate that it supports RTSP. That way, DOMImplementation::createDocument will create the same MediaDocument as is used for HTTP videos. + + * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp: + (WebCore::MediaPlayerPrivate::supportsType): + +2012-11-24 Andreas Kling <akling@apple.com> + + Put computed style 'font-family' values in the CSSValuePool. + <http://webkit.org/b/103184> + + Reviewed by Ojan Vafai. + + Use CSSValuePool::createFontFamilyValue() when handing out 'font-family' values from CSSComputedStyleDeclaration. + This avoids creating extra CSSPrimitiveValue objects since we already have these in the pool from parsing. + Also added a max capacity to the font-family cache (using random eviction.) + + * css/CSSComputedStyleDeclaration.cpp: + (WebCore::valueForFamily): + * css/CSSValuePool.cpp: + (WebCore::CSSValuePool::createFontFamilyValue): + +2012-11-24 Hayato Ito <hayato@chromium.org> + + It's confusing that return values of 'bool Node::dispatchEvent(...)' and 'bool Node::dispatchMouseEvent(..)' have the opposite meanings. + https://bugs.webkit.org/show_bug.cgi?id=103058 + + Reviewed by Ojan Vafai. + + Refactor MouseEventDispatchMediator::dispatchEvent() and + EventHandler::dispatchMouseEvent() so that they return bool + which has the same meaning of the return value of + Node::dispatchEvent(). + + No tests. No change in behavior. + + * dom/MouseEvent.cpp: + (WebCore::MouseEventDispatchMediator::dispatchEvent): + * page/EventHandler.cpp: + (WebCore::EventHandler::handleMousePressEvent): + (WebCore::EventHandler::handleMouseDoubleClickEvent): + (WebCore::EventHandler::handleMouseMoveEvent): + (WebCore::EventHandler::handleMouseReleaseEvent): + (WebCore::EventHandler::dispatchMouseEvent): + (WebCore::EventHandler::sendContextMenuEvent): + (WebCore::EventHandler::sendContextMenuEventForKey): + +2012-11-23 Kangil Han <kangil.han@samsung.com> + + Fix unused parameter compile warnings + https://bugs.webkit.org/show_bug.cgi?id=103167 + + Reviewed by Gyuyoung Kim. + + Remove compile warning messages by omitting parameter name and using UNUSED_PARAM. + + * accessibility/atk/WebKitAccessibleHyperlink.cpp: + (webkitAccessibleHyperlinkIsSelectedLink): + * accessibility/atk/WebKitAccessibleInterfaceText.cpp: + (webkitAccessibleTextGetTextAfterOffset): + (webkitAccessibleTextGetTextAtOffset): + (webkitAccessibleTextGetTextBeforeOffset): + (webkitAccessibleTextGetOffsetAtPoint): + +2012-11-23 Michael Saboff <msaboff@apple.com> + + listMarkerText() should create 8 bit strings when possible + https://bugs.webkit.org/show_bug.cgi?id=103011 + + Reviewed by Filip Pizlo. + + Made processing of marker text items use 8 bit strings where possible in order to reduce 16 bit strings. + + Changes covered by existing tests. + + * rendering/RenderListMarker.cpp: + (WebCore::toRoman): Changed character constants and buffer to build string to LChar's + (WebCore::toAlphabeticOrNumeric): Made a template based on character type. + (WebCore::toSymbolic): Made a template based on character type. + (WebCore::toAlphabetic): Made a template based on character type. + (WebCore::toNumeric): Added character type template parameter. + (WebCore::listMarkerText): Changed character constants to LChar where possible. + +2012-11-23 Robert Kroeger <rjkroege@chromium.org> + + Remove unused ScrollByPixelVelocity + https://bugs.webkit.org/show_bug.cgi?id=102840 + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=80311 wrongly introduced a new + kind of scroll: "ScrollByPixelVelocity". This code is not used on any platform + and will not be of use in the future so this patch removes it. + + No new tests: code removal/cleanup. + + * page/EventHandler.cpp: + (WebCore::EventHandler::defaultWheelEventHandler): + (WebCore::EventHandler::handleGestureEvent): + * platform/PlatformWheelEvent.h: + * platform/ScrollAnimator.cpp: + (WebCore::ScrollAnimator::handleWheelEvent): + * platform/ScrollAnimatorNone.cpp: + (WebCore::ScrollAnimatorNone::ScrollAnimatorNone): + (WebCore::ScrollAnimatorNone::scroll): + (WebCore::ScrollAnimatorNone::cancelAnimations): + (WebCore::ScrollAnimatorNone::animationTimerFired): + * platform/ScrollAnimatorNone.h: + (ScrollAnimatorNone): + * platform/ScrollTypes.h: + * platform/ScrollableArea.cpp: + (WebCore::ScrollableArea::scroll): + +2012-11-23 Adenilson Cavalcanti <cavalcantii@gmail.com> + + Removing unnecessary RenderBox friend access in RenderObject + https://bugs.webkit.org/show_bug.cgi?id=103159 + + Reviewed by Eric Seidel. + + RenderObject has several classes marked as friend, between them, + there is RenderBox which is derived from it indirectly and is not accessing + its forefather private data making unnecessary the 'friend' access level. + + No new tests, no changes in functionality. + + * rendering/RenderObject.h: + (RenderObject): + +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Implement the parsing of the CSS3 background-position property which + allows to specify up to four values to position the background. It is + documented here : + http://www.w3.org/TR/css3-background/#the-background-position . I + decided to split up the patch is two pieces, the parsing and later I + will do the rendering. I kept the old code as much as possible (i.e. + the two values parsing) as it is used not only by background-position + but by few other properties. The new four values support is only valid + on the property itself but does not work on the shorthand. + + Opera has already implemented this feature. + + I extended backgrounds/background-position-parsing-2.html to cover the + new possible values as well as buggy values. + + * Configurations/FeatureDefines.xcconfig: + * GNUmakefile.am: + * GNUmakefile.features.am: + * css/CSSParser.cpp: + (WebCore::CSSParser::parseFillPositionComponent): Modify this function + to allow creation of CSS primitive values with not only percentage or + length but with keywords also as the new <position> type allows to + specify keywords, for example top 30px right 20px. + (WebCore): + (WebCore::isValueConflictingWithCurrentEdge): + (WebCore::isBackgroundPositionKeyword): + (WebCore::CSSParser::parse3ValuesBackgroundPosition): + (WebCore::CSSParser::parse4ValuesBackgroundPosition): + (WebCore::CSSParser::parseFillBackgroundPosition): This function counts + the number of words for the property value and call dedicated parsing + functions for each case. Note that in case of two values we just call the old CSS 2.1 + method. + (WebCore::CSSParser::parseFillPosition): + (WebCore::CSSParser::parseFillProperty): Only call the new parsing + function if the feature is activated otherwise fallback to the old code + path. + * css/CSSParser.h: + +2012-11-23 Justin Novosad <junov@google.com> + + Adding occlusion detection to reduce overdraw in RenderBox background rendering + https://bugs.webkit.org/show_bug.cgi?id=102557 + + Reviewed by Stephen White. + + Adding hasAlpha method to all classes dervived from CSSImageValue and + StyleImage, in order to support occlusion testing. + This allows the FillLayer recursion to stop early when an opaque layer + is encountered while applying a CSS background style. This also allows + the elimination of background color application when the background is + completely covered by an image. The optimization also skips the + clearing of the page's root element when the page background is + entirely covered by an image (e.g a tiled bitmap or a gradient) + + Test: fast/backgrounds/background-opaque-images-over-color.html + + * css/CSSCrossfadeValue.cpp: + (WebCore::subimageHasAlpha): + (WebCore): + (WebCore::CSSCrossfadeValue::isPending): + (WebCore::CSSCrossfadeValue::hasAlpha): + * css/CSSCrossfadeValue.h: + (CSSCrossfadeValue): + * css/CSSGradientValue.cpp: + (WebCore::CSSGradientValue::hasAlpha): + (WebCore): + * css/CSSGradientValue.h: + (CSSGradientValue): + * css/CSSImageGeneratorValue.cpp: + (WebCore::CSSImageGeneratorValue::hasAlpha): + (WebCore): + * css/CSSImageGeneratorValue.h: + (CSSImageGeneratorValue): + * css/CSSImageValue.cpp: + (WebCore::CSSImageValue::hasAlpha): + (WebCore): + * css/CSSImageValue.h: + (WebCore): + (CSSImageValue): + * loader/cache/CachedImage.cpp: + (WebCore::CachedImage::currentFrameHasAlpha): + Test whether a cached image has alpha, with side effect of ensuring + the image is in cache. (new method) + (WebCore): + * loader/cache/CachedImage.h: + (CachedImage): + * rendering/RenderBox.cpp: + (WebCore::RenderBox::paintFillLayers): + Added layer recursion early exit when an opaque layer is encountered. + * rendering/RenderBoxModelObject.cpp: + (WebCore::RenderBoxModelObject::paintFillLayerExtended): + Eliminated background color fill when the layer contains an opaque + image that covers the entire RenderBox. + * rendering/style/FillLayer.cpp: + (WebCore::FillLayer::hasOpaqueImage): + Returns true if the layer's image is known to be fully opaque. + (WebCore): + (WebCore::FillLayer::hasRepeatXY): + * rendering/style/FillLayer.h: + (FillLayer): + * rendering/style/StyleCachedImage.cpp: + (WebCore::StyleCachedImage::hasAlpha): + (WebCore): + * rendering/style/StyleCachedImage.h: + (StyleCachedImage): + * rendering/style/StyleCachedImageSet.cpp: + (WebCore::StyleCachedImageSet::hasAlpha): + (WebCore): + * rendering/style/StyleCachedImageSet.h: + (StyleCachedImageSet): + * rendering/style/StyleGeneratedImage.cpp: + (WebCore::StyleGeneratedImage::hasAlpha): + (WebCore): + * rendering/style/StyleGeneratedImage.h: + (StyleGeneratedImage): + * rendering/style/StyleImage.h: + (StyleImage): + * rendering/style/StylePendingImage.h: + (WebCore::StylePendingImage::hasAlpha): + +2012-11-23 Justin Novosad <junov@google.com> + + Page background color bleeds through inner edge of div border with rounded edges + https://bugs.webkit.org/show_bug.cgi?id=103089 + + Reviewed by Stephen White. + + Test that verifies whether a RenderBoxEdge is more than 2 pixels wide + was applying the content scale factor backwards, so the + obscuresBackgroundEdge was falsely passing for downsized boxes. + + Test: fast/backgrounds/gradient-background-leakage-2.html + + * rendering/RenderBoxModelObject.cpp: + (WebCore::BorderEdge::obscuresBackgroundEdge): + +2012-11-23 Huang Dongsung <luxtella@company100.net> + + [TexMap] Remove dependency of TextureMapperLayer on GraphicsLayerTextureMapper. + https://bugs.webkit.org/show_bug.cgi?id=103046 + + Reviewed by Noam Rosenthal. + + It is a preparation patch for Threaded Coordinated Graphics on WK1. + + We want to make TextureMapperLayer into an actor model. After making an actor + model, GraphicsLayerTextureMapper and LayerTreeRenderer will communicate with + TextureMapperLayer using message passing. In the first step, we want to hide + GraphicsLayerTextureMapper from TextureMapperLayer. + + There are 2 kinds of dependencies of TextureMapperLayer in GraphicsLayerTextureMapper. + 1. To query layer states + 2. To paint layer contents + + In this patch, we removed the second dependency. Currently, TextureMapperLayer + requests painting contents to GraphicsLayerTextureMapper in WK1 while + Coordinated Graphics prepares the contents in LayerTreeRenderer. This patch + makes WK1 prepare the contents in GraphicsLayerTextureMapper like + LayerTreeRenderer. + + We will remove the first dependency in a follow-up patch. + + Covered by existing layout tests. + + * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: + (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper): + (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly): + (WebCore::GraphicsLayerTextureMapper::flushCompositingState): + (WebCore): + (WebCore::GraphicsLayerTextureMapper::didFlushCompositingState): + (WebCore::GraphicsLayerTextureMapper::didFlushCompositingStateRecursive): + (WebCore::GraphicsLayerTextureMapper::updateBackingStore): + (WebCore::GraphicsLayerTextureMapper::prepareBackingStore): + (WebCore::GraphicsLayerTextureMapper::shouldHaveBackingStore): + (WebCore::GraphicsLayerTextureMapper::drawRepaintCounter): + (WebCore::GraphicsLayerTextureMapper::setDebugBorder): + * platform/graphics/texmap/GraphicsLayerTextureMapper.h: + (GraphicsLayerTextureMapper): + (WebCore::GraphicsLayerTextureMapper::setHasOwnBackingStore): + * platform/graphics/texmap/TextureMapperLayer.cpp: + (WebCore::TextureMapperLayer::rootLayer): + (WebCore::TextureMapperLayer::paintSelf): + (WebCore::TextureMapperLayer::textureMapper): + (WebCore): + (WebCore::TextureMapperLayer::flushCompositingState): + (WebCore::TextureMapperLayer::flushCompositingStateSelf): + * platform/graphics/texmap/TextureMapperLayer.h: + (WebCore): + (WebCore::TextureMapperLayer::TextureMapperLayer): + (TextureMapperLayer): + (WebCore::TextureMapperLayer::setBackingStore): + (State): + (WebCore::TextureMapperLayer::State::State): + +2012-11-23 Carlos Garcia Campos <cgarcia@igalia.com> + + [ENCHANT] Infinite loop when end word position is not found + https://bugs.webkit.org/show_bug.cgi?id=103139 + + Reviewed by Martin Robinson. + + Covered by existing tests in editing/spelling. + + * editing/visible_units.cpp: + (WebCore::isLogicalStartOfWord): Make it private again. + (WebCore::islogicalEndOfWord): Ditto. + * editing/visible_units.h: + * platform/text/enchant/TextCheckerEnchant.cpp: + (WebCore::TextCheckerEnchant::checkSpellingOfWord): Helper funtion + to check a word inside a string using the loaded dictionaries. + (WebCore::TextCheckerEnchant::checkSpellingOfString): Optimize and + simply the code by using the word iterator to iterate the + words. + * platform/text/enchant/TextCheckerEnchant.h: + (TextCheckerEnchant): + +2012-11-23 Zeno Albisser <zeno@webkit.org> + + [Qt] GraphicsContext3DQt makes wrong surface current. + https://bugs.webkit.org/show_bug.cgi?id=103136 + + blitMultisampleFramebufferAndRestoreContext restores + the wrong surface in case the currentContext is the same + as m_platformContext. + In this case we would reset the bound surface to NULL. + Instead we should just leave the context unchanged. + + Reviewed by Kenneth Rohde Christiansen. + + * platform/graphics/qt/GraphicsContext3DQt.cpp: + (WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext): + +2012-11-23 Alexei Filippov <alph@chromium.org> + + Web Inspector: remove total item from NMI snapshot grid + https://bugs.webkit.org/show_bug.cgi?id=101926 + + Reviewed by Yury Semikhatsky. + + * inspector/front-end/NativeMemorySnapshotView.js: + (WebInspector.NativeSnapshotDataGrid): + +2012-11-23 Zeno Albisser <zeno@webkit.org> + + [Qt] GraphicsContext3DQt should not overwrite glClearColor of sharing context. + https://bugs.webkit.org/show_bug.cgi?id=103135 + + In case we use GraphicsContext3DQt to render into or + read from an existing context, we should not reset + the glClearColor on construction. + Otherwise we might overwrite an existing definition from + the sharing context. + + Reviewed by Kenneth Rohde Christiansen. + + * platform/graphics/qt/GraphicsContext3DQt.cpp: + (WebCore::GraphicsContext3D::GraphicsContext3D): + +2012-11-23 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: damaging last chunk does not remove its garbage from DOM + https://bugs.webkit.org/show_bug.cgi?id=103132 + + Reviewed by Vsevolod Vlasov. + + Removing everything between undamaged chunks, not registered chunk rows. + + * inspector/front-end/DefaultTextEditor.js: + (WebInspector.TextEditorMainPanel.prototype._insertSpanBefore): + (WebInspector.TextEditorMainPanel.prototype._updateChunksForRanges): + (WebInspector.TextEditorMainChunk.prototype.updateCollapsedLineRow): + (WebInspector.TextEditorMainChunk.prototype.firstElement): + (WebInspector.TextEditorMainChunk.prototype.lastElement): + +2012-11-23 Ilya Tikhonovsky <loislo@chromium.org> + + RenderLayer minor clean-up: replace raw pointers with OwnPtrs. + https://bugs.webkit.org/show_bug.cgi?id=103134 + + Reviewed by Eric Seidel. + + I found that RenderLayer still uses raw pointers to the objects which it owns. + Looks like these pointers could be replaced with OwnPtrs. + + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::RenderLayer): + (WebCore::RenderLayer::~RenderLayer): + (WebCore::RenderLayer::paintLayerContents): + (WebCore::RenderLayer::hitTestLayer): + (WebCore::RenderLayer::updateNormalFlowList): + (WebCore::RenderLayer::collectLayers): + (WebCore::RenderLayer::styleChanged): + * rendering/RenderLayer.h: + (WebCore::RenderLayer::marquee): + (WebCore::RenderLayer::posZOrderList): + (WebCore::RenderLayer::negZOrderList): + (WebCore::RenderLayer::normalFlowList): + (RenderLayer): + (WebCore::RenderLayer::clearZOrderLists): + +2012-11-23 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][AC] Mouse cursor is not updated when accelerated compositing is enabled + https://bugs.webkit.org/show_bug.cgi?id=103131 + + Reviewed by Kenneth Rohde Christiansen. + + Make sure we try to get the Ecore_X_Window using ecore_evas_gl_x11_window_get() + in applyFallbackCursor() if accelerated compositing is enabled instead of + using ecore_evas_software_x11_window_get(). This fixes mouse cursor update + when accelerated compositing is enabled. + + No new tests, no behavior change for layout tests. + + * platform/efl/EflScreenUtilities.cpp: + (WebCore::applyFallbackCursor): + +2012-11-16 Yury Semikhatsky <yurys@chromium.org> + + Memory instrumentation: extract MemoryObjectInfo declaration into a separate file + https://bugs.webkit.org/show_bug.cgi?id=102510 + + Reviewed by Pavel Feldman. + + Added necessary includes where MemoryObjectInfo declaration is required. + + * platform/audio/FFTFrame.cpp: + * rendering/style/RenderStyle.cpp: + * rendering/style/StyleRareInheritedData.cpp: + * rendering/style/StyleRareNonInheritedData.cpp: + 2012-11-23 Dan Carney <dcarney@google.com> Remove V8DOMWindowShell::getEntered diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig index 0e1b15340..588ddb80b 100644 --- a/Source/WebCore/Configurations/FeatureDefines.xcconfig +++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig @@ -48,6 +48,7 @@ ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS; ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS; ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION; ENABLE_CSS_VARIABLES = ; +ENABLE_CSS3_BACKGROUND = ; ENABLE_CSS3_CONDITIONAL_RULES = ; ENABLE_CSS3_TEXT = ; ENABLE_CUSTOM_SCHEME_HANDLER = ; @@ -157,4 +158,5 @@ ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); + diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am index 0ad046c0b..594bda003 100644 --- a/Source/WebCore/GNUmakefile.am +++ b/Source/WebCore/GNUmakefile.am @@ -381,6 +381,15 @@ feature_defines_overrides += ENABLE_SPELLCHECK=0 endif # END ENABLE_SPELLCHECK # --- +# CSS3 Background support +# --- +if ENABLE_CSS3_BACKGROUND +feature_defines_overrides += ENABLE_CSS3_BACKGROUND=1 +else +feature_defines_overrides += ENABLE_CSS3_BACKGROUND=0 +endif # END ENABLE_CSS3_BACKGROUND + +# --- # CSS3 Conditional Rules support # --- if ENABLE_CSS3_CONDITIONAL_RULES diff --git a/Source/WebCore/GNUmakefile.features.am b/Source/WebCore/GNUmakefile.features.am index 4587b3dd9..c1276d161 100644 --- a/Source/WebCore/GNUmakefile.features.am +++ b/Source/WebCore/GNUmakefile.features.am @@ -6,6 +6,7 @@ feature_defines_defaults += \ ENABLE_BLOB=1 \ ENABLE_CHANNEL_MESSAGING=1 \ ENABLE_CSP_NEXT=1 \ + ENABLE_CSS3_BACKGROUND=0 \ ENABLE_CSS3_TEXT=1 \ ENABLE_CSS_BOX_DECORATION_BREAK=1 \ ENABLE_CSS_COMPOSITING=0 \ diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am index deb87bb87..70e108730 100644 --- a/Source/WebCore/GNUmakefile.list.am +++ b/Source/WebCore/GNUmakefile.list.am @@ -2772,8 +2772,6 @@ webcore_sources += \ Source/WebCore/dom/DOMStringMap.cpp \ Source/WebCore/dom/DOMStringMap.h \ Source/WebCore/dom/DOMTimeStamp.h \ - Source/WebCore/dom/DynamicNodeList.cpp \ - Source/WebCore/dom/DynamicNodeList.h \ Source/WebCore/dom/Element.cpp \ Source/WebCore/dom/Element.h \ Source/WebCore/dom/ElementAttributeData.cpp \ @@ -2825,6 +2823,8 @@ webcore_sources += \ Source/WebCore/dom/IdTargetObserver.h \ Source/WebCore/dom/IdTargetObserverRegistry.cpp \ Source/WebCore/dom/IdTargetObserverRegistry.h \ + Source/WebCore/dom/LiveNodeList.cpp \ + Source/WebCore/dom/LiveNodeList.h \ Source/WebCore/dom/HashChangeEvent.h \ Source/WebCore/dom/KeyboardEvent.cpp \ Source/WebCore/dom/KeyboardEvent.h \ @@ -2924,6 +2924,7 @@ webcore_sources += \ Source/WebCore/dom/SelectorQuery.h \ Source/WebCore/dom/ShadowRoot.cpp \ Source/WebCore/dom/ShadowRoot.h \ + Source/WebCore/dom/SimulatedClickOptions.h \ Source/WebCore/dom/SpaceSplitString.cpp \ Source/WebCore/dom/SpaceSplitString.h \ Source/WebCore/dom/StaticHashSetNodeList.cpp \ diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri index 0b7ec42eb..c970f5e90 100644 --- a/Source/WebCore/Target.pri +++ b/Source/WebCore/Target.pri @@ -384,7 +384,6 @@ SOURCES += \ dom/DOMStringList.cpp \ dom/DOMStringMap.cpp \ dom/DatasetDOMStringMap.cpp \ - dom/DynamicNodeList.cpp \ dom/Element.cpp \ dom/ElementAttributeData.cpp \ dom/ElementRareData.cpp \ @@ -406,6 +405,7 @@ SOURCES += \ dom/IconURL.cpp \ dom/IdTargetObserver.cpp \ dom/IdTargetObserverRegistry.cpp \ + dom/LiveNodeList.cpp \ dom/KeyboardEvent.cpp \ dom/MessageChannel.cpp \ dom/MessageEvent.cpp \ @@ -1562,7 +1562,6 @@ HEADERS += \ dom/DOMStringMap.h \ dom/DOMTimeStamp.h \ dom/DatasetDOMStringMap.h \ - dom/DynamicNodeList.h \ dom/Element.h \ dom/ElementShadow.h \ dom/ElementAttributeData.h \ @@ -1581,6 +1580,7 @@ HEADERS += \ dom/GestureEvent.h \ dom/IdTargetObserver.h \ dom/IdTargetObserverRegistry.h \ + dom/LiveNodeList.h \ dom/KeyboardEvent.h \ dom/MessageChannel.h \ dom/MessageEvent.h \ @@ -1621,6 +1621,7 @@ HEADERS += \ dom/ScriptExecutionContext.h \ dom/SelectorQuery.h \ dom/ShadowRoot.h \ + dom/SimulatedClickOptions.h \ dom/SpaceSplitString.h \ dom/StaticNodeList.h \ dom/StyledElement.h \ diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi index e9f3b20e9..294885cde 100644 --- a/Source/WebCore/WebCore.gypi +++ b/Source/WebCore/WebCore.gypi @@ -690,6 +690,7 @@ 'dom/ScriptExecutionContext.h', 'dom/ScriptRunner.h', 'dom/ShadowRoot.h', + 'dom/SimulatedClickOptions.h', 'dom/SpaceSplitString.h', 'dom/StyledElement.h', 'dom/Text.h', @@ -3803,8 +3804,6 @@ 'dom/DocumentParser.cpp', 'dom/DocumentStyleSheetCollection.cpp', 'dom/DocumentType.cpp', - 'dom/DynamicNodeList.cpp', - 'dom/DynamicNodeList.h', 'dom/ElementShadow.cpp', 'dom/Element.cpp', 'dom/ElementAttributeData.cpp', @@ -3845,6 +3844,8 @@ 'dom/IdTargetObserverRegistry.cpp', 'dom/IdTargetObserverRegistry.h', 'dom/KeyboardEvent.cpp', + 'dom/LiveNodeList.cpp', + 'dom/LiveNodeList.h', 'dom/MessageChannel.cpp', 'dom/MessageChannel.h', 'dom/MessageEvent.cpp', @@ -3925,6 +3926,7 @@ 'dom/SelectorQuery.h', 'dom/ShadowRoot.cpp', 'dom/ShadowRoot.h', + 'dom/SimulatedClickOptions.h', 'dom/SpaceSplitString.cpp', 'dom/StaticHashSetNodeList.cpp', 'dom/StaticHashSetNodeList.h', diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj index 22eda2918..de6c19ddc 100755 --- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj +++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj @@ -54350,6 +54350,10 @@ >
</File>
<File
+ RelativePath="..\dom\SimulatedClickOptions.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\SpaceSplitString.cpp"
>
<FileConfiguration
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj index f7173f8e9..cd7327aba 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj @@ -911,6 +911,7 @@ 316FE1180E6E1DA700BF6088 /* ImplicitAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE10E0E6E1DA700BF6088 /* ImplicitAnimation.h */; }; 316FE1190E6E1DA700BF6088 /* KeyframeAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE10F0E6E1DA700BF6088 /* KeyframeAnimation.cpp */; }; 316FE11A0E6E1DA700BF6088 /* KeyframeAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE1100E6E1DA700BF6088 /* KeyframeAnimation.h */; }; + 31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3194616213020B20004BB3F8 /* JSWebKitAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3194616013020B20004BB3F8 /* JSWebKitAnimation.cpp */; }; 3194616313020B20004BB3F8 /* JSWebKitAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 3194616113020B20004BB3F8 /* JSWebKitAnimation.h */; }; 3194616A13020B66004BB3F8 /* DOMWebKitAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 3194616813020B66004BB3F8 /* DOMWebKitAnimation.h */; }; @@ -5564,8 +5565,8 @@ BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC772E121331620C001EC9CE /* CSSLineBoxContainValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC772E16133162C2001EC9CE /* CSSLineBoxContainValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */; }; BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7F44A70B9E324E00A9D081 /* ImageObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BC7FA6200D1F0CBD00DB22A9 /* DynamicNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7FA61E0D1F0CBD00DB22A9 /* DynamicNodeList.cpp */; }; - BC7FA6210D1F0CBD00DB22A9 /* DynamicNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7FA61F0D1F0CBD00DB22A9 /* DynamicNodeList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + BC7FA6200D1F0CBD00DB22A9 /* LiveNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */; }; + BC7FA6210D1F0CBD00DB22A9 /* LiveNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC7FA62D0D1F0EFF00DB22A9 /* StaticNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7FA62B0D1F0EFF00DB22A9 /* StaticNodeList.h */; }; BC7FA62E0D1F0EFF00DB22A9 /* StaticNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */; }; BC80C9870CD294EE00A0B7B3 /* CSSTimingFunctionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC80C9850CD294EE00A0B7B3 /* CSSTimingFunctionValue.cpp */; }; @@ -8082,6 +8083,7 @@ 316FE10E0E6E1DA700BF6088 /* ImplicitAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImplicitAnimation.h; path = animation/ImplicitAnimation.h; sourceTree = "<group>"; }; 316FE10F0E6E1DA700BF6088 /* KeyframeAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KeyframeAnimation.cpp; path = animation/KeyframeAnimation.cpp; sourceTree = "<group>"; }; 316FE1100E6E1DA700BF6088 /* KeyframeAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyframeAnimation.h; path = animation/KeyframeAnimation.h; sourceTree = "<group>"; }; + 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimulatedClickOptions.h; sourceTree = "<group>"; }; 3194616013020B20004BB3F8 /* JSWebKitAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitAnimation.cpp; sourceTree = "<group>"; }; 3194616113020B20004BB3F8 /* JSWebKitAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitAnimation.h; sourceTree = "<group>"; }; 3194616813020B66004BB3F8 /* DOMWebKitAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitAnimation.h; sourceTree = "<group>"; }; @@ -12940,8 +12942,8 @@ BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSLineBoxContainValue.cpp; sourceTree = "<group>"; }; BC7B2AF80450824100A8000F /* Scrollbar.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Scrollbar.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BC7F44A70B9E324E00A9D081 /* ImageObserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageObserver.h; sourceTree = "<group>"; }; - BC7FA61E0D1F0CBD00DB22A9 /* DynamicNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicNodeList.cpp; sourceTree = "<group>"; }; - BC7FA61F0D1F0CBD00DB22A9 /* DynamicNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicNodeList.h; sourceTree = "<group>"; }; + BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiveNodeList.cpp; sourceTree = "<group>"; }; + BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveNodeList.h; sourceTree = "<group>"; }; BC7FA62B0D1F0EFF00DB22A9 /* StaticNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticNodeList.h; sourceTree = "<group>"; }; BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaticNodeList.cpp; sourceTree = "<group>"; }; BC80C9850CD294EE00A0B7B3 /* CSSTimingFunctionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSTimingFunctionValue.cpp; sourceTree = "<group>"; }; @@ -21902,8 +21904,6 @@ BC64640811D7F304006455B0 /* DOMStringMap.h */, BC64647911D800CD006455B0 /* DOMStringMap.idl */, 05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */, - BC7FA61E0D1F0CBD00DB22A9 /* DynamicNodeList.cpp */, - BC7FA61F0D1F0CBD00DB22A9 /* DynamicNodeList.h */, A8C4A7F609D563270003AC8D /* Element.cpp */, A8C4A7F509D563270003AC8D /* Element.h */, 93EEC1EA09C2877700C515D1 /* Element.idl */, @@ -21969,6 +21969,8 @@ 85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */, 85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */, 14CF7C2009F7110600EB3665 /* KeyboardEvent.idl */, + BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */, + BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */, BC9A6144146859D9006057FD /* make_dom_exceptions.pl */, BC9A6145146859D9006057FD /* make_event_factory.pl */, BC9A6146146859D9006057FD /* make_names.pl */, @@ -22094,6 +22096,7 @@ A6D169611346B49B000EB770 /* ShadowRoot.cpp */, A6D169631346B4C1000EB770 /* ShadowRoot.h */, A7DB418114CE1F0A00A2E316 /* ShadowRoot.idl */, + 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */, D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */, D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */, CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */, @@ -22483,7 +22486,7 @@ buildActionMask = 2147483647; files = ( FD1AF1501656F15100C6D4F7 /* ExclusionShapeValue.h in Headers */, - BC7FA6210D1F0CBD00DB22A9 /* DynamicNodeList.h in Headers */, + BC7FA6210D1F0CBD00DB22A9 /* LiveNodeList.h in Headers */, A81369DA097374F600D74463 /* HTMLOptionsCollection.h in Headers */, A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */, A81369DC097374F600D74463 /* HTMLOptionElement.h in Headers */, @@ -25808,6 +25811,7 @@ 53EF766B16530A61004CBE49 /* SettingsMacros.h in Headers */, 447958041643B49A001E0A7F /* ParsedContentType.h in Headers */, FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */, + 31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -26812,7 +26816,7 @@ A7CFB3D50B7ED1180070C32D /* DragImageMac.mm in Sources */, 498770DB1242C535002226BA /* DrawingBuffer.cpp in Sources */, 498771531243F9FA002226BA /* DrawingBufferMac.mm in Sources */, - BC7FA6200D1F0CBD00DB22A9 /* DynamicNodeList.cpp in Sources */, + BC7FA6200D1F0CBD00DB22A9 /* LiveNodeList.cpp in Sources */, FD6ED2C7136B8E66003CF072 /* DynamicsCompressor.cpp in Sources */, FD537356137B653B00008DCE /* DynamicsCompressorKernel.cpp in Sources */, FD6ED2C3136B8E42003CF072 /* DynamicsCompressorNode.cpp in Sources */, diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp index a11281ede..7dd1336bd 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityObject.cpp @@ -55,6 +55,7 @@ #include "TextCheckerClient.h" #include "TextCheckingHelper.h" #include "TextIterator.h" +#include "UserGestureIndicator.h" #include "htmlediting.h" #include "visible_units.h" #include <wtf/StdLibExtras.h> @@ -540,6 +541,8 @@ bool AccessibilityObject::press() const return false; if (Frame* f = actionElem->document()->frame()) f->loader()->resetMultipleFormSubmissionProtection(); + + UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); actionElem->accessKeyAction(true); return true; } diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp index 6ae56ff13..af1e4295e 100644 --- a/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp +++ b/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp @@ -281,7 +281,7 @@ static gint webkitAccessibleHyperlinkGetNAnchors(AtkHyperlink* link) return 1; } -static gboolean webkitAccessibleHyperlinkIsSelectedLink(AtkHyperlink* link) +static gboolean webkitAccessibleHyperlinkIsSelectedLink(AtkHyperlink*) { // Not implemented: this function is deprecated in ATK now notImplemented(); diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp index e16654adf..8957a5984 100644 --- a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp +++ b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp @@ -567,6 +567,12 @@ static gchar* webkitAccessibleTextGetTextAfterOffset(AtkText* text, gint offset, #if PLATFORM(GTK) return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), GAIL_AFTER_OFFSET, boundaryType, offset, startOffset, endOffset); #else + UNUSED_PARAM(text); + UNUSED_PARAM(offset); + UNUSED_PARAM(boundaryType); + UNUSED_PARAM(startOffset); + UNUSED_PARAM(endOffset); + notImplemented(); return 0; #endif @@ -577,6 +583,12 @@ static gchar* webkitAccessibleTextGetTextAtOffset(AtkText* text, gint offset, At #if PLATFORM(GTK) return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), GAIL_AT_OFFSET, boundaryType, offset, startOffset, endOffset); #else + UNUSED_PARAM(text); + UNUSED_PARAM(offset); + UNUSED_PARAM(boundaryType); + UNUSED_PARAM(startOffset); + UNUSED_PARAM(endOffset); + notImplemented(); return 0; #endif @@ -587,6 +599,12 @@ static gchar* webkitAccessibleTextGetTextBeforeOffset(AtkText* text, gint offset #if PLATFORM(GTK) return gail_text_util_get_text(getGailTextUtilForAtk(text), getPangoLayoutForAtk(text), GAIL_BEFORE_OFFSET, boundaryType, offset, startOffset, endOffset); #else + UNUSED_PARAM(text); + UNUSED_PARAM(offset); + UNUSED_PARAM(boundaryType); + UNUSED_PARAM(startOffset); + UNUSED_PARAM(endOffset); + notImplemented(); return 0; #endif @@ -684,7 +702,7 @@ static gint webkitAccessibleTextGetCharacterCount(AtkText* text) return accessibilityObjectLength(core(text)); } -static gint webkitAccessibleTextGetOffsetAtPoint(AtkText* text, gint x, gint y, AtkCoordType coords) +static gint webkitAccessibleTextGetOffsetAtPoint(AtkText* text, gint x, gint y, AtkCoordType) { // FIXME: Use the AtkCoordType // TODO: Is it correct to ignore range.length? diff --git a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp index ea3679e2d..e08e40c07 100644 --- a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp +++ b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp @@ -205,12 +205,8 @@ bool RuntimeEnabledFeatures::isInputTypeDateTimeEnabled = true; #endif #if ENABLE(INPUT_TYPE_DATETIMELOCAL) -#if PLATFORM(CHROMIUM) && !OS(ANDROID) -bool RuntimeEnabledFeatures::isInputTypeDateTimeLocalEnabled = false; -#else bool RuntimeEnabledFeatures::isInputTypeDateTimeLocalEnabled = true; #endif -#endif #if ENABLE(INPUT_TYPE_MONTH) bool RuntimeEnabledFeatures::isInputTypeMonthEnabled = true; diff --git a/Source/WebCore/bindings/gobject/GNUmakefile.am b/Source/WebCore/bindings/gobject/GNUmakefile.am index 88ed16c07..ce87bb53c 100644 --- a/Source/WebCore/bindings/gobject/GNUmakefile.am +++ b/Source/WebCore/bindings/gobject/GNUmakefile.am @@ -237,6 +237,8 @@ webkitgtk_gdom_built_sources += \ DerivedSources/webkit/WebKitDOMRangePrivate.h \ DerivedSources/webkit/WebKitDOMScreen.cpp \ DerivedSources/webkit/WebKitDOMScreenPrivate.h \ + DerivedSources/webkit/WebKitDOMShadowRoot.cpp \ + DerivedSources/webkit/WebKitDOMShadowRootPrivate.h \ DerivedSources/webkit/WebKitDOMStorage.cpp \ DerivedSources/webkit/WebKitDOMStorageInfo.cpp \ DerivedSources/webkit/WebKitDOMStorageInfoPrivate.h \ diff --git a/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp b/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp index 023033f1a..8c079364b 100644 --- a/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp +++ b/Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp @@ -48,7 +48,7 @@ static JSValue getNamedItems(ExecState* exec, JSHTMLOptionsCollection* collectio if (namedItems.size() == 1) return toJS(exec, collection->globalObject(), namedItems[0].get()); - // FIXME: HTML5 specifies that this should be a DynamicNodeList. + // FIXME: HTML5 specifies that this should be a LiveNodeList. return toJS(exec, collection->globalObject(), StaticNodeList::adopt(namedItems).get()); } diff --git a/Source/WebCore/bindings/js/JSNodeListCustom.cpp b/Source/WebCore/bindings/js/JSNodeListCustom.cpp index 741615970..13dc32f93 100644 --- a/Source/WebCore/bindings/js/JSNodeListCustom.cpp +++ b/Source/WebCore/bindings/js/JSNodeListCustom.cpp @@ -26,8 +26,8 @@ #include "config.h" #include "JSNodeList.h" -#include "DynamicNodeList.h" #include "JSNode.h" +#include "LiveNodeList.h" #include "Node.h" #include "NodeList.h" #include <wtf/text/AtomicString.h> @@ -41,20 +41,20 @@ bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handl JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.get().asCell()); if (!jsNodeList->hasCustomProperties()) return false; - if (!jsNodeList->impl()->isDynamicNodeList()) + if (!jsNodeList->impl()->isLiveNodeList()) return false; - return visitor.containsOpaqueRoot(root(static_cast<DynamicNodeList*>(jsNodeList->impl())->ownerNode())); + return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList*>(jsNodeList->impl())->ownerNode())); } bool JSNodeList::canGetItemsForName(ExecState*, NodeList* impl, PropertyName propertyName) { - return impl->itemWithName(propertyNameToAtomicString(propertyName)); + return impl->namedItem(propertyNameToAtomicString(propertyName)); } JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName) { JSNodeList* thisObj = jsCast<JSNodeList*>(asObject(slotBase)); - return toJS(exec, thisObj->globalObject(), thisObj->impl()->itemWithName(propertyNameToAtomicString(propertyName))); + return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName))); } } // namespace WebCore diff --git a/Source/WebCore/bindings/v8/ScriptController.cpp b/Source/WebCore/bindings/v8/ScriptController.cpp index f0aae1fa0..5adf3a090 100644 --- a/Source/WebCore/bindings/v8/ScriptController.cpp +++ b/Source/WebCore/bindings/v8/ScriptController.cpp @@ -112,8 +112,7 @@ ScriptController::ScriptController(Frame* frame) ScriptController::~ScriptController() { - m_windowShell->destroyGlobal(); - clearForClose(); + clearForClose(true); } void ScriptController::clearScriptObjects() @@ -145,27 +144,23 @@ void ScriptController::clearScriptObjects() #endif } -void ScriptController::reset() +void ScriptController::clearForOutOfMemory() { - for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); - iter != m_isolatedWorlds.end(); ++iter) { - iter->value->destroyIsolatedShell(); - } - m_isolatedWorlds.clear(); - V8GCController::hintForCollectGarbage(); + clearForClose(true); } -void ScriptController::clearForOutOfMemory() +void ScriptController::clearForClose(bool destroyGlobal) { - clearForClose(); - m_windowShell->destroyGlobal(); + m_windowShell->clearForClose(destroyGlobal); + for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_isolatedWorlds.end(); ++iter) + iter->value->clearForClose(destroyGlobal); + V8GCController::hintForCollectGarbage(); } void ScriptController::clearForClose() { double start = currentTime(); - reset(); - m_windowShell->clearForClose(); + clearForClose(false); HistogramSupport::histogramCustomCounts("WebCore.ScriptController.clearForClose", (currentTime() - start) * 1000, 0, 10000, 50); } @@ -655,10 +650,12 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement void ScriptController::clearWindowShell(DOMWindow*, bool) { double start = currentTime(); - reset(); // V8 binding expects ScriptController::clearWindowShell only be called // when a frame is loading a new page. This creates a new context for the new page. m_windowShell->clearForNavigation(); + for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_isolatedWorlds.end(); ++iter) + iter->value->clearForNavigation(); + V8GCController::hintForCollectGarbage(); HistogramSupport::histogramCustomCounts("WebCore.ScriptController.clearWindowShell", (currentTime() - start) * 1000, 0, 10000, 50); } diff --git a/Source/WebCore/bindings/v8/ScriptController.h b/Source/WebCore/bindings/v8/ScriptController.h index 66a573434..828450506 100644 --- a/Source/WebCore/bindings/v8/ScriptController.h +++ b/Source/WebCore/bindings/v8/ScriptController.h @@ -195,7 +195,7 @@ public: private: typedef HashMap<int, OwnPtr<V8DOMWindowShell> > IsolatedWorldMap; - void reset(); + void clearForClose(bool destroyGlobal); Frame* m_frame; const String* m_sourceURL; diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp index e67eb2e1f..426874027 100644 --- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp +++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp @@ -102,7 +102,7 @@ void V8DOMWindowShell::destroyIsolatedShell() v8::HandleScope handleScope; m_world->makeContextWeak(m_context.get()); disposeContext(); - destroyGlobal(); + m_global.clear(); } void V8DOMWindowShell::disposeContext() @@ -123,13 +123,11 @@ void V8DOMWindowShell::disposeContext() V8GCForContextDispose::instance().notifyContextDisposed(isMainFrame); } -void V8DOMWindowShell::destroyGlobal() +void V8DOMWindowShell::clearForClose(bool destroyGlobal) { - m_global.clear(); -} + if (destroyGlobal) + m_global.clear(); -void V8DOMWindowShell::clearForClose() -{ if (m_context.isEmpty()) return; diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.h b/Source/WebCore/bindings/v8/V8DOMWindowShell.h index 5dec886f3..4ff9ebeaa 100644 --- a/Source/WebCore/bindings/v8/V8DOMWindowShell.h +++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.h @@ -74,9 +74,7 @@ public: void updateDocumentWrapper(v8::Handle<v8::Object> wrapper); void clearForNavigation(); - void clearForClose(); - - void destroyGlobal(); + void clearForClose(bool destroyGlobal); DOMWrapperWorld* world() { return m_world.get(); } diff --git a/Source/WebCore/bindings/v8/V8Initializer.cpp b/Source/WebCore/bindings/v8/V8Initializer.cpp index 1d4e3b5fd..f83d533a8 100644 --- a/Source/WebCore/bindings/v8/V8Initializer.cpp +++ b/Source/WebCore/bindings/v8/V8Initializer.cpp @@ -39,6 +39,7 @@ #include "V8GCController.h" #include "V8History.h" #include "V8Location.h" +#include "V8PerContextData.h" #include <v8.h> #include <wtf/RefPtr.h> #include <wtf/text/WTFString.h> @@ -67,14 +68,14 @@ static Frame* findFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data) return 0; } -static void reportFatalError(const char* location, const char* message) +static void reportFatalErrorInMainThread(const char* location, const char* message) { int memoryUsageMB = MemoryUsageSupport::actualMemoryUsageMB(); printf("V8 error: %s (%s). Current memory usage: %d MB\n", message, location, memoryUsageMB); CRASH(); } -static void reportUncaughtException(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data) +static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data) { DOMWindow* firstWindow = firstDOMWindow(BindingState::instance()); if (!firstWindow->isCurrentlyDisplayedInFrame()) @@ -94,7 +95,7 @@ static void reportUncaughtException(v8::Handle<v8::Message> message, v8::Handle< firstWindow->document()->reportException(errorMessage, message->GetLineNumber(), resource, callStack); } -static void reportUnsafeJavaScriptAccess(v8::Local<v8::Object> host, v8::AccessType type, v8::Local<v8::Value> data) +static void failedAccessCheckCallbackInMainThread(v8::Local<v8::Object> host, v8::AccessType type, v8::Local<v8::Value> data) { Frame* target = findFrame(host, data); if (!target) @@ -113,11 +114,11 @@ void V8Initializer::initializeMainThreadIfNeeded() initialized = true; v8::V8::IgnoreOutOfMemoryException(); - v8::V8::SetFatalErrorHandler(reportFatalError); - v8::V8::AddGCPrologueCallback(&V8GCController::gcPrologue); - v8::V8::AddGCEpilogueCallback(&V8GCController::gcEpilogue); - v8::V8::AddMessageListener(&reportUncaughtException); - v8::V8::SetFailedAccessCheckCallbackFunction(reportUnsafeJavaScriptAccess); + v8::V8::SetFatalErrorHandler(reportFatalErrorInMainThread); + v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue); + v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); + v8::V8::AddMessageListener(messageHandlerInMainThread); + v8::V8::SetFailedAccessCheckCallbackFunction(failedAccessCheckCallbackInMainThread); #if ENABLE(JAVASCRIPT_DEBUGGER) ScriptProfiler::initialize(); #endif @@ -128,4 +129,53 @@ void V8Initializer::initializeMainThreadIfNeeded() v8::V8::SetFlagsFromString(es5ReadonlyFlag, sizeof(es5ReadonlyFlag)); } +static void reportFatalErrorInWorker(const char* location, const char* message) +{ + // FIXME: We temporarily deal with V8 internal error situations such as out-of-memory by crashing the worker. + CRASH(); +} + +static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data) +{ + static bool isReportingException = false; + // Exceptions that occur in error handler should be ignored since in that case + // WorkerContext::reportException will send the exception to the worker object. + if (isReportingException) + return; + isReportingException = true; + + // During the frame teardown, there may not be a valid context. + if (ScriptExecutionContext* context = getScriptExecutionContext()) { + String errorMessage = toWebCoreString(message->Get()); + int lineNumber = message->GetLineNumber(); + String sourceURL = toWebCoreString(message->GetScriptResourceName()); + context->reportException(errorMessage, lineNumber, sourceURL, 0); + } + + isReportingException = false; +} + +static const int kWorkerMaxStackSize = 500 * 1024; + +void V8Initializer::initializeWorker() +{ + v8::V8::AddMessageListener(messageHandlerInWorker); + v8::V8::IgnoreOutOfMemoryException(); + v8::V8::SetFatalErrorHandler(reportFatalErrorInWorker); + + v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue); + v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue); + + // FIXME: Remove the following 2 lines when V8 default has changed. + const char es5ReadonlyFlag[] = "--es5_readonly"; + v8::V8::SetFlagsFromString(es5ReadonlyFlag, sizeof(es5ReadonlyFlag)); + + v8::ResourceConstraints resourceConstraints; + uint32_t here; + resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uint32_t*)); + v8::SetResourceConstraints(&resourceConstraints); + + V8PerIsolateData::ensureInitialized(v8::Isolate::GetCurrent()); +} + } // namespace WebCore diff --git a/Source/WebCore/bindings/v8/V8Initializer.h b/Source/WebCore/bindings/v8/V8Initializer.h index d7854ce3c..a80bed54b 100644 --- a/Source/WebCore/bindings/v8/V8Initializer.h +++ b/Source/WebCore/bindings/v8/V8Initializer.h @@ -31,6 +31,7 @@ namespace WebCore { class V8Initializer { public: static void initializeMainThreadIfNeeded(); + static void initializeWorker(); }; } // namespace WebCore diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp index 3f1a45111..9be359580 100644 --- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp +++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp @@ -46,6 +46,7 @@ #include "V8DOMWindowShell.h" #include "V8DedicatedWorkerContext.h" #include "V8GCController.h" +#include "V8Initializer.h" #include "V8ObjectConstructor.h" #include "V8PerContextData.h" #include "V8RecursionScope.h" @@ -58,37 +59,11 @@ namespace WebCore { -static void reportFatalErrorInV8(const char* location, const char* message) -{ - // FIXME: We temporarily deal with V8 internal error situations such as out-of-memory by crashing the worker. - CRASH(); -} - -static void v8MessageHandler(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data) -{ - static bool isReportingException = false; - // Exceptions that occur in error handler should be ignored since in that case - // WorkerContext::reportException will send the exception to the worker object. - if (isReportingException) - return; - isReportingException = true; - - // During the frame teardown, there may not be a valid context. - if (ScriptExecutionContext* context = getScriptExecutionContext()) { - String errorMessage = toWebCoreString(message->Get()); - int lineNumber = message->GetLineNumber(); - String sourceURL = toWebCoreString(message->GetScriptResourceName()); - context->reportException(errorMessage, lineNumber, sourceURL, 0); - } - - isReportingException = false; -} - WorkerContextExecutionProxy::WorkerContextExecutionProxy(WorkerContext* workerContext) : m_workerContext(workerContext) , m_disableEvalPending(String()) { - initIsolate(); + V8Initializer::initializeWorker(); } WorkerContextExecutionProxy::~WorkerContextExecutionProxy() @@ -102,30 +77,6 @@ void WorkerContextExecutionProxy::dispose() m_context.clear(); } -void WorkerContextExecutionProxy::initIsolate() -{ - // Setup the security handlers and message listener. - v8::V8::AddMessageListener(&v8MessageHandler); - - // Tell V8 not to call the default OOM handler, binding code will handle it. - v8::V8::IgnoreOutOfMemoryException(); - v8::V8::SetFatalErrorHandler(reportFatalErrorInV8); - - v8::V8::AddGCPrologueCallback(&V8GCController::gcPrologue); - v8::V8::AddGCEpilogueCallback(&V8GCController::gcEpilogue); - - // FIXME: Remove the following 2 lines when V8 default has changed. - const char es5ReadonlyFlag[] = "--es5_readonly"; - v8::V8::SetFlagsFromString(es5ReadonlyFlag, sizeof(es5ReadonlyFlag)); - - v8::ResourceConstraints resource_constraints; - uint32_t here; - resource_constraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uint32_t*)); - v8::SetResourceConstraints(&resource_constraints); - - V8PerIsolateData::ensureInitialized(v8::Isolate::GetCurrent()); -} - bool WorkerContextExecutionProxy::initializeIfNeeded() { // Bail out if the context has already been initialized. diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h index 37793adec..8890eccde 100644 --- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h +++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h @@ -81,8 +81,6 @@ namespace WebCore { bool initializeIfNeeded(); void dispose(); - static const int kWorkerMaxStackSize = 500 * 1024; - WorkerContext* m_workerContext; ScopedPersistent<v8::Context> m_context; OwnPtr<V8PerContextData> m_perContextData; diff --git a/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.cpp b/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.cpp index d9da174b6..3c50dba35 100644 --- a/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.cpp +++ b/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.cpp @@ -42,7 +42,7 @@ Node* V8NamedNodesCollection::item(unsigned index) const return 0; } -Node* V8NamedNodesCollection::itemWithName(const AtomicString& id) const +Node* V8NamedNodesCollection::namedItem(const AtomicString& id) const { for (unsigned i = 0; i < m_nodes.size(); ++i) { Node* node = m_nodes[i].get(); diff --git a/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.h b/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.h index 0372de154..c2ee00f95 100644 --- a/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.h +++ b/Source/WebCore/bindings/v8/custom/V8NamedNodesCollection.h @@ -46,9 +46,9 @@ namespace WebCore { return adoptRef(new V8NamedNodesCollection(nodes)); } - virtual unsigned length() const { return m_nodes.size(); } - virtual Node* item(unsigned) const; - virtual Node* itemWithName(const AtomicString&) const; + virtual unsigned length() const OVERRIDE { return m_nodes.size(); } + virtual Node* item(unsigned) const OVERRIDE; + virtual Node* namedItem(const AtomicString&) const OVERRIDE; private: explicit V8NamedNodesCollection(const Vector<RefPtr<Node> >& nodes) diff --git a/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp index e8b704c7a..ee2b15aa1 100644 --- a/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "V8NodeList.h" -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include "NodeList.h" #include "V8Binding.h" #include "V8GCController.h" @@ -53,7 +53,7 @@ v8::Handle<v8::Value> V8NodeList::namedPropertyGetter(v8::Local<v8::String> name if (key == length) return v8Integer(list->length(), info.GetIsolate()); - RefPtr<Node> result = list->itemWithName(key); + RefPtr<Node> result = list->namedItem(key); if (!result) return v8Undefined(); @@ -64,9 +64,9 @@ void* V8NodeList::opaqueRootForGC(void* object, v8::Persistent<v8::Object> wrapp { ASSERT(V8NodeList::HasInstance(wrapper)); NodeList* impl = static_cast<NodeList*>(object); - if (!impl->isDynamicNodeList()) + if (!impl->isLiveNodeList()) return object; - Node* owner = static_cast<DynamicNodeList*>(impl)->ownerNode(); + Node* owner = static_cast<LiveNodeList*>(impl)->ownerNode(); if (!owner) return object; return V8GCController::opaqueRootForGC(owner); diff --git a/Source/WebCore/css/CSSCrossfadeValue.cpp b/Source/WebCore/css/CSSCrossfadeValue.cpp index 126734ffc..7375d08bb 100644 --- a/Source/WebCore/css/CSSCrossfadeValue.cpp +++ b/Source/WebCore/css/CSSCrossfadeValue.cpp @@ -52,6 +52,19 @@ static bool subimageIsPending(CSSValue* value) return false; } +static bool subimageHasAlpha(CSSValue* value, const RenderObject* renderer) +{ + if (value->isImageValue()) + return static_cast<CSSImageValue*>(value)->hasAlpha(renderer); + + if (value->isImageGeneratorValue()) + return static_cast<CSSImageGeneratorValue*>(value)->hasAlpha(renderer); + + ASSERT_NOT_REACHED(); + + return true; +} + static CachedImage* cachedImageForCSSValue(CSSValue* value, CachedResourceLoader* cachedResourceLoader) { if (!value) @@ -126,6 +139,11 @@ bool CSSCrossfadeValue::isPending() const return subimageIsPending(m_fromValue.get()) || subimageIsPending(m_toValue.get()); } +bool CSSCrossfadeValue::hasAlpha(const RenderObject* renderer) const +{ + return subimageHasAlpha(m_fromValue.get(), renderer) || subimageHasAlpha(m_toValue.get(), renderer); +} + void CSSCrossfadeValue::loadSubimages(CachedResourceLoader* cachedResourceLoader) { m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), cachedResourceLoader); diff --git a/Source/WebCore/css/CSSCrossfadeValue.h b/Source/WebCore/css/CSSCrossfadeValue.h index cb07abc3b..80d26d13b 100644 --- a/Source/WebCore/css/CSSCrossfadeValue.h +++ b/Source/WebCore/css/CSSCrossfadeValue.h @@ -58,6 +58,8 @@ public: IntSize fixedSize(const RenderObject*); bool isPending() const; + bool hasAlpha(const RenderObject*) const; + void loadSubimages(CachedResourceLoader*); void setPercentage(PassRefPtr<CSSPrimitiveValue> percentageValue) { m_percentageValue = percentageValue; } diff --git a/Source/WebCore/css/CSSGradientValue.cpp b/Source/WebCore/css/CSSGradientValue.cpp index d00c1308e..3b1beced3 100644 --- a/Source/WebCore/css/CSSGradientValue.cpp +++ b/Source/WebCore/css/CSSGradientValue.cpp @@ -462,6 +462,15 @@ bool CSSGradientValue::isCacheable() const return true; } +bool CSSGradientValue::hasAlpha(const RenderObject*) const +{ + for (size_t i = 0; i < m_stops.size(); ++i) { + if (m_stops[i].m_resolvedColor.hasAlpha()) + return true; + } + return false; +} + void CSSGradientValue::reportBaseClassMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const { MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); diff --git a/Source/WebCore/css/CSSGradientValue.h b/Source/WebCore/css/CSSGradientValue.h index 1e5e7e24e..1e25acf66 100644 --- a/Source/WebCore/css/CSSGradientValue.h +++ b/Source/WebCore/css/CSSGradientValue.h @@ -74,6 +74,8 @@ public: IntSize fixedSize(const RenderObject*) const { return IntSize(); } bool isPending() const { return false; } + bool hasAlpha(const RenderObject*) const; + void loadSubimages(CachedResourceLoader*) { } PassRefPtr<CSSGradientValue> gradientWithStylesResolved(StyleResolver*); diff --git a/Source/WebCore/css/CSSImageGeneratorValue.cpp b/Source/WebCore/css/CSSImageGeneratorValue.cpp index 6c460a768..b38237323 100644 --- a/Source/WebCore/css/CSSImageGeneratorValue.cpp +++ b/Source/WebCore/css/CSSImageGeneratorValue.cpp @@ -196,6 +196,23 @@ bool CSSImageGeneratorValue::isPending() const return false; } +bool CSSImageGeneratorValue::hasAlpha(const RenderObject* renderer) const +{ + switch (classType()) { + case CrossfadeClass: + return static_cast<const CSSCrossfadeValue*>(this)->hasAlpha(renderer); + case CanvasClass: + return true; + case LinearGradientClass: + return static_cast<const CSSLinearGradientValue*>(this)->hasAlpha(renderer); + case RadialGradientClass: + return static_cast<const CSSRadialGradientValue*>(this)->hasAlpha(renderer); + default: + ASSERT_NOT_REACHED(); + } + return true; +} + void CSSImageGeneratorValue::loadSubimages(CachedResourceLoader* cachedResourceLoader) { switch (classType()) { diff --git a/Source/WebCore/css/CSSImageGeneratorValue.h b/Source/WebCore/css/CSSImageGeneratorValue.h index cdf405a1c..f02292aeb 100644 --- a/Source/WebCore/css/CSSImageGeneratorValue.h +++ b/Source/WebCore/css/CSSImageGeneratorValue.h @@ -63,6 +63,7 @@ public: IntSize fixedSize(const RenderObject*); bool isPending() const; + bool hasAlpha(const RenderObject*) const; void loadSubimages(CachedResourceLoader*); diff --git a/Source/WebCore/css/CSSImageValue.cpp b/Source/WebCore/css/CSSImageValue.cpp index c3f4f63e9..6e103a983 100644 --- a/Source/WebCore/css/CSSImageValue.cpp +++ b/Source/WebCore/css/CSSImageValue.cpp @@ -140,4 +140,9 @@ void CSSImageValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectIn // No need to report m_image as it is counted as part of RenderArena. } +bool CSSImageValue::hasAlpha(const RenderObject* renderer) const +{ + return m_image ? m_image->hasAlpha(renderer) : true; +} + } // namespace WebCore diff --git a/Source/WebCore/css/CSSImageValue.h b/Source/WebCore/css/CSSImageValue.h index 5cf5a1f59..1d975839c 100644 --- a/Source/WebCore/css/CSSImageValue.h +++ b/Source/WebCore/css/CSSImageValue.h @@ -30,6 +30,7 @@ class CachedResourceLoader; class Element; class StyleCachedImage; class StyleImage; +class RenderObject; class CSSImageValue : public CSSValue { public: @@ -51,6 +52,8 @@ public: void reportDescendantMemoryUsage(MemoryObjectInfo*) const; + bool hasAlpha(const RenderObject*) const; + protected: CSSImageValue(ClassType, const String& url); diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp index d58c57b7b..7ca155c5b 100644 --- a/Source/WebCore/css/CSSParser.cpp +++ b/Source/WebCore/css/CSSParser.cpp @@ -3624,7 +3624,7 @@ PassRefPtr<CSSValue> CSSParser::parseFillPositionY(CSSParserValueList* valueList return 0; } -PassRefPtr<CSSValue> CSSParser::parseFillPositionComponent(CSSParserValueList* valueList, unsigned& cumulativeFlags, FillPositionFlag& individualFlag) +PassRefPtr<CSSPrimitiveValue> CSSParser::parseFillPositionComponent(CSSParserValueList* valueList, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode parsingMode) { int id = valueList->current()->id; if (id == CSSValueLeft || id == CSSValueTop || id == CSSValueRight || id == CSSValueBottom || id == CSSValueCenter) { @@ -3650,6 +3650,10 @@ PassRefPtr<CSSValue> CSSParser::parseFillPositionComponent(CSSParserValueList* v cumulativeFlags |= AmbiguousFillPosition; individualFlag = AmbiguousFillPosition; } + + if (parsingMode == ResolveValuesAsKeyword) + return cssValuePool().createIdentifierValue(id); + return cssValuePool().createValue(percent, CSSPrimitiveValue::CSS_PERCENTAGE); } if (validUnit(valueList->current(), FPercent | FLength)) { @@ -3669,6 +3673,226 @@ PassRefPtr<CSSValue> CSSParser::parseFillPositionComponent(CSSParserValueList* v return 0; } +#if ENABLE(CSS3_BACKGROUND) +static bool isValueConflictingWithCurrentEdge(int value1, int value2) +{ + if ((value1 == CSSValueLeft || value1 == CSSValueRight) && (value2 == CSSValueLeft || value2 == CSSValueRight)) + return true; + + if ((value1 == CSSValueTop || value1 == CSSValueBottom) && (value2 == CSSValueTop || value2 == CSSValueBottom)) + return true; + + return false; +} + +static bool isBackgroundPositionKeyword(int value) +{ + return value == CSSValueLeft || value == CSSValueTop || value == CSSValueBottom || value == CSSValueRight || value == CSSValueCenter; +} + +void CSSParser::parse4ValuesBackgroundPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsedValue1, PassRefPtr<CSSPrimitiveValue> parsedValue2) +{ + // [ left | right ] [ <percentage] | <length> ] && [ top | bottom ] [ <percentage> | <length> ] + // In the case of 4 values <position> requires the second value to be a length or a percentage. + if (isBackgroundPositionKeyword(parsedValue2->getIdent())) + return; + + unsigned cumulativeFlags = 0; + FillPositionFlag value3Flag = InvalidFillPosition; + RefPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cumulativeFlags, value3Flag, ResolveValuesAsKeyword); + if (!value3) + return; + + int ident1 = parsedValue1->getIdent(); + int ident3 = value3->getIdent(); + + if (ident1 == CSSValueCenter) + return; + + if (!isBackgroundPositionKeyword(ident3) || ident3 == CSSValueCenter) + return; + + // We need to check if the values are not conflicting, e.g. they are not on the same edge. It is + // needed as the second call to parseFillPositionComponent was on purpose not checking it. In the + // case of two values top 20px is invalid but in the case of 4 values it becomes valid. + if (isValueConflictingWithCurrentEdge(ident1, ident3)) + return; + + valueList->next(); + + cumulativeFlags = 0; + FillPositionFlag value4Flag = InvalidFillPosition; + RefPtr<CSSPrimitiveValue> value4 = parseFillPositionComponent(valueList, cumulativeFlags, value4Flag, ResolveValuesAsKeyword); + if (!value4) + return; + + // 4th value must be a length or a percentage. + if (isBackgroundPositionKeyword(value4->getIdent())) + return; + + value1 = createPrimitiveValuePair(parsedValue1, parsedValue2); + value2 = createPrimitiveValuePair(value3, value4); + + if (ident1 == CSSValueTop || ident1 == CSSValueBottom) + value1.swap(value2); + + valueList->next(); +} +void CSSParser::parse3ValuesBackgroundPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsedValue1, PassRefPtr<CSSPrimitiveValue> parsedValue2) +{ + unsigned cumulativeFlags = 0; + FillPositionFlag value3Flag = InvalidFillPosition; + RefPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cumulativeFlags, value3Flag, ResolveValuesAsKeyword); + + // value3 is not an expected value, we return. + if (!value3) + return; + + valueList->next(); + + bool swapNeeded = false; + int ident1 = parsedValue1->getIdent(); + int ident2 = parsedValue2->getIdent(); + int ident3 = value3->getIdent(); + + int firstPositionKeyword; + int secondPositionKeyword; + + if (ident1 == CSSValueCenter) { + // <position> requires the first 'center' to be followed by a keyword. + if (!isBackgroundPositionKeyword(ident2)) + return; + + // If 'center' is the first keyword then the last one needs to be a length. + if (isBackgroundPositionKeyword(ident3)) + return; + + firstPositionKeyword = CSSValueLeft; + if (ident2 == CSSValueLeft || ident2 == CSSValueRight) { + firstPositionKeyword = CSSValueTop; + swapNeeded = true; + } + value1 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(firstPositionKeyword), cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE)); + value2 = createPrimitiveValuePair(parsedValue2, value3); + } else if (ident3 == CSSValueCenter) { + if (isBackgroundPositionKeyword(ident2)) + return; + + secondPositionKeyword = CSSValueTop; + if (ident1 == CSSValueTop || ident1 == CSSValueBottom) { + secondPositionKeyword = CSSValueLeft; + swapNeeded = true; + } + value1 = createPrimitiveValuePair(parsedValue1, parsedValue2); + value2 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(secondPositionKeyword), cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE)); + } else { + RefPtr<CSSPrimitiveValue> firstPositionValue; + RefPtr<CSSPrimitiveValue> secondPositionValue; + + if (isBackgroundPositionKeyword(ident2)) { + // To match CSS grammar, we should only accept: [ center | left | right | bottom | top ] [ left | right | top | bottom ] [ <percentage> | <length> ]. + ASSERT(ident2 != CSSValueCenter); + + if (isBackgroundPositionKeyword(ident3)) + return; + + secondPositionValue = value3; + secondPositionKeyword = ident2; + firstPositionValue = cssValuePool().createValue(0, CSSPrimitiveValue::CSS_PERCENTAGE); + } else { + // Per CSS, we should only accept: [ right | left | top | bottom ] [ <percentage> | <length> ] [ center | left | right | bottom | top ]. + if (!isBackgroundPositionKeyword(ident3)) + return; + + firstPositionValue = parsedValue2; + secondPositionKeyword = ident3; + secondPositionValue = cssValuePool().createValue(0, CSSPrimitiveValue::CSS_PERCENTAGE); + } + + if (isValueConflictingWithCurrentEdge(ident1, secondPositionKeyword)) + return; + + value1 = createPrimitiveValuePair(parsedValue1, firstPositionValue); + value2 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(secondPositionKeyword), secondPositionValue); + } + + if (ident1 == CSSValueTop || ident1 == CSSValueBottom || swapNeeded) + value1.swap(value2); + +#ifndef NDEBUG + CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(value1.get()); + CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(value2.get()); + ident1 = first->getPairValue()->first()->getIdent(); + ident2 = second->getPairValue()->first()->getIdent(); + ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight); + ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop); +#endif +} + +void CSSParser::parseFillBackgroundPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2) +{ + unsigned numberOfValues = 0; + for (unsigned i = valueList->currentIndex(); i < valueList->size(); ++i, ++numberOfValues) { + CSSParserValue* current = valueList->valueAt(i); + if (isComma(current) || !current) + break; + } + + if (numberOfValues > 4) + return; + + // If we are parsing two values, we can safely call the CSS 2.1 parsing function and return. + if (numberOfValues <= 2) { + parseFillPosition(valueList, value1, value2); + return; + } + + ASSERT(numberOfValues > 2 && numberOfValues <= 4); + + CSSParserValue* value = valueList->current(); + + // <position> requires the first value to be a background keyword. + if (!isBackgroundPositionKeyword(value->id)) + return; + + // Parse the first value. We're just making sure that it is one of the valid keywords or a percentage/length. + unsigned cumulativeFlags = 0; + FillPositionFlag value1Flag = InvalidFillPosition; + FillPositionFlag value2Flag = InvalidFillPosition; + value1 = parseFillPositionComponent(valueList, cumulativeFlags, value1Flag, ResolveValuesAsKeyword); + if (!value1) + return; + + value = valueList->next(); + + // In case we are parsing more than two values, relax the check inside of parseFillPositionComponent. top 20px is + // a valid start for <position>. + cumulativeFlags = AmbiguousFillPosition; + value2 = parseFillPositionComponent(valueList, cumulativeFlags, value2Flag, ResolveValuesAsKeyword); + if (value2) + valueList->next(); + else { + value1.clear(); + return; + } + + RefPtr<CSSPrimitiveValue> parsedValue1 = static_cast<CSSPrimitiveValue*>(value1.get()); + RefPtr<CSSPrimitiveValue> parsedValue2 = static_cast<CSSPrimitiveValue*>(value2.get()); + + value1.clear(); + value2.clear(); + + // Per CSS3 syntax, <position> can't have 'center' as its second keyword as we have more arguments to follow. + if (parsedValue2->getIdent() == CSSValueCenter) + return; + + if (numberOfValues == 3) + parse3ValuesBackgroundPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release()); + else + parse4ValuesBackgroundPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release()); +} +#endif + void CSSParser::parseFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2) { CSSParserValue* value = valueList->current(); @@ -3703,8 +3927,8 @@ void CSSParser::parseFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue } if (!value2) - // Only one value was specified. If that value was not a keyword, then it sets the x position, and the y position - // is simply 50%. This is our default. + // Only one value was specified. If that value was not a keyword, then it sets the x position, and the y position + // is simply 50%. This is our default. // For keywords, the keyword was either an x-keyword (left/right), a y-keyword (top/bottom), or an ambiguous keyword (center). // For left/right/center, the default of 50% in the y is still correct. value2 = cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE); @@ -3879,6 +4103,14 @@ bool CSSParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1, } break; case CSSPropertyBackgroundPosition: +#if ENABLE(CSS3_BACKGROUND) + if (!inShorthand()) { + parseFillBackgroundPosition(m_valueList.get(), currValue, currValue2); + // parseFillBackgroundPosition advances the m_valueList pointer + break; + } + // Fall through to CSS 2.1 parsing. +#endif case CSSPropertyWebkitMaskPosition: parseFillPosition(m_valueList.get(), currValue, currValue2); // parseFillPosition advances the m_valueList pointer diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h index 5181f9ecd..2b0d85419 100644 --- a/Source/WebCore/css/CSSParser.h +++ b/Source/WebCore/css/CSSParser.h @@ -112,10 +112,16 @@ public: bool parseFillImage(CSSParserValueList*, RefPtr<CSSValue>&); enum FillPositionFlag { InvalidFillPosition = 0, AmbiguousFillPosition = 1, XFillPosition = 2, YFillPosition = 4 }; - PassRefPtr<CSSValue> parseFillPositionComponent(CSSParserValueList*, unsigned& cumulativeFlags, FillPositionFlag& individualFlag); + enum FillPositionParsingMode { ResolveValuesAsPercent = 0, ResolveValuesAsKeyword = 1 }; + PassRefPtr<CSSPrimitiveValue> parseFillPositionComponent(CSSParserValueList*, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode = ResolveValuesAsPercent); PassRefPtr<CSSValue> parseFillPositionX(CSSParserValueList*); PassRefPtr<CSSValue> parseFillPositionY(CSSParserValueList*); void parseFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&); +#if ENABLE(CSS3_BACKGROUND) + void parseFillBackgroundPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&); + void parse3ValuesBackgroundPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>); + void parse4ValuesBackgroundPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>); +#endif void parseFillRepeat(RefPtr<CSSValue>&, RefPtr<CSSValue>&); PassRefPtr<CSSValue> parseFillSize(CSSPropertyID, bool &allowComma); diff --git a/Source/WebCore/dom/CharacterData.cpp b/Source/WebCore/dom/CharacterData.cpp index 25af94d7b..26f38d105 100644 --- a/Source/WebCore/dom/CharacterData.cpp +++ b/Source/WebCore/dom/CharacterData.cpp @@ -32,6 +32,7 @@ #include "NodeRenderingContext.h" #include "RenderText.h" #include "StyleInheritedData.h" +#include "Text.h" #include "TextBreakIterator.h" #include "WebCoreMemoryInstrumentation.h" @@ -89,7 +90,10 @@ unsigned CharacterData::parserAppendData(const String& string, unsigned offset, else m_data.append(string.characters16() + offset, characterLengthLimit); - updateRenderer(oldLength, 0); + ASSERT(!renderer() || isTextNode()); + if (isTextNode()) + toText(this)->updateTextRenderer(oldLength, 0); + document()->incDOMTreeVersion(); // We don't call dispatchModifiedEvent here because we don't want the // parser to dispatch DOM mutation events. @@ -193,7 +197,9 @@ void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfRep String oldData = m_data; m_data = newData; - updateRenderer(offsetOfReplacedData, oldLength); + ASSERT(!renderer() || isTextNode()); + if (isTextNode()) + toText(this)->updateTextRenderer(offsetOfReplacedData, oldLength); if (document()->frame()) document()->frame()->selection()->textWasReplaced(this, offsetOfReplacedData, oldLength, newLength); @@ -202,14 +208,6 @@ void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfRep dispatchModifiedEvent(oldData); } -void CharacterData::updateRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData) -{ - if ((!renderer() || !rendererIsNeeded(NodeRenderingContext(this, renderer()->style()))) && attached()) - reattach(); - else if (renderer()) - toRenderText(renderer())->setTextWithOffset(m_data.impl(), offsetOfReplacedData, lengthOfReplacedData); -} - void CharacterData::dispatchModifiedEvent(const String& oldData) { #if ENABLE(MUTATION_OBSERVERS) @@ -245,13 +243,6 @@ int CharacterData::maxCharacterOffset() const return static_cast<int>(length()); } -bool CharacterData::rendererIsNeeded(const NodeRenderingContext& context) -{ - if (!m_data || !length()) - return false; - return Node::rendererIsNeeded(context); -} - bool CharacterData::offsetInCharacters() const { return true; diff --git a/Source/WebCore/dom/CharacterData.h b/Source/WebCore/dom/CharacterData.h index d8d7b2da9..afce57154 100644 --- a/Source/WebCore/dom/CharacterData.h +++ b/Source/WebCore/dom/CharacterData.h @@ -57,8 +57,6 @@ protected: ASSERT(type == CreateOther || type == CreateText || type == CreateEditingText); } - virtual bool rendererIsNeeded(const NodeRenderingContext&); - void setDataWithoutUpdate(const String& data) { ASSERT(!data.isNull()); @@ -73,7 +71,6 @@ private: virtual int maxCharacterOffset() const; virtual bool offsetInCharacters() const; void setDataAndUpdate(const String&, unsigned offsetOfReplacedData, unsigned oldLength, unsigned newLength); - void updateRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData); void checkCharDataOperation(unsigned offset, ExceptionCode&); String m_data; diff --git a/Source/WebCore/dom/ChildNodeList.cpp b/Source/WebCore/dom/ChildNodeList.cpp index fe55892b2..32afd02ac 100644 --- a/Source/WebCore/dom/ChildNodeList.cpp +++ b/Source/WebCore/dom/ChildNodeList.cpp @@ -28,7 +28,7 @@ namespace WebCore { ChildNodeList::ChildNodeList(PassRefPtr<Node> node) - : DynamicNodeList(node, ChildNodeListType, NodeListIsRootedAtNode, DoNotInvalidateOnAttributeChanges) + : LiveNodeList(node, ChildNodeListType, DoNotInvalidateOnAttributeChanges) { } @@ -39,7 +39,7 @@ ChildNodeList::~ChildNodeList() bool ChildNodeList::nodeMatches(Element* testNode) const { - // This function will be called only by DynamicNodeList::itemWithName, + // This function will be called only by LiveNodeList::namedItem, // for an element that was located with getElementById. return testNode->parentNode() == rootNode(); } diff --git a/Source/WebCore/dom/ChildNodeList.h b/Source/WebCore/dom/ChildNodeList.h index 646289ded..dfde57342 100644 --- a/Source/WebCore/dom/ChildNodeList.h +++ b/Source/WebCore/dom/ChildNodeList.h @@ -24,12 +24,12 @@ #ifndef ChildNodeList_h #define ChildNodeList_h -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include <wtf/PassRefPtr.h> namespace WebCore { - class ChildNodeList : public DynamicNodeList { + class ChildNodeList : public LiveNodeList { public: static PassRefPtr<ChildNodeList> create(PassRefPtr<Node> rootNode) { diff --git a/Source/WebCore/dom/ClassNodeList.cpp b/Source/WebCore/dom/ClassNodeList.cpp index d2efabe0d..a2da9a448 100644 --- a/Source/WebCore/dom/ClassNodeList.cpp +++ b/Source/WebCore/dom/ClassNodeList.cpp @@ -37,7 +37,7 @@ namespace WebCore { ClassNodeList::ClassNodeList(PassRefPtr<Node> rootNode, const String& classNames) - : DynamicSubtreeNodeList(rootNode, ClassNodeListType, InvalidateOnClassAttrChange) + : LiveNodeList(rootNode, ClassNodeListType, InvalidateOnClassAttrChange) , m_classNames(classNames, document()->inQuirksMode()) , m_originalClassNames(classNames) { diff --git a/Source/WebCore/dom/ClassNodeList.h b/Source/WebCore/dom/ClassNodeList.h index 8cfb9c03b..5466d03a6 100644 --- a/Source/WebCore/dom/ClassNodeList.h +++ b/Source/WebCore/dom/ClassNodeList.h @@ -30,13 +30,13 @@ #ifndef ClassNodeList_h #define ClassNodeList_h -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include "Node.h" #include "SpaceSplitString.h" namespace WebCore { - class ClassNodeList : public DynamicSubtreeNodeList { + class ClassNodeList : public LiveNodeList { public: static PassRefPtr<ClassNodeList> create(PassRefPtr<Node> rootNode, const String& classNames) { diff --git a/Source/WebCore/dom/ContainerNode.h b/Source/WebCore/dom/ContainerNode.h index 485ecdb3c..f673e47cf 100644 --- a/Source/WebCore/dom/ContainerNode.h +++ b/Source/WebCore/dom/ContainerNode.h @@ -131,6 +131,8 @@ public: void disconnectDescendantFrames(); + virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const { return true; } + // More efficient versions of these two functions for the case where we are starting with a ContainerNode. Node* traverseNextNode() const; Node* traverseNextNode(const Node* stayWithin) const; diff --git a/Source/WebCore/dom/DOMAllInOne.cpp b/Source/WebCore/dom/DOMAllInOne.cpp index 997db9fb1..506e267ea 100644 --- a/Source/WebCore/dom/DOMAllInOne.cpp +++ b/Source/WebCore/dom/DOMAllInOne.cpp @@ -67,7 +67,6 @@ #include "DocumentOrderedMap.cpp" #include "DocumentParser.cpp" #include "DocumentType.cpp" -#include "DynamicNodeList.cpp" #include "Element.cpp" #include "ElementAttributeData.cpp" #include "ElementShadow.cpp" @@ -87,6 +86,7 @@ #include "IdTargetObserver.cpp" #include "IdTargetObserverRegistry.cpp" #include "KeyboardEvent.cpp" +#include "LiveNodeList.cpp" #include "MessageChannel.cpp" #include "MessageEvent.cpp" #include "MessagePort.cpp" diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index 3ecbdbb56..33c2d05a9 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -3459,7 +3459,7 @@ void Document::setCSSTarget(Element* n) } } -void Document::registerNodeListCache(DynamicNodeListCacheBase* list) +void Document::registerNodeListCache(LiveNodeListBase* list) { if (list->hasIdNameCache()) m_nodeListCounts[InvalidateOnIdNameAttrChange]++; @@ -3468,7 +3468,7 @@ void Document::registerNodeListCache(DynamicNodeListCacheBase* list) m_listsInvalidatedAtDocument.add(list); } -void Document::unregisterNodeListCache(DynamicNodeListCacheBase* list) +void Document::unregisterNodeListCache(LiveNodeListBase* list) { if (list->hasIdNameCache()) m_nodeListCounts[InvalidateOnIdNameAttrChange]--; @@ -4334,7 +4334,7 @@ bool Document::hasSVGRootNode() const } #endif -// FIXME: This caching mechanism should be merged that of DynamicNodeList in NodeRareData. +// FIXME: This caching mechanism should be merged that of LiveNodeList in NodeRareData. PassRefPtr<HTMLCollection> Document::cachedCollection(CollectionType type) { ASSERT(static_cast<unsigned>(type) < NumUnnamedDocumentCachedTypes); @@ -4425,7 +4425,7 @@ PassRefPtr<HTMLCollection> Document::documentNamedItems(const AtomicString& name return collection.release(); } -// FIXME: This caching mechanism should be merged that of DynamicNodeList in NodeRareData. +// FIXME: This caching mechanism should be merged that of LiveNodeList in NodeRareData. void Document::removeWindowNamedItemCache(HTMLCollection* collection, const AtomicString& name) { ASSERT_UNUSED(collection, m_windowNamedItemCollections.get(name) == collection); diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h index da29598e0..075b00e9b 100644 --- a/Source/WebCore/dom/Document.h +++ b/Source/WebCore/dom/Document.h @@ -80,7 +80,6 @@ class DocumentParser; class DocumentStyleSheetCollection; class DocumentType; class DocumentWeakReference; -class DynamicNodeListCacheBase; class Element; class ElementAttributeData; class EntityReference; @@ -106,6 +105,7 @@ class HitTestResult; class IntPoint; class LayoutPoint; class LayoutRect; +class LiveNodeListBase; class DOMWrapperWorld; class JSNode; class Locale; @@ -718,8 +718,8 @@ public: bool hasPendingForcedStyleRecalc() const; void styleRecalcTimerFired(Timer<Document>*); - void registerNodeListCache(DynamicNodeListCacheBase*); - void unregisterNodeListCache(DynamicNodeListCacheBase*); + void registerNodeListCache(LiveNodeListBase*); + void unregisterNodeListCache(LiveNodeListBase*); bool shouldInvalidateNodeListCaches(const QualifiedName* attrName = 0) const; void invalidateNodeListCaches(const QualifiedName* attrName); @@ -1407,7 +1407,7 @@ private: InheritedBool m_designMode; - HashSet<DynamicNodeListCacheBase*> m_listsInvalidatedAtDocument; + HashSet<LiveNodeListBase*> m_listsInvalidatedAtDocument; unsigned m_nodeListCounts[numNodeListInvalidationTypes]; HTMLCollection* m_collections[NumUnnamedDocumentCachedTypes]; diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index 450ec8435..a4f7d72af 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -1097,6 +1097,11 @@ const QualifiedName& Element::imageSourceAttributeName() const return srcAttr; } +bool Element::rendererIsNeeded(const NodeRenderingContext& context) +{ + return (document()->documentElement() == this) || (context.style()->display() != NONE); +} + RenderObject* Element::createRenderer(RenderArena* arena, RenderStyle* style) { if (document()->documentElement() == this && style->display() == NONE) { @@ -1184,12 +1189,18 @@ void Element::removedFrom(ContainerNode* insertionPoint) ContainerNode::removedFrom(insertionPoint); } +void Element::createRendererIfNeeded() +{ + NodeRenderingContext(this).createRendererForElementIfNeeded(); +} + void Element::attach() { suspendPostAttachCallbacks(); WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; createRendererIfNeeded(); + StyleResolverParentPusher parentPusher(this); if (parentElement() && parentElement()->isInCanvasSubtree()) @@ -1429,6 +1440,11 @@ ElementShadow* Element::ensureShadow() return data->m_shadow.get(); } +PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionCode& ec) +{ + return ShadowRoot::create(this, ec); +} + ShadowRoot* Element::userAgentShadowRoot() const { if (ElementShadow* elementShadow = shadow()) { @@ -2140,7 +2156,7 @@ bool Element::childShouldCreateRenderer(const NodeRenderingContext& childContext if (childContext.node()->isSVGElement()) return childContext.node()->hasTagName(SVGNames::svgTag) || isSVGElement(); - return Node::childShouldCreateRenderer(childContext); + return ContainerNode::childShouldCreateRenderer(childContext); } #endif @@ -2530,7 +2546,6 @@ PassRefPtr<RenderStyle> Element::customStyleForRenderer() return 0; } - void Element::cloneAttributesFromElement(const Element& other) { if (hasSyntheticAttrChildNodes()) diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h index bb1201e2b..82339c96b 100644 --- a/Source/WebCore/dom/Element.h +++ b/Source/WebCore/dom/Element.h @@ -270,10 +270,13 @@ public: virtual void attach(); virtual void detach(); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); + virtual bool rendererIsNeeded(const NodeRenderingContext&); void recalcStyle(StyleChange = NoChange); ElementShadow* shadow() const; ElementShadow* ensureShadow(); + PassRefPtr<ShadowRoot> createShadowRoot(ExceptionCode&); + virtual void willAddAuthorShadowRoot() { } virtual bool areAuthorShadowsAllowed() const { return true; } @@ -425,7 +428,7 @@ public: virtual bool isSpellCheckingEnabled() const; PassRefPtr<WebKitAnimationList> webkitGetAnimations() const; - + PassRefPtr<RenderStyle> styleForRenderer(); RenderRegion* renderRegion() const; @@ -530,13 +533,14 @@ private: bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&); -private: ElementRareData* elementRareData() const; ElementRareData* ensureElementRareData(); void detachAllAttrNodesFromElement(); void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); + void createRendererIfNeeded(); + RefPtr<ElementAttributeData> m_attributeData; }; diff --git a/Source/WebCore/dom/Element.idl b/Source/WebCore/dom/Element.idl index 8b6622d10..8769c63e6 100644 --- a/Source/WebCore/dom/Element.idl +++ b/Source/WebCore/dom/Element.idl @@ -119,8 +119,10 @@ readonly attribute Element nextElementSibling; readonly attribute unsigned long childElementCount; -#if defined(ENABLE_SHADOW_DOM) + // ShadowAware API +#if defined(ENABLE_SHADOW_DOM) && ENABLE_SHADOW_DOM [Reflect, V8EnabledAtRuntime=shadowDOM] attribute DOMString pseudo; + [V8EnabledAtRuntime=shadowDOM] ShadowRoot createShadowRoot() raises(DOMException); #endif // DOM 4 diff --git a/Source/WebCore/dom/EventDispatcher.cpp b/Source/WebCore/dom/EventDispatcher.cpp index 65409586a..73ac3199f 100644 --- a/Source/WebCore/dom/EventDispatcher.cpp +++ b/Source/WebCore/dom/EventDispatcher.cpp @@ -208,7 +208,7 @@ void EventDispatcher::dispatchScopedEvent(Node* node, PassRefPtr<EventDispatchMe ScopedEventQueue::instance()->enqueueEventDispatchMediator(mediator); } -void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent, bool sendMouseEvents, bool showPressedLook) +void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent, SimulatedClickMouseEventOptions mouseEventOptions, SimulatedClickVisualOptions visualOptions) { if (node->disabled()) return; @@ -220,11 +220,13 @@ void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent, gNodesDispatchingSimulatedClicks->add(node); - // send mousedown and mouseup before the click, if requested - if (sendMouseEvents) + if (mouseEventOptions == SendMouseOverUpDownEvents) + EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseoverEvent, node->document()->defaultView(), underlyingEvent)); + + if (mouseEventOptions != SendNoEvents) EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent)); - node->setActive(true, showPressedLook); - if (sendMouseEvents) + node->setActive(true, visualOptions == ShowPressedLook); + if (mouseEventOptions != SendNoEvents) EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent)); node->setActive(false); diff --git a/Source/WebCore/dom/EventDispatcher.h b/Source/WebCore/dom/EventDispatcher.h index e73d31680..c8585097a 100644 --- a/Source/WebCore/dom/EventDispatcher.h +++ b/Source/WebCore/dom/EventDispatcher.h @@ -26,6 +26,7 @@ #ifndef EventDispatcher_h #define EventDispatcher_h +#include "SimulatedClickOptions.h" #include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/Vector.h> @@ -72,7 +73,7 @@ public: static bool dispatchEvent(Node*, PassRefPtr<EventDispatchMediator>); static void dispatchScopedEvent(Node*, PassRefPtr<EventDispatchMediator>); - static void dispatchSimulatedClick(Node*, Event* underlyingEvent, bool sendMouseEvents, bool showPressedLook); + static void dispatchSimulatedClick(Node*, Event* underlyingEvent, SimulatedClickMouseEventOptions, SimulatedClickVisualOptions); bool dispatchEvent(PassRefPtr<Event>); void adjustRelatedTarget(Event*, PassRefPtr<EventTarget> prpRelatedTarget); diff --git a/Source/WebCore/dom/DynamicNodeList.cpp b/Source/WebCore/dom/LiveNodeList.cpp index 6bdc71da7..bea483aaa 100644 --- a/Source/WebCore/dom/DynamicNodeList.cpp +++ b/Source/WebCore/dom/LiveNodeList.cpp @@ -21,7 +21,7 @@ */ #include "config.h" -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include "Document.h" #include "Element.h" @@ -32,7 +32,7 @@ namespace WebCore { -Node* DynamicNodeListCacheBase::rootNode() const +Node* LiveNodeListBase::rootNode() const { if (isRootedAtDocument() && m_ownerNode->inDocument()) return m_ownerNode->document(); @@ -52,7 +52,7 @@ Node* DynamicNodeListCacheBase::rootNode() const return m_ownerNode.get(); } -void DynamicNodeListCacheBase::invalidateCache() const +void LiveNodeListBase::invalidateCache() const { m_cachedItem = 0; m_isLengthCacheValid = false; @@ -74,7 +74,7 @@ void DynamicNodeListCacheBase::invalidateCache() const #endif } -void DynamicNodeListCacheBase::invalidateIdNameCacheMaps() const +void LiveNodeListBase::invalidateIdNameCacheMaps() const { ASSERT(hasIdNameCache()); const HTMLCollection* cacheBase = static_cast<const HTMLCollection*>(this); @@ -82,37 +82,15 @@ void DynamicNodeListCacheBase::invalidateIdNameCacheMaps() const cacheBase->m_nameCache.clear(); } -void DynamicNodeListCacheBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const +void LiveNodeListBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const { MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); + NodeList::reportMemoryUsage(memoryObjectInfo); info.addMember(m_ownerNode); info.addWeakPointer(m_cachedItem); } -void DynamicNodeList::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - NodeList::reportMemoryUsage(memoryObjectInfo); - DynamicNodeListCacheBase::reportMemoryUsage(memoryObjectInfo); -} - -void DynamicSubtreeNodeList::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const -{ - MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); - DynamicNodeList::reportMemoryUsage(memoryObjectInfo); -} - -unsigned DynamicNodeList::length() const -{ - return lengthCommon(); -} - -Node* DynamicNodeList::item(unsigned offset) const -{ - return itemCommon(offset); -} - -Node* DynamicNodeList::itemWithName(const AtomicString& elementId) const +Node* LiveNodeList::namedItem(const AtomicString& elementId) const { Node* rootNode = this->rootNode(); diff --git a/Source/WebCore/dom/DynamicNodeList.h b/Source/WebCore/dom/LiveNodeList.h index 50aa64198..20a103d72 100644 --- a/Source/WebCore/dom/DynamicNodeList.h +++ b/Source/WebCore/dom/LiveNodeList.h @@ -21,8 +21,8 @@ * */ -#ifndef DynamicNodeList_h -#define DynamicNodeList_h +#ifndef LiveNodeList_h +#define LiveNodeList_h #include "CollectionType.h" #include "Document.h" @@ -41,14 +41,14 @@ enum NodeListRootType { NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr, }; -class DynamicNodeListCacheBase { +class LiveNodeListBase : public NodeList { public: enum ItemAfterOverrideType { OverridesItemAfter, DoesNotOverrideItemAfter, }; - DynamicNodeListCacheBase(Node* ownerNode, NodeListRootType rootType, NodeListInvalidationType invalidationType, + LiveNodeListBase(Node* ownerNode, NodeListRootType rootType, NodeListInvalidationType invalidationType, bool shouldOnlyIncludeDirectChildren, CollectionType collectionType, ItemAfterOverrideType itemAfterOverrideType) : m_ownerNode(ownerNode) , m_cachedItem(0) @@ -68,11 +68,12 @@ public: ASSERT(!m_overridesItemAfter || !isNodeList(collectionType)); } - virtual ~DynamicNodeListCacheBase() { } - virtual void reportMemoryUsage(MemoryObjectInfo*) const; -public: + // DOM API + virtual unsigned length() const OVERRIDE; + virtual Node* item(unsigned offset) const OVERRIDE; + ALWAYS_INLINE bool hasIdNameCache() const { return !isNodeList(type()); } ALWAYS_INLINE bool isRootedAtDocument() const { return m_rootType == NodeListIsRootedAtDocument || m_rootType == NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr; } ALWAYS_INLINE NodeListInvalidationType invalidationType() const { return static_cast<NodeListInvalidationType>(m_invalidationType); } @@ -123,8 +124,6 @@ protected: bool hasNameCache() const { return m_isNameCacheValid; } void setHasNameCache() const { m_isNameCacheValid = true; } - unsigned lengthCommon() const; - Node* itemCommon(unsigned offset) const; Node* itemBeforeOrAfterCachedItem(unsigned offset) const; Node* itemAfter(unsigned&, Node* previousItem) const; @@ -153,7 +152,7 @@ private: mutable unsigned m_isItemRefElementsCacheValid : 1; }; -ALWAYS_INLINE bool DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange(NodeListInvalidationType type, const QualifiedName& attrName) +ALWAYS_INLINE bool LiveNodeListBase::shouldInvalidateTypeOnAttributeChange(NodeListInvalidationType type, const QualifiedName& attrName) { switch (type) { case InvalidateOnClassAttrChange: @@ -182,49 +181,29 @@ ALWAYS_INLINE bool DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChan return false; } -class DynamicNodeList : public NodeList, public DynamicNodeListCacheBase { +class LiveNodeList : public LiveNodeListBase { public: - DynamicNodeList(PassRefPtr<Node> ownerNode, CollectionType collectionType, NodeListRootType rootType, NodeListInvalidationType invalidationType) - : DynamicNodeListCacheBase(ownerNode.get(), rootType, invalidationType, collectionType == ChildNodeListType, + LiveNodeList(PassRefPtr<Node> ownerNode, CollectionType collectionType, NodeListInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRootedAtNode) + : LiveNodeListBase(ownerNode.get(), rootType, invalidationType, collectionType == ChildNodeListType, collectionType, DoesNotOverrideItemAfter) - { } - virtual ~DynamicNodeList() { } - - // DOM methods & attributes for NodeList - virtual unsigned length() const OVERRIDE; - virtual Node* item(unsigned offset) const OVERRIDE; - virtual Node* itemWithName(const AtomicString&) const; - - // Other methods (not part of DOM) - virtual bool nodeMatches(Element*) const = 0; - - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - -private: - virtual bool isDynamicNodeList() const OVERRIDE { return true; } -}; - -class DynamicSubtreeNodeList : public DynamicNodeList { -public: - virtual ~DynamicSubtreeNodeList() { - document()->unregisterNodeListCache(this); + if (collectionType != ChildNodeListType) + document()->registerNodeListCache(this); } - virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; - -protected: - DynamicSubtreeNodeList(PassRefPtr<Node> node, CollectionType type, NodeListInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRootedAtNode) - : DynamicNodeList(node, type, rootType, invalidationType) + virtual ~LiveNodeList() { - document()->registerNodeListCache(this); + if (type() != ChildNodeListType) + document()->unregisterNodeListCache(this); } + virtual Node* namedItem(const AtomicString&) const OVERRIDE; + virtual bool nodeMatches(Element*) const = 0; + private: - Node* itemForwardsFromCurrent(Node* start, unsigned offset, int remainingOffset) const; - Node* itemBackwardsFromCurrent(Node* start, unsigned offset, int remainingOffset) const; + virtual bool isLiveNodeList() const OVERRIDE { return true; } }; } // namespace WebCore -#endif // DynamicNodeList_h +#endif // LiveNodeList_h diff --git a/Source/WebCore/dom/MicroDataItemList.cpp b/Source/WebCore/dom/MicroDataItemList.cpp index 850cd4859..727862e77 100644 --- a/Source/WebCore/dom/MicroDataItemList.cpp +++ b/Source/WebCore/dom/MicroDataItemList.cpp @@ -44,7 +44,7 @@ const String& MicroDataItemList::undefinedItemType() } MicroDataItemList::MicroDataItemList(PassRefPtr<Node> rootNode, const String& typeNames) - : DynamicSubtreeNodeList(rootNode, MicroDataItemListType, InvalidateOnItemAttrChange) + : LiveNodeList(rootNode, MicroDataItemListType, InvalidateOnItemAttrChange) , m_typeNames(typeNames, document()->inQuirksMode()) , m_originalTypeNames(typeNames) { diff --git a/Source/WebCore/dom/MicroDataItemList.h b/Source/WebCore/dom/MicroDataItemList.h index fbfc1e03e..d4c281d93 100644 --- a/Source/WebCore/dom/MicroDataItemList.h +++ b/Source/WebCore/dom/MicroDataItemList.h @@ -28,13 +28,13 @@ #if ENABLE(MICRODATA) -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include "Node.h" #include "SpaceSplitString.h" namespace WebCore { -class MicroDataItemList : public DynamicSubtreeNodeList { +class MicroDataItemList : public LiveNodeList { public: static PassRefPtr<MicroDataItemList> create(PassRefPtr<Node> rootNode, const String& typeNames) { diff --git a/Source/WebCore/dom/MouseEvent.cpp b/Source/WebCore/dom/MouseEvent.cpp index 9e92c2713..dde193615 100644 --- a/Source/WebCore/dom/MouseEvent.cpp +++ b/Source/WebCore/dom/MouseEvent.cpp @@ -227,10 +227,10 @@ MouseEvent* MouseEventDispatchMediator::event() const bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const { if (dispatcher->node()->disabled()) // Don't even send DOM events for disabled controls.. - return true; + return false; if (event()->type().isEmpty()) - return false; // Shouldn't happen. + return true; // Shouldn't happen. EventTarget* relatedTarget = event()->relatedTarget(); dispatcher->adjustRelatedTarget(event(), relatedTarget); @@ -239,7 +239,7 @@ bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons bool swallowEvent = event()->defaultHandled() || event()->defaultPrevented(); if (event()->type() != eventNames().clickEvent || event()->detail() != 2) - return swallowEvent; + return !swallowEvent; // Special case: If it's a double click event, we also send the dblclick event. This is not part // of the DOM specs, but is used for compatibility with the ondblclick="" attribute. This is treated // as a separate event in other DOM-compliant browsers like Firefox, and so we do the same. @@ -252,8 +252,8 @@ bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons doubleClickEvent->setDefaultHandled(); EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediator::create(doubleClickEvent)); if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented()) - return true; - return swallowEvent; + return false; + return !swallowEvent; } } // namespace WebCore diff --git a/Source/WebCore/dom/NameNodeList.cpp b/Source/WebCore/dom/NameNodeList.cpp index 59684542b..b66d4937c 100644 --- a/Source/WebCore/dom/NameNodeList.cpp +++ b/Source/WebCore/dom/NameNodeList.cpp @@ -33,7 +33,7 @@ namespace WebCore { using namespace HTMLNames; NameNodeList::NameNodeList(PassRefPtr<Node> rootNode, const AtomicString& name) - : DynamicSubtreeNodeList(rootNode, NameNodeListType, InvalidateOnNameAttrChange) + : LiveNodeList(rootNode, NameNodeListType, InvalidateOnNameAttrChange) , m_name(name) { } diff --git a/Source/WebCore/dom/NameNodeList.h b/Source/WebCore/dom/NameNodeList.h index b030a1f38..8d8512b1c 100644 --- a/Source/WebCore/dom/NameNodeList.h +++ b/Source/WebCore/dom/NameNodeList.h @@ -24,14 +24,14 @@ #ifndef NameNodeList_h #define NameNodeList_h -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include <wtf/Forward.h> #include <wtf/text/AtomicString.h> namespace WebCore { // NodeList which lists all Nodes in a Element with a given "name" attribute -class NameNodeList : public DynamicSubtreeNodeList { +class NameNodeList : public LiveNodeList { public: static PassRefPtr<NameNodeList> create(PassRefPtr<Node> rootNode, const AtomicString& name) { diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp index bdeb6e243..85014c94f 100644 --- a/Source/WebCore/dom/Node.cpp +++ b/Source/WebCore/dom/Node.cpp @@ -46,7 +46,6 @@ #include "DOMSettableTokenList.h" #include "Document.h" #include "DocumentType.h" -#include "DynamicNodeList.h" #include "Element.h" #include "ElementRareData.h" #include "ElementShadow.h" @@ -68,6 +67,7 @@ #include "InspectorCounters.h" #include "KeyboardEvent.h" #include "LabelsNodeList.h" +#include "LiveNodeList.h" #include "Logging.h" #include "MouseEvent.h" #include "MutationEvent.h" @@ -971,7 +971,7 @@ unsigned Node::nodeIndex() const template<unsigned type> bool shouldInvalidateNodeListCachesForAttr(const unsigned nodeListCounts[], const QualifiedName& attrName) { - if (nodeListCounts[type] && DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange(static_cast<NodeListInvalidationType>(type), attrName)) + if (nodeListCounts[type] && LiveNodeListBase::shouldInvalidateTypeOnAttributeChange(static_cast<NodeListInvalidationType>(type), attrName)) return true; return shouldInvalidateNodeListCachesForAttr<type + 1>(nodeListCounts, attrName); } @@ -997,8 +997,8 @@ bool Document::shouldInvalidateNodeListCaches(const QualifiedName* attrName) con void Document::invalidateNodeListCaches(const QualifiedName* attrName) { - HashSet<DynamicNodeListCacheBase*>::iterator end = m_listsInvalidatedAtDocument.end(); - for (HashSet<DynamicNodeListCacheBase*>::iterator it = m_listsInvalidatedAtDocument.begin(); it != end; ++it) + HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end(); + for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument.begin(); it != end; ++it) (*it)->invalidateCache(attrName); } @@ -1193,7 +1193,7 @@ static void checkAcceptChild(Node* newParent, Node* newChild, ExceptionCode& ec) // HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the // newChild node, or if the node to append is one of this node's ancestors. - if (newChild == newParent || newParent->isDescendantOf(newChild)) { + if (newChild->contains(newParent)) { ec = HIERARCHY_REQUEST_ERR; return; } @@ -1267,7 +1267,7 @@ void Node::attach() // FIXME: This is O(N^2) for the innerHTML case, where all children are replaced at once (and not attached). // If this node got a renderer it may be the previousRenderer() of sibling text nodes and thus affect the - // result of Text::rendererIsNeeded() for those nodes. + // result of Text::textRendererIsNeeded() for those nodes. if (renderer()) { for (Node* next = nextSibling(); next; next = next->nextSibling()) { if (next->renderer()) @@ -1275,7 +1275,7 @@ void Node::attach() if (!next->attached()) break; // Assume this means none of the following siblings are attached. if (next->isTextNode()) - next->createRendererIfNeeded(); + toText(next)->createTextRendererIfNeeded(); } } @@ -1395,22 +1395,6 @@ ContainerNode* Node::parentNodeForRenderingAndStyle() return NodeRenderingContext(this).parentNodeForRenderingAndStyle(); } -void Node::createRendererIfNeeded() -{ - NodeRenderingContext(this).createRendererIfNeeded(); -} - -bool Node::rendererIsNeeded(const NodeRenderingContext& context) -{ - return (document()->documentElement() == this) || (context.style()->display() != NONE); -} - -RenderObject* Node::createRenderer(RenderArena*, RenderStyle*) -{ - ASSERT_NOT_REACHED(); - return 0; -} - RenderStyle* Node::virtualComputedStyle(PseudoId pseudoElementSpecifier) { return parentOrHostNode() ? parentOrHostNode()->computedStyle(pseudoElementSpecifier) : 0; @@ -2620,9 +2604,9 @@ bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) } #endif -void Node::dispatchSimulatedClick(Event* underlyingEvent, bool sendMouseEvents, bool showPressedLook) +void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEventOptions eventOptions, SimulatedClickVisualOptions visualOptions) { - EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, sendMouseEvents, showPressedLook); + EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions, visualOptions); } bool Node::dispatchBeforeLoadEvent(const String& sourceURL) diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h index f57ca46c6..d3ab3bb78 100644 --- a/Source/WebCore/dom/Node.h +++ b/Source/WebCore/dom/Node.h @@ -32,6 +32,7 @@ #include "MutationObserver.h" #include "RenderStyleConstants.h" #include "ScriptWrappable.h" +#include "SimulatedClickOptions.h" #include "TreeShared.h" #include <wtf/Forward.h> #include <wtf/ListHashSet.h> @@ -54,7 +55,6 @@ class ClassNodeList; class ContainerNode; class DOMSettableTokenList; class Document; -class DynamicSubtreeNodeList; class Element; class Event; class EventContext; @@ -539,10 +539,6 @@ public: void reattach(); void reattachIfAttached(); - void createRendererIfNeeded(); - virtual bool rendererIsNeeded(const NodeRenderingContext&); - virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const { return true; } - virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); ContainerNode* parentNodeForRenderingAndStyle(); // Wrapper for nodes that don't have a renderer, but still cache the style (like HTMLOptionElement). @@ -642,7 +638,7 @@ public: #if ENABLE(GESTURE_EVENTS) bool dispatchGestureEvent(const PlatformGestureEvent&); #endif - void dispatchSimulatedClick(Event* underlyingEvent, bool sendMouseEvents = false, bool showPressedLook = true); + void dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEventOptions = SendNoEvents, SimulatedClickVisualOptions = ShowPressedLook); bool dispatchBeforeLoadEvent(const String& sourceURL); virtual void dispatchFocusEvent(PassRefPtr<Node> oldFocusedNode); diff --git a/Source/WebCore/dom/NodeList.h b/Source/WebCore/dom/NodeList.h index f0aa631a5..a768e6262 100644 --- a/Source/WebCore/dom/NodeList.h +++ b/Source/WebCore/dom/NodeList.h @@ -39,10 +39,10 @@ namespace WebCore { // DOM methods & attributes for NodeList virtual unsigned length() const = 0; virtual Node* item(unsigned index) const = 0; - virtual Node* itemWithName(const AtomicString&) const = 0; - + virtual Node* namedItem(const AtomicString&) const = 0; + // Other methods (not part of DOM) - virtual bool isDynamicNodeList() const { return false; } + virtual bool isLiveNodeList() const { return false; } }; } // namespace WebCore diff --git a/Source/WebCore/dom/NodeRareData.h b/Source/WebCore/dom/NodeRareData.h index 722fba989..65959f78b 100644 --- a/Source/WebCore/dom/NodeRareData.h +++ b/Source/WebCore/dom/NodeRareData.h @@ -24,7 +24,7 @@ #include "ChildNodeList.h" #include "DOMSettableTokenList.h" -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include "MutationObserver.h" #include "MutationObserverRegistration.h" #include "QualifiedName.h" @@ -59,8 +59,8 @@ public: static const bool safeToCompareToEmptyOrDeleted = DefaultHash<StringType>::Hash::safeToCompareToEmptyOrDeleted; }; - typedef HashMap<std::pair<unsigned char, AtomicString>, DynamicNodeListCacheBase*, NodeListCacheMapEntryHash<AtomicString> > NodeListAtomicNameCacheMap; - typedef HashMap<std::pair<unsigned char, String>, DynamicSubtreeNodeList*, NodeListCacheMapEntryHash<String> > NodeListNameCacheMap; + typedef HashMap<std::pair<unsigned char, AtomicString>, LiveNodeListBase*, NodeListCacheMapEntryHash<AtomicString> > NodeListAtomicNameCacheMap; + typedef HashMap<std::pair<unsigned char, String>, LiveNodeListBase*, NodeListCacheMapEntryHash<String> > NodeListNameCacheMap; typedef HashMap<QualifiedName, TagNodeList*> TagNodeListCacheNS; template<typename T> @@ -117,19 +117,19 @@ public: return list.release(); } - void removeCacheWithAtomicName(DynamicNodeListCacheBase* list, CollectionType collectionType, const AtomicString& name = starAtom) + void removeCacheWithAtomicName(LiveNodeListBase* list, CollectionType collectionType, const AtomicString& name = starAtom) { ASSERT_UNUSED(list, list == m_atomicNameCaches.get(namedNodeListKey(collectionType, name))); m_atomicNameCaches.remove(namedNodeListKey(collectionType, name)); } - void removeCacheWithName(DynamicSubtreeNodeList* list, CollectionType collectionType, const String& name) + void removeCacheWithName(LiveNodeListBase* list, CollectionType collectionType, const String& name) { ASSERT_UNUSED(list, list == m_nameCaches.get(namedNodeListKey(collectionType, name))); m_nameCaches.remove(namedNodeListKey(collectionType, name)); } - void removeCacheWithQualifiedName(DynamicSubtreeNodeList* list, const AtomicString& namespaceURI, const AtomicString& localName) + void removeCacheWithQualifiedName(LiveNodeList* list, const AtomicString& namespaceURI, const AtomicString& localName) { QualifiedName name(nullAtom, localName, namespaceURI); ASSERT_UNUSED(list, list == m_tagNodeListCacheNS.get(name)); @@ -154,21 +154,21 @@ public: if (oldDocument != newDocument) { NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicNameCaches.end(); for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begin(); it != atomicNameCacheEnd; ++it) { - DynamicNodeListCacheBase* list = it->value; + LiveNodeListBase* list = it->value; oldDocument->unregisterNodeListCache(list); newDocument->registerNodeListCache(list); } NodeListNameCacheMap::const_iterator nameCacheEnd = m_nameCaches.end(); for (NodeListNameCacheMap::const_iterator it = m_nameCaches.begin(); it != nameCacheEnd; ++it) { - DynamicNodeListCacheBase* list = it->value; + LiveNodeListBase* list = it->value; oldDocument->unregisterNodeListCache(list); newDocument->registerNodeListCache(list); } TagNodeListCacheNS::const_iterator tagEnd = m_tagNodeListCacheNS.end(); for (TagNodeListCacheNS::const_iterator it = m_tagNodeListCacheNS.begin(); it != tagEnd; ++it) { - DynamicNodeListCacheBase* list = it->value; + LiveNodeListBase* list = it->value; ASSERT(!list->isRootedAtDocument()); oldDocument->unregisterNodeListCache(list); newDocument->registerNodeListCache(list); diff --git a/Source/WebCore/dom/NodeRenderingContext.cpp b/Source/WebCore/dom/NodeRenderingContext.cpp index 9aeeacfe1..9bbf60aba 100644 --- a/Source/WebCore/dom/NodeRenderingContext.cpp +++ b/Source/WebCore/dom/NodeRenderingContext.cpp @@ -38,9 +38,11 @@ #include "RenderFullScreen.h" #include "RenderNamedFlowThread.h" #include "RenderObject.h" +#include "RenderText.h" #include "RenderView.h" #include "ShadowRoot.h" #include "StyleInheritedData.h" +#include "Text.h" #if ENABLE(SVG) #include "SVGNames.h" @@ -146,11 +148,12 @@ bool NodeRenderingContext::shouldCreateRenderer() const void NodeRenderingContext::moveToFlowThreadIfNeeded() { + ASSERT(m_node->isElementNode()); ASSERT(m_style); if (!m_node->document()->cssRegionsEnabled()) return; - if (!m_node->isElementNode() || m_style->flowThread().isEmpty()) + if (m_style->flowThread().isEmpty()) return; // FIXME: Do not collect elements if they are in shadow tree. @@ -201,21 +204,21 @@ static void adjustInsertionPointForTopLayerElement(Element* element, RenderObjec } #endif -void NodeRenderingContext::createRendererIfNeeded() +void NodeRenderingContext::createRendererForElementIfNeeded() { ASSERT(!m_node->renderer()); + Element* element = toElement(m_node); + if (!shouldCreateRenderer()) return; - Element* element = m_node->isElementNode() ? toElement(m_node) : 0; - - m_style = element ? element->styleForRenderer() : parentRenderer()->style(); + m_style = element->styleForRenderer(); ASSERT(m_style); moveToFlowThreadIfNeeded(); - if (!m_node->rendererIsNeeded(*this)) { - if (element && m_style->affectedByEmpty()) + if (!element->rendererIsNeeded(*this)) { + if (m_style->affectedByEmpty()) element->setStyleAffectedByEmpty(); return; } @@ -223,23 +226,23 @@ void NodeRenderingContext::createRendererIfNeeded() RenderObject* nextRenderer = this->nextRenderer(); #if ENABLE(DIALOG_ELEMENT) - if (element && element->isInTopLayer()) + if (element->isInTopLayer()) adjustInsertionPointForTopLayerElement(element, parentRenderer, nextRenderer); #endif - Document* document = m_node->document(); - RenderObject* newRenderer = m_node->createRenderer(document->renderArena(), m_style.get()); + Document* document = element->document(); + RenderObject* newRenderer = element->createRenderer(document->renderArena(), m_style.get()); if (!newRenderer) return; if (!parentRenderer->isChildAllowed(newRenderer, m_style.get())) { newRenderer->destroy(); return; } - m_node->setRenderer(newRenderer); + element->setRenderer(newRenderer); newRenderer->setAnimatableStyle(m_style.release()); // setAnimatableStyle() can depend on renderer() already being set. #if ENABLE(FULLSCREEN_API) - if (document->webkitIsFullScreen() && document->webkitCurrentFullScreenElement() == m_node) { + if (document->webkitIsFullScreen() && document->webkitCurrentFullScreenElement() == element) { newRenderer = RenderFullScreen::wrapRenderer(newRenderer, parentRenderer, document); if (!newRenderer) return; @@ -249,4 +252,33 @@ void NodeRenderingContext::createRendererIfNeeded() parentRenderer->addChild(newRenderer, nextRenderer); } +void NodeRenderingContext::createRendererForTextIfNeeded() +{ + ASSERT(!m_node->renderer()); + + Text* textNode = toText(m_node); + + if (!shouldCreateRenderer()) + return; + RenderObject* parentRenderer = this->parentRenderer(); + ASSERT(parentRenderer); + m_style = parentRenderer->style(); + + if (!textNode->textRendererIsNeeded(*this)) + return; + Document* document = textNode->document(); + RenderText* newRenderer = textNode->createTextRenderer(document->renderArena(), m_style.get()); + if (!newRenderer) + return; + if (!parentRenderer->isChildAllowed(newRenderer, m_style.get())) { + newRenderer->destroy(); + return; + } + RenderObject* nextRenderer = this->nextRenderer(); + textNode->setRenderer(newRenderer); + // Parent takes care of the animations, no need to call setAnimatableStyle. + newRenderer->setStyle(m_style.release()); + parentRenderer->addChild(newRenderer, nextRenderer); +} + } diff --git a/Source/WebCore/dom/NodeRenderingContext.h b/Source/WebCore/dom/NodeRenderingContext.h index fd2fd75ed..7da48e29a 100644 --- a/Source/WebCore/dom/NodeRenderingContext.h +++ b/Source/WebCore/dom/NodeRenderingContext.h @@ -48,7 +48,8 @@ public: NodeRenderingContext(Node*, RenderStyle*); ~NodeRenderingContext(); - void createRendererIfNeeded(); + void createRendererForTextIfNeeded(); + void createRendererForElementIfNeeded(); Node* node() const; ContainerNode* parentNodeForRenderingAndStyle() const; diff --git a/Source/WebCore/dom/PropertyNodeList.cpp b/Source/WebCore/dom/PropertyNodeList.cpp index 0441dc76b..183116c25 100644 --- a/Source/WebCore/dom/PropertyNodeList.cpp +++ b/Source/WebCore/dom/PropertyNodeList.cpp @@ -44,7 +44,7 @@ namespace WebCore { using namespace HTMLNames; PropertyNodeList::PropertyNodeList(Node* rootNode, const String& name) - : DynamicSubtreeNodeList(rootNode, PropertyNodeListType, InvalidateOnItemAttrChange, NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr) + : LiveNodeList(rootNode, PropertyNodeListType, InvalidateOnItemAttrChange, NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr) , m_name(name) { } diff --git a/Source/WebCore/dom/PropertyNodeList.h b/Source/WebCore/dom/PropertyNodeList.h index fa96a4148..9bb737b17 100644 --- a/Source/WebCore/dom/PropertyNodeList.h +++ b/Source/WebCore/dom/PropertyNodeList.h @@ -32,7 +32,7 @@ #define PropertyNodeList_h #if ENABLE(MICRODATA) -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include "MicroDataItemValue.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> @@ -42,7 +42,7 @@ namespace WebCore { typedef Vector<RefPtr<MicroDataItemValue> > PropertyValueArray; -class PropertyNodeList : public DynamicSubtreeNodeList { +class PropertyNodeList : public LiveNodeList { public: static PassRefPtr<PropertyNodeList> create(Node* rootNode, const String& name) { diff --git a/Source/WebCore/dom/Range.cpp b/Source/WebCore/dom/Range.cpp index c71fa1cd9..cc0684583 100644 --- a/Source/WebCore/dom/Range.cpp +++ b/Source/WebCore/dom/Range.cpp @@ -1447,7 +1447,7 @@ void Range::surroundContents(PassRefPtr<Node> passNewParent, ExceptionCode& ec) return; } - if (m_start.container() == newParent || m_start.container()->isDescendantOf(newParent.get())) { + if (newParent->contains(m_start.container())) { ec = HIERARCHY_REQUEST_ERR; return; } diff --git a/Source/WebCore/dom/SimulatedClickOptions.h b/Source/WebCore/dom/SimulatedClickOptions.h new file mode 100644 index 000000000..a49ed7496 --- /dev/null +++ b/Source/WebCore/dom/SimulatedClickOptions.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 Apple Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * 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 SimulatedClickOptions_h +#define SimulatedClickOptions_h + +namespace WebCore { + +enum SimulatedClickMouseEventOptions { + SendNoEvents, + SendMouseUpDownEvents, + SendMouseOverUpDownEvents +}; + +enum SimulatedClickVisualOptions { + DoNotShowPressedLook, + ShowPressedLook +}; + +} // namespace WebCore + +#endif // SimulatedClickOptions_h diff --git a/Source/WebCore/dom/StaticHashSetNodeList.cpp b/Source/WebCore/dom/StaticHashSetNodeList.cpp index 3d6b5c38f..ad4a9a4a7 100644 --- a/Source/WebCore/dom/StaticHashSetNodeList.cpp +++ b/Source/WebCore/dom/StaticHashSetNodeList.cpp @@ -63,7 +63,7 @@ Node* StaticHashSetNodeList::item(unsigned index) const return 0; } -Node* StaticHashSetNodeList::itemWithName(const AtomicString& elementId) const +Node* StaticHashSetNodeList::namedItem(const AtomicString& elementId) const { ListHashSet<RefPtr<Node> >::const_iterator it = m_nodes.begin(); ListHashSet<RefPtr<Node> >::const_iterator end = m_nodes.end(); diff --git a/Source/WebCore/dom/StaticHashSetNodeList.h b/Source/WebCore/dom/StaticHashSetNodeList.h index cb1093fad..4d06c0e16 100644 --- a/Source/WebCore/dom/StaticHashSetNodeList.h +++ b/Source/WebCore/dom/StaticHashSetNodeList.h @@ -55,9 +55,9 @@ public: return adoptRef(new StaticHashSetNodeList(nodes)); } - virtual unsigned length() const; - virtual Node* item(unsigned index) const; - virtual Node* itemWithName(const AtomicString&) const; + virtual unsigned length() const OVERRIDE; + virtual Node* item(unsigned index) const OVERRIDE; + virtual Node* namedItem(const AtomicString&) const OVERRIDE; private: explicit StaticHashSetNodeList(ListHashSet<RefPtr<Node> >& nodes); diff --git a/Source/WebCore/dom/StaticNodeList.cpp b/Source/WebCore/dom/StaticNodeList.cpp index 412c125e0..2ca9011fb 100644 --- a/Source/WebCore/dom/StaticNodeList.cpp +++ b/Source/WebCore/dom/StaticNodeList.cpp @@ -45,7 +45,7 @@ Node* StaticNodeList::item(unsigned index) const return 0; } -Node* StaticNodeList::itemWithName(const AtomicString& elementId) const +Node* StaticNodeList::namedItem(const AtomicString& elementId) const { size_t length = m_nodes.size(); for (size_t i = 0; i < length; ++i) { diff --git a/Source/WebCore/dom/StaticNodeList.h b/Source/WebCore/dom/StaticNodeList.h index 7d3fbf5b0..5320ce52b 100644 --- a/Source/WebCore/dom/StaticNodeList.h +++ b/Source/WebCore/dom/StaticNodeList.h @@ -46,9 +46,9 @@ namespace WebCore { return adoptRef(new StaticNodeList(nodes)); } - virtual unsigned length() const; - virtual Node* item(unsigned index) const; - virtual Node* itemWithName(const AtomicString&) const; + virtual unsigned length() const OVERRIDE; + virtual Node* item(unsigned index) const OVERRIDE; + virtual Node* namedItem(const AtomicString&) const OVERRIDE; private: explicit StaticNodeList(Vector<RefPtr<Node> >& nodes) diff --git a/Source/WebCore/dom/TagNodeList.cpp b/Source/WebCore/dom/TagNodeList.cpp index c71369aad..b7bdde988 100644 --- a/Source/WebCore/dom/TagNodeList.cpp +++ b/Source/WebCore/dom/TagNodeList.cpp @@ -31,7 +31,7 @@ namespace WebCore { TagNodeList::TagNodeList(PassRefPtr<Node> rootNode, const AtomicString& namespaceURI, const AtomicString& localName) - : DynamicSubtreeNodeList(rootNode, TagNodeListType, DoNotInvalidateOnAttributeChanges) + : LiveNodeList(rootNode, TagNodeListType, DoNotInvalidateOnAttributeChanges) , m_namespaceURI(namespaceURI) , m_localName(localName) { diff --git a/Source/WebCore/dom/TagNodeList.h b/Source/WebCore/dom/TagNodeList.h index 251a86d40..95c0f5da4 100644 --- a/Source/WebCore/dom/TagNodeList.h +++ b/Source/WebCore/dom/TagNodeList.h @@ -24,13 +24,13 @@ #ifndef TagNodeList_h #define TagNodeList_h -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include <wtf/text/AtomicString.h> namespace WebCore { // NodeList that limits to a particular tag. - class TagNodeList : public DynamicSubtreeNodeList { + class TagNodeList : public LiveNodeList { public: static PassRefPtr<TagNodeList> create(PassRefPtr<Node> rootNode, const AtomicString& namespaceURI, const AtomicString& localName) { diff --git a/Source/WebCore/dom/Text.cpp b/Source/WebCore/dom/Text.cpp index 9ef159a2d..6737affec 100644 --- a/Source/WebCore/dom/Text.cpp +++ b/Source/WebCore/dom/Text.cpp @@ -195,11 +195,15 @@ PassRefPtr<Node> Text::cloneNode(bool /*deep*/) return create(document(), data()); } -bool Text::rendererIsNeeded(const NodeRenderingContext& context) +bool Text::textRendererIsNeeded(const NodeRenderingContext& context) { if (isEditingText()) return true; - if (!CharacterData::rendererIsNeeded(context)) + + if (!length()) + return false; + + if (context.style()->display() == NONE) return false; bool onlyWS = containsOnlyWhitespace(); @@ -252,13 +256,17 @@ static bool isSVGText(Text* text) } #endif -RenderObject* Text::createRenderer(RenderArena* arena, RenderStyle* style) +void Text::createTextRendererIfNeeded() +{ + NodeRenderingContext(this).createRendererForTextIfNeeded(); +} + +RenderText* Text::createTextRenderer(RenderArena* arena, RenderStyle* style) { #if ENABLE(SVG) if (isSVGText(this) || isSVGShadowText(this)) return new (arena) RenderSVGInlineText(this, dataImpl()); #endif - if (style->hasTextCombine()) return new (arena) RenderCombineText(this, dataImpl()); @@ -267,14 +275,13 @@ RenderObject* Text::createRenderer(RenderArena* arena, RenderStyle* style) void Text::attach() { - createRendererIfNeeded(); + createTextRendererIfNeeded(); CharacterData::attach(); } void Text::recalcTextStyle(StyleChange change) { - RenderObject* renderer = this->renderer(); - + RenderText* renderer = toRenderText(this->renderer()); // The only time we have a renderer and our parent doesn't is if our parent // is a shadow root. if (change != NoChange && renderer) { @@ -287,15 +294,26 @@ void Text::recalcTextStyle(StyleChange change) } if (needsStyleRecalc()) { - if (renderer) { - if (renderer->isText()) - toRenderText(renderer)->setText(dataImpl()); - } else + if (renderer) + renderer->setText(dataImpl()); + else reattach(); } clearNeedsStyleRecalc(); } +void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData) +{ + if (!attached()) + return; + RenderText* textRenderer = toRenderText(renderer()); + if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRenderer->style()))) { + reattach(); + return; + } + textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfReplacedData); +} + bool Text::childTypeAllowed(NodeType) const { return false; diff --git a/Source/WebCore/dom/Text.h b/Source/WebCore/dom/Text.h index 27dccfc01..6e3a41849 100644 --- a/Source/WebCore/dom/Text.h +++ b/Source/WebCore/dom/Text.h @@ -26,7 +26,9 @@ #include "CharacterData.h" namespace WebCore { - + +class RenderText; + class Text : public CharacterData { public: static const unsigned defaultLengthLimit = 1 << 16; @@ -43,6 +45,10 @@ public: PassRefPtr<Text> replaceWholeText(const String&, ExceptionCode&); void recalcTextStyle(StyleChange); + void createTextRendererIfNeeded(); + bool textRendererIsNeeded(const NodeRenderingContext&); + RenderText* createTextRenderer(RenderArena*, RenderStyle*); + void updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData); virtual void attach(); @@ -58,8 +64,6 @@ private: virtual String nodeName() const; virtual NodeType nodeType() const; virtual PassRefPtr<Node> cloneNode(bool deep); - virtual bool rendererIsNeeded(const NodeRenderingContext&); - virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual bool childTypeAllowed(NodeType) const; virtual PassRefPtr<Text> virtualCreate(const String&); diff --git a/Source/WebCore/editing/visible_units.cpp b/Source/WebCore/editing/visible_units.cpp index 950867799..6ecb77c64 100644 --- a/Source/WebCore/editing/visible_units.cpp +++ b/Source/WebCore/editing/visible_units.cpp @@ -322,7 +322,7 @@ static TextBreakIterator* wordBreakIteratorForMaxOffsetBoundary(const VisiblePos return wordBreakIterator(string.data(), len); } -bool isLogicalStartOfWord(TextBreakIterator* iter, int position, bool hardLineBreak) +static bool isLogicalStartOfWord(TextBreakIterator* iter, int position, bool hardLineBreak) { bool boundary = hardLineBreak ? true : isTextBreak(iter, position); if (!boundary) @@ -333,7 +333,7 @@ bool isLogicalStartOfWord(TextBreakIterator* iter, int position, bool hardLineBr return isWordTextBreak(iter); } -bool islogicalEndOfWord(TextBreakIterator* iter, int position, bool hardLineBreak) +static bool islogicalEndOfWord(TextBreakIterator* iter, int position, bool hardLineBreak) { bool boundary = isTextBreak(iter, position); return (hardLineBreak || boundary) && isWordTextBreak(iter); diff --git a/Source/WebCore/editing/visible_units.h b/Source/WebCore/editing/visible_units.h index 816ebbb48..723c196af 100644 --- a/Source/WebCore/editing/visible_units.h +++ b/Source/WebCore/editing/visible_units.h @@ -46,9 +46,6 @@ VisiblePosition nextWordPosition(const VisiblePosition &); VisiblePosition rightWordPosition(const VisiblePosition&, bool skipsSpaceWhenMovingRight); VisiblePosition leftWordPosition(const VisiblePosition&, bool skipsSpaceWhenMovingRight); bool isStartOfWord(const VisiblePosition&); -// used by TextCheckerEnchant.cpp -bool isLogicalStartOfWord(TextBreakIterator*, int position, bool hardLineBreak = false); -bool islogicalEndOfWord(TextBreakIterator*, int position, bool hardLineBreak = false); // sentences VisiblePosition startOfSentence(const VisiblePosition &); diff --git a/Source/WebCore/html/BaseCheckableInputType.cpp b/Source/WebCore/html/BaseCheckableInputType.cpp index 2812173b7..cb61c7e58 100644 --- a/Source/WebCore/html/BaseCheckableInputType.cpp +++ b/Source/WebCore/html/BaseCheckableInputType.cpp @@ -89,9 +89,7 @@ void BaseCheckableInputType::accessKeyAction(bool sendMouseEvents) { InputType::accessKeyAction(sendMouseEvents); - // Send mouse button events if the caller specified sendMouseEvents. - // FIXME: The comment above is no good. It says what we do, but not why. - element()->dispatchSimulatedClick(0, sendMouseEvents); + element()->dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents); } String BaseCheckableInputType::fallbackValue() const diff --git a/Source/WebCore/html/BaseClickableWithKeyInputType.cpp b/Source/WebCore/html/BaseClickableWithKeyInputType.cpp index 329c512ed..2a09b2fd8 100644 --- a/Source/WebCore/html/BaseClickableWithKeyInputType.cpp +++ b/Source/WebCore/html/BaseClickableWithKeyInputType.cpp @@ -75,9 +75,7 @@ void BaseClickableWithKeyInputType::handleKeyupEvent(InputType& inputType, Keybo // FIXME: Could share this with BaseCheckableInputType and RangeInputType if we had a common base class. void BaseClickableWithKeyInputType::accessKeyAction(HTMLInputElement* element, bool sendMouseEvents) { - // Send mouse button events if the caller specified sendMouseEvents. - // FIXME: The comment above is no good. It says what we do, but not why. - element->dispatchSimulatedClick(0, sendMouseEvents); + element->dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents); } void BaseClickableWithKeyInputType::handleKeydownEvent(KeyboardEvent* event) diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp index d60e359a6..d571a4ab1 100644 --- a/Source/WebCore/html/HTMLAnchorElement.cpp +++ b/Source/WebCore/html/HTMLAnchorElement.cpp @@ -241,8 +241,7 @@ void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt void HTMLAnchorElement::accessKeyAction(bool sendMouseEvents) { - // send the mouse button events if the caller specified sendMouseEvents - dispatchSimulatedClick(0, sendMouseEvents); + dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents); } bool HTMLAnchorElement::isURLAttribute(const Attribute& attribute) const diff --git a/Source/WebCore/html/HTMLButtonElement.cpp b/Source/WebCore/html/HTMLButtonElement.cpp index 1c9d53df6..eff6fd857 100644 --- a/Source/WebCore/html/HTMLButtonElement.cpp +++ b/Source/WebCore/html/HTMLButtonElement.cpp @@ -192,8 +192,8 @@ bool HTMLButtonElement::appendFormData(FormDataList& formData, bool) void HTMLButtonElement::accessKeyAction(bool sendMouseEvents) { focus(); - // Send the mouse button events if the caller specified sendMouseEvents - dispatchSimulatedClick(0, sendMouseEvents); + + dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents); } bool HTMLButtonElement::isURLAttribute(const Attribute& attribute) const diff --git a/Source/WebCore/html/HTMLCollection.cpp b/Source/WebCore/html/HTMLCollection.cpp index da2a4bfca..df20954de 100644 --- a/Source/WebCore/html/HTMLCollection.cpp +++ b/Source/WebCore/html/HTMLCollection.cpp @@ -176,7 +176,7 @@ static NodeListInvalidationType invalidationTypeExcludingIdAndNameAttributes(Col HTMLCollection::HTMLCollection(Node* ownerNode, CollectionType type, ItemAfterOverrideType itemAfterOverrideType) - : DynamicNodeListCacheBase(ownerNode, rootTypeFromCollectionType(type), invalidationTypeExcludingIdAndNameAttributes(type), + : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidationTypeExcludingIdAndNameAttributes(type), WebCore::shouldOnlyIncludeDirectChildren(type), type, itemAfterOverrideType) { document()->registerNodeListCache(this); @@ -290,14 +290,14 @@ static Node* firstNode(bool forward, Node* rootNode, bool onlyIncludeDirectChild } template <bool forward> -Node* DynamicNodeListCacheBase::iterateForNextNode(Node* current) const +Node* LiveNodeListBase::iterateForNextNode(Node* current) const { bool onlyIncludeDirectChildren = shouldOnlyIncludeDirectChildren(); CollectionType collectionType = type(); Node* rootNode = this->rootNode(); for (; current; current = nextNode<forward>(rootNode, current, onlyIncludeDirectChildren)) { if (isNodeList(collectionType)) { - if (current->isElementNode() && static_cast<const DynamicNodeList*>(this)->nodeMatches(toElement(current))) + if (current->isElementNode() && static_cast<const LiveNodeList*>(this)->nodeMatches(toElement(current))) return toElement(current); } else { if (current->isElementNode() && isAcceptableElement(collectionType, toElement(current))) @@ -310,7 +310,7 @@ Node* DynamicNodeListCacheBase::iterateForNextNode(Node* current) const // Without this ALWAYS_INLINE, length() and item() can be 100% slower. template<bool forward> ALWAYS_INLINE -Node* DynamicNodeListCacheBase::itemBeforeOrAfter(Node* previous) const +Node* LiveNodeListBase::itemBeforeOrAfter(Node* previous) const { Node* current; if (LIKELY(!!previous)) // Without this LIKELY, length() and item() can be 10% slower. @@ -325,13 +325,13 @@ Node* DynamicNodeListCacheBase::itemBeforeOrAfter(Node* previous) const } // Without this ALWAYS_INLINE, length() and item() can be 100% slower. -ALWAYS_INLINE Node* DynamicNodeListCacheBase::itemBefore(Node* previous) const +ALWAYS_INLINE Node* LiveNodeListBase::itemBefore(Node* previous) const { return itemBeforeOrAfter<false>(previous); } // Without this ALWAYS_INLINE, length() and item() can be 100% slower. -ALWAYS_INLINE Node* DynamicNodeListCacheBase::itemAfter(unsigned& offsetInArray, Node* previous) const +ALWAYS_INLINE Node* LiveNodeListBase::itemAfter(unsigned& offsetInArray, Node* previous) const { if (UNLIKELY(overridesItemAfter())) // Without this UNLIKELY, length() can be 100% slower. return static_cast<const HTMLCollection*>(this)->virtualItemAfter(offsetInArray, toElement(previous)); @@ -339,7 +339,7 @@ ALWAYS_INLINE Node* DynamicNodeListCacheBase::itemAfter(unsigned& offsetInArray, return itemBeforeOrAfter<true>(previous); } -bool ALWAYS_INLINE DynamicNodeListCacheBase::isLastItemCloserThanLastOrCachedItem(unsigned offset) const +bool ALWAYS_INLINE LiveNodeListBase::isLastItemCloserThanLastOrCachedItem(unsigned offset) const { ASSERT(isLengthCacheValid()); unsigned distanceFromLastItem = cachedLength() - offset; @@ -349,7 +349,7 @@ bool ALWAYS_INLINE DynamicNodeListCacheBase::isLastItemCloserThanLastOrCachedIte return cachedItemOffset() < offset && distanceFromLastItem < offset - cachedItemOffset(); } -bool ALWAYS_INLINE DynamicNodeListCacheBase::isFirstItemCloserThanCachedItem(unsigned offset) const +bool ALWAYS_INLINE LiveNodeListBase::isFirstItemCloserThanCachedItem(unsigned offset) const { ASSERT(isItemCacheValid()); if (cachedItemOffset() < offset) @@ -359,7 +359,7 @@ bool ALWAYS_INLINE DynamicNodeListCacheBase::isFirstItemCloserThanCachedItem(uns return offset < distanceFromCachedItem; } -ALWAYS_INLINE void DynamicNodeListCacheBase::setItemCache(Node* item, unsigned offset, unsigned elementsArrayOffset) const +ALWAYS_INLINE void LiveNodeListBase::setItemCache(Node* item, unsigned offset, unsigned elementsArrayOffset) const { setItemCache(item, offset); if (overridesItemAfter()) { @@ -369,18 +369,18 @@ ALWAYS_INLINE void DynamicNodeListCacheBase::setItemCache(Node* item, unsigned o ASSERT(!elementsArrayOffset); } -unsigned DynamicNodeListCacheBase::lengthCommon() const +unsigned LiveNodeListBase::length() const { if (isLengthCacheValid()) return cachedLength(); - itemCommon(UINT_MAX); + item(UINT_MAX); ASSERT(isLengthCacheValid()); return cachedLength(); } -Node* DynamicNodeListCacheBase::itemCommon(unsigned offset) const +Node* LiveNodeListBase::item(unsigned offset) const { if (isItemCacheValid() && cachedItemOffset() == offset) return cachedItem(); @@ -416,7 +416,7 @@ Node* DynamicNodeListCacheBase::itemCommon(unsigned offset) const return itemBeforeOrAfterCachedItem(offset); } -Node* DynamicNodeListCacheBase::itemBeforeOrAfterCachedItem(unsigned offset) const +Node* LiveNodeListBase::itemBeforeOrAfterCachedItem(unsigned offset) const { unsigned currentOffset = cachedItemOffset(); Node* currentItem = cachedItem(); diff --git a/Source/WebCore/html/HTMLCollection.h b/Source/WebCore/html/HTMLCollection.h index 98f361fe9..1707f5650 100644 --- a/Source/WebCore/html/HTMLCollection.h +++ b/Source/WebCore/html/HTMLCollection.h @@ -24,7 +24,7 @@ #define HTMLCollection_h #include "CollectionType.h" -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include "ScriptWrappable.h" #include <wtf/Forward.h> #include <wtf/HashMap.h> @@ -33,14 +33,12 @@ namespace WebCore { -class HTMLCollection : public ScriptWrappable, public RefCounted<HTMLCollection>, public DynamicNodeListCacheBase { +class HTMLCollection : public LiveNodeListBase { public: static PassRefPtr<HTMLCollection> create(Node* base, CollectionType); virtual ~HTMLCollection(); // DOM API - unsigned length() const { return lengthCommon(); } - Node* item(unsigned offset) const { return itemCommon(offset); } virtual Node* namedItem(const AtomicString& name) const; PassRefPtr<NodeList> tags(const String&); @@ -81,13 +79,15 @@ protected: private: bool checkForNameMatch(Element*, bool checkName, const AtomicString& name) const; + virtual bool isLiveNodeList() const OVERRIDE { ASSERT_NOT_REACHED(); return true; } + static void append(NodeCacheMap&, const AtomicString&, Element*); mutable NodeCacheMap m_idCache; mutable NodeCacheMap m_nameCache; mutable unsigned m_cachedElementsArrayOffset; - friend class DynamicNodeListCacheBase; + friend class LiveNodeListBase; }; } // namespace diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp index 571653235..87b7e2629 100644 --- a/Source/WebCore/html/HTMLElement.cpp +++ b/Source/WebCore/html/HTMLElement.cpp @@ -690,12 +690,12 @@ void HTMLElement::setSpellcheck(bool enable) void HTMLElement::click() { - dispatchSimulatedClick(0, false, false); + dispatchSimulatedClick(0, SendNoEvents, DoNotShowPressedLook); } void HTMLElement::accessKeyAction(bool sendMouseEvents) { - dispatchSimulatedClick(0, sendMouseEvents); + dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents); } String HTMLElement::title() const diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index 5dac84963..4cae786f1 100644 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/Source/WebCore/html/HTMLInputElement.cpp @@ -56,7 +56,6 @@ #include "Language.h" #include "LocalizedStrings.h" #include "MouseEvent.h" -#include "NumberInputType.h" #include "RenderTextControlSingleLine.h" #include "RenderTheme.h" #include "RuntimeEnabledFeatures.h" @@ -545,35 +544,9 @@ void HTMLInputElement::updateType() void HTMLInputElement::subtreeHasChanged() { - ASSERT(isTextField()); - ASSERT(renderer()); - - bool wasChanged = wasChangedSinceLastFormControlChangeEvent(); - setChangedSinceLastFormControlChangeEvent(true); - - // We don't need to call sanitizeUserInputValue() function here because - // HTMLInputElement::handleBeforeTextInsertedEvent() has already called - // sanitizeUserInputValue(). - // sanitizeValue() is needed because IME input doesn't dispatch BeforeTextInsertedEvent. - setValueFromRenderer(sanitizeValue(convertFromVisibleValue(innerTextValue()))); - updatePlaceholderVisibility(false); - // Recalc for :invalid and hasUnacceptableValue() change. - setNeedsStyleRecalc(); - m_inputType->subtreeHasChanged(); - - if (!wasChanged && focused()) { - if (Frame* frame = document()->frame()) - frame->editor()->textFieldDidBeginEditing(this); - } - - if (focused()) { - if (Frame* frame = document()->frame()) - frame->editor()->textDidChangeInTextField(this); - } // When typing in an input field, childrenChanged is not called, so we need to force the directionality check. - if (isTextField()) - calculateAndAdjustDirectionality(); + calculateAndAdjustDirectionality(); } const AtomicString& HTMLInputElement::formControlType() const @@ -1404,11 +1377,6 @@ String HTMLInputElement::visibleValue() const return m_inputType->visibleValue(); } -String HTMLInputElement::convertFromVisibleValue(const String& visibleValue) const -{ - return m_inputType->convertFromVisibleValue(visibleValue); -} - String HTMLInputElement::sanitizeValue(const String& proposedValue) const { if (proposedValue.isNull()) diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h index 422f40b97..b0ac6ae96 100644 --- a/Source/WebCore/html/HTMLInputElement.h +++ b/Source/WebCore/html/HTMLInputElement.h @@ -163,7 +163,6 @@ public: // The value which is drawn by a renderer. String visibleValue() const; - String convertFromVisibleValue(const String&) const; const String& suggestedValue() const; void setSuggestedValue(const String&); diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp index 0527a91ca..23ac57af4 100644 --- a/Source/WebCore/html/HTMLSelectElement.cpp +++ b/Source/WebCore/html/HTMLSelectElement.cpp @@ -393,7 +393,7 @@ void HTMLSelectElement::optionElementChildrenChanged() void HTMLSelectElement::accessKeyAction(bool sendMouseEvents) { focus(); - dispatchSimulatedClick(0, sendMouseEvents); + dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents); } void HTMLSelectElement::setMultiple(bool multiple) diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp index ad10269bc..4a437e029 100644 --- a/Source/WebCore/html/InputType.cpp +++ b/Source/WebCore/html/InputType.cpp @@ -684,11 +684,6 @@ String InputType::visibleValue() const return element()->value(); } -String InputType::convertFromVisibleValue(const String& visibleValue) const -{ - return visibleValue; -} - String InputType::sanitizeValue(const String& proposedValue) const { return proposedValue; @@ -888,6 +883,7 @@ void InputType::readonlyAttributeChanged() void InputType::subtreeHasChanged() { + ASSERT_NOT_REACHED(); } #if ENABLE(TOUCH_EVENTS) diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h index 6da537281..fe4a9e4d9 100644 --- a/Source/WebCore/html/InputType.h +++ b/Source/WebCore/html/InputType.h @@ -175,7 +175,6 @@ public: virtual bool canSetStringValue() const; virtual String localizeValue(const String&) const; virtual String visibleValue() const; - virtual String convertFromVisibleValue(const String&) const; // Returing the null string means "use the default value." // This function must be called only by HTMLInputElement::sanitizeValue(). virtual String sanitizeValue(const String&) const; diff --git a/Source/WebCore/html/LabelsNodeList.cpp b/Source/WebCore/html/LabelsNodeList.cpp index 4d7b0bd85..59bcc407b 100644 --- a/Source/WebCore/html/LabelsNodeList.cpp +++ b/Source/WebCore/html/LabelsNodeList.cpp @@ -34,7 +34,7 @@ namespace WebCore { using namespace HTMLNames; LabelsNodeList::LabelsNodeList(Node* forNode) - : DynamicSubtreeNodeList(forNode, LabelsNodeListType, InvalidateOnForAttrChange, NodeListIsRootedAtDocument) + : LiveNodeList(forNode, LabelsNodeListType, InvalidateOnForAttrChange, NodeListIsRootedAtDocument) { } diff --git a/Source/WebCore/html/LabelsNodeList.h b/Source/WebCore/html/LabelsNodeList.h index 5879f9254..9052eedd6 100644 --- a/Source/WebCore/html/LabelsNodeList.h +++ b/Source/WebCore/html/LabelsNodeList.h @@ -25,12 +25,12 @@ #ifndef LabelsNodeList_h #define LabelsNodeList_h -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include <wtf/PassRefPtr.h> namespace WebCore { -class LabelsNodeList : public DynamicSubtreeNodeList { +class LabelsNodeList : public LiveNodeList { public: static PassRefPtr<LabelsNodeList> create(Node* forNode, const AtomicString&) { diff --git a/Source/WebCore/html/RadioInputType.cpp b/Source/WebCore/html/RadioInputType.cpp index 076e22a5a..a9d86f3e5 100644 --- a/Source/WebCore/html/RadioInputType.cpp +++ b/Source/WebCore/html/RadioInputType.cpp @@ -96,7 +96,7 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event) break; if (inputElement->isRadioButton() && inputElement->name() == element()->name() && inputElement->isFocusable()) { document->setFocusedNode(inputElement); - inputElement->dispatchSimulatedClick(event, false, false); + inputElement->dispatchSimulatedClick(event, SendNoEvents, DoNotShowPressedLook); event->setDefaultHandled(); return; } diff --git a/Source/WebCore/html/RadioNodeList.cpp b/Source/WebCore/html/RadioNodeList.cpp index 8970816df..00108d094 100644 --- a/Source/WebCore/html/RadioNodeList.cpp +++ b/Source/WebCore/html/RadioNodeList.cpp @@ -38,7 +38,7 @@ namespace WebCore { using namespace HTMLNames; RadioNodeList::RadioNodeList(Node* rootNode, const AtomicString& name) - : DynamicSubtreeNodeList(rootNode, RadioNodeListType, InvalidateForFormControls, rootNode->hasTagName(formTag) ? NodeListIsRootedAtDocument : NodeListIsRootedAtNode) + : LiveNodeList(rootNode, RadioNodeListType, InvalidateForFormControls, rootNode->hasTagName(formTag) ? NodeListIsRootedAtDocument : NodeListIsRootedAtNode) , m_name(name) { } diff --git a/Source/WebCore/html/RadioNodeList.h b/Source/WebCore/html/RadioNodeList.h index 18eb288ad..23a527d35 100644 --- a/Source/WebCore/html/RadioNodeList.h +++ b/Source/WebCore/html/RadioNodeList.h @@ -26,7 +26,7 @@ #ifndef RadioNodeList_h #define RadioNodeList_h -#include "DynamicNodeList.h" +#include "LiveNodeList.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> #include <wtf/Vector.h> @@ -34,7 +34,7 @@ namespace WebCore { -class RadioNodeList : public DynamicSubtreeNodeList { +class RadioNodeList : public LiveNodeList { public: static PassRefPtr<RadioNodeList> create(Node* rootNode, const AtomicString& name) { diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp index 2ddf4c3f0..c37f6b770 100644 --- a/Source/WebCore/html/RangeInputType.cpp +++ b/Source/WebCore/html/RangeInputType.cpp @@ -286,9 +286,7 @@ void RangeInputType::accessKeyAction(bool sendMouseEvents) { InputType::accessKeyAction(sendMouseEvents); - // Send mouse button events if the caller specified sendMouseEvents. - // FIXME: The comment above is no good. It says what we do, but not why. - element()->dispatchSimulatedClick(0, sendMouseEvents); + element()->dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents); } void RangeInputType::minOrMaxAttributeChanged() diff --git a/Source/WebCore/html/SearchInputType.cpp b/Source/WebCore/html/SearchInputType.cpp index ada23e633..54d5c3abb 100644 --- a/Source/WebCore/html/SearchInputType.cpp +++ b/Source/WebCore/html/SearchInputType.cpp @@ -175,7 +175,7 @@ bool SearchInputType::searchEventsShouldBeDispatched() const return element()->hasAttribute(incrementalAttr); } -void SearchInputType::subtreeHasChanged() +void SearchInputType::didSetValueByUserEdit(ValueChangeState state) { if (m_cancelButton) toRenderSearchField(element()->renderer())->updateCancelButtonVisibility(); @@ -183,6 +183,8 @@ void SearchInputType::subtreeHasChanged() // If the incremental attribute is set, then dispatch the search event if (searchEventsShouldBeDispatched()) startSearchEventTimer(); + + TextFieldInputType::didSetValueByUserEdit(state); } } // namespace WebCore diff --git a/Source/WebCore/html/SearchInputType.h b/Source/WebCore/html/SearchInputType.h index 44bd1b7c0..45bbd347b 100644 --- a/Source/WebCore/html/SearchInputType.h +++ b/Source/WebCore/html/SearchInputType.h @@ -58,7 +58,7 @@ private: virtual HTMLElement* resultsButtonElement() const OVERRIDE; virtual HTMLElement* cancelButtonElement() const OVERRIDE; virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE; - virtual void subtreeHasChanged(); + virtual void didSetValueByUserEdit(ValueChangeState) OVERRIDE; void searchEventTimerFired(Timer<SearchInputType>*); bool searchEventsShouldBeDispatched() const; diff --git a/Source/WebCore/html/TextFieldInputType.cpp b/Source/WebCore/html/TextFieldInputType.cpp index 1ccec2fd0..a5edcb0b3 100644 --- a/Source/WebCore/html/TextFieldInputType.cpp +++ b/Source/WebCore/html/TextFieldInputType.cpp @@ -440,6 +440,41 @@ bool TextFieldInputType::appendFormData(FormDataList& list, bool multipart) cons return true; } +String TextFieldInputType::convertFromVisibleValue(const String& visibleValue) const +{ + return visibleValue; +} + +void TextFieldInputType::subtreeHasChanged() +{ + ASSERT(element()->renderer()); + + bool wasChanged = element()->wasChangedSinceLastFormControlChangeEvent(); + element()->setChangedSinceLastFormControlChangeEvent(true); + + // We don't need to call sanitizeUserInputValue() function here because + // HTMLInputElement::handleBeforeTextInsertedEvent() has already called + // sanitizeUserInputValue(). + // sanitizeValue() is needed because IME input doesn't dispatch BeforeTextInsertedEvent. + element()->setValueFromRenderer(sanitizeValue(convertFromVisibleValue(element()->innerTextValue()))); + element()->updatePlaceholderVisibility(false); + // Recalc for :invalid and hasUnacceptableValue() change. + element()->setNeedsStyleRecalc(); + + didSetValueByUserEdit(wasChanged ? ValueChangeStateChanged : ValueChangeStateNone); +} + +void TextFieldInputType::didSetValueByUserEdit(ValueChangeState state) +{ + if (!element()->focused()) + return; + if (Frame* frame = element()->document()->frame()) { + if (state == ValueChangeStateNone) + frame->editor()->textFieldDidBeginEditing(element()); + frame->editor()->textDidChangeInTextField(element()); + } +} + void TextFieldInputType::spinButtonStepDown() { stepUpFromRenderer(-1); diff --git a/Source/WebCore/html/TextFieldInputType.h b/Source/WebCore/html/TextFieldInputType.h index 97b9437d9..b32aeaa68 100644 --- a/Source/WebCore/html/TextFieldInputType.h +++ b/Source/WebCore/html/TextFieldInputType.h @@ -68,6 +68,13 @@ protected: virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior) OVERRIDE; virtual void updateInnerTextValue() OVERRIDE; + virtual String convertFromVisibleValue(const String&) const; + enum ValueChangeState { + ValueChangeStateNone, + ValueChangeStateChanged + }; + virtual void didSetValueByUserEdit(ValueChangeState); + private: virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE; virtual bool isMouseFocusable() const OVERRIDE; @@ -84,6 +91,7 @@ private: virtual void updatePlaceholderText() OVERRIDE; virtual bool appendFormData(FormDataList&, bool multipart) const OVERRIDE; virtual void attach() OVERRIDE; + virtual void subtreeHasChanged() OVERRIDE; // SpinButtonElement::SpinButtonOwner functions. virtual void focusAndSelectSpinButtonOwner() OVERRIDE; diff --git a/Source/WebCore/html/shadow/ContentDistributor.cpp b/Source/WebCore/html/shadow/ContentDistributor.cpp index 954ddcf90..e3216839f 100644 --- a/Source/WebCore/html/shadow/ContentDistributor.cpp +++ b/Source/WebCore/html/shadow/ContentDistributor.cpp @@ -36,6 +36,28 @@ namespace WebCore { +void ContentDistribution::swap(ContentDistribution& other) +{ + m_nodes.swap(other.m_nodes); + m_indices.swap(other.m_indices); +} + +void ContentDistribution::append(PassRefPtr<Node> node) +{ + size_t size = m_nodes.size(); + m_indices.set(node.get(), size); + m_nodes.append(node); +} + +size_t ContentDistribution::find(const Node* node) const +{ + HashMap<const Node*, size_t>::const_iterator it = m_indices.find(node); + if (it == m_indices.end()) + return notFound; + + return it.get()->value; +} + ContentDistributor::ContentDistributor() : m_validity(Undetermined) { @@ -156,10 +178,10 @@ void ContentDistributor::distributeSelectionsTo(InsertionPoint* insertionPoint, if (distributed[i]) continue; - if (!query.matches(pool, i)) + if (!query.matches(pool.nodes(), i)) continue; - Node* child = pool[i].get(); + Node* child = pool.at(i).get(); distribution.append(child); m_nodeToInsertionPoint.add(child, insertionPoint); distributed[i] = true; diff --git a/Source/WebCore/html/shadow/ContentDistributor.h b/Source/WebCore/html/shadow/ContentDistributor.h index 0d8d0082e..97cffbcc7 100644 --- a/Source/WebCore/html/shadow/ContentDistributor.h +++ b/Source/WebCore/html/shadow/ContentDistributor.h @@ -44,7 +44,29 @@ class InsertionPoint; class Node; class ShadowRoot; -typedef Vector<RefPtr<Node> > ContentDistribution; +class ContentDistribution { +public: + PassRefPtr<Node> first() const { return m_nodes.first(); } + PassRefPtr<Node> last() const { return m_nodes.last(); } + PassRefPtr<Node> at(size_t index) const { return m_nodes.at(index); } + + size_t size() const { return m_nodes.size(); } + bool isEmpty() const { return m_nodes.isEmpty(); } + + void append(PassRefPtr<Node>); + void clear() { m_nodes.clear(); m_indices.clear(); } + + bool contains(const Node* node) const { return m_indices.contains(node); } + size_t find(const Node*) const; + + void swap(ContentDistribution& other); + + const Vector<RefPtr<Node> >& nodes() const { return m_nodes; } + +private: + Vector<RefPtr<Node> > m_nodes; + HashMap<const Node*, size_t> m_indices; +}; class ContentDistributor { WTF_MAKE_NONCOPYABLE(ContentDistributor); diff --git a/Source/WebCore/inspector/front-end/DOMExtension.js b/Source/WebCore/inspector/front-end/DOMExtension.js index 1af5d3ebb..162fa964d 100644 --- a/Source/WebCore/inspector/front-end/DOMExtension.js +++ b/Source/WebCore/inspector/front-end/DOMExtension.js @@ -183,17 +183,6 @@ Element.prototype.positionAt = function(x, y) this.style.removeProperty("top"); } -Element.prototype.pruneEmptyTextNodes = function() -{ - var sibling = this.firstChild; - while (sibling) { - var nextSibling = sibling.nextSibling; - if (sibling.nodeType === Node.TEXT_NODE && sibling.nodeValue === "") - this.removeChild(sibling); - sibling = nextSibling; - } -} - Element.prototype.isScrolledToBottom = function() { // This code works only for 0-width border @@ -253,13 +242,6 @@ Node.prototype.enclosingNodeOrSelfWithClass = function(className) return null; } -Node.prototype.enclosingNodeWithClass = function(className) -{ - if (!this.parentNode) - return null; - return this.parentNode.enclosingNodeOrSelfWithClass(className); -} - Element.prototype.query = function(query) { return this.ownerDocument.evaluate(query, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; @@ -544,12 +526,6 @@ Node.prototype.traversePreviousNode = function(stayWithin) return this.parentNode; } -HTMLTextAreaElement.prototype.moveCursorToEnd = function() -{ - var length = this.value.length; - this.setSelectionRange(length, length); -} - function isEnterKey(event) { // Check if in IME. return event.keyCode !== 229 && event.keyIdentifier === "Enter"; diff --git a/Source/WebCore/inspector/front-end/DefaultTextEditor.js b/Source/WebCore/inspector/front-end/DefaultTextEditor.js index f7e85ff4a..08f48e08f 100644 --- a/Source/WebCore/inspector/front-end/DefaultTextEditor.js +++ b/Source/WebCore/inspector/front-end/DefaultTextEditor.js @@ -2076,7 +2076,7 @@ WebInspector.TextEditorMainPanel.prototype = { var span = this._cachedSpans.pop() || document.createElement("span"); span.className = "webkit-" + className; - if (false) // For paint debugging. + if (WebInspector.FALSE) // For paint debugging. span.addStyleClass("debug-fadeout"); span.textContent = content; element.insertBefore(span, oldChild); @@ -2412,27 +2412,33 @@ WebInspector.TextEditorMainPanel.prototype = { this._textChunks[chunkNumber].startLine += linesDiff; } + // Remove damaged chunks from DOM and from textChunks model. + var lastUndamagedChunk = firstDamagedChunkNumber > 0 ? this._textChunks[firstDamagedChunkNumber - 1] : null; + var firstUndamagedChunk = lastDamagedChunkNumber + 1 < this._textChunks.length ? this._textChunks[lastDamagedChunkNumber + 1] : null; + var removeDOMFromNode = lastUndamagedChunk ? lastUndamagedChunk.lastElement().nextSibling : this._container.firstChild; + var removeDOMToNode = firstUndamagedChunk ? firstUndamagedChunk.firstElement() : null; + for (var node = removeDOMFromNode; node && node !== removeDOMToNode; ) { + var nodeToRemove = node; + node = node.nextSibling; + nodeToRemove.remove(); + } + this._textChunks.splice(firstDamagedChunkNumber, lastDamagedChunkNumber - firstDamagedChunkNumber + 1); + // Compute damaged chunks span var startLine = firstDamagedChunk.startLine; var endLine = lastDamagedChunk.endLine + linesDiff; + var lineSpan = endLine - startLine; // Re-create chunks for damaged area. - var insertedChunks = []; - var insertionIndex = lastDamagedChunkNumber + 1; - - var lineSpan = endLine - startLine; + var insertionIndex = firstDamagedChunkNumber; var chunkSize = Math.ceil(lineSpan / Math.ceil(lineSpan / this._defaultChunkSize)); for (var i = startLine; i < endLine; i += chunkSize) { var chunk = this._createNewChunk(i, Math.min(endLine, i + chunkSize)); this._textChunks.splice(insertionIndex++, 0, chunk); - this._container.insertBefore(chunk.element, firstDamagedChunk.anchorElement()); + this._container.insertBefore(chunk.element, removeDOMToNode); } - // Remove damaged chunks from DOM and the chunks list. - var removedChunks = this._textChunks.splice(firstDamagedChunkNumber, lastDamagedChunkNumber - firstDamagedChunkNumber + 1); - for (var i = 0; i < removedChunks.length; ++i) - removedChunks[i].detachFromDOM(); this._assertDOMMatchesTextModel(); }, @@ -2721,7 +2727,7 @@ WebInspector.TextEditorMainChunk.prototype = { for (var i = this.startLine; i < this.startLine + this.linesCount; ++i) lines.push(this._textModel.line(i)); - if (WebInspector.debugDefaultTextEditor) + if (WebInspector.FALSE) console.log("Rebuilding chunk with " + lines.length + " lines"); this.element.removeChildren(); @@ -2731,19 +2737,14 @@ WebInspector.TextEditorMainChunk.prototype = { this.element.appendChild(document.createElement("br")); }, - detachFromDOM: function() + firstElement: function() { - if (this._expandedLineRows) { - for (var i = 0; i < this._expandedLineRows.length; ++i) - this._expandedLineRows[i].remove(); - delete this._expandedLineRows; - } else - this.element.remove(); + return this._expandedLineRows ? this._expandedLineRows[0] : this.element; }, - anchorElement: function() + lastElement: function() { - return this._expandedLineRows ? this._expandedLineRows[0] : this.element; + return this._expandedLineRows ? this._expandedLineRows[this._expandedLineRows.length - 1] : this.element; } } diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotView.js b/Source/WebCore/inspector/front-end/HeapSnapshotView.js index 2c48fa3ad..46d3ef544 100644 --- a/Source/WebCore/inspector/front-end/HeapSnapshotView.js +++ b/Source/WebCore/inspector/front-end/HeapSnapshotView.js @@ -388,6 +388,11 @@ WebInspector.HeapSnapshotView.prototype = { var profileIndex = this.filterSelectElement.selectedIndex - 1; this.dataGrid.filterSelectIndexChanged(this._profiles(), profileIndex); + WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction, { + action: WebInspector.UserMetrics.UserActionNames.HeapSnapshotFilterChanged, + label: this.filterSelectElement[this.filterSelectElement.selectedIndex].label + }); + if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults) return; diff --git a/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js b/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js index 7696dda34..a9d046c3f 100644 --- a/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js +++ b/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js @@ -59,10 +59,15 @@ WebInspector.NativeSnapshotDataGrid = function(profile) size: { title: WebInspector.UIString("Size"), sortable: false }, }; WebInspector.DataGrid.call(this, columns); - this.setRootNode(new WebInspector.DataGridNode(null, true)); var totalNode = new WebInspector.NativeSnapshotNode(profile, profile); - this.rootNode().appendChild(totalNode); - totalNode.expand(); + if (WebInspector.settings.showNativeSnapshotUninstrumentedSize.get()) { + this.setRootNode(new WebInspector.DataGridNode(null, true)); + this.rootNode().appendChild(totalNode) + totalNode.expand(); + } else { + this.setRootNode(totalNode); + totalNode._populate(); + } } WebInspector.NativeSnapshotDataGrid.prototype = { diff --git a/Source/WebCore/inspector/front-end/TextPrompt.js b/Source/WebCore/inspector/front-end/TextPrompt.js index 6ca3ca58f..2b5b2d5aa 100644 --- a/Source/WebCore/inspector/front-end/TextPrompt.js +++ b/Source/WebCore/inspector/front-end/TextPrompt.js @@ -327,7 +327,7 @@ WebInspector.TextPrompt.prototype = { return; this._userEnteredRange.deleteContents(); - this._element.pruneEmptyTextNodes(); + this._element.normalize(); var userTextNode = document.createTextNode(this._userEnteredText); this._userEnteredRange.insertNode(userTextNode); @@ -500,7 +500,7 @@ WebInspector.TextPrompt.prototype = { if (auto) { if (this.isCaretAtEndOfPrompt()) { this._userEnteredRange.deleteContents(); - this._element.pruneEmptyTextNodes(); + this._element.normalize(); var finalSelectionRange = document.createRange(); var prefixText = completionText.substring(0, wordPrefixLength); var suffixText = completionText.substring(wordPrefixLength); @@ -549,7 +549,7 @@ WebInspector.TextPrompt.prototype = { wordPrefixLength = this._userEnteredText ? this._userEnteredText.length : 0; this._userEnteredRange.deleteContents(); - this._element.pruneEmptyTextNodes(); + this._element.normalize(); var finalSelectionRange = document.createRange(); var completionTextNode = document.createTextNode(completionText); this._userEnteredRange.insertNode(completionTextNode); diff --git a/Source/WebCore/inspector/front-end/UserMetrics.js b/Source/WebCore/inspector/front-end/UserMetrics.js index 24b61ab37..0c436adbc 100644 --- a/Source/WebCore/inspector/front-end/UserMetrics.js +++ b/Source/WebCore/inspector/front-end/UserMetrics.js @@ -102,7 +102,7 @@ WebInspector.UserMetrics.UserActionNames = { NetworkSort: "networkSort", NetworkRequestSelected: "networkRequestSelected", NetworkRequestTabSelected: "networkRequestTabSelected", - ChoseHeapSnapshotBetween: "choseHeapSnapshotBetween" + HeapSnapshotFilterChanged: "heapSnapshotFilterChanged" }; WebInspector.UserMetrics.prototype = { diff --git a/Source/WebCore/inspector/front-end/utilities.js b/Source/WebCore/inspector/front-end/utilities.js index 7f77c5f59..043e886e9 100644 --- a/Source/WebCore/inspector/front-end/utilities.js +++ b/Source/WebCore/inspector/front-end/utilities.js @@ -428,12 +428,6 @@ function insertionIndexForObjectInListSortedByFunction(anObject, aList, aFunctio } } -Array.convert = function(list) -{ - // Cast array-like object to an array. - return Array.prototype.slice.call(list); -} - /** * @param {string} format * @param {...*} var_arg diff --git a/Source/WebCore/loader/cache/CachedImage.cpp b/Source/WebCore/loader/cache/CachedImage.cpp index 35a6c520a..33d69797e 100644 --- a/Source/WebCore/loader/cache/CachedImage.cpp +++ b/Source/WebCore/loader/cache/CachedImage.cpp @@ -475,4 +475,12 @@ void CachedImage::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const #endif } +bool CachedImage::currentFrameHasAlpha(const RenderObject* renderer) +{ + Image* image = imageForRenderer(renderer); + if (image->isBitmapImage()) + image->nativeImageForCurrentFrame(); // force decode + return image->currentFrameHasAlpha(); +} + } // namespace WebCore diff --git a/Source/WebCore/loader/cache/CachedImage.h b/Source/WebCore/loader/cache/CachedImage.h index 41d950a47..77afc13e6 100644 --- a/Source/WebCore/loader/cache/CachedImage.h +++ b/Source/WebCore/loader/cache/CachedImage.h @@ -52,6 +52,7 @@ public: Image* image(); // Returns the nullImage() if the image is not available yet. Image* imageForRenderer(const RenderObject*); // Returns the nullImage() if the image is not available yet. bool hasImage() const { return m_image.get(); } + bool currentFrameHasAlpha(const RenderObject*); // Side effect: ensures decoded image is in cache, therefore should only be called when about to draw the image. std::pair<Image*, float> brokenImage(float deviceScaleFactor) const; // Returns an image and the image's resolution scale factor. bool willPaintBrokenImage() const; diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp index ac50de5c6..8705af623 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp @@ -1646,7 +1646,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) m_frame->selection()->setCaretBlinkingSuspended(true); - bool swallowEvent = dispatchMouseEvent(eventNames().mousedownEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true); + bool swallowEvent = !dispatchMouseEvent(eventNames().mousedownEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true); m_capturesDragging = !swallowEvent || mev.scrollbar(); // If the hit testing originally determined the event was in a scrollbar, refetch the MouseEventWithHitTestResults @@ -1690,7 +1690,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) swallowEvent = handleMousePressEvent(mev); } - return swallowEvent; + return !swallowEvent; } // This method only exists for platforms that don't know how to deliver @@ -1714,9 +1714,9 @@ bool EventHandler::handleMouseDoubleClickEvent(const PlatformMouseEvent& mouseEv return true; m_clickCount = mouseEvent.clickCount(); - bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false); + bool swallowMouseUpEvent = !dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false); - bool swallowClickEvent = mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true); + bool swallowClickEvent = mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode && !dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true); if (m_lastScrollbarUnderMouse) swallowMouseUpEvent = m_lastScrollbarUnderMouse->mouseUp(mouseEvent); @@ -1813,7 +1813,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi #endif if (m_frameSetBeingResized) - return dispatchMouseEvent(eventNames().mousemoveEvent, m_frameSetBeingResized.get(), false, 0, mouseEvent, false); + return !dispatchMouseEvent(eventNames().mousemoveEvent, m_frameSetBeingResized.get(), false, 0, mouseEvent, false); // Send events right to a scrollbar if the mouse is pressed. if (m_lastScrollbarUnderMouse && m_mousePressed) @@ -1888,7 +1888,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi if (swallowEvent) return true; - swallowEvent = dispatchMouseEvent(eventNames().mousemoveEvent, mev.targetNode(), false, 0, mouseEvent, true); + swallowEvent = !dispatchMouseEvent(eventNames().mousemoveEvent, mev.targetNode(), false, 0, mouseEvent, true); #if ENABLE(DRAG_SUPPORT) if (!swallowEvent) swallowEvent = handleMouseDraggedEvent(mev); @@ -1935,7 +1935,7 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent) #endif if (m_frameSetBeingResized) - return dispatchMouseEvent(eventNames().mouseupEvent, m_frameSetBeingResized.get(), true, m_clickCount, mouseEvent, false); + return !dispatchMouseEvent(eventNames().mouseupEvent, m_frameSetBeingResized.get(), true, m_clickCount, mouseEvent, false); if (m_lastScrollbarUnderMouse) { invalidateClick(); @@ -1950,14 +1950,14 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent) if (subframe && passMouseReleaseEventToSubframe(mev, subframe)) return true; - bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false); + bool swallowMouseUpEvent = !dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false); Node* clickTarget = mev.targetNode(); if (clickTarget) clickTarget = clickTarget->shadowAncestorNode(); Node* adjustedClickNode = m_clickNode ? m_clickNode->shadowAncestorNode() : 0; - bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() != RightButton && clickTarget == adjustedClickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true); + bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() != RightButton && clickTarget == adjustedClickNode && !dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true); if (m_resizeLayer) { m_resizeLayer->setInResizeMode(false); @@ -2342,14 +2342,14 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe bool swallowEvent = false; if (m_nodeUnderMouse) - swallowEvent = m_nodeUnderMouse->dispatchMouseEvent(mouseEvent, eventType, clickCount); + swallowEvent = !(m_nodeUnderMouse->dispatchMouseEvent(mouseEvent, eventType, clickCount)); if (!swallowEvent && eventType == eventNames().mousedownEvent) { // If clicking on a frame scrollbar, do not mess up with content focus. if (FrameView* view = m_frame->view()) { if (view->scrollbarAtPoint(mouseEvent.position())) - return false; + return true; } // The layout needs to be up to date to determine if an element is focusable. @@ -2372,7 +2372,7 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe if (m_frame->selection()->isRange() && m_frame->selection()->toNormalizedRange()->compareNode(n, ec) == Range::NODE_INSIDE && n->isDescendantOf(m_frame->document()->focusedNode())) - return false; + return true; break; } @@ -2392,7 +2392,7 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe } } - return swallowEvent; + return !swallowEvent; } #if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && (OS(UNIX) && !OS(DARWIN))) @@ -2481,7 +2481,7 @@ void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv return; Node* stopNode = m_previousWheelScrolledNode.get(); - ScrollGranularity granularity = m_baseEventType == PlatformEvent::GestureScrollEnd ? ScrollByPixelVelocity : wheelGranularityToScrollGranularity(wheelEvent->granularity()); + ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->granularity()); // Break up into two scrolls if we need to. Diagonal movement on // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set). @@ -2588,8 +2588,6 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent) switch (gestureEvent.type()) { case PlatformEvent::GestureScrollBegin: return handleGestureScrollCore(gestureEvent, ScrollByPixelWheelEvent, false); - case PlatformEvent::GestureScrollEnd: - return handleGestureScrollCore(gestureEvent, ScrollByPixelVelocityWheelEvent, true); case PlatformEvent::GestureScrollUpdate: return handleGestureScrollUpdate(gestureEvent); case PlatformEvent::GestureTap: @@ -2600,6 +2598,7 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent) return handleGestureLongPress(gestureEvent); case PlatformEvent::GestureTwoFingerTap: return handleGestureTwoFingerTap(gestureEvent); + case PlatformEvent::GestureScrollEnd: case PlatformEvent::GestureDoubleTap: case PlatformEvent::GesturePinchBegin: case PlatformEvent::GesturePinchEnd: @@ -2797,7 +2796,7 @@ bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event) selectClosestWordOrLinkFromMouseEvent(mev); } - swallowEvent = dispatchMouseEvent(eventNames().contextmenuEvent, mev.targetNode(), true, 0, event, false); + swallowEvent = !dispatchMouseEvent(eventNames().contextmenuEvent, mev.targetNode(), true, 0, event, false); return swallowEvent; } @@ -2875,7 +2874,7 @@ bool EventHandler::sendContextMenuEventForKey() PlatformMouseEvent mouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime()); - return dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, mouseEvent, false); + return !dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, mouseEvent, false); } #if ENABLE(GESTURE_EVENTS) diff --git a/Source/WebCore/platform/PlatformWheelEvent.h b/Source/WebCore/platform/PlatformWheelEvent.h index ebb69ea2c..8c0302c5e 100644 --- a/Source/WebCore/platform/PlatformWheelEvent.h +++ b/Source/WebCore/platform/PlatformWheelEvent.h @@ -58,7 +58,6 @@ namespace WebCore { enum PlatformWheelEventGranularity { ScrollByPageWheelEvent, ScrollByPixelWheelEvent, - ScrollByPixelVelocityWheelEvent }; #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) diff --git a/Source/WebCore/platform/ScrollAnimator.cpp b/Source/WebCore/platform/ScrollAnimator.cpp index 74fd3616e..97863c4d1 100644 --- a/Source/WebCore/platform/ScrollAnimator.cpp +++ b/Source/WebCore/platform/ScrollAnimator.cpp @@ -104,11 +104,6 @@ bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e) || (deltaY < 0 && maxForwardScrollDelta.height() > 0) || (deltaY > 0 && maxBackwardScrollDelta.height() > 0)) { handled = true; - if (e.granularity() == ScrollByPixelVelocityWheelEvent) { - scroll(VerticalScrollbar, ScrollByPixelVelocity, 0, -deltaY); - scroll(HorizontalScrollbar, ScrollByPixelVelocity, 0, -deltaX); - return handled; - } if (deltaY) { if (e.granularity() == ScrollByPageWheelEvent) { diff --git a/Source/WebCore/platform/ScrollAnimatorNone.cpp b/Source/WebCore/platform/ScrollAnimatorNone.cpp index 04f26d27b..60bac8464 100644 --- a/Source/WebCore/platform/ScrollAnimatorNone.cpp +++ b/Source/WebCore/platform/ScrollAnimatorNone.cpp @@ -44,12 +44,6 @@ #include <wtf/CurrentTime.h> #include <wtf/PassOwnPtr.h> -#if ENABLE(GESTURE_ANIMATION) -#include "ActivePlatformGestureAnimation.h" -#include "TouchFlingPlatformGestureCurve.h" -#endif - - #if PLATFORM(CHROMIUM) #include "TraceEvent.h" #endif @@ -392,9 +386,6 @@ ScrollAnimatorNone::ScrollAnimatorNone(ScrollableArea* scrollableArea) #else , m_animationActive(false) #endif - , m_firstVelocity(0) - , m_firstVelocitySet(false) - , m_firstVelocityIsVertical(false) { } @@ -403,20 +394,6 @@ ScrollAnimatorNone::~ScrollAnimatorNone() stopAnimationTimerIfNeeded(); } -void ScrollAnimatorNone::fireUpAnAnimation(FloatPoint fp) -{ -#if ENABLE(GESTURE_ANIMATION) - if (m_gestureAnimation) - m_gestureAnimation.clear(); - m_gestureAnimation = ActivePlatformGestureAnimation::create(TouchFlingPlatformGestureCurve::createForTouchPad(fp), this); -#endif -#if USE(REQUEST_ANIMATION_FRAME_TIMER) - startNextTimer(0); -#else - startNextTimer(); -#endif -} - ScrollAnimatorNone::Parameters ScrollAnimatorNone::parametersForScrollGranularity(ScrollGranularity granularity) const { #if !PLATFORM(QT) @@ -472,21 +449,6 @@ bool ScrollAnimatorNone::scroll(ScrollbarOrientation orientation, ScrollGranular break; case ScrollByPrecisePixel: return ScrollAnimator::scroll(orientation, granularity, step, multiplier); - case ScrollByPixelVelocity: - // FIXME: Generalize the scroll interface to support a richer set of parameters. - if (m_firstVelocitySet) { - float x = m_firstVelocityIsVertical ? multiplier : m_firstVelocity; - float y = m_firstVelocityIsVertical ? m_firstVelocity : multiplier; - FloatPoint fp(x, y); - fireUpAnAnimation(fp); - m_firstVelocitySet = false; - m_firstVelocityIsVertical = false; - } else { - m_firstVelocitySet = true; - m_firstVelocityIsVertical = orientation == VerticalScrollbar; - m_firstVelocity = multiplier; - } - return true; } // If the individual input setting is disabled, bail. @@ -525,9 +487,6 @@ void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset void ScrollAnimatorNone::cancelAnimations() { m_animationActive = false; -#if ENABLE(GESTURE_ANIMATION) - m_gestureAnimation.clear(); -#endif } void ScrollAnimatorNone::serviceScrollAnimations() @@ -581,15 +540,6 @@ void ScrollAnimatorNone::animationTimerFired() if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime)) continueAnimation = true; -#if ENABLE(GESTURE_ANIMATION) - if (m_gestureAnimation) { - if (m_gestureAnimation->animate(currentTime)) - continueAnimation = true; - else - m_gestureAnimation.clear(); - } -#endif - if (continueAnimation) #if USE(REQUEST_ANIMATION_FRAME_TIMER) startNextTimer(max(kMinimumTimerInterval, deltaToNextFrame)); diff --git a/Source/WebCore/platform/ScrollAnimatorNone.h b/Source/WebCore/platform/ScrollAnimatorNone.h index 867df9741..30fa1c7fa 100644 --- a/Source/WebCore/platform/ScrollAnimatorNone.h +++ b/Source/WebCore/platform/ScrollAnimatorNone.h @@ -38,7 +38,6 @@ #endif #include "FloatPoint.h" -#include "PlatformGestureCurveTarget.h" #include "ScrollAnimator.h" #include "Timer.h" #include <wtf/OwnPtr.h> @@ -51,7 +50,7 @@ class IntPoint; class ActivePlatformGestureAnimation; struct ScrollAnimatorParameters; -class ScrollAnimatorNone : public ScrollAnimator, public PlatformGestureCurveTarget { +class ScrollAnimatorNone : public ScrollAnimator { public: explicit ScrollAnimatorNone(ScrollableArea*); virtual ~ScrollAnimatorNone(); @@ -159,7 +158,6 @@ protected: void stopAnimationTimerIfNeeded(); bool animationTimerActive(); void updateVisibleLengths(); - virtual void fireUpAnAnimation(FloatPoint); PerAxisData m_horizontalData; PerAxisData m_verticalData; @@ -170,14 +168,6 @@ protected: #else bool m_animationActive; #endif - - float m_firstVelocity; - bool m_firstVelocitySet; - bool m_firstVelocityIsVertical; - -#if ENABLE(GESTURE_ANIMATION) - OwnPtr<ActivePlatformGestureAnimation> m_gestureAnimation; -#endif }; } // namespace WebCore diff --git a/Source/WebCore/platform/ScrollTypes.h b/Source/WebCore/platform/ScrollTypes.h index ee119fbca..d65d82131 100644 --- a/Source/WebCore/platform/ScrollTypes.h +++ b/Source/WebCore/platform/ScrollTypes.h @@ -106,7 +106,6 @@ namespace WebCore { ScrollByPage, ScrollByDocument, ScrollByPixel, - ScrollByPixelVelocity, ScrollByPrecisePixel }; diff --git a/Source/WebCore/platform/ScrollableArea.cpp b/Source/WebCore/platform/ScrollableArea.cpp index e99b7a3b7..232d2af6c 100644 --- a/Source/WebCore/platform/ScrollableArea.cpp +++ b/Source/WebCore/platform/ScrollableArea.cpp @@ -115,11 +115,9 @@ bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granula case ScrollByPrecisePixel: step = scrollbar->pixelStep(); break; - case ScrollByPixelVelocity: - break; } - if (granularity != ScrollByPixelVelocity && (direction == ScrollUp || direction == ScrollLeft)) + if (direction == ScrollUp || direction == ScrollLeft) multiplier = -multiplier; return scrollAnimator()->scroll(orientation, granularity, step, multiplier); diff --git a/Source/WebCore/platform/audio/FFTFrame.cpp b/Source/WebCore/platform/audio/FFTFrame.cpp index 63c87ddc9..eee45de8a 100644 --- a/Source/WebCore/platform/audio/FFTFrame.cpp +++ b/Source/WebCore/platform/audio/FFTFrame.cpp @@ -40,6 +40,7 @@ #include "PlatformMemoryInstrumentation.h" #include <wtf/Complex.h> #include <wtf/MathExtras.h> +#include <wtf/MemoryObjectInfo.h> #include <wtf/OwnPtr.h> #if !USE_ACCELERATE_FFT && USE(WEBAUDIO_FFMPEG) diff --git a/Source/WebCore/platform/efl/EflScreenUtilities.cpp b/Source/WebCore/platform/efl/EflScreenUtilities.cpp index 6048db969..3d2781765 100644 --- a/Source/WebCore/platform/efl/EflScreenUtilities.cpp +++ b/Source/WebCore/platform/efl/EflScreenUtilities.cpp @@ -112,7 +112,15 @@ void applyFallbackCursor(Ecore_Evas* ecoreEvas, const char* cursorString) " c ursor group %s", cursorString); shape = ECORE_X_CURSOR_LEFT_PTR; } - Ecore_X_Window window = ecore_evas_software_x11_window_get(ecoreEvas); + + Ecore_X_Window window; +#if USE(ACCELERATED_COMPOSITING) + window = ecore_evas_gl_x11_window_get(ecoreEvas); + // Fallback to software mode if necessary. + if (!window) +#endif + window = ecore_evas_software_x11_window_get(ecoreEvas); + Ecore_X_Cursor cursor = ecore_x_cursor_shape_get(shape); ecore_x_window_cursor_set(window, cursor); #endif diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.cpp b/Source/WebCore/platform/efl/RenderThemeEfl.cpp index b1ca21c4c..67d848312 100644 --- a/Source/WebCore/platform/efl/RenderThemeEfl.cpp +++ b/Source/WebCore/platform/efl/RenderThemeEfl.cpp @@ -173,21 +173,21 @@ static bool isFormElementTooLargeToDisplay(const IntSize& elementSize) return elementSize.width() > maxEdjeDimension || elementSize.height() > maxEdjeDimension; } -RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::ThemePartCacheEntry::create(const String& themePath, FormType type, const IntSize& size) +PassOwnPtr<RenderThemeEfl::ThemePartCacheEntry> RenderThemeEfl::ThemePartCacheEntry::create(const String& themePath, FormType type, const IntSize& size) { ASSERT(!themePath.isEmpty()); if (isFormElementTooLargeToDisplay(size) || size.isEmpty()) { EINA_LOG_ERR("Cannot render an element of size %dx%d.", size.width(), size.height()); - return 0; + return nullptr; } - OwnPtr<ThemePartCacheEntry*> entry = adoptPtr(new ThemePartCacheEntry); + OwnPtr<ThemePartCacheEntry> entry = adoptPtr(new ThemePartCacheEntry); entry->m_canvas = adoptPtr(ecore_evas_buffer_new(size.width(), size.height())); if (!entry->canvas()) { EINA_LOG_ERR("ecore_evas_buffer_new(%d, %d) failed.", size.width(), size.height()); - return 0; + return nullptr; } // By default EFL creates buffers without alpha. @@ -197,11 +197,11 @@ RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::ThemePartCacheEntry::create ASSERT(entry->edje()); if (!setSourceGroupForEdjeObject(entry->edje(), themePath, toEdjeGroup(type))) - return 0; + return nullptr; entry->m_surface = createSurfaceForBackingStore(entry->canvas()); if (!entry->surface()) - return 0; + return nullptr; evas_object_resize(entry->edje(), size.width(), size.height()); evas_object_show(entry->edje()); @@ -209,16 +209,22 @@ RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::ThemePartCacheEntry::create entry->type = type; entry->size = size; - return entry.leakPtr(); + return entry.release(); } void RenderThemeEfl::ThemePartCacheEntry::reuse(const String& themePath, FormType newType, const IntSize& newSize) { ASSERT(!themePath.isEmpty()); - if (!newSize.isEmpty()) { - cairo_surface_finish(surface()); + if (type != newType) { + type = newType; + if (!setSourceGroupForEdjeObject(edje(), themePath, toEdjeGroup(newType))) { + type = FormTypeLast; // Invalidate. + return; + } + } + if (size != newSize) { size = newSize; ecore_evas_resize(canvas(), newSize.width(), newSize.height()); evas_object_resize(edje(), newSize.width(), newSize.height()); @@ -229,69 +235,58 @@ void RenderThemeEfl::ThemePartCacheEntry::reuse(const String& themePath, FormTyp return; } } - - if (!setSourceGroupForEdjeObject(edje(), themePath, toEdjeGroup(newType))) { - type = FormTypeLast; // Invalidate. - return; - } - - type = newType; } RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::getThemePartFromCache(FormType type, const IntSize& size) { - Vector<ThemePartCacheEntry*>::iterator it, end; - size_t lastWithRequestedSize = notFound; - - it = m_partCache.begin(); - end = m_partCache.end(); - for (size_t i = 0; it != end; i++, it++) { - ThemePartCacheEntry* entry = *it; - ASSERT(entry); - if (entry->size == size) { - if (entry->type == type) - return entry; - lastWithRequestedSize = i; + void* data; + Eina_List* node; + Eina_List* reusableNode = 0; + + // Look for the item in the cache. + EINA_LIST_FOREACH(m_partCache, node, data) { + ThemePartCacheEntry* cachedEntry = static_cast<ThemePartCacheEntry*>(data); + if (cachedEntry->size == size) { + if (cachedEntry->type == type) { + // Found the right item, move it to the head of the list + // and return it. + m_partCache = eina_list_promote_list(m_partCache, node); + return cachedEntry; + } + // We reuse in priority the last item in the list that has + // the requested size. + reusableNode = node; } } - if (m_partCache.size() < RENDER_THEME_EFL_PART_CACHE_MAX) { - ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size); - if (entry) // Can be '0', if creation fails. Do not store it in this case. - m_partCache.prepend(entry); + if (eina_list_count(m_partCache) < RENDER_THEME_EFL_PART_CACHE_MAX) { + ThemePartCacheEntry* entry = ThemePartCacheEntry::create(themePath(), type, size).leakPtr(); + if (entry) + m_partCache = eina_list_prepend(m_partCache, entry); + return entry; } - // We have a full cache now! - EINA_LOG_INFO("RenderTheme cache is full, reusing."); + // The cache is full, reuse the last item we found that had the + // requested size to avoid resizing. If there was none, reuse + // the last item of the list. + if (!reusableNode) + reusableNode = eina_list_last(m_partCache); - if (lastWithRequestedSize != notFound && lastWithRequestedSize != 1) { - ThemePartCacheEntry* entry = m_partCache.at(lastWithRequestedSize); - ASSERT(entry); - entry->reuse(themePath(), type); - m_partCache.remove(lastWithRequestedSize); - m_partCache.prepend(entry); - return entry; - } + ThemePartCacheEntry* reusedEntry = static_cast<ThemePartCacheEntry*>(eina_list_data_get(reusableNode)); + ASSERT(reusedEntry); + reusedEntry->reuse(themePath(), type, size); + m_partCache = eina_list_promote_list(m_partCache, reusableNode); - ThemePartCacheEntry* entry = m_partCache.last(); - ASSERT(entry); - entry->reuse(themePath(), type, size); - m_partCache.removeLast(); - m_partCache.prepend(entry); - return entry; + return reusedEntry; } -void RenderThemeEfl::flushThemePartCache() +void RenderThemeEfl::clearThemePartCache() { - Vector<ThemePartCacheEntry*>::iterator it, end; + void* data; + EINA_LIST_FREE(m_partCache, data) + delete static_cast<ThemePartCacheEntry*>(data); - it = m_partCache.begin(); - end = m_partCache.end(); - for (; it != end; it++) - delete (*it); - - m_partCache.clear(); } void RenderThemeEfl::applyEdjeStateFromForm(Evas_Object* object, ControlStates states) @@ -317,36 +312,17 @@ void RenderThemeEfl::applyEdjeStateFromForm(Evas_Object* object, ControlStates s } } -bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const PaintInfo& info, const IntRect& rect) +void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, RenderObject* object, FormType type, const IntRect& rect) { - loadThemeIfNeeded(); - _ASSERT_ON_RELEASE_RETURN_VAL(edje(), false, "Could not paint native HTML part due to missing theme."); - - ThemePartCacheEntry* entry; - Eina_List* updates; - cairo_t* cairo; - - entry = getThemePartFromCache(type, rect.size()); - if (!entry) - return false; - - applyEdjeStateFromForm(entry->edje(), controlStatesForRenderer(object)); - - cairo = info.context->platformContext()->cr(); - ASSERT(cairo); - - // Currently, only sliders needs this message; if other widget ever needs special - // treatment, move them to special functions. if (type == SliderVertical || type == SliderHorizontal) { if (!object->isSlider()) - return true; // probably have -webkit-appearance: slider.. + return; // probably have -webkit-appearance: slider.. RenderSlider* renderSlider = toRenderSlider(object); HTMLInputElement* input = renderSlider->node()->toInputElement(); double valueRange = input->maximum() - input->minimum(); - OwnArrayPtr<char> buffer = adoptArrayPtr(new char[sizeof(Edje_Message_Float_Set) + sizeof(double)]); - Edje_Message_Float_Set* msg = new(buffer.get()) Edje_Message_Float_Set; + OwnPtr<Edje_Message_Float_Set> msg = adoptPtr(static_cast<Edje_Message_Float_Set*>(operator new (sizeof(Edje_Message_Float_Set) + sizeof(double)))); msg->count = 2; // The first parameter of the message decides if the progress bar @@ -359,7 +335,7 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P msg->val[0] = 0; msg->val[1] = (input->valueAsNumber() - input->minimum()) / valueRange; - edje_object_message_send(entry->edje(), EDJE_MESSAGE_FLOAT_SET, 0, msg); + edje_object_message_send(edje, EDJE_MESSAGE_FLOAT_SET, 0, msg.get()); #if ENABLE(PROGRESS_ELEMENT) } else if (type == ProgressBar) { RenderProgress* renderProgress = toRenderProgress(object); @@ -367,8 +343,7 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P int max = rect.width(); double value = renderProgress->position(); - OwnArrayPtr<char> buffer = adoptArrayPtr(new char[sizeof(Edje_Message_Float_Set) + sizeof(double)]); - Edje_Message_Float_Set* msg = new(buffer.get()) Edje_Message_Float_Set; + OwnPtr<Edje_Message_Float_Set> msg = adoptPtr(static_cast<Edje_Message_Float_Set*>(operator new (sizeof(Edje_Message_Float_Set) + sizeof(double)))); msg->count = 2; if (object->style()->direction() == RTL) @@ -376,14 +351,31 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P else msg->val[0] = 0; msg->val[1] = value; - edje_object_message_send(entry->edje(), EDJE_MESSAGE_FLOAT_SET, 0, msg); + edje_object_message_send(edje, EDJE_MESSAGE_FLOAT_SET, 0, msg.get()); +#else + UNUSED_PARAM(rect); #endif } +} + +bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const PaintInfo& info, const IntRect& rect) +{ + loadThemeIfNeeded(); + _ASSERT_ON_RELEASE_RETURN_VAL(edje(), false, "Could not paint native HTML part due to missing theme."); + + ThemePartCacheEntry* entry = getThemePartFromCache(type, rect.size()); + if (!entry) + return false; + + applyEdjeStateFromForm(entry->edje(), controlStatesForRenderer(object)); + applyEdjeRTLState(entry->edje(), object, type, rect); edje_object_calc_force(entry->edje()); edje_object_message_signal_process(entry->edje()); - updates = evas_render_updates(ecore_evas_get(entry->canvas())); - evas_render_updates_free(updates); + evas_render(ecore_evas_get(entry->canvas())); + + cairo_t* cairo = info.context->platformContext()->cr(); + ASSERT(cairo); cairo_save(cairo); cairo_set_source_surface(cairo, entry->surface(), rect.x(), rect.y()); @@ -494,9 +486,9 @@ bool RenderThemeEfl::loadTheme() if (!setSourceGroupForEdjeObject(o.get(), m_themePath, "webkit/base")) return false; // Keep current theme. - // Get rid of existing theme. + // Invalidate existing theme part cache. if (edje()) - flushThemePartCache(); + clearThemePartCache(); // Set new loaded theme, and apply it. m_edje = o; @@ -606,12 +598,13 @@ RenderThemeEfl::RenderThemeEfl(Page* page) , m_mediaPanelColor(220, 220, 195) // light tannish color. , m_mediaSliderColor(Color::white) #endif + , m_partCache(0) { } RenderThemeEfl::~RenderThemeEfl() { - flushThemePartCache(); + clearThemePartCache(); } static bool supportsFocus(ControlPart appearance) diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.h b/Source/WebCore/platform/efl/RenderThemeEfl.h index 483c0be2d..34999f190 100644 --- a/Source/WebCore/platform/efl/RenderThemeEfl.h +++ b/Source/WebCore/platform/efl/RenderThemeEfl.h @@ -35,6 +35,7 @@ #endif #include "RenderTheme.h" +#include <Eina.h> #include <cairo.h> #include <wtf/efl/RefPtrEfl.h> @@ -229,6 +230,7 @@ private: void applyPartDescriptionsFrom(const String& themePath); void applyEdjeStateFromForm(Evas_Object*, ControlStates); + void applyEdjeRTLState(Evas_Object*, RenderObject*, FormType, const IntRect&); bool paintThemePart(RenderObject*, FormType, const PaintInfo&, const IntRect&); #if ENABLE(VIDEO) @@ -263,8 +265,8 @@ private: void applyPartDescription(Evas_Object*, struct ThemePartDesc*); struct ThemePartCacheEntry { - static ThemePartCacheEntry* create(const String& themePath, FormType, const IntSize&); - void reuse(const String& themePath, FormType, const IntSize& = IntSize()); + static PassOwnPtr<RenderThemeEfl::ThemePartCacheEntry> create(const String& themePath, FormType, const IntSize&); + void reuse(const String& themePath, FormType, const IntSize&); ALWAYS_INLINE Ecore_Evas* canvas() { return m_canvas.get(); } ALWAYS_INLINE Evas_Object* edje() { return m_edje.get(); } @@ -282,12 +284,13 @@ private: struct ThemePartDesc m_partDescs[FormTypeLast]; - // this should be small and not so frequently used, - // so use a vector and do linear searches - Vector<ThemePartCacheEntry*> m_partCache; + // List of ThemePartCacheEntry* sorted so that the most recently + // used entries come first. We use a list for efficient moving + // of items within the container. + Eina_List* m_partCache; ThemePartCacheEntry* getThemePartFromCache(FormType, const IntSize&); - void flushThemePartCache(); + void clearThemePartCache(); }; } diff --git a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp index 79162f95e..7e9a79cb0 100644 --- a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp +++ b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp @@ -76,19 +76,21 @@ void MediaPlayerPrivate::getSupportedTypes(HashSet<WTF::String>& types) types.add(*i); } -MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const WTF::String& type, const WTF::String& codecs, const KURL&) +MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const WTF::String& type, const WTF::String& codecs, const KURL& url) { - if (type.isNull() || type.isEmpty()) { + bool isRTSP = url.protocolIs("rtsp"); + + if (!isRTSP && (type.isNull() || type.isEmpty())) { LOG(Media, "MediaPlayer does not support type; type is null or empty."); return MediaPlayer::IsNotSupported; } // spec says we should not return "probably" if the codecs string is empty - if (PlatformPlayer::mimeTypeSupported(type.ascii().data())) { - LOG(Media, "MediaPlayer supports type; cache contains type '%s'.", type.ascii().data()); + if (isRTSP || PlatformPlayer::mimeTypeSupported(type.ascii().data())) { + LOG(Media, "MediaPlayer supports type %s.", isRTSP ? "rtsp" : type.ascii().data()); return codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported; } - LOG(Media, "MediaPlayer does not support type; cache doesn't contain type '%s'.", type.ascii().data()); + LOG(Media, "MediaPlayer does not support type %s.", type.ascii().data()); return MediaPlayer::IsNotSupported; } diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp index 715d1b5e9..1ead15d18 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp @@ -330,7 +330,7 @@ void GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext() con m_platformContext->makeCurrent(m_surface); } blitMultisampleFramebuffer(); - if (currentContext) + if (currentContext && currentContext != m_platformContext) const_cast<QOpenGLContext*>(currentContext)->makeCurrent(currentSurface); } @@ -414,7 +414,8 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif - glClearColor(0.0, 0.0, 0.0, 0.0); + if (renderStyle != RenderToCurrentGLContext) + glClearColor(0.0, 0.0, 0.0, 0.0); } GraphicsContext3D::~GraphicsContext3D() diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp index fddb78975..b47d08e7d 100644 --- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp +++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp @@ -20,9 +20,17 @@ #include "config.h" #include "GraphicsLayerTextureMapper.h" +#include "GraphicsContext.h" #include "GraphicsLayerAnimation.h" #include "GraphicsLayerFactory.h" -#include "TextureMapperLayer.h" +#include "ImageBuffer.h" +#include "NotImplemented.h" +#include <wtf/CurrentTime.h> + +#if USE(CAIRO) +#include "CairoUtilities.h" +#include <wtf/text/CString.h> +#endif namespace WebCore { @@ -47,7 +55,9 @@ GraphicsLayerTextureMapper::GraphicsLayerTextureMapper(GraphicsLayerClient* clie , m_compositedNativeImagePtr(0) , m_changeMask(0) , m_needsDisplay(false) + , m_hasOwnBackingStore(true) , m_fixedToViewport(false) + , m_debugBorderWidth(0) , m_contentsLayer(0) , m_animationStartedTimer(this, &GraphicsLayerTextureMapper::animationStartedTimerFired) { @@ -61,13 +71,6 @@ void GraphicsLayerTextureMapper::notifyChange(TextureMapperLayer::ChangeMask cha client()->notifyFlushRequired(this); } -void GraphicsLayerTextureMapper::didSynchronize() -{ - m_changeMask = 0; - m_needsDisplay = false; - m_needsDisplayRect = IntRect(); -} - void GraphicsLayerTextureMapper::setName(const String& name) { GraphicsLayer::setName(name); @@ -377,6 +380,7 @@ void GraphicsLayerTextureMapper::setContentsToMedia(TextureMapperPlatformLayer* void GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly() { m_layer->flushCompositingState(this); + didFlushCompositingState(); } /* \reimp (GraphicsLayer.h) @@ -384,8 +388,122 @@ void GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly() void GraphicsLayerTextureMapper::flushCompositingState(const FloatRect&) { m_layer->flushCompositingState(this, TextureMapperLayer::TraverseDescendants); + didFlushCompositingStateRecursive(); +} + +void GraphicsLayerTextureMapper::didFlushCompositingState() +{ + updateBackingStore(); + m_changeMask = 0; + m_needsDisplay = false; + m_needsDisplayRect = IntRect(); } +void GraphicsLayerTextureMapper::didFlushCompositingStateRecursive() +{ + didFlushCompositingState(); + for (size_t i = 0; i < children().size(); ++i) + toGraphicsLayerTextureMapper(children()[i])->didFlushCompositingStateRecursive(); + if (maskLayer()) + toGraphicsLayerTextureMapper(maskLayer())->didFlushCompositingStateRecursive(); + if (replicaLayer()) + toGraphicsLayerTextureMapper(replicaLayer())->didFlushCompositingStateRecursive(); +} + +void GraphicsLayerTextureMapper::updateBackingStore() +{ + if (!m_hasOwnBackingStore) + return; + + prepareBackingStore(); + m_layer->setBackingStore(m_backingStore); +} + +void GraphicsLayerTextureMapper::prepareBackingStore() +{ + if (!shouldHaveBackingStore()) { + m_backingStore.clear(); + return; + } + + IntRect dirtyRect = enclosingIntRect(FloatRect(FloatPoint::zero(), m_size)); + if (!m_needsDisplay) + dirtyRect.intersect(enclosingIntRect(m_needsDisplayRect)); + if (dirtyRect.isEmpty()) + return; + + TextureMapper* textureMapper = m_layer->textureMapper(); + ASSERT(textureMapper); + + if (!m_backingStore) + m_backingStore = TextureMapperTiledBackingStore::create(); + + // Paint the entire dirty rect into an image buffer. This ensures we only paint once. + OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(dirtyRect.size()); + GraphicsContext* context = imageBuffer->context(); + context->setImageInterpolationQuality(textureMapper->imageInterpolationQuality()); + context->setTextDrawingMode(textureMapper->textDrawingMode()); + context->translate(-dirtyRect.x(), -dirtyRect.y()); + paintGraphicsLayerContents(*context, dirtyRect); + + if (isShowingRepaintCounter()) { + incrementRepaintCount(); + drawRepaintCounter(context); + } + + RefPtr<Image> image = imageBuffer->copyImage(DontCopyBackingStore); +#if PLATFORM(QT) + ASSERT(dynamic_cast<TextureMapperTiledBackingStore*>(m_backingStore.get())); +#endif + TextureMapperTiledBackingStore* backingStore = static_cast<TextureMapperTiledBackingStore*>(m_backingStore.get()); + backingStore->updateContents(textureMapper, image.get(), m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); + + backingStore->setShowDebugBorders(isShowingDebugBorder()); + backingStore->setDebugBorder(m_debugBorderColor, m_debugBorderWidth); + + m_needsDisplay = false; + m_needsDisplayRect = IntRect(); +} + +bool GraphicsLayerTextureMapper::shouldHaveBackingStore() const +{ + return drawsContent() && contentsAreVisible() && !m_size.isEmpty(); +} + +#if USE(CAIRO) +void GraphicsLayerTextureMapper::drawRepaintCounter(GraphicsContext* context) +{ + cairo_t* cr = context->platformContext()->cr(); + cairo_save(cr); + + CString repaintCount = String::format("%i", this->repaintCount()).utf8(); + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); + cairo_set_font_size(cr, 18); + + cairo_text_extents_t repaintTextExtents; + cairo_text_extents(cr, repaintCount.data(), &repaintTextExtents); + + static const int repaintCountBorderWidth = 10; + setSourceRGBAFromColor(cr, isShowingDebugBorder() ? m_debugBorderColor : Color(0, 255, 0, 127)); + cairo_rectangle(cr, 0, 0, + repaintTextExtents.width + (repaintCountBorderWidth * 2), + repaintTextExtents.height + (repaintCountBorderWidth * 2)); + cairo_fill(cr); + + cairo_set_source_rgb(cr, 1, 1, 1); + cairo_move_to(cr, repaintCountBorderWidth, repaintTextExtents.height + repaintCountBorderWidth); + cairo_show_text(cr, repaintCount.data()); + + cairo_restore(cr); +} +#else +void GraphicsLayerTextureMapper::drawRepaintCounter(GraphicsContext* context) +{ + notImplemented(); +} + +#endif + bool GraphicsLayerTextureMapper::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& keyframesName, double timeOffset) { ASSERT(!keyframesName.isEmpty()); @@ -429,7 +547,10 @@ void GraphicsLayerTextureMapper::animationStartedTimerFired(Timer<GraphicsLayerT void GraphicsLayerTextureMapper::setDebugBorder(const Color& color, float width) { - m_layer->setDebugBorder(color, width); + // The default values for GraphicsLayer debug borders are a little + // hard to see (some less than one pixel wide), so we double their size here. + m_debugBorderColor = color; + m_debugBorderWidth = width * 2; } #if ENABLE(CSS_FILTERS) diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h index bea8c543a..af4940943 100644 --- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h +++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h @@ -25,11 +25,10 @@ #include "GraphicsLayerClient.h" #include "Image.h" #include "TextureMapperLayer.h" +#include "Timer.h" namespace WebCore { -class TextureMapperLayer; -class BitmapTexture; class TextureMapper; class GraphicsLayerTextureMapper : public GraphicsLayer { @@ -76,7 +75,6 @@ public: void notifyChange(TextureMapperLayer::ChangeMask); inline int changeMask() const { return m_changeMask; } - void didSynchronize(); virtual bool addAnimation(const KeyframeValueList&, const IntSize&, const Animation*, const String&, double); virtual void pauseAnimation(const String&, double); @@ -84,8 +82,6 @@ public: void setAnimations(const GraphicsLayerAnimations&); TextureMapperLayer* layer() const { return m_layer.get(); } - bool needsDisplay() const { return m_needsDisplay; } - IntRect needsDisplayRect() const { return enclosingIntRect(m_needsDisplayRect); } virtual void setDebugBorder(const Color&, float width); @@ -93,22 +89,38 @@ public: virtual bool setFilters(const FilterOperations&); #endif + // FIXME: It will be removed after removing dependency of LayerTreeRenderer on GraphicsLayerTextureMapper. + void setHasOwnBackingStore(bool b) { m_hasOwnBackingStore = b; } + void setFixedToViewport(bool fixed) { m_fixedToViewport = fixed; } bool fixedToViewport() const { return m_fixedToViewport; } private: virtual void willBeDestroyed(); + void didFlushCompositingState(); + void didFlushCompositingStateRecursive(); + void updateBackingStore(); + void prepareBackingStore(); + bool shouldHaveBackingStore() const; + void drawRepaintCounter(GraphicsContext*); + void animationStartedTimerFired(Timer<GraphicsLayerTextureMapper>*); OwnPtr<TextureMapperLayer> m_layer; RefPtr<TextureMapperTiledBackingStore> m_compositedImage; NativeImagePtr m_compositedNativeImagePtr; + RefPtr<TextureMapperBackingStore> m_backingStore; + int m_changeMask; bool m_needsDisplay; + bool m_hasOwnBackingStore; bool m_fixedToViewport; + + Color m_debugBorderColor; + float m_debugBorderWidth; + TextureMapperPlatformLayer* m_contentsLayer; FloatRect m_needsDisplayRect; GraphicsLayerAnimations m_animations; - void animationStartedTimerFired(Timer<GraphicsLayerTextureMapper>*); Timer<GraphicsLayerTextureMapper> m_animationStartedTimer; }; diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp index fe6b6c0e1..50b32b360 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp @@ -20,19 +20,9 @@ #include "config.h" #include "TextureMapperLayer.h" -#include "stdio.h" - #if USE(ACCELERATED_COMPOSITING) #include "GraphicsLayerTextureMapper.h" -#include "ImageBuffer.h" -#include "NotImplemented.h" -#include <wtf/MathExtras.h> - -#if USE(CAIRO) -#include "CairoUtilities.h" -#include <wtf/text/CString.h> -#endif namespace WebCore { @@ -41,7 +31,7 @@ TextureMapperLayer* toTextureMapperLayer(GraphicsLayer* layer) return layer ? toGraphicsLayerTextureMapper(layer)->layer() : 0; } -TextureMapperLayer* TextureMapperLayer::rootLayer() +const TextureMapperLayer* TextureMapperLayer::rootLayer() const { if (m_effectTarget) return m_effectTarget->rootLayer(); @@ -95,56 +85,6 @@ void TextureMapperLayer::computeTransformsRecursive() sortByZOrder(m_children, 0, m_children.size()); } -void TextureMapperLayer::updateBackingStore(TextureMapper* textureMapper, GraphicsLayerTextureMapper* layer) -{ - if (!layer || !textureMapper) - return; - - if (!m_shouldUpdateBackingStoreFromLayer) - return; - - if (!m_state.drawsContent || !m_state.contentsVisible || m_size.isEmpty()) { - m_backingStore.clear(); - return; - } - - IntRect dirtyRect = enclosingIntRect(layerRect()); - if (!m_state.needsDisplay) - dirtyRect.intersect(enclosingIntRect(m_state.needsDisplayRect)); - if (dirtyRect.isEmpty()) - return; - - if (!m_backingStore) - m_backingStore = TextureMapperTiledBackingStore::create(); - -#if PLATFORM(QT) - ASSERT(dynamic_cast<TextureMapperTiledBackingStore*>(m_backingStore.get())); -#endif - - // Paint the entire dirty rect into an image buffer. This ensures we only paint once. - OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(dirtyRect.size()); - GraphicsContext* context = imageBuffer->context(); - context->setImageInterpolationQuality(textureMapper->imageInterpolationQuality()); - context->setTextDrawingMode(textureMapper->textDrawingMode()); - context->translate(-dirtyRect.x(), -dirtyRect.y()); - layer->paintGraphicsLayerContents(*context, dirtyRect); - - if (layer->isShowingRepaintCounter()) { - layer->incrementRepaintCount(); - drawRepaintCounter(context, layer); - } - - RefPtr<Image> image = imageBuffer->copyImage(DontCopyBackingStore); - TextureMapperTiledBackingStore* backingStore = static_cast<TextureMapperTiledBackingStore*>(m_backingStore.get()); - backingStore->updateContents(textureMapper, image.get(), m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); - - backingStore->setShowDebugBorders(layer->isShowingDebugBorder()); - backingStore->setDebugBorder(m_debugBorderColor, m_debugBorderWidth); - - m_state.needsDisplay = false; - m_state.needsDisplayRect = IntRect(); -} - void TextureMapperLayer::paint() { computeTransformsRecursive(); @@ -170,6 +110,7 @@ void TextureMapperLayer::paintSelf(const TextureMapperPaintOptions& options) RefPtr<BitmapTexture> mask = options.mask; if (m_backingStore) { + ASSERT(m_state.drawsContent && m_state.contentsVisible && !m_size.isEmpty()); ASSERT(!layerRect().isEmpty()); m_backingStore->paintToTextureMapper(options.textureMapper, layerRect(), transform, opacity, mask.get()); } @@ -406,9 +347,14 @@ TextureMapperLayer::~TextureMapperLayer() m_parent->m_children.remove(m_parent->m_children.find(this)); } +TextureMapper* TextureMapperLayer::textureMapper() const +{ + return rootLayer()->m_textureMapper; +} + void TextureMapperLayer::flushCompositingState(GraphicsLayerTextureMapper* graphicsLayer, int options) { - flushCompositingState(graphicsLayer, rootLayer()->m_textureMapper, options); + flushCompositingState(graphicsLayer, textureMapper(), options); } void TextureMapperLayer::flushCompositingStateSelf(GraphicsLayerTextureMapper* graphicsLayer, TextureMapper*) @@ -489,9 +435,6 @@ void TextureMapperLayer::flushCompositingStateSelf(GraphicsLayerTextureMapper* g #endif m_fixedToViewport = graphicsLayer->fixedToViewport(); - m_state.needsDisplay = m_state.needsDisplay || graphicsLayer->needsDisplay(); - if (!m_state.needsDisplay) - m_state.needsDisplayRect.unite(graphicsLayer->needsDisplayRect()); m_contentsLayer = graphicsLayer->platformLayer(); m_transform.setPosition(adjustedPosition()); @@ -539,10 +482,8 @@ void TextureMapperLayer::flushCompositingState(GraphicsLayerTextureMapper* graph if (!textureMapper) return; - if (graphicsLayer && !(options & ComputationsOnly)) { + if (graphicsLayer && !(options & ComputationsOnly)) flushCompositingStateSelf(graphicsLayer, textureMapper); - graphicsLayer->didSynchronize(); - } if (graphicsLayer && m_state.maskLayer) { m_state.maskLayer->flushCompositingState(toGraphicsLayerTextureMapper(graphicsLayer->maskLayer()), textureMapper); @@ -556,7 +497,6 @@ void TextureMapperLayer::flushCompositingState(GraphicsLayerTextureMapper* graph m_state.replicaLayer->flushCompositingState(toGraphicsLayerTextureMapper(graphicsLayer->replicaLayer()), textureMapper); syncAnimations(); - updateBackingStore(textureMapper, graphicsLayer); if (!(options & TraverseDescendants)) options = ComputationsOnly; @@ -598,48 +538,5 @@ void TextureMapperLayer::setScrollPositionDeltaIfNeeded(const FloatSize& delta) m_transform.setPosition(adjustedPosition()); } -void TextureMapperLayer::setDebugBorder(const Color& color, float width) -{ - // The default values for GraphicsLayer debug borders are a little - // hard to see (some less than one pixel wide), so we double their size here. - m_debugBorderColor = color; - m_debugBorderWidth = width * 2; -} - -#if USE(CAIRO) -void TextureMapperLayer::drawRepaintCounter(GraphicsContext* context, GraphicsLayer* layer) -{ - - cairo_t* cr = context->platformContext()->cr(); - cairo_save(cr); - - CString repaintCount = String::format("%i", layer->repaintCount()).utf8(); - cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); - cairo_set_font_size(cr, 18); - - cairo_text_extents_t repaintTextExtents; - cairo_text_extents(cr, repaintCount.data(), &repaintTextExtents); - - static const int repaintCountBorderWidth = 10; - setSourceRGBAFromColor(cr, layer->isShowingDebugBorder() ? m_debugBorderColor : Color(0, 255, 0, 127)); - cairo_rectangle(cr, 0, 0, - repaintTextExtents.width + (repaintCountBorderWidth * 2), - repaintTextExtents.height + (repaintCountBorderWidth * 2)); - cairo_fill(cr); - - cairo_set_source_rgb(cr, 1, 1, 1); - cairo_move_to(cr, repaintCountBorderWidth, repaintTextExtents.height + repaintCountBorderWidth); - cairo_show_text(cr, repaintCount.data()); - - cairo_restore(cr); -} -#else -void TextureMapperLayer::drawRepaintCounter(GraphicsContext* context, GraphicsLayer* layer) -{ - notImplemented(); -} - -#endif - } #endif diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h index 5cd959d61..27a77f6fe 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h @@ -24,24 +24,15 @@ #include "FilterOperations.h" #include "FloatRect.h" -#include "GraphicsContext.h" #include "GraphicsLayer.h" #include "GraphicsLayerAnimation.h" #include "GraphicsLayerTransform.h" -#include "Image.h" -#include "IntPointHash.h" #include "TextureMapper.h" #include "TextureMapperBackingStore.h" -#include "Timer.h" -#include "TransformOperations.h" -#include <wtf/CurrentTime.h> -#include <wtf/HashMap.h> -#include <wtf/RefCounted.h> namespace WebCore { class TextureMapperPlatformLayer; -class TextureMapperLayer; class GraphicsLayerTextureMapper; class TextureMapperPaintOptions { @@ -107,13 +98,12 @@ public: , m_contentsLayer(0) , m_opacity(1) , m_centerZ(0) - , m_shouldUpdateBackingStoreFromLayer(true) , m_textureMapper(0) - , m_debugBorderWidth(0) { } virtual ~TextureMapperLayer(); + TextureMapper* textureMapper() const; void flushCompositingState(GraphicsLayerTextureMapper*, int syncOptions = 0); void flushCompositingState(GraphicsLayerTextureMapper*, TextureMapper*, int syncOptions = 0); IntSize size() const { return IntSize(m_size.width(), m_size.height()); } @@ -127,18 +117,16 @@ public: void paint(); - void setShouldUpdateBackingStoreFromLayer(bool b) { m_shouldUpdateBackingStoreFromLayer = b; } - void setBackingStore(TextureMapperBackingStore* backingStore) { m_backingStore = backingStore; } + void setBackingStore(PassRefPtr<TextureMapperBackingStore> backingStore) { m_backingStore = backingStore; } PassRefPtr<TextureMapperBackingStore> backingStore() { return m_backingStore; } void clearBackingStoresRecursive(); void setScrollPositionDeltaIfNeeded(const FloatSize&); - void setDebugBorder(const Color&, float width); void applyAnimationsRecursively(); private: - TextureMapperLayer* rootLayer(); + const TextureMapperLayer* rootLayer() const; void computeTransformsRecursive(); void computeOverlapsIfNeeded(); void computeTiles(); @@ -161,9 +149,6 @@ private: void paintSelf(const TextureMapperPaintOptions&); void paintSelfAndChildren(const TextureMapperPaintOptions&); void paintSelfAndChildrenWithReplica(const TextureMapperPaintOptions&); - void updateBackingStore(TextureMapper*, GraphicsLayerTextureMapper*); - - void drawRepaintCounter(GraphicsContext*, GraphicsLayer*); // GraphicsLayerAnimation::Client void setAnimatedTransform(const TransformationMatrix& matrix) { setTransform(matrix); } @@ -202,7 +187,6 @@ private: #endif float m_centerZ; String m_name; - bool m_shouldUpdateBackingStoreFromLayer; struct State { FloatPoint pos; @@ -212,7 +196,6 @@ private: TransformationMatrix childrenTransform; float opacity; FloatRect contentsRect; - FloatRect needsDisplayRect; int descendantsWithContent; TextureMapperLayer* maskLayer; TextureMapperLayer* replicaLayer; @@ -227,7 +210,6 @@ private: bool contentsOpaque : 1; bool backfaceVisibility : 1; bool visible : 1; - bool needsDisplay: 1; bool mightHaveOverlaps : 1; bool needsRepaint; State() @@ -241,7 +223,6 @@ private: , contentsOpaque(false) , backfaceVisibility(false) , visible(true) - , needsDisplay(true) , mightHaveOverlaps(false) , needsRepaint(false) { @@ -253,8 +234,6 @@ private: GraphicsLayerAnimations m_animations; FloatSize m_scrollPositionDelta; bool m_fixedToViewport; - Color m_debugBorderColor; - float m_debugBorderWidth; }; diff --git a/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp b/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp index 230d2c7ba..d48dcbf88 100644 --- a/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp +++ b/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp @@ -96,6 +96,9 @@ void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const Float size_t frames = frameCount(); for (size_t i = 0; i < frames; ++i) { cairo_surface_t* image = frameAtIndex(i)->surface(); + if (!image) + continue; + if (cairo_image_surface_get_height(image) == static_cast<size_t>(srcSize.height()) && cairo_image_surface_get_width(image) == static_cast<size_t>(srcSize.width())) { size_t currentFrame = m_currentFrame; m_currentFrame = i; diff --git a/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp b/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp index f9b30df6a..b950dd48f 100644 --- a/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp +++ b/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp @@ -23,13 +23,10 @@ #if ENABLE(SPELLCHECK) #include <Language.h> -#include <editing/visible_units.h> #include <glib.h> #include <text/TextBreakIterator.h> -#include <wtf/text/CString.h> -#include <wtf/text/StringBuilder.h> -using namespace WebCore; +namespace WebCore { static const size_t maximumNumberOfSuggestions = 10; @@ -66,6 +63,25 @@ void TextCheckerEnchant::learnWord(const String& word) enchant_dict_add_to_personal(*iter, word.utf8().data(), -1); } +void TextCheckerEnchant::checkSpellingOfWord(const CString& word, int start, int end, int& misspellingLocation, int& misspellingLength) +{ + const char* string = word.data(); + char* startPtr = g_utf8_offset_to_pointer(string, start); + int numberOfBytes = static_cast<int>(g_utf8_offset_to_pointer(string, end) - startPtr); + + for (Vector<EnchantDict*>::const_iterator dictIter = m_enchantDictionaries.begin(); dictIter != m_enchantDictionaries.end(); ++dictIter) { + if (!enchant_dict_check(*dictIter, startPtr, numberOfBytes)) { + // Stop checking, this word is ok in at least one dict. + misspellingLocation = -1; + misspellingLength = 0; + break; + } + + misspellingLocation = start; + misspellingLength = end - start; + } +} + void TextCheckerEnchant::checkSpellingOfString(const String& string, int& misspellingLocation, int& misspellingLength) { // Assume that the words in the string are spelled correctly. @@ -75,46 +91,16 @@ void TextCheckerEnchant::checkSpellingOfString(const String& string, int& misspe if (!hasDictionary()) return; - size_t numberOfCharacters = string.length(); - TextBreakIterator* iter = wordBreakIterator(string.characters(), numberOfCharacters); + TextBreakIterator* iter = wordBreakIterator(string.characters(), string.length()); if (!iter) return; CString utf8String = string.utf8(); - const char* cString = utf8String.data(); - - for (size_t i = 0; i < numberOfCharacters + 1; i++) { - // We go through each character until we find the beginning of the word - // then we get into an inner loop to find the end of the word corresponding - // to it. - if (isLogicalStartOfWord(iter, i)) { - int start = i; - int end = i; - int wordLength; - - while (!islogicalEndOfWord(iter, end)) - end++; - - wordLength = end - start; - // Set the iterator to be at the current word end, so we don't - // check characters twice. - i = end; - - char* cstart = g_utf8_offset_to_pointer(cString, start); - int numberOfBytes = static_cast<int>(g_utf8_offset_to_pointer(cString, end) - cstart); - - for (Vector<EnchantDict*>::const_iterator dictIter = m_enchantDictionaries.begin(); dictIter != m_enchantDictionaries.end(); ++dictIter) { - if (enchant_dict_check(*dictIter, cstart, numberOfBytes)) { - misspellingLocation = start; - misspellingLength = wordLength; - } else { - // Stop checking, this word is ok in at least one dict. - misspellingLocation = -1; - misspellingLength = 0; - break; - } - } - } + int start = textBreakFirst(iter); + for (int end = textBreakNext(iter); end != TextBreakDone; end = textBreakNext(iter)) { + if (isWordTextBreak(iter)) + checkSpellingOfWord(utf8String, start, end, misspellingLocation, misspellingLength); + start = end; } } @@ -212,5 +198,7 @@ void TextCheckerEnchant::freeEnchantBrokerDictionaries() enchant_broker_free_dict(m_broker, *iter); } +} // namespace WebCore + #endif // ENABLE(SPELLCHECK) diff --git a/Source/WebCore/platform/text/enchant/TextCheckerEnchant.h b/Source/WebCore/platform/text/enchant/TextCheckerEnchant.h index 0fe2caaa9..e3142ace9 100644 --- a/Source/WebCore/platform/text/enchant/TextCheckerEnchant.h +++ b/Source/WebCore/platform/text/enchant/TextCheckerEnchant.h @@ -26,6 +26,7 @@ #include <wtf/FastAllocBase.h> #include <wtf/PassOwnPtr.h> #include <wtf/Vector.h> +#include <wtf/text/CString.h> #include <wtf/text/WTFString.h> namespace WebCore { @@ -49,6 +50,7 @@ public: private: TextCheckerEnchant(); void freeEnchantBrokerDictionaries(); + void checkSpellingOfWord(const CString&, int start, int end, int& misspellingLocation, int& misspellingLength); EnchantBroker* m_broker; Vector<EnchantDict*> m_enchantDictionaries; diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index 84f7b3c61..d53cd5637 100644 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -298,7 +298,7 @@ void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle* newSt if (newStyle->position() == StaticPosition) // Clear our positioned objects list. Our absolutely positioned descendants will be // inserted into our containing block's positioned objects list during layout. - removePositionedObjects(0); + removePositionedObjects(0, NewContainingBlock); else if (oldStyle->position() == StaticPosition) { // Remove our absolutely positioned descendants from their current containing block. // They will be inserted into our positioned objects list during layout. @@ -312,7 +312,7 @@ void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle* newSt } if (cb->isRenderBlock()) - toRenderBlock(cb)->removePositionedObjects(this); + toRenderBlock(cb)->removePositionedObjects(this, NewContainingBlock); } if (containsFloats() && !isFloating() && !isOutOfFlowPositioned() && newStyle->hasOutOfFlowPosition()) @@ -560,7 +560,7 @@ RenderBlock* RenderBlock::clone() const cloneBlock->setChildrenInline(childrenInline()); } else { - RenderObject* cloneRenderer = node()->createRenderer(renderArena(), style()); + RenderObject* cloneRenderer = toElement(node())->createRenderer(renderArena(), style()); cloneBlock = toRenderBlock(cloneRenderer); cloneBlock->setStyle(style()); @@ -3727,7 +3727,7 @@ void RenderBlock::removePositionedObject(RenderBox* o) removeFromTrackedRendererMaps(o, gPositionedDescendantsMap, gPositionedContainerMap); } -void RenderBlock::removePositionedObjects(RenderBlock* o) +void RenderBlock::removePositionedObjects(RenderBlock* o, ContainingBlockState containingBlockState) { TrackedRendererListHashSet* positionedDescendants = positionedObjects(); if (!positionedDescendants) @@ -3742,7 +3742,7 @@ void RenderBlock::removePositionedObjects(RenderBlock* o) for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); it != end; ++it) { r = *it; if (!o || r->isDescendantOf(o)) { - if (o) + if (containingBlockState == NewContainingBlock) r->setChildNeedsLayout(true, MarkOnlyThis); // It is parent blocks job to add positioned child to positioned objects list of its containing block diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h index a5566ed77..89c816c9b 100644 --- a/Source/WebCore/rendering/RenderBlock.h +++ b/Source/WebCore/rendering/RenderBlock.h @@ -67,6 +67,7 @@ typedef WTF::HashMap<const RenderBox*, HashSet<RenderBlock*>*> TrackedContainerM typedef Vector<WordMeasurement, 64> WordMeasurements; enum CaretType { CursorCaret, DragCaret }; +enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; enum TextRunFlag { DefaultTextRunFlags = 0, @@ -114,7 +115,7 @@ public: void insertPositionedObject(RenderBox*); static void removePositionedObject(RenderBox*); - void removePositionedObjects(RenderBlock*); + void removePositionedObjects(RenderBlock*, ContainingBlockState = SameContainingBlock); TrackedRendererListHashSet* positionedObjects() const; bool hasPositionedObjects() const diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp index 2e58ea677..eb6b4b5dd 100644 --- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp +++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp @@ -1826,7 +1826,7 @@ RootInlineBox* RenderBlock::determineStartPosition(LineLayoutState& layoutState, // We have a dirty line. if (RootInlineBox* prevRootBox = curr->prevRootBox()) { // We have a previous line. - if (!dirtiedByFloat && (!prevRootBox->endsWithBreak() || (prevRootBox->lineBreakObj()->isText() && prevRootBox->lineBreakPos() >= toRenderText(prevRootBox->lineBreakObj())->textLength()))) + if (!dirtiedByFloat && (!prevRootBox->endsWithBreak() || !prevRootBox->lineBreakObj() || (prevRootBox->lineBreakObj()->isText() && prevRootBox->lineBreakPos() >= toRenderText(prevRootBox->lineBreakObj())->textLength()))) // The previous line didn't break cleanly or broke at a newline // that has been deleted, so treat it as dirty too. curr = prevRootBox; diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp index 6846aa90d..e999113bf 100644 --- a/Source/WebCore/rendering/RenderBox.cpp +++ b/Source/WebCore/rendering/RenderBox.cpp @@ -1001,7 +1001,14 @@ void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons if (!fillLayer) return; - paintFillLayers(paintInfo, c, fillLayer->next(), rect, bleedAvoidance, op, backgroundObject); + // FIXME : It would be possible for the following occlusion culling test to be more aggressive + // on layers with no repeat by testing whether the image covers the layout rect. + // Testing that here would imply duplicating a lot of calculations that are currently done in + // RenderBoxModelOBject::paintFillLayerExtended. A more efficient solution might be to move + // the layer recursion into paintFillLayerExtended, or to compute the layer geometry here + // and pass it down. + if (fillLayer->next() && (!fillLayer->hasOpaqueImage(this) || !fillLayer->image()->canRender(this, style()->effectiveZoom()) || !fillLayer->hasRepeatXY())) + paintFillLayers(paintInfo, c, fillLayer->next(), rect, bleedAvoidance, op, backgroundObject); paintFillLayer(paintInfo, c, fillLayer, rect, bleedAvoidance, op, backgroundObject); } diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp index f9a994f4d..293591d76 100644 --- a/Source/WebCore/rendering/RenderBoxModelObject.cpp +++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp @@ -907,8 +907,10 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co view()->frameView()->setContentIsOpaque(isOpaqueRoot); } - // Paint the color first underneath all images. - if (!bgLayer->next()) { + // Paint the color first underneath all images, culled if background image occludes it. + // FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culling test + // by verifying whether the background image covers the entire layout rect. + if (!bgLayer->next() && !(shouldPaintBackgroundImage && bgLayer->hasOpaqueImage(this) && bgLayer->hasRepeatXY())) { IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect)); bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box); if (!boxShadowShouldBeAppliedToBackground) @@ -1447,7 +1449,7 @@ public: bool presentButInvisible() const { return usedWidth() && !hasVisibleColorAndStyle(); } bool obscuresBackgroundEdge(float scale) const { - if (!isPresent || isTransparent || width < (2 * scale) || color.hasAlpha() || style == BHIDDEN) + if (!isPresent || isTransparent || (width * scale) < 2 || color.hasAlpha() || style == BHIDDEN) return false; if (style == DOTTED || style == DASHED) diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index 4e67cd571..b4b01b057 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -179,10 +179,6 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer) , m_next(0) , m_first(0) , m_last(0) - , m_posZOrderList(0) - , m_negZOrderList(0) - , m_normalFlowList(0) - , m_marquee(0) , m_staticInlinePosition(0) , m_staticBlockPosition(0) , m_reflection(0) @@ -245,11 +241,6 @@ RenderLayer::~RenderLayer() // Child layers will be deleted by their corresponding render objects, so // we don't need to delete them ourselves. - delete m_posZOrderList; - delete m_negZOrderList; - delete m_normalFlowList; - delete m_marquee; - #if USE(ACCELERATED_COMPOSITING) clearBacking(true); #endif @@ -3421,7 +3412,7 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti } // Paint any child layers that have overflow. - paintList(m_normalFlowList, context, localPaintingInfo, localPaintFlags); + paintList(m_normalFlowList.get(), context, localPaintingInfo, localPaintFlags); // Now walk the sorted list of children with positive z-indices. paintList(posZOrderList(), context, localPaintingInfo, localPaintFlags); @@ -3884,7 +3875,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont } // Now check our overflow objects. - hitLayer = hitTestList(m_normalFlowList, rootLayer, request, result, hitTestRect, hitTestLocation, + hitLayer = hitTestList(m_normalFlowList.get(), rootLayer, request, result, hitTestRect, hitTestLocation, localTransformState.get(), zOffsetForDescendantsPtr, zOffset, unflattenedTransformState.get(), depthSortDescendants); if (hitLayer) { if (!depthSortDescendants) @@ -4832,7 +4823,7 @@ void RenderLayer::updateNormalFlowList() // Ignore non-overflow layers and reflections. if (child->isNormalFlowOnly() && (!m_reflection || reflectionLayer() != child)) { if (!m_normalFlowList) - m_normalFlowList = new Vector<RenderLayer*>; + m_normalFlowList = adoptPtr(new Vector<RenderLayer*>); m_normalFlowList->append(child); } } @@ -4840,7 +4831,7 @@ void RenderLayer::updateNormalFlowList() m_normalFlowListDirty = false; } -void RenderLayer::collectLayers(bool includeHiddenLayers, Vector<RenderLayer*>*& posBuffer, Vector<RenderLayer*>*& negBuffer) +void RenderLayer::collectLayers(bool includeHiddenLayers, OwnPtr<Vector<RenderLayer*> >& posBuffer, OwnPtr<Vector<RenderLayer*> >& negBuffer) { #if ENABLE(DIALOG_ELEMENT) if (isInTopLayer()) @@ -4853,11 +4844,11 @@ void RenderLayer::collectLayers(bool includeHiddenLayers, Vector<RenderLayer*>*& bool includeHiddenLayer = includeHiddenLayers || (m_hasVisibleContent || (m_hasVisibleDescendant && isStackingContext())); if (includeHiddenLayer && !isNormalFlowOnly() && !renderer()->isRenderFlowThread()) { // Determine which buffer the child should be in. - Vector<RenderLayer*>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; + OwnPtr<Vector<RenderLayer*> >& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; // Create the buffer if it doesn't exist yet. if (!buffer) - buffer = new Vector<RenderLayer*>; + buffer = adoptPtr(new Vector<RenderLayer*>); // Append ourselves at the end of the appropriate buffer. buffer->append(this); @@ -5086,12 +5077,11 @@ void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) if (renderer()->style()->overflowX() == OMARQUEE && renderer()->style()->marqueeBehavior() != MNONE && renderer()->isBox()) { if (!m_marquee) - m_marquee = new RenderMarquee(this); + m_marquee = adoptPtr(new RenderMarquee(this)); m_marquee->updateMarqueeStyle(); } else if (m_marquee) { - delete m_marquee; - m_marquee = 0; + m_marquee.clear(); } updateStackingContextsAfterStyleChange(oldStyle); diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h index 19d52968c..0b14a6d6b 100644 --- a/Source/WebCore/rendering/RenderLayer.h +++ b/Source/WebCore/rendering/RenderLayer.h @@ -284,7 +284,7 @@ public: void styleChanged(StyleDifference, const RenderStyle* oldStyle); - RenderMarquee* marquee() const { return m_marquee; } + RenderMarquee* marquee() const { return m_marquee.get(); } bool isNormalFlowOnly() const { return m_isNormalFlowOnly; } bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } @@ -433,7 +433,7 @@ public: { ASSERT(!m_zOrderListsDirty); ASSERT(isStackingContext() || !m_posZOrderList); - return m_posZOrderList; + return m_posZOrderList.get(); } bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList()->size(); } @@ -442,11 +442,11 @@ public: { ASSERT(!m_zOrderListsDirty); ASSERT(isStackingContext() || !m_negZOrderList); - return m_negZOrderList; + return m_negZOrderList.get(); } void dirtyNormalFlowList(); - Vector<RenderLayer*>* normalFlowList() const { ASSERT(!m_normalFlowListDirty); return m_normalFlowList; } + Vector<RenderLayer*>* normalFlowList() const { ASSERT(!m_normalFlowListDirty); return m_normalFlowList.get(); } // Update our normal and z-index lists. void updateLayerListsIfNeeded(); @@ -764,7 +764,7 @@ private: LayoutUnit renderBoxX() const { return renderBoxLocation().x(); } LayoutUnit renderBoxY() const { return renderBoxLocation().y(); } - void collectLayers(bool includeHiddenLayers, Vector<RenderLayer*>*&, Vector<RenderLayer*>*&); + void collectLayers(bool includeHiddenLayers, OwnPtr<Vector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&); void updateCompositingAndLayerListsIfNeeded(); @@ -1038,18 +1038,18 @@ protected: // descendant layers within the stacking context that have z-indices of 0 or greater // (auto will count as 0). m_negZOrderList holds descendants within our stacking context with negative // z-indices. - Vector<RenderLayer*>* m_posZOrderList; - Vector<RenderLayer*>* m_negZOrderList; + OwnPtr<Vector<RenderLayer*> > m_posZOrderList; + OwnPtr<Vector<RenderLayer*> > m_negZOrderList; // This list contains child layers that cannot create stacking contexts. For now it is just // overflow layers, but that may change in the future. - Vector<RenderLayer*>* m_normalFlowList; + OwnPtr<Vector<RenderLayer*> > m_normalFlowList; OwnPtr<ClipRectsCache> m_clipRectsCache; IntPoint m_cachedOverlayScrollbarOffset; - RenderMarquee* m_marquee; // Used by layers with overflow:marquee + OwnPtr<RenderMarquee> m_marquee; // Used by layers with overflow:marquee // Cached normal flow values for absolute positioned elements with static left/top values. LayoutUnit m_staticInlinePosition; @@ -1076,15 +1076,8 @@ inline void RenderLayer::clearZOrderLists() { ASSERT(!isStackingContext()); - if (m_posZOrderList) { - delete m_posZOrderList; - m_posZOrderList = 0; - } - - if (m_negZOrderList) { - delete m_negZOrderList; - m_negZOrderList = 0; - } + m_posZOrderList.clear(); + m_negZOrderList.clear(); } inline void RenderLayer::updateZOrderLists() diff --git a/Source/WebCore/rendering/RenderListMarker.cpp b/Source/WebCore/rendering/RenderListMarker.cpp index 23f5416cc..7ccb686ff 100644 --- a/Source/WebCore/rendering/RenderListMarker.cpp +++ b/Source/WebCore/rendering/RenderListMarker.cpp @@ -55,12 +55,12 @@ static String toRoman(int number, bool upper) // Big enough to store largest roman number less than 3999 which // is 3888 (MMMDCCCLXXXVIII) const int lettersSize = 15; - UChar letters[lettersSize]; + LChar letters[lettersSize]; int length = 0; - const UChar ldigits[] = { 'i', 'v', 'x', 'l', 'c', 'd', 'm' }; - const UChar udigits[] = { 'I', 'V', 'X', 'L', 'C', 'D', 'M' }; - const UChar* digits = upper ? udigits : ldigits; + const LChar ldigits[] = { 'i', 'v', 'x', 'l', 'c', 'd', 'm' }; + const LChar udigits[] = { 'I', 'V', 'X', 'L', 'C', 'D', 'M' }; + const LChar* digits = upper ? udigits : ldigits; int d = 0; do { int num = number % 10; @@ -81,13 +81,18 @@ static String toRoman(int number, bool upper) return String(&letters[lettersSize - length], length); } -static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, unsigned sequenceSize, SequenceType type) +// The typedef is needed because taking sizeof(number) in the const expression below doesn't work with some compilers. +// This is likely the case because of the template. +typedef int numberType; + +template <typename CharacterType> +static inline String toAlphabeticOrNumeric(numberType number, const CharacterType* sequence, unsigned sequenceSize, SequenceType type) { ASSERT(sequenceSize >= 2); - const int lettersSize = sizeof(number) * 8 + 1; // Binary is the worst case; requires one character per bit plus a minus sign. + const int lettersSize = sizeof(numberType) * 8 + 1; // Binary is the worst case; requires one character per bit plus a minus sign. - UChar letters[lettersSize]; + CharacterType letters[lettersSize]; bool isNegativeNumber = false; unsigned numberShadow = number; @@ -117,7 +122,8 @@ static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, un return String(&letters[lettersSize - length], length); } -static String toSymbolic(int number, const UChar* symbols, unsigned symbolsSize) +template <typename CharacterType> +static String toSymbolic(int number, const CharacterType* symbols, unsigned symbolsSize) { ASSERT(number > 0); ASSERT(symbolsSize >= 1); @@ -133,27 +139,32 @@ static String toSymbolic(int number, const UChar* symbols, unsigned symbolsSize) return letters.toString(); } -static String toAlphabetic(int number, const UChar* alphabet, unsigned alphabetSize) +template <typename CharacterType> +static String toAlphabetic(int number, const CharacterType* alphabet, unsigned alphabetSize) { return toAlphabeticOrNumeric(number, alphabet, alphabetSize, AlphabeticSequence); } -static String toNumeric(int number, const UChar* numerals, unsigned numeralsSize) +template <typename CharacterType> +static String toNumeric(int number, const CharacterType* numerals, unsigned numeralsSize) { return toAlphabeticOrNumeric(number, numerals, numeralsSize, NumericSequence); } -template <size_t size> static inline String toAlphabetic(int number, const UChar(&alphabet)[size]) +template <typename CharacterType, size_t size> +static inline String toAlphabetic(int number, const CharacterType(&alphabet)[size]) { return toAlphabetic(number, alphabet, size); } -template <size_t size> static inline String toNumeric(int number, const UChar(&alphabet)[size]) +template <typename CharacterType, size_t size> +static inline String toNumeric(int number, const CharacterType(&alphabet)[size]) { return toNumeric(number, alphabet, size); } -template <size_t size> static inline String toSymbolic(int number, const UChar(&alphabet)[size]) +template <typename CharacterType, size_t size> +static inline String toSymbolic(int number, const CharacterType(&alphabet)[size]) { return toSymbolic(number, alphabet, size); } @@ -600,8 +611,8 @@ String listMarkerText(EListStyleType type, int value) return ""; case Asterisks: { - static const UChar asterisksSymbols[1] = { - 0x002A + static const LChar asterisksSymbols[1] = { + 0x2A }; return toSymbolic(value, asterisksSymbols); } @@ -638,7 +649,7 @@ String listMarkerText(EListStyleType type, int value) return toNumeric(value, arabicIndicNumerals); } case BinaryListStyle: { - static const UChar binaryNumerals[2] = { + static const LChar binaryNumerals[2] = { '0', '1' }; return toNumeric(value, binaryNumerals); @@ -681,7 +692,7 @@ String listMarkerText(EListStyleType type, int value) return toNumeric(value, kannadaNumerals); } case LowerHexadecimal: { - static const UChar lowerHexadecimalNumerals[16] = { + static const LChar lowerHexadecimalNumerals[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; return toNumeric(value, lowerHexadecimalNumerals); @@ -711,7 +722,7 @@ String listMarkerText(EListStyleType type, int value) return toNumeric(value, myanmarNumerals); } case Octal: { - static const UChar octalNumerals[8] = { + static const LChar octalNumerals[8] = { '0', '1', '2', '3', '4', '5', '6', '7' }; return toNumeric(value, octalNumerals); @@ -748,7 +759,7 @@ String listMarkerText(EListStyleType type, int value) return toNumeric(value, thaiNumerals); } case UpperHexadecimal: { - static const UChar upperHexadecimalNumerals[16] = { + static const LChar upperHexadecimalNumerals[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; return toNumeric(value, upperHexadecimalNumerals); @@ -756,7 +767,7 @@ String listMarkerText(EListStyleType type, int value) case LowerAlpha: case LowerLatin: { - static const UChar lowerLatinAlphabet[26] = { + static const LChar lowerLatinAlphabet[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; @@ -764,7 +775,7 @@ String listMarkerText(EListStyleType type, int value) } case UpperAlpha: case UpperLatin: { - static const UChar upperLatinAlphabet[26] = { + static const LChar upperLatinAlphabet[26] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; @@ -992,20 +1003,20 @@ String listMarkerText(EListStyleType type, int value) return toAlphabetic(value, upperGreekAlphabet); } case LowerNorwegian: { - static const UChar lowerNorwegianAlphabet[29] = { - 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, - 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, - 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E6, - 0x00F8, 0x00E5 + static const LChar lowerNorwegianAlphabet[29] = { + 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, + 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xE6, + 0xF8, 0xE5 }; return toAlphabetic(value, lowerNorwegianAlphabet); } case UpperNorwegian: { - static const UChar upperNorwegianAlphabet[29] = { - 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, - 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, - 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00C6, - 0x00D8, 0x00C5 + static const LChar upperNorwegianAlphabet[29] = { + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, + 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0xC6, + 0xD8, 0xC5 }; return toAlphabetic(value, upperNorwegianAlphabet); } diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h index 118a996af..9ffbcfb74 100644 --- a/Source/WebCore/rendering/RenderObject.h +++ b/Source/WebCore/rendering/RenderObject.h @@ -157,7 +157,6 @@ const int showTreeCharacterOffset = 39; class RenderObject : public CachedImageClient { friend class LayoutRepainter; friend class RenderBlock; - friend class RenderBox; friend class RenderLayer; friend class RenderObjectChildList; friend class RenderSVGContainer; diff --git a/Source/WebCore/rendering/style/FillLayer.cpp b/Source/WebCore/rendering/style/FillLayer.cpp index 195a05c5d..edd3d9a60 100644 --- a/Source/WebCore/rendering/style/FillLayer.cpp +++ b/Source/WebCore/rendering/style/FillLayer.cpp @@ -280,4 +280,23 @@ bool FillLayer::imagesAreLoaded() const return true; } +bool FillLayer::hasOpaqueImage(const RenderObject* renderer) const +{ + if (!m_image) + return false; + + if (m_composite == CompositeClear || m_composite == CompositeCopy) + return true; + + if (m_composite == CompositeSourceOver) + return !m_image->hasAlpha(renderer); + + return false; +} + +bool FillLayer::hasRepeatXY() const +{ + return m_repeatX == RepeatFill && m_repeatY == RepeatFill; +} + } // namespace WebCore diff --git a/Source/WebCore/rendering/style/FillLayer.h b/Source/WebCore/rendering/style/FillLayer.h index 7f1ceb148..525f533ab 100644 --- a/Source/WebCore/rendering/style/FillLayer.h +++ b/Source/WebCore/rendering/style/FillLayer.h @@ -144,6 +144,9 @@ public: return m_next ? m_next->hasFixedImage() : false; } + bool hasOpaqueImage(const RenderObject*) const; + bool hasRepeatXY() const; + EFillLayerType type() const { return static_cast<EFillLayerType>(m_type); } void fillUnsetProperties(); diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp index d7f41816a..6ecaa0417 100644 --- a/Source/WebCore/rendering/style/RenderStyle.cpp +++ b/Source/WebCore/rendering/style/RenderStyle.cpp @@ -41,6 +41,7 @@ #endif #include "WebCoreMemoryInstrumentation.h" #include <wtf/MemoryInstrumentationVector.h> +#include <wtf/MemoryObjectInfo.h> #include <wtf/StdLibExtras.h> #include <algorithm> diff --git a/Source/WebCore/rendering/style/StyleCachedImage.cpp b/Source/WebCore/rendering/style/StyleCachedImage.cpp index 2e5043264..4269edd12 100644 --- a/Source/WebCore/rendering/style/StyleCachedImage.cpp +++ b/Source/WebCore/rendering/style/StyleCachedImage.cpp @@ -106,4 +106,9 @@ PassRefPtr<Image> StyleCachedImage::image(RenderObject* renderer, const IntSize& return m_image->imageForRenderer(renderer); } +bool StyleCachedImage::hasAlpha(const RenderObject* renderer) const +{ + return m_image->currentFrameHasAlpha(renderer); +} + } diff --git a/Source/WebCore/rendering/style/StyleCachedImage.h b/Source/WebCore/rendering/style/StyleCachedImage.h index a55b6303c..f6c4fda97 100644 --- a/Source/WebCore/rendering/style/StyleCachedImage.h +++ b/Source/WebCore/rendering/style/StyleCachedImage.h @@ -56,6 +56,7 @@ public: virtual void addClient(RenderObject*); virtual void removeClient(RenderObject*); virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const; + virtual bool hasAlpha(const RenderObject*) const OVERRIDE; private: explicit StyleCachedImage(CachedImage*); diff --git a/Source/WebCore/rendering/style/StyleCachedImageSet.cpp b/Source/WebCore/rendering/style/StyleCachedImageSet.cpp index 76a2c0951..c9f138270 100644 --- a/Source/WebCore/rendering/style/StyleCachedImageSet.cpp +++ b/Source/WebCore/rendering/style/StyleCachedImageSet.cpp @@ -116,6 +116,11 @@ PassRefPtr<Image> StyleCachedImageSet::image(RenderObject* renderer, const IntSi return m_bestFitImage->imageForRenderer(renderer); } +bool StyleCachedImageSet::hasAlpha(const RenderObject* renderer) const +{ + return m_bestFitImage->currentFrameHasAlpha(renderer); +} + } // namespace WebCore #endif // ENABLE(CSS_IMAGE_SET) diff --git a/Source/WebCore/rendering/style/StyleCachedImageSet.h b/Source/WebCore/rendering/style/StyleCachedImageSet.h index 7e5eb5dce..9ffd4b263 100644 --- a/Source/WebCore/rendering/style/StyleCachedImageSet.h +++ b/Source/WebCore/rendering/style/StyleCachedImageSet.h @@ -71,6 +71,7 @@ public: virtual void removeClient(RenderObject*); virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const; virtual float imageScaleFactor() const { return m_imageScaleFactor; } + virtual bool hasAlpha(const RenderObject*) const OVERRIDE; private: StyleCachedImageSet(CachedImage*, float imageScaleFactor, CSSImageSetValue*); diff --git a/Source/WebCore/rendering/style/StyleGeneratedImage.cpp b/Source/WebCore/rendering/style/StyleGeneratedImage.cpp index cd3572b55..09781a61a 100644 --- a/Source/WebCore/rendering/style/StyleGeneratedImage.cpp +++ b/Source/WebCore/rendering/style/StyleGeneratedImage.cpp @@ -89,4 +89,9 @@ PassRefPtr<Image> StyleGeneratedImage::image(RenderObject* renderer, const IntSi return m_imageGeneratorValue->image(renderer, size); } +bool StyleGeneratedImage::hasAlpha(const RenderObject* renderer) const +{ + return m_imageGeneratorValue->hasAlpha(renderer); +} + } diff --git a/Source/WebCore/rendering/style/StyleGeneratedImage.h b/Source/WebCore/rendering/style/StyleGeneratedImage.h index 0e7a7542f..7ab70f2db 100644 --- a/Source/WebCore/rendering/style/StyleGeneratedImage.h +++ b/Source/WebCore/rendering/style/StyleGeneratedImage.h @@ -51,6 +51,7 @@ public: virtual void addClient(RenderObject*); virtual void removeClient(RenderObject*); virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const; + virtual bool hasAlpha(const RenderObject*) const OVERRIDE; private: StyleGeneratedImage(PassRefPtr<CSSImageGeneratorValue>); diff --git a/Source/WebCore/rendering/style/StyleImage.h b/Source/WebCore/rendering/style/StyleImage.h index b41eb8424..486ec3dab 100644 --- a/Source/WebCore/rendering/style/StyleImage.h +++ b/Source/WebCore/rendering/style/StyleImage.h @@ -64,6 +64,7 @@ public: virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const = 0; virtual WrappedImagePtr data() const = 0; virtual float imageScaleFactor() const { return 1; } + virtual bool hasAlpha(const RenderObject*) const = 0; ALWAYS_INLINE bool isCachedImage() const { return m_isCachedImage; } ALWAYS_INLINE bool isPendingImage() const { return m_isPendingImage; } diff --git a/Source/WebCore/rendering/style/StylePendingImage.h b/Source/WebCore/rendering/style/StylePendingImage.h index aa3f75416..192063be7 100644 --- a/Source/WebCore/rendering/style/StylePendingImage.h +++ b/Source/WebCore/rendering/style/StylePendingImage.h @@ -66,6 +66,7 @@ public: ASSERT_NOT_REACHED(); return 0; } + virtual bool hasAlpha(const RenderObject*) const { return true; } private: StylePendingImage(CSSValue* value) diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp index b1ba5986a..434e3ccf0 100644 --- a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp +++ b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp @@ -28,6 +28,7 @@ #include "RenderStyleConstants.h" #include "ShadowData.h" #include "WebCoreMemoryInstrumentation.h" +#include <wtf/MemoryObjectInfo.h> namespace WebCore { diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp index 1c6cb1879..ed9e9a2ef 100644 --- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp +++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp @@ -33,6 +33,7 @@ #include "WebCoreMemoryInstrumentation.h" #include <wtf/MemoryInstrumentationHashMap.h> #include <wtf/MemoryInstrumentationVector.h> +#include <wtf/MemoryObjectInfo.h> namespace WebCore { diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp index aece95429..8c24a51cd 100644 --- a/Source/WebKit/blackberry/Api/WebPage.cpp +++ b/Source/WebKit/blackberry/Api/WebPage.cpp @@ -1636,7 +1636,6 @@ void WebPagePrivate::zoomToInitialScaleOnLoad() BBLOG(Platform::LogLevelInfo, "WebPagePrivate::zoomToInitialScaleOnLoad content is empty!"); #endif requestLayoutIfNeeded(); - m_client->resetBitmapZoomScale(currentScale()); notifyTransformedContentsSizeChanged(); return; } @@ -1667,7 +1666,6 @@ void WebPagePrivate::zoomToInitialScaleOnLoad() if (!performedZoom) { // We only notify if we didn't perform zoom, because zoom will notify on // its own... - m_client->resetBitmapZoomScale(currentScale()); notifyTransformedContentsSizeChanged(); } } @@ -2959,7 +2957,6 @@ void WebPagePrivate::zoomBlock() TransformationMatrix zoom; zoom.scale(m_blockZoomFinalScale); *m_transformationMatrix = zoom; - m_client->resetBitmapZoomScale(m_blockZoomFinalScale); // FIXME: Do we really need to suspend/resume both backingstore and screen here? m_backingStore->d->suspendBackingStoreUpdates(); m_backingStore->d->suspendScreenUpdates(); @@ -3467,7 +3464,14 @@ void WebPagePrivate::dispatchViewportPropertiesDidChange(const ViewportArguments Platform::IntSize virtualViewport = recomputeVirtualViewportFromViewportArguments(); m_webPage->setVirtualViewportSize(virtualViewport); - if (loadState() == WebKit::WebPagePrivate::Committed) + // Reset m_userPerformedManualZoom and enable m_shouldZoomToInitialScaleAfterLoadFinished so that we can relayout + // the page and zoom it to fit the screen when we dynamically change the meta viewport after the load is finished. + bool isLoadFinished = loadState() == Finished; + if (isLoadFinished) { + m_userPerformedManualZoom = false; + setShouldZoomToInitialScaleAfterLoadFinished(true); + } + if (loadState() == Committed || isLoadFinished) zoomToInitialScaleOnLoad(); } @@ -4048,72 +4052,13 @@ void WebPage::setDocumentScrollOriginPoint(const Platform::IntPoint& documentScr d->setScrollOriginPoint(documentScrollOrigin); } -bool WebPagePrivate::dispatchTouchEventToFullScreenPlugin(PluginView* plugin, const Platform::TouchEvent& event) -{ - NPTouchEvent npTouchEvent; - - if (event.isDoubleTap()) - npTouchEvent.type = TOUCH_EVENT_DOUBLETAP; - else if (event.isTouchHold()) - npTouchEvent.type = TOUCH_EVENT_TOUCHHOLD; - else { - switch (event.m_type) { - case Platform::TouchEvent::TouchStart: - npTouchEvent.type = TOUCH_EVENT_START; - break; - case Platform::TouchEvent::TouchEnd: - npTouchEvent.type = TOUCH_EVENT_END; - break; - case Platform::TouchEvent::TouchMove: - npTouchEvent.type = TOUCH_EVENT_MOVE; - break; - case Platform::TouchEvent::TouchCancel: - npTouchEvent.type = TOUCH_EVENT_CANCEL; - break; - default: - return false; - } - } - - npTouchEvent.points = 0; - npTouchEvent.size = event.m_points.size(); - if (npTouchEvent.size) { - npTouchEvent.points = new NPTouchPoint[npTouchEvent.size]; - for (int i = 0; i < npTouchEvent.size; i++) { - npTouchEvent.points[i].touchId = event.m_points[i].m_id; - npTouchEvent.points[i].clientX = event.m_points[i].m_screenPos.x(); - npTouchEvent.points[i].clientY = event.m_points[i].m_screenPos.y(); - npTouchEvent.points[i].screenX = event.m_points[i].m_screenPos.x(); - npTouchEvent.points[i].screenY = event.m_points[i].m_screenPos.y(); - npTouchEvent.points[i].pageX = event.m_points[i].m_pos.x(); - npTouchEvent.points[i].pageY = event.m_points[i].m_pos.y(); - } - } - - NPEvent npEvent; - npEvent.type = NP_TouchEvent; - npEvent.data = &npTouchEvent; - - bool handled = plugin->dispatchFullScreenNPEvent(npEvent); - - if (npTouchEvent.type == TOUCH_EVENT_DOUBLETAP && !handled) { - // Send Touch Up if double tap not consumed. - npTouchEvent.type = TOUCH_EVENT_END; - npEvent.data = &npTouchEvent; - handled = plugin->dispatchFullScreenNPEvent(npEvent); - } - delete[] npTouchEvent.points; - return handled; -} - void WebPage::touchPointAsMouseEvent(const Platform::TouchPoint& point) { if (d->m_page->defersLoading()) return; - PluginView* pluginView = d->m_fullScreenPluginView.get(); - if (pluginView) - d->dispatchTouchPointAsMouseEventToFullScreenPlugin(pluginView, point); + if (d->m_fullScreenPluginView.get()) + return; d->m_lastUserEventTimestamp = currentTime(); @@ -4129,6 +4074,51 @@ void WebPage::playSoundIfAnchorIsTarget() const d->m_touchEventHandler->playSoundIfAnchorIsTarget(); } +bool WebPagePrivate::dispatchTouchEventToFullScreenPlugin(PluginView* plugin, const Platform::TouchEvent& event) +{ + // Always convert touch events to mouse events. + // Don't send actual touch events because no one has ever implemented them in flash. + if (!event.neverHadMultiTouch()) + return false; + + if (event.isDoubleTap() || event.isTouchHold() || event.m_type == Platform::TouchEvent::TouchCancel) { + NPTouchEvent npTouchEvent; + + if (event.isDoubleTap()) + npTouchEvent.type = TOUCH_EVENT_DOUBLETAP; + else if (event.isTouchHold()) + npTouchEvent.type = TOUCH_EVENT_TOUCHHOLD; + else if (event.m_type == Platform::TouchEvent::TouchCancel) + npTouchEvent.type = TOUCH_EVENT_CANCEL; + + npTouchEvent.points = 0; + npTouchEvent.size = event.m_points.size(); + if (npTouchEvent.size) { + npTouchEvent.points = new NPTouchPoint[npTouchEvent.size]; + for (int i = 0; i < npTouchEvent.size; i++) { + npTouchEvent.points[i].touchId = event.m_points[i].m_id; + npTouchEvent.points[i].clientX = event.m_points[i].m_screenPos.x(); + npTouchEvent.points[i].clientY = event.m_points[i].m_screenPos.y(); + npTouchEvent.points[i].screenX = event.m_points[i].m_screenPos.x(); + npTouchEvent.points[i].screenY = event.m_points[i].m_screenPos.y(); + npTouchEvent.points[i].pageX = event.m_points[i].m_pos.x(); + npTouchEvent.points[i].pageY = event.m_points[i].m_pos.y(); + } + } + + NPEvent npEvent; + npEvent.type = NP_TouchEvent; + npEvent.data = &npTouchEvent; + + plugin->dispatchFullScreenNPEvent(npEvent); + delete[] npTouchEvent.points; + return true; + } + + dispatchTouchPointAsMouseEventToFullScreenPlugin(plugin, event.m_points[0]); + return true; +} + bool WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin(PluginView* pluginView, const Platform::TouchPoint& point) { NPEvent npEvent; @@ -4145,7 +4135,7 @@ bool WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin(PluginView mouse.type = MOUSE_MOTION; break; case Platform::TouchPoint::TouchStationary: - return false; + return true; } mouse.x = point.m_screenPos.x(); @@ -4155,7 +4145,8 @@ bool WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin(PluginView npEvent.type = NP_MouseEvent; npEvent.data = &mouse; - return pluginView->dispatchFullScreenNPEvent(npEvent); + pluginView->dispatchFullScreenNPEvent(npEvent); + return true; } void WebPage::touchEventCancel() diff --git a/Source/WebKit/blackberry/Api/WebPageClient.h b/Source/WebKit/blackberry/Api/WebPageClient.h index 26ddf0918..896f24c67 100644 --- a/Source/WebKit/blackberry/Api/WebPageClient.h +++ b/Source/WebKit/blackberry/Api/WebPageClient.h @@ -151,7 +151,7 @@ public: virtual void showVirtualKeyboard(bool) = 0; virtual void requestSpellingCheckingOptions(imf_sp_text_t&, const BlackBerry::Platform::IntRect& documentCaretRect, const BlackBerry::Platform::IntSize& screenOffset) = 0; - virtual int32_t checkSpellingOfStringAsync(wchar_t* text, int length) = 0; + virtual int32_t checkSpellingOfStringAsync(wchar_t* text, const unsigned length) = 0; virtual void notifySelectionDetailsChanged(const Platform::IntRect& documentStartRect, const Platform::IntRect& documentEndRect, const Platform::IntRectRegion& documentRegion, bool overrideTouchHandling = false) = 0; virtual void cancelSelectionVisuals() = 0; @@ -201,7 +201,6 @@ public: virtual BlackBerry::Platform::ViewportAccessor* userInterfaceViewportAccessor() const = 0; - virtual void resetBitmapZoomScale(double scale) = 0; virtual void animateBlockZoom(double finalScale, const Platform::FloatPoint& finalDocumentScrollPosition) = 0; virtual void setPreventsScreenIdleDimming(bool noDimming) = 0; diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog index 4c00f23f4..9382a941c 100644 --- a/Source/WebKit/blackberry/ChangeLog +++ b/Source/WebKit/blackberry/ChangeLog @@ -1,3 +1,113 @@ +2012-11-25 Jacky Jiang <zhajiang@rim.com> + + [BlackBerry] Get rid of resetBitmapZoomScale() + https://bugs.webkit.org/show_bug.cgi?id=103200 + + Reviewed by Rob Buis. + Internally reviewed by Gen Mak. + + PR: 235707 + Right now, resetBitmapZoomScale() takes an unused paramter and + dispatches a message to end the bitmap zooming. However, the + interaction has its own state machine to start bitmap zooming when it + is active and end bitmap zooming when it is inactive. This is + expecially for pinch zoom and scroll. From WebKit side, block zoom + which will call zoomBlock when the bitmap zoom finished doesn't even + need to dispatch the useless ending message to ZoomHandler. + resetBitmapZoomScale() is basically a noop for block zoom. And likewise + that is useless for zoomToInitialScaleOnLoad(). It can also potentially + cause problem if it is used somewhere else in the future and + incidentally breaks the interaction's own state machine. So just remove + this completely. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::zoomToInitialScaleOnLoad): + (BlackBerry::WebKit::WebPagePrivate::zoomBlock): + * Api/WebPageClient.h: + +2012-11-24 Andy Chen <andchen@rim.com> + + [BlackBerry] Find-on-page keeps stale pointer + https://bugs.webkit.org/show_bug.cgi?id=103190 + + Reviewed by Rob Buis. + + Find on page: pendingScopingEffort stores stale pointer when frames unload, + we need to cancel those scoping efforts. + PR 250807. + + Internally reviewed by Yongxin Dai and Mike Fenton. + + * WebKitSupport/InPageSearchManager.cpp: + (InPageSearchManager::DeferredScopeStringMatches): + (BlackBerry::WebKit::InPageSearchManager::frameUnloaded): + +2012-11-24 Genevieve Mak <gmak@rim.com> + + [BlackBerry] Text not selected when input field focused. + https://bugs.webkit.org/show_bug.cgi?id=103182 + + Reviewed by George Staikos. + + Reviewed Internally by: Mike Fenton, Eli Fidler + PR #250163 + + * WebKitSupport/SelectionHandler.cpp: + (BlackBerry::WebKit::SelectionHandler::selectObject): + +2012-11-23 Nima Ghanavatian <nghanavatian@rim.com> + + [BlackBerry] Define platform limitations in platform layer + https://bugs.webkit.org/show_bug.cgi?id=103160 + + Reviewed by Rob Buis. + + Taking length as const unsigned in checkSpellingOfStringAsync. + This value is unchanging and should never be less than 0, even + in an error case. + + Internally reviewed by Mike Fenton. + + * Api/WebPageClient.h: + * WebKitSupport/InputHandler.cpp: + (BlackBerry::WebKit::InputHandler::requestCheckingOfString): + +2012-11-23 Jacky Jiang <zhajiang@rim.com> + + [BlackBerry] Meta viewport can't be changed dynamically + https://bugs.webkit.org/show_bug.cgi?id=103098 + + Reviewed by Rob Buis. + Internally reviewed by Arvid Nilsson. + + PR: 237072 + Reset m_userPerformedManualZoom and enable + m_shouldZoomToInitialScaleAfterLoadFinished so that we can relayout the + page and zoom it to fit the screen when we dynamically change the meta + viewport after the load is finished. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::dispatchViewportPropertiesDidChange): + +2012-11-23 Genevieve Mak <gmak@rim.com> + + [BlackBerry] Drop Synchronous Mouse Events + https://bugs.webkit.org/show_bug.cgi?id=102980 + + Reviewed by Rob Buis. + + Reviewed Internally by George Staikos and Mike Lattanzio. + Don't send actual Touch Events to fullscreen plugins unless + its a Touch Cancel, DoubleTap or TouchHold. + Instead send mouse events as long as its a single finger. + PR #242781 + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPage::touchPointAsMouseEvent): + (BlackBerry::WebKit::WebPagePrivate::dispatchTouchEventToFullScreenPlugin): + (WebKit): + (BlackBerry::WebKit::WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin): + 2012-11-23 Andrew Lo <anlo@rim.com> [BlackBerry] InputHandler::ensureFocusTextElementVisible incorrectly used y coordinate as x coordinate diff --git a/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp b/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp index b24fda3a6..e673b1a0c 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp @@ -53,6 +53,7 @@ public: } private: + friend class InPageSearchManager; void doTimeout(Timer<DeferredScopeStringMatches>*) { m_searchManager->callScopeStringMatches(this, m_scopingFrame, m_searchText, m_reset, m_locateActiveMatchOnly); @@ -247,6 +248,13 @@ void InPageSearchManager::setActiveMatchAndMarker(PassRefPtr<Range> range) void InPageSearchManager::frameUnloaded(const Frame* frame) { + for (size_t i = 0; i < m_deferredScopingWork.size(); i++) { + if (m_deferredScopingWork[i]->m_scopingFrame == frame) { + // Clear pending scoping efforts in case of dangling pointer. + cancelPendingScopingEffort(); + break; + } + } if (!m_activeMatch) { if (m_webPage->mainFrame() == frame && m_activeSearchString.length()) m_activeSearchString = String(); diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp index 6a39aa5d5..115b2fbc4 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp @@ -64,6 +64,7 @@ #include "htmlediting.h" #include "visible_units.h" +#include <BlackBerryPlatformIMF.h> #include <BlackBerryPlatformKeyboardEvent.h> #include <BlackBerryPlatformLog.h> #include <BlackBerryPlatformMisc.h> @@ -77,7 +78,6 @@ #define ENABLE_SPELLING_LOG 0 static const unsigned MaxLearnTextDataSize = 500; -static const unsigned MaxSpellCheckingStringLength = 250; using namespace BlackBerry::Platform; using namespace WebCore; @@ -616,7 +616,7 @@ void InputHandler::requestCheckingOfString(PassRefPtr<WebCore::TextCheckingReque return; } - m_processingTransactionId = m_webPage->m_client->checkSpellingOfStringAsync(checkingString, paragraphLength); + m_processingTransactionId = m_webPage->m_client->checkSpellingOfStringAsync(checkingString, static_cast<unsigned>(paragraphLength)); free(checkingString); // If the call to the input service did not go through, then cancel the request so we don't block endlessly. diff --git a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp index 587b904de..c57ab1068 100644 --- a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp @@ -664,6 +664,10 @@ void SelectionHandler::selectObject(Node* node) if (!node) return; + // Clear input focus if we're not selecting text there. + if (node != m_webPage->m_inputHandler->currentFocusElement().get()) + m_webPage->clearFocusNode(); + m_selectionActive = true; ASSERT(m_webPage && m_webPage->focusedOrMainFrame() && m_webPage->focusedOrMainFrame()->selection()); diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index d1cf5e0f8..24abafb25 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,38 @@ +2012-11-24 Silvia Pfeiffer <silviapf@chromium.org> + + [chromium] Remove traces of MediaControlRootElement + https://bugs.webkit.org/show_bug.cgi?id=103174 + + Reviewed by Adam Barth. + + Now that nothing is using MediaControlRootElement any more, + we can remove the FIXME and MediaControlRootElement enum left + over from bug 88871. + + * public/WebContextMenuData.h: + +2012-11-23 Robert Kroeger <rjkroege@chromium.org> + + Remove unused ScrollByPixelVelocity + https://bugs.webkit.org/show_bug.cgi?id=102840 + + Reviewed by Sam Weinig. + + Removed test for deleted code. + + * tests/ScrollAnimatorNoneTest.cpp: + +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Protect the new feature behind a feature flag. + + * features.gypi: + 2012-11-23 Yury Semikhatsky <yurys@chromium.org> Unreviewed. Fix Chromium Win compilation after r135580. diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi index 4f43106d3..8e2aaf317 100644 --- a/Source/WebKit/chromium/features.gypi +++ b/Source/WebKit/chromium/features.gypi @@ -38,6 +38,7 @@ 'ENABLE_BLOB_SLICE=1', 'ENABLE_CHANNEL_MESSAGING=1', 'ENABLE_CSP_NEXT=1', + 'ENABLE_CSS3_BACKGROUND=0', 'ENABLE_CSS3_CONDITIONAL_RULES=0', 'ENABLE_CSS3_TEXT=0', 'ENABLE_CSS_BOX_DECORATION_BREAK=1', diff --git a/Source/WebKit/chromium/public/WebContextMenuData.h b/Source/WebKit/chromium/public/WebContextMenuData.h index 7aaee9d52..0a33ee6fe 100644 --- a/Source/WebKit/chromium/public/WebContextMenuData.h +++ b/Source/WebKit/chromium/public/WebContextMenuData.h @@ -100,8 +100,6 @@ struct WebContextMenuData { MediaCanSave = 0x10, MediaHasAudio = 0x20, MediaHasVideo = 0x40, - // FIXME: Remove MediaControlRootElement after patch lands for webkit.org/b/88871. - MediaControlRootElement = 0x80, MediaControls = 0x80, MediaCanPrint = 0x100, MediaCanRotate = 0x200, diff --git a/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp b/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp index 83088a312..35ad63c46 100644 --- a/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp +++ b/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp @@ -146,30 +146,6 @@ TEST(ScrollAnimatorEnabled, Enabled) scrollAnimatorNone.reset(); } -TEST(ScrollAnimatorEnabled, flingScrollEncoding) -{ - MockScrollableArea scrollableArea(true); - MockScrollAnimatorNone scrollAnimatorNone(&scrollableArea); - - scrollAnimatorNone.reset(); - - scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPixelVelocity, 111, -42); - scrollAnimatorNone.scroll(VerticalScrollbar, ScrollByPixelVelocity, 222, 42); - EXPECT_EQ(-42, scrollAnimatorNone.m_fp.x()); - EXPECT_EQ(42, scrollAnimatorNone.m_fp.y()); - EXPECT_EQ(1, scrollAnimatorNone.m_count); - scrollAnimatorNone.reset(); - - scrollAnimatorNone.scroll(VerticalScrollbar, ScrollByPixelVelocity, 222, 42); - scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPixelVelocity, 111, -42); - EXPECT_EQ(-42, scrollAnimatorNone.m_fp.x()); - EXPECT_EQ(42, scrollAnimatorNone.m_fp.y()); - EXPECT_EQ(1, scrollAnimatorNone.m_count); - scrollAnimatorNone.reset(); -} - - - TEST(ScrollAnimatorEnabled, Disabled) { MockScrollableArea scrollableArea(false); diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index 2f97483fa..2007c5354 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,16 @@ +2012-11-24 Viatcheslav Ostapenko <v.ostapenko@samsung.com> + + [EFL] Layout test comes to crash on WK1 + https://bugs.webkit.org/show_bug.cgi?id=103170 + + Reviewed by Kenneth Rohde Christiansen. + + Switch off accelerated compositing for WK1 because GraphicsContext3D is + missing direct rendering implementation that is required for EFL WK1. + + * ewk/ewk_view.cpp: + (_ewk_view_priv_new): + 2012-11-21 Allan Sandfeld Jensen <allan.jensen@digia.com> Disambiguate innerNodeFramePoint and mainFramePoint diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index 6816a877f..03d69c073 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -837,6 +837,9 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) priv->pageSettings->setFullScreenEnabled(true); #endif priv->pageSettings->setInteractiveFormValidationEnabled(true); +#if USE(ACCELERATED_COMPOSITING) + priv->pageSettings->setAcceleratedCompositingEnabled(false); +#endif url = priv->pageSettings->userStyleSheetLocation(); priv->settings.userStylesheet = eina_stringshare_add(url.string().utf8().data()); diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog index a218eed75..bf9641b43 100644 --- a/Source/WebKit/gtk/ChangeLog +++ b/Source/WebKit/gtk/ChangeLog @@ -1,3 +1,18 @@ +2012-11-25 Kaustubh Atrawalkar <kaustubh@motorola.com> + + Remove deprecated load-done signal + https://bugs.webkit.org/show_bug.cgi?id=72712 + + Reviewed by Brent Fulgham. + + Remove deprecated load-done signal and migrate to load-status. + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit): + (WebKit::FrameLoaderClient::dispatchDidFinishLoad): + * webkit/webkitwebframe.cpp: + (webkit_web_frame_class_init): + 2012-09-26 Gustavo Noronha Silva <gns@gnome.org> [GTK] Split SVG from WebCore to work-around make limitation diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index 6dc536315..8860c63ed 100644 --- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -139,13 +139,6 @@ static void notifyStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus) } } -static void loadDone(WebKitWebFrame* frame, bool didSucceed) -{ - // FIXME: load-done is deprecated. Please remove when signal's been removed. - g_signal_emit_by_name(frame, "load-done", didSucceed); - notifyStatus(frame, WEBKIT_LOAD_FINISHED); -} - WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClient::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData) { RefPtr<WebKit::DocumentLoader> loader = WebKit::DocumentLoader::create(request, substituteData); @@ -626,8 +619,7 @@ void FrameLoaderClient::dispatchDidFinishLoad() m_loadingErrorPage = false; return; } - - loadDone(m_frame, true); + notifyStatus(m_frame, WEBKIT_LOAD_FINISHED); } void FrameLoaderClient::frameLoadCompleted() diff --git a/Source/WebKit/gtk/webkit/webkitwebframe.cpp b/Source/WebKit/gtk/webkit/webkitwebframe.cpp index c1033e61d..80800c2c5 100644 --- a/Source/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebframe.cpp @@ -231,25 +231,6 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass) G_TYPE_NONE, 0); /** - * WebKitWebFrame::load-done - * @web_frame: the object on which the signal is emitted - * - * Emitted when frame loading is done. - * - * Deprecated: Use the "load-status" property instead, and/or - * WebKitWebView::load-error to be notified of load errors - */ - webkit_web_frame_signals[LOAD_DONE] = g_signal_new("load-done", - G_TYPE_FROM_CLASS(frameClass), - (GSignalFlags)G_SIGNAL_RUN_LAST, - 0, - 0, - 0, - g_cclosure_marshal_VOID__BOOLEAN, - G_TYPE_NONE, 1, - G_TYPE_BOOLEAN); - - /** * WebKitWebFrame::title-changed: * @frame: the object on which the signal is emitted * @title: the new title diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog index 86f91b300..a1eafcd63 100644 --- a/Source/WebKit/mac/ChangeLog +++ b/Source/WebKit/mac/ChangeLog @@ -1,3 +1,14 @@ +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Protect the new feature behind a feature flag. + + * Configurations/FeatureDefines.xcconfig: + 2012-11-21 Allan Sandfeld Jensen <allan.jensen@digia.com> Disambiguate innerNodeFramePoint and mainFramePoint diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig index 0e1b15340..b0d2dab41 100644 --- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -48,6 +48,7 @@ ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS; ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS; ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION; ENABLE_CSS_VARIABLES = ; +ENABLE_CSS3_BACKGROUND = ; ENABLE_CSS3_CONDITIONAL_RULES = ; ENABLE_CSS3_TEXT = ; ENABLE_CUSTOM_SCHEME_HANDLER = ; @@ -157,4 +158,4 @@ ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp index 65624d190..81571b05b 100644 --- a/Source/WebKit/qt/Api/qwebpage.cpp +++ b/Source/WebKit/qt/Api/qwebpage.cpp @@ -68,7 +68,6 @@ #include "HTMLNames.h" #include "HitTestResult.h" #include "Image.h" -#include "InitWebCoreQt.h" #include "InitWebKitQt.h" #include "InspectorClientQt.h" #include "InspectorClientWebPage.h" @@ -326,7 +325,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq) #endif WebKit::initializeWebKitWidgets(); - WebCore::initializeWebCoreQt(); Page::PageClients pageClients; pageClients.chromeClient = new ChromeClientQt(this); diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog index 4b0852a0c..af879c5b5 100644 --- a/Source/WebKit/qt/ChangeLog +++ b/Source/WebKit/qt/ChangeLog @@ -1,3 +1,72 @@ +2012-11-26 Michael Brüning <michael.bruning@digia.com> + + [Qt] QStyleFacadeImp build break with latest Qt 5 + https://bugs.webkit.org/show_bug.cgi?id=103198 + + Reviewed by Simon Hausmann. + + Original patch by J-P Nurmi <jpnurmi@digia.com>. + + Fixes QtWebKit build by replacing qobject_cast to + QMacStyle with calls to QObject::inherits. Also + replaces Q_WS_MAC preprocesser directives with Q_OS_MAC + for Qt 5 compatibility. + + * WebCoreSupport/QStyleFacadeImp.cpp: + (WebKit::QStyleFacadeImp::getButtonMetrics): + (WebKit::QStyleFacadeImp::paintComboBox): + (WebKit::QStyleFacadeImp::paintInnerSpinButton): + (WebKit::QStyleFacadeImp::paintScrollBar): + +2012-11-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135648 and r135649. + http://trac.webkit.org/changeset/135648 + http://trac.webkit.org/changeset/135649 + https://bugs.webkit.org/show_bug.cgi?id=103176 + + This change cannot be built with a qt-minimal configuration. + (Requested by zalbisser on #webkit). + + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer): + +2012-11-24 Zeno Albisser <zeno@webkit.org> + + Unreviewed Qt build fix: + + Make sure QGLWidget definition is available. + + * WebCoreSupport/PageClientQt.cpp: + +2012-11-24 Zeno Albisser <zeno@webkit.org> + + [Qt] Make sure the QGLWidget context is current when creating the TextureMapper. + https://bugs.webkit.org/show_bug.cgi?id=103142 + + When creating the TextureMapperGL for WK1 we have to make sure + that the GL context provided by the QGLWidget is current. + Otherwise the GraphicsContext3DQt created by TextureMapperGL will pick up + the wrong pointer by calling QOpenGLContext::currentContext(). + + Reviewed by Kenneth Rohde Christiansen. + + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer): + +2012-11-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135575. + http://trac.webkit.org/changeset/135575 + https://bugs.webkit.org/show_bug.cgi?id=103169 + + It made all tests assert (Requested by Ossy on #webkit). + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * WebCoreSupport/InitWebCoreQt.cpp: + (WebKit::initializeWebKitQt): + 2012-11-23 Allan Sandfeld Jensen <allan.jensen@digia.com> tst_qwebpage fails after QMimeDatabase patch diff --git a/Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp b/Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp index 385fe9c39..e75b852fe 100644 --- a/Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp @@ -62,6 +62,8 @@ Q_DECL_EXPORT void initializeWebKitQt() WebCore::RenderThemeQStyle::setStyleFactoryFunction(initCallback); WebCore::RenderThemeQt::setCustomTheme(WebCore::RenderThemeQStyle::create, new WebCore::ScrollbarThemeQStyle); } + + WebCore::initializeWebCoreQt(); } Q_DECL_EXPORT void setImagePlatformResource(const char* name, const QPixmap& pixmap) diff --git a/Source/WebKit/qt/WebCoreSupport/QStyleFacadeImp.cpp b/Source/WebKit/qt/WebCoreSupport/QStyleFacadeImp.cpp index 7fc5cc56e..3af6cf694 100644 --- a/Source/WebKit/qt/WebCoreSupport/QStyleFacadeImp.cpp +++ b/Source/WebKit/qt/WebCoreSupport/QStyleFacadeImp.cpp @@ -27,7 +27,6 @@ #include <QApplication> #include <QLineEdit> -#include <QMacStyle> #include <QPainter> #include <QPushButton> #include <QStyleFactory> @@ -221,7 +220,7 @@ void QStyleFacadeImp::getButtonMetrics(QString *buttonFontFamily, int *buttonFon QFont defaultButtonFont = QApplication::font(&button); *buttonFontFamily = defaultButtonFont.family(); *buttonFontPixelSize = 0; -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC button.setAttribute(Qt::WA_MacSmallSize); QFontInfo fontInfo(defaultButtonFont); *buttonFontPixelSize = fontInfo.pixelSize(); @@ -275,11 +274,11 @@ void QStyleFacadeImp::paintComboBox(QPainter *painter, const QStyleFacadeOption IntRect rect = opt.rect; -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) // QMacStyle makes the combo boxes a little bit smaller to leave space for the focus rect. // Because of it, the combo button is drawn at a point to the left of where it was expect to be and may end up // overlapped with the text. This will force QMacStyle to draw the combo box with the expected width. - if (qobject_cast<QMacStyle*>(m_style)) + if (m_style->inherits("QMacStyle")) rect.inflateX(3); #endif @@ -359,11 +358,11 @@ void QStyleFacadeImp::paintInnerSpinButton(QPainter* painter, const QStyleFacade // Default to moving the buttons a little bit within the editor frame. int inflateX = -2; int inflateY = -2; -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) // QMacStyle will position the aqua buttons flush to the right. // This will move them more within the control for better style, a la // Chromium look & feel. - if (qobject_cast<QMacStyle*>(m_style)) { + if (m_style->inherits("QMacStyle")) { inflateX = -4; // Render mini aqua spin buttons for QMacStyle to fit nicely into // the editor area, like Chromium. @@ -451,10 +450,10 @@ void QStyleFacadeImp::paintScrollBar(QPainter *painter, const QStyleFacadeOption MappedStyleOption<QStyleOptionSlider> opt(widget, proxyOption); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC // FIXME: We also need to check the widget style but today ScrollbarTheme is not aware of the page so we // can't get the widget. - if (qobject_cast<QMacStyle*>(m_style)) + if (m_style->inherits("QMacStyle")) m_style->drawComplexControl(QStyle::CC_ScrollBar, &opt, painter, widget); else #endif diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 576cd0538..71a25bbfe 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,169 @@ +2012-11-25 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [WK2] TiledBackingStore: page contents is scaled wrongly + https://bugs.webkit.org/show_bug.cgi?id=103090 + + Reviewed by Kenneth Rohde Christiansen. + + Before this change the page contents scaling in PageViewportController was + defined all the times by m_rawAttributes.initialScale. If initial scale had not + been specified in the viewport meta tag it was set to m_minimumScaleToFit inside + PageViewportController::didChangeViewportAttributes(). + + The problem was that m_minimumScaleToFit could have wrong value as contents size + might have not be updated by the time PageViewportController::didChangeViewportAttributes() + was invoked. + + The solution is to use m_minimumScaleToFit for contents scaling if initial scale + is not specified in the viewport meta tag, as it is updated all the time. + Also a flag m_initiallyFitToViewport is added to PageViewportController to detect + whether m_minimumScaleToFit should be used for scaling. + + * UIProcess/PageViewportController.cpp: + (WebKit::PageViewportController::PageViewportController): + (WebKit::PageViewportController::didChangeContentsSize): + (WebKit::PageViewportController::pageTransitionViewportReady): + (WebKit::PageViewportController::didChangeViewportAttributes): + * UIProcess/PageViewportController.h: + (PageViewportController): + +2012-11-24 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [EFL][WK2] Stop the mess with DECLARE_EWK_VIEW_CALLBACK arg type definition + https://bugs.webkit.org/show_bug.cgi?id=103187 + + Reviewed by Kenneth Rohde Christiansen. + + Now the client should pass to DECLARE_EWK_VIEW_CALLBACK macro exacly the + same arg type s/he wants to have in the Ewk_View callback. + + * UIProcess/API/efl/EwkViewCallbacks.h: + (EvasObjectHolder): + (EwkViewCallbacks::EvasObjectHolder::EvasObjectHolder): + (EwkViewCallbacks): + +2012-11-24 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> + + [EFL][WK2] Check errors in EwkView callbacks usage at compile time + https://bugs.webkit.org/show_bug.cgi?id=103177 + + Reviewed by Kenneth Rohde Christiansen. + + Errors in EwkView callbacks usage are now checked at compile time. + + * UIProcess/API/efl/EwkViewCallbacks.h: + (CallBack): + (EwkViewCallbacks::CallBack::CallBack): + (EwkViewCallbacks::CallBack::call): + +2012-11-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135575. + http://trac.webkit.org/changeset/135575 + https://bugs.webkit.org/show_bug.cgi?id=103169 + + It made all tests assert (Requested by Ossy on #webkit). + + * qt/MainQt.cpp: + (WebKit): + (main): + +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Protect the new feature behind a feature flag. + + * Configurations/FeatureDefines.xcconfig: + +2012-11-23 Huang Dongsung <luxtella@company100.net> + + Coordinated Graphics: Match the behavior of selfOrAncestorHaveNonAffineTransforms() to its name. + https://bugs.webkit.org/show_bug.cgi?id=103097 + + Reviewed by Noam Rosenthal. + + CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms() does + not check its ancestor. This patch makes this method check its ancestor + to match its name. + + * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp: + (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms): + +2012-11-23 Huang Dongsung <luxtella@company100.net> + + Coordinated Graphics: LayerTreeRenderer::removeTile() does not remove tiles actually. + https://bugs.webkit.org/show_bug.cgi?id=103030 + + Reviewed by Noam Rosenthal. + + LayerTreeRenderer::removeTile() must add a backing store into + m_backingStoresWithPendingBuffers. Otherwise, tiles are not removed. + + * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: + (WebKit::LayerTreeRenderer::removeTile): + +2012-11-23 Huang Dongsung <luxtella@company100.net> + + [TexMap] Remove dependency of TextureMapperLayer on GraphicsLayerTextureMapper. + https://bugs.webkit.org/show_bug.cgi?id=103046 + + Reviewed by Noam Rosenthal. + + This patch makes GraphicsLayerTextureMapper create its own backing + store. However, LayerTreeRenderer also creates its own backing store. So + when LayerTreeRenderer uses GraphicsLayerTextureMapper, + LayerTreeRenderer needs GraphicsLayerTextureMapper to not create its own + backing store. + + * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: + (WebKit::LayerTreeRenderer::createLayer): + (WebKit::LayerTreeRenderer::getBackingStore): + +2012-11-23 Huang Dongsung <luxtella@company100.net> + + REGRESSION(r135486): ASSERT(isMainThread()) hit in LayerTreeRenderer::setActive(bool) + https://bugs.webkit.org/show_bug.cgi?id=103077 + + Reviewed by Noam Rosenthal. + + Currently, the painting thread uses purgeGLResources() and setActive(). + QQuickWebPage::updatePaintNode() indirectly calls both methods after + locking the main thread. + + This patch changes two points. + 1. Remove ASSERT(isMainThread()) in methods that the painting thread can + call. + 2. Make purgeGLResources() and setActive() call methods of + LayerTreeCoordinatorProxy via dispatchOnMainThread(). + + * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: + (WebKit::LayerTreeRenderer::LayerTreeRenderer): + (WebKit::LayerTreeRenderer::renderNextFrame): + (WebKit::LayerTreeRenderer::purgeGLResources): + (WebKit): + (WebKit::LayerTreeRenderer::purgeBackingStores): + (WebKit::LayerTreeRenderer::setActive): + * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h: + (LayerTreeRenderer): + +2012-11-23 Christophe Dumez <christophe.dumez@intel.com> + + [EFL][WK2][AC] EwkViewImpl::transformToScreen() does not retrieve the Ecore_X_Window properly + https://bugs.webkit.org/show_bug.cgi?id=103133 + + Reviewed by Kenneth Rohde Christiansen. + + If accelerated compositing is enabled, EwkViewImpl::transformToScreen() should + attempt to retrieve the Ecore_X_Window using ecore_evas_gl_x11_window_get() first + and only fall back to ecore_evas_software_x11_window_get(). + + * UIProcess/API/efl/EwkViewImpl.cpp: + (EwkViewImpl::transformToScreen): + 2012-11-23 Wojciech Bielawski <w.bielawski@samsung.com> [WK2][WKTR] WebKitTestRunner needs eventSender.contextClick() diff --git a/Source/WebKit2/Configurations/FeatureDefines.xcconfig b/Source/WebKit2/Configurations/FeatureDefines.xcconfig index 0e1b15340..b0d2dab41 100644 --- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig +++ b/Source/WebKit2/Configurations/FeatureDefines.xcconfig @@ -48,6 +48,7 @@ ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS; ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS; ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION; ENABLE_CSS_VARIABLES = ; +ENABLE_CSS3_BACKGROUND = ; ENABLE_CSS3_CONDITIONAL_RULES = ; ENABLE_CSS3_TEXT = ; ENABLE_CUSTOM_SCHEME_HANDLER = ; @@ -157,4 +158,4 @@ ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT); diff --git a/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h b/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h index 4140c742b..cf822a2ed 100644 --- a/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h +++ b/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h @@ -96,63 +96,58 @@ enum CallbackType { #endif }; -template<typename T> -inline bool callbackArgumentsExpected() -{ - return true; -} +template <CallbackType> +struct CallBackInfo; -template<> -inline bool callbackArgumentsExpected<void>() -{ - return false; -} +class EvasObjectHolder { +protected: + explicit EvasObjectHolder(Evas_Object* object) + : m_object(object) + { + ASSERT(m_object); + } -template <CallbackType> -struct CallBackInfo { - typedef void* Type; + Evas_Object* m_object; +}; - static inline const char* name() +template <CallbackType callbackType, typename ArgType = typename CallBackInfo<callbackType>::Type> +struct CallBack: public EvasObjectHolder { + explicit CallBack(Evas_Object* view) : EvasObjectHolder(view) { } + + void call(ArgType argument) { - ASSERT_NOT_REACHED(); - return ""; + evas_object_smart_callback_call(m_object, CallBackInfo<callbackType>::name(), static_cast<void*>(argument)); } }; template <CallbackType callbackType> -class CallBack { -public: - typedef typename CallBackInfo<callbackType>::Type ArgType; +struct CallBack <callbackType, void> : public EvasObjectHolder { + explicit CallBack(Evas_Object* view) : EvasObjectHolder(view) { } - explicit CallBack(Evas_Object* view) - : m_view(view) + void call() { - ASSERT(m_view); + evas_object_smart_callback_call(m_object, CallBackInfo<callbackType>::name(), 0); } +}; - void call(ArgType* argument = 0) - { - if (argument && !callbackArgumentsExpected<ArgType>()) { - CRITICAL("should not pass arguments for this callback!"); - ASSERT_NOT_REACHED(); - return; - } +template <CallbackType callbackType> +struct CallBack <callbackType, const char*> : public EvasObjectHolder { + explicit CallBack(Evas_Object* view) : EvasObjectHolder(view) { } - evas_object_smart_callback_call(m_view, CallBackInfo<callbackType>::name(), static_cast<void*>(argument)); + void call(const char* arg) + { + evas_object_smart_callback_call(m_object, CallBackInfo<callbackType>::name(), const_cast<char*>(arg)); } void call(const String& arg) { - call(const_cast<char*>(arg.utf8().data())); + call(arg.utf8().data()); } void call(const WKEinaSharedString& arg) { - call(const_cast<char*>(static_cast<const char*>(arg))); + call(static_cast<const char*>(arg)); } - -private: - Evas_Object* m_view; }; #define DECLARE_EWK_VIEW_CALLBACK(callbackType, string, type) \ @@ -163,45 +158,45 @@ struct CallBackInfo<callbackType> { \ } // Note: type 'void' means that no arguments are expected. -DECLARE_EWK_VIEW_CALLBACK(AuthenticationRequest, "authentication,request", Ewk_Auth_Request); +DECLARE_EWK_VIEW_CALLBACK(AuthenticationRequest, "authentication,request", Ewk_Auth_Request*); DECLARE_EWK_VIEW_CALLBACK(BackForwardListChange, "back,forward,list,changed", void); DECLARE_EWK_VIEW_CALLBACK(CancelVibration, "cancel,vibration", void); -DECLARE_EWK_VIEW_CALLBACK(DownloadJobCancelled, "download,cancelled", Ewk_Download_Job); -DECLARE_EWK_VIEW_CALLBACK(DownloadJobFailed, "download,failed", Ewk_Download_Job_Error); -DECLARE_EWK_VIEW_CALLBACK(DownloadJobFinished, "download,finished", Ewk_Download_Job); -DECLARE_EWK_VIEW_CALLBACK(DownloadJobRequested, "download,request", Ewk_Download_Job); -DECLARE_EWK_VIEW_CALLBACK(FileChooserRequest, "file,chooser,request", Ewk_File_Chooser_Request); -DECLARE_EWK_VIEW_CALLBACK(NewFormSubmissionRequest, "form,submission,request", Ewk_Form_Submission_Request); +DECLARE_EWK_VIEW_CALLBACK(DownloadJobCancelled, "download,cancelled", Ewk_Download_Job*); +DECLARE_EWK_VIEW_CALLBACK(DownloadJobFailed, "download,failed", Ewk_Download_Job_Error*); +DECLARE_EWK_VIEW_CALLBACK(DownloadJobFinished, "download,finished", Ewk_Download_Job*); +DECLARE_EWK_VIEW_CALLBACK(DownloadJobRequested, "download,request", Ewk_Download_Job*); +DECLARE_EWK_VIEW_CALLBACK(FileChooserRequest, "file,chooser,request", Ewk_File_Chooser_Request*); +DECLARE_EWK_VIEW_CALLBACK(NewFormSubmissionRequest, "form,submission,request", Ewk_Form_Submission_Request*); DECLARE_EWK_VIEW_CALLBACK(IconChanged, "icon,changed", void); -DECLARE_EWK_VIEW_CALLBACK(LoadError, "load,error", Ewk_Error); +DECLARE_EWK_VIEW_CALLBACK(LoadError, "load,error", Ewk_Error*); DECLARE_EWK_VIEW_CALLBACK(LoadFinished, "load,finished", void); -DECLARE_EWK_VIEW_CALLBACK(LoadProgress, "load,progress", double); -DECLARE_EWK_VIEW_CALLBACK(ProvisionalLoadFailed, "load,provisional,failed", Ewk_Error); +DECLARE_EWK_VIEW_CALLBACK(LoadProgress, "load,progress", double*); +DECLARE_EWK_VIEW_CALLBACK(ProvisionalLoadFailed, "load,provisional,failed", Ewk_Error*); DECLARE_EWK_VIEW_CALLBACK(ProvisionalLoadRedirect, "load,provisional,redirect", void); DECLARE_EWK_VIEW_CALLBACK(ProvisionalLoadStarted, "load,provisional,started", void); -DECLARE_EWK_VIEW_CALLBACK(MenuBarVisible, "menubar,visible", bool); -DECLARE_EWK_VIEW_CALLBACK(NavigationPolicyDecision, "policy,decision,navigation", Ewk_Navigation_Policy_Decision); -DECLARE_EWK_VIEW_CALLBACK(NewWindowPolicyDecision, "policy,decision,new,window", Ewk_Navigation_Policy_Decision); -DECLARE_EWK_VIEW_CALLBACK(ResourceLoadStarted, "resource,request,new", Ewk_Resource_Request); -DECLARE_EWK_VIEW_CALLBACK(ResourceLoadResponse, "resource,request,response", Ewk_Resource_Load_Response); -DECLARE_EWK_VIEW_CALLBACK(ResourceLoadFailed, "resource,request,failed", Ewk_Resource_Load_Error); -DECLARE_EWK_VIEW_CALLBACK(ResourceLoadFinished, "resource,request,finished", Ewk_Resource); -DECLARE_EWK_VIEW_CALLBACK(ResourceRequestSent, "resource,request,sent", Ewk_Resource_Request); -DECLARE_EWK_VIEW_CALLBACK(StatusBarVisible, "statusbar,visible", bool); -DECLARE_EWK_VIEW_CALLBACK(TextFound, "text,found", unsigned); -DECLARE_EWK_VIEW_CALLBACK(TitleChange, "title,changed", char); -DECLARE_EWK_VIEW_CALLBACK(ToolbarVisible, "toolbar,visible", bool); +DECLARE_EWK_VIEW_CALLBACK(MenuBarVisible, "menubar,visible", bool*); +DECLARE_EWK_VIEW_CALLBACK(NavigationPolicyDecision, "policy,decision,navigation", Ewk_Navigation_Policy_Decision*); +DECLARE_EWK_VIEW_CALLBACK(NewWindowPolicyDecision, "policy,decision,new,window", Ewk_Navigation_Policy_Decision*); +DECLARE_EWK_VIEW_CALLBACK(ResourceLoadStarted, "resource,request,new", Ewk_Resource_Request*); +DECLARE_EWK_VIEW_CALLBACK(ResourceLoadResponse, "resource,request,response", Ewk_Resource_Load_Response*); +DECLARE_EWK_VIEW_CALLBACK(ResourceLoadFailed, "resource,request,failed", Ewk_Resource_Load_Error*); +DECLARE_EWK_VIEW_CALLBACK(ResourceLoadFinished, "resource,request,finished", Ewk_Resource*); +DECLARE_EWK_VIEW_CALLBACK(ResourceRequestSent, "resource,request,sent", Ewk_Resource_Request*); +DECLARE_EWK_VIEW_CALLBACK(StatusBarVisible, "statusbar,visible", bool*); +DECLARE_EWK_VIEW_CALLBACK(TextFound, "text,found", unsigned*); +DECLARE_EWK_VIEW_CALLBACK(TitleChange, "title,changed", const char*); +DECLARE_EWK_VIEW_CALLBACK(ToolbarVisible, "toolbar,visible", bool*); DECLARE_EWK_VIEW_CALLBACK(TooltipTextUnset, "tooltip,text,unset", void); -DECLARE_EWK_VIEW_CALLBACK(TooltipTextSet, "tooltip,text,set", char); -DECLARE_EWK_VIEW_CALLBACK(URLChanged, "url,changed", char); -DECLARE_EWK_VIEW_CALLBACK(Vibrate, "vibrate", uint64_t); -DECLARE_EWK_VIEW_CALLBACK(WebProcessCrashed, "webprocess,crashed", bool); -DECLARE_EWK_VIEW_CALLBACK(WindowResizable, "window,resizable", bool); +DECLARE_EWK_VIEW_CALLBACK(TooltipTextSet, "tooltip,text,set", const char*); +DECLARE_EWK_VIEW_CALLBACK(URLChanged, "url,changed", const char*); +DECLARE_EWK_VIEW_CALLBACK(Vibrate, "vibrate", uint64_t*); +DECLARE_EWK_VIEW_CALLBACK(WebProcessCrashed, "webprocess,crashed", bool*); +DECLARE_EWK_VIEW_CALLBACK(WindowResizable, "window,resizable", bool*); #if ENABLE(WEB_INTENTS) -DECLARE_EWK_VIEW_CALLBACK(IntentRequest, "intent,request,new", Ewk_Intent); +DECLARE_EWK_VIEW_CALLBACK(IntentRequest, "intent,request,new", Ewk_Intent*); #endif #if ENABLE(WEB_INTENTS_TAG) -DECLARE_EWK_VIEW_CALLBACK(IntentServiceRegistration, "intent,service,register", Ewk_Intent_Service); +DECLARE_EWK_VIEW_CALLBACK(IntentServiceRegistration, "intent,service,register", Ewk_Intent_Service*); #endif } diff --git a/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp b/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp index e0c59054d..29161ff23 100644 --- a/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp +++ b/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp @@ -314,7 +314,14 @@ AffineTransform EwkViewImpl::transformToScreen() const #ifdef HAVE_ECORE_X Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(sd->base.evas); - Ecore_X_Window window = ecore_evas_software_x11_window_get(ecoreEvas); // Returns 0 if none. + + Ecore_X_Window window; +#if USE(ACCELERATED_COMPOSITING) + window = ecore_evas_gl_x11_window_get(ecoreEvas); + // Fallback to software mode if necessary. + if (!window) +#endif + window = ecore_evas_software_x11_window_get(ecoreEvas); // Returns 0 if none. int x, y; // x, y are relative to parent (in a reparenting window manager). while (window) { diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp index 305882edd..0c009ec48 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp @@ -68,8 +68,8 @@ static FloatPoint boundedScrollPosition(const FloatPoint& scrollPosition, const LayerTreeRenderer::LayerTreeRenderer(LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy) : m_layerTreeCoordinatorProxy(layerTreeCoordinatorProxy) - , m_rootLayerID(InvalidWebLayerID) , m_isActive(false) + , m_rootLayerID(InvalidWebLayerID) , m_animationsLocked(false) #if ENABLE(REQUEST_ANIMATION_FRAME) , m_animationFrameRequested(false) @@ -86,9 +86,8 @@ LayerTreeRenderer::~LayerTreeRenderer() PassOwnPtr<GraphicsLayer> LayerTreeRenderer::createLayer(WebLayerID) { - GraphicsLayer* newLayer = new GraphicsLayerTextureMapper(this); - TextureMapperLayer* layer = toTextureMapperLayer(newLayer); - layer->setShouldUpdateBackingStoreFromLayer(false); + GraphicsLayerTextureMapper* newLayer = new GraphicsLayerTextureMapper(this); + newLayer->setHasOwnBackingStore(false); return adoptPtr(newLayer); } @@ -411,7 +410,7 @@ PassRefPtr<CoordinatedBackingStore> LayerTreeRenderer::getBackingStore(GraphicsL RefPtr<CoordinatedBackingStore> backingStore = static_cast<CoordinatedBackingStore*>(layer->backingStore().get()); if (!backingStore) { backingStore = CoordinatedBackingStore::create(); - layer->setBackingStore(backingStore.get()); + layer->setBackingStore(backingStore); } ASSERT(backingStore); return backingStore; @@ -452,6 +451,7 @@ void LayerTreeRenderer::removeTile(WebLayerID layerID, int tileID) RefPtr<CoordinatedBackingStore> backingStore = getBackingStore(layer); backingStore->removeTile(tileID); resetBackingStoreSizeToLayerSize(layer); + m_backingStoresWithPendingBuffers.add(backingStore); removeBackingStoreIfNeeded(layer); } @@ -550,7 +550,6 @@ void LayerTreeRenderer::flushLayerChanges() void LayerTreeRenderer::renderNextFrame() { - ASSERT(isMainThread()); if (m_layerTreeCoordinatorProxy) m_layerTreeCoordinatorProxy->renderNextFrame(); } @@ -593,7 +592,6 @@ void LayerTreeRenderer::syncRemoteContent() void LayerTreeRenderer::purgeGLResources() { - ASSERT(isMainThread()); TextureMapperLayer* layer = toTextureMapperLayer(rootLayer()); if (layer) @@ -613,6 +611,11 @@ void LayerTreeRenderer::purgeGLResources() m_backingStoresWithPendingBuffers.clear(); setActive(false); + dispatchOnMainThread(bind(&LayerTreeRenderer::purgeBackingStores, this)); +} + +void LayerTreeRenderer::purgeBackingStores() +{ if (m_layerTreeCoordinatorProxy) m_layerTreeCoordinatorProxy->purgeBackingStores(); } @@ -659,7 +662,6 @@ void LayerTreeRenderer::appendUpdate(const Function<void()>& function) void LayerTreeRenderer::setActive(bool active) { - ASSERT(isMainThread()); if (m_isActive == active) return; @@ -669,7 +671,7 @@ void LayerTreeRenderer::setActive(bool active) m_renderQueue.clear(); m_isActive = active; if (m_isActive) - renderNextFrame(); + dispatchOnMainThread(bind(&LayerTreeRenderer::renderNextFrame, this)); } void LayerTreeRenderer::setBackgroundColor(const WebCore::Color& color) diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h index 40333cfa1..b081c5e16 100644 --- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h +++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h @@ -67,7 +67,6 @@ public: }; explicit LayerTreeRenderer(LayerTreeCoordinatorProxy*); virtual ~LayerTreeRenderer(); - void purgeGLResources(); void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&, WebCore::TextureMapper::PaintFlags = 0); void paintToGraphicsContext(BackingStore::PlatformGraphicsContext); void setContentsSize(const WebCore::FloatSize&); @@ -81,6 +80,10 @@ public: void detach(); void appendUpdate(const Function<void()>&); + + // The painting thread must lock the main thread to use below two methods, because two methods access members that the main thread manages. See m_layerTreeCoordinatorProxy. + // Currently, QQuickWebPage::updatePaintNode() locks the main thread before calling both methods. + void purgeGLResources(); void setActive(bool); void deleteLayer(WebLayerID); @@ -111,7 +114,6 @@ public: #if ENABLE(REQUEST_ANIMATION_FRAME) void requestAnimationFrame(); - void animationFrameReady(); #endif private: @@ -121,22 +123,27 @@ private: WebCore::GraphicsLayer* rootLayer() { return m_rootLayer.get(); } void syncRemoteContent(); + void adjustPositionForFixedLayers(); // Reimplementations from WebCore::GraphicsLayerClient. virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double) { } virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) { } virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect&) OVERRIDE { } - void updateViewport(); void dispatchOnMainThread(const Function<void()>&); - void adjustPositionForFixedLayers(); + void updateViewport(); +#if ENABLE(REQUEST_ANIMATION_FRAME) + void animationFrameReady(); +#endif + void renderNextFrame(); + void purgeBackingStores(); + void assignImageBackingToLayer(WebCore::GraphicsLayer*, CoordinatedImageBackingID); void removeReleasedImageBackingsIfNeeded(); void ensureRootLayer(); void ensureLayer(WebLayerID); void commitTileOperations(); - void renderNextFrame(); PassRefPtr<CoordinatedBackingStore> getBackingStore(WebCore::GraphicsLayer*); void removeBackingStoreIfNeeded(WebCore::GraphicsLayer*); @@ -163,7 +170,10 @@ private: SurfaceBackingStoreMap m_surfaceBackingStores; #endif + // Below two members are accessed by only the main thread. The painting thread must lock the main thread to access both members. LayerTreeCoordinatorProxy* m_layerTreeCoordinatorProxy; + bool m_isActive; + OwnPtr<WebCore::GraphicsLayer> m_rootLayer; LayerMap m_layers; @@ -171,7 +181,6 @@ private: WebLayerID m_rootLayerID; WebCore::IntPoint m_renderedContentsScrollPosition; WebCore::IntPoint m_pendingRenderedContentsScrollPosition; - bool m_isActive; bool m_animationsLocked; #if ENABLE(REQUEST_ANIMATION_FRAME) bool m_animationFrameRequested; diff --git a/Source/WebKit2/UIProcess/PageViewportController.cpp b/Source/WebKit2/UIProcess/PageViewportController.cpp index 5de791920..7c43a5546 100644 --- a/Source/WebKit2/UIProcess/PageViewportController.cpp +++ b/Source/WebKit2/UIProcess/PageViewportController.cpp @@ -44,6 +44,7 @@ PageViewportController::PageViewportController(WebKit::WebPageProxy* proxy, Page , m_client(client) , m_allowsUserScaling(false) , m_minimumScaleToFit(1) + , m_initiallyFitToViewport(true) , m_hasSuspendedContent(false) , m_hadUserInteraction(false) , m_effectiveScale(1) @@ -109,7 +110,17 @@ void PageViewportController::didCommitLoad() void PageViewportController::didChangeContentsSize(const IntSize& newSize) { m_contentsSize = newSize; - if (updateMinimumScaleToFit()) + + bool minimumScaleUpdated = updateMinimumScaleToFit(); + + if (m_initiallyFitToViewport) { + // Restrict scale factors to m_minimumScaleToFit. + ASSERT(m_minimumScaleToFit > 0); + m_rawAttributes.initialScale = m_minimumScaleToFit; + WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(m_rawAttributes); + } + + if (minimumScaleUpdated) m_client->didChangeViewportAttributes(); } @@ -149,8 +160,8 @@ void PageViewportController::pageTransitionViewportReady() { if (!m_rawAttributes.layoutSize.isEmpty()) { m_hadUserInteraction = false; - ASSERT(m_rawAttributes.initialScale > 0); - applyScaleAfterRenderingContents(innerBoundedViewportScale(toViewportScale(m_rawAttributes.initialScale))); + float initialScale = m_initiallyFitToViewport ? m_minimumScaleToFit : m_rawAttributes.initialScale; + applyScaleAfterRenderingContents(innerBoundedViewportScale(toViewportScale(initialScale))); } // At this point we should already have received the first viewport arguments and the requested scroll @@ -218,18 +229,12 @@ void PageViewportController::didChangeViewportAttributes(const WebCore::Viewport m_rawAttributes = newAttributes; m_allowsUserScaling = !!m_rawAttributes.userScalable; + m_initiallyFitToViewport = (m_rawAttributes.initialScale < 0); - bool minimumScaleUpdated = updateMinimumScaleToFit(); - - ASSERT(m_minimumScaleToFit > 0); - - // Set the initial scale if it was not specified in the viewport meta tag. - if (m_rawAttributes.initialScale < 0) - m_rawAttributes.initialScale = m_minimumScaleToFit; + if (!m_initiallyFitToViewport) + WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(m_rawAttributes); - WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(m_rawAttributes); - - if (minimumScaleUpdated) + if (updateMinimumScaleToFit()) m_client->didChangeViewportAttributes(); } diff --git a/Source/WebKit2/UIProcess/PageViewportController.h b/Source/WebKit2/UIProcess/PageViewportController.h index 3be3d2745..052e89ab0 100644 --- a/Source/WebKit2/UIProcess/PageViewportController.h +++ b/Source/WebKit2/UIProcess/PageViewportController.h @@ -94,6 +94,7 @@ private: bool m_allowsUserScaling; float m_minimumScaleToFit; + bool m_initiallyFitToViewport; bool m_hasSuspendedContent; bool m_hadUserInteraction; diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp index e5639cf79..c7808b2b2 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp @@ -860,7 +860,10 @@ bool CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms() if (!m_layerTransform.combined().isAffine()) return true; - return false; + if (!parent()) + return false; + + return toCoordinatedGraphicsLayer(parent())->selfOrAncestorHaveNonAffineTransforms(); } bool CoordinatedGraphicsLayer::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& keyframesName, double delayAsNegativeTimeOffset) diff --git a/Source/WebKit2/qt/MainQt.cpp b/Source/WebKit2/qt/MainQt.cpp index 17ad8537d..0990c01f8 100644 --- a/Source/WebKit2/qt/MainQt.cpp +++ b/Source/WebKit2/qt/MainQt.cpp @@ -45,6 +45,7 @@ Q_DECL_IMPORT int WebProcessMainQt(QGuiApplication*); #if !defined(QT_NO_WIDGETS) Q_DECL_IMPORT void initializeWebKitWidgets(); #endif +Q_DECL_IMPORT void initializeWebKitQt(); } #if !defined(NDEBUG) && defined(Q_OS_UNIX) @@ -95,7 +96,10 @@ int main(int argc, char** argv) #if !defined(QT_NO_WIDGETS) if (qgetenv("QT_WEBKIT_THEME_NAME") == "qstyle") WebKit::initializeWebKitWidgets(); + else #endif + WebKit::initializeWebKitQt(); + return WebKit::WebProcessMainQt(appInstance); } diff --git a/Source/cmake/OptionsCommon.cmake b/Source/cmake/OptionsCommon.cmake index 43a212f3e..70105980c 100644 --- a/Source/cmake/OptionsCommon.cmake +++ b/Source/cmake/OptionsCommon.cmake @@ -30,7 +30,7 @@ STRING(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCES IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|x86)" AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") # To avoid out of memory when building with debug option in 32bit system. # See https://bugs.webkit.org/show_bug.cgi?id=77327 - SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-keep-memory") + SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-keep-memory ${CMAKE_SHARED_LINKER_FLAGS}") ENDIF () SET(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)") diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake index 6a287f3ce..11578c27e 100644 --- a/Source/cmake/OptionsEfl.cmake +++ b/Source/cmake/OptionsEfl.cmake @@ -4,8 +4,6 @@ SET(PROJECT_VERSION_PATCH 0) SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) ADD_DEFINITIONS(-DBUILDING_EFL__=1) -ADD_DEFINITIONS(-DWTF_PLATFORM_EFL=1) -SET(WTF_PLATFORM_EFL 1) FIND_PACKAGE(Cairo 1.10.2 REQUIRED) FIND_PACKAGE(Fontconfig 2.8.0 REQUIRED) diff --git a/Source/cmake/OptionsWindows.cmake b/Source/cmake/OptionsWindows.cmake index 8f6256c0b..6234b0dd3 100644 --- a/Source/cmake/OptionsWindows.cmake +++ b/Source/cmake/OptionsWindows.cmake @@ -14,8 +14,8 @@ IF (MSVC) STRING(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable RTTI IF (NOT MSVC_VERSION LESS 1500) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") + SET(CMAKE_C_FLAGS "/MP ${CMAKE_C_FLAGS}") + SET(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}") ENDIF () ENDIF () diff --git a/Source/cmake/WebKitFeatures.cmake b/Source/cmake/WebKitFeatures.cmake index 44ab67dae..0b25c2068 100644 --- a/Source/cmake/WebKitFeatures.cmake +++ b/Source/cmake/WebKitFeatures.cmake @@ -20,6 +20,7 @@ MACRO (WEBKIT_OPTION_BEGIN) WEBKIT_OPTION_DEFINE(ENABLE_BLOB "Toggle Blob support" OFF) WEBKIT_OPTION_DEFINE(ENABLE_CHANNEL_MESSAGING "Toggle MessageChannel and MessagePort support" ON) WEBKIT_OPTION_DEFINE(ENABLE_CSP_NEXT "Toggle Content Security Policy 1.1 support" OFF) + WEBKIT_OPTION_DEFINE(ENABLE_CSS3_BACKGROUND "Toggle CSS3 Background support" OFF) WEBKIT_OPTION_DEFINE(ENABLE_CSS3_CONDITIONAL_RULES "Toggle CSS3 Conditional Rules support" OFF) WEBKIT_OPTION_DEFINE(ENABLE_CSS3_TEXT "Toggle CSS3 Text support" OFF) WEBKIT_OPTION_DEFINE(ENABLE_CSS_BOX_DECORATION_BREAK "Toggle Box Decoration Break (CSS Backgrounds and Borders) support" ON) diff --git a/Source/cmake/WebKitHelpers.cmake b/Source/cmake/WebKitHelpers.cmake index dab5807fb..23b219b00 100644 --- a/Source/cmake/WebKitHelpers.cmake +++ b/Source/cmake/WebKitHelpers.cmake @@ -21,7 +21,7 @@ MACRO(WEBKIT_SET_EXTRA_COMPILER_FLAGS _target) # Disable some optimizations on buggy compiler versions # GCC 4.5.1 does not implement -ftree-sra correctly IF (${COMPILER_VERSION} STREQUAL "4.5.1") - SET(OLD_COMPILE_FLAGS "${OLD_COMPILE_FLAGS} -fno-tree-sra") + SET(OLD_COMPILE_FLAGS "-fno-tree-sra ${OLD_COMPILE_FLAGS}") ENDIF () IF (NOT SHARED_CORE) @@ -42,7 +42,7 @@ MACRO(WEBKIT_SET_EXTRA_COMPILER_FLAGS _target) # Enable errors on warning IF (OPTION_ENABLE_WERROR) - SET(OLD_COMPILE_FLAGS "${OLD_COMPILE_FLAGS} -Werror -Wno-error=unused-parameter") + SET(OLD_COMPILE_FLAGS "-Werror -Wno-error=unused-parameter ${OLD_COMPILE_FLAGS}") ENDIF () # Disable C++0x compat warnings for GCC >= 4.6.0 until we build diff --git a/Source/cmake/WebKitMacros.cmake b/Source/cmake/WebKitMacros.cmake index c8138a96a..86e69439a 100644 --- a/Source/cmake/WebKitMacros.cmake +++ b/Source/cmake/WebKitMacros.cmake @@ -161,11 +161,16 @@ ENDMACRO () MACRO (GENERATE_GRAMMAR _prefix _input _output_header _output_source _features) + # This is a workaround for winflexbison, which does not work corretly when + # run in a different working directory than the installation directory. + GET_FILENAME_COMPONENT(_working_directory ${BISON_EXECUTABLE} PATH) + ADD_CUSTOM_COMMAND( OUTPUT ${_output_header} ${_output_source} MAIN_DEPENDENCY ${_input} DEPENDS ${_input} COMMAND ${PERL_EXECUTABLE} -I ${WEBCORE_DIR}/bindings/scripts ${WEBCORE_DIR}/css/makegrammar.pl --outputDir ${DERIVED_SOURCES_WEBCORE_DIR} --extraDefines "${_features}" --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" --bison "${BISON_EXECUTABLE}" --symbolsPrefix ${_prefix} ${_input} + WORKING_DIRECTORY ${_working_directory} VERBATIM) ENDMACRO () diff --git a/Source/cmakeconfig.h.cmake b/Source/cmakeconfig.h.cmake index 3cd14bc81..0a71369f2 100644 --- a/Source/cmakeconfig.h.cmake +++ b/Source/cmakeconfig.h.cmake @@ -26,6 +26,7 @@ #cmakedefine01 ENABLE_CSS_SHADERS #cmakedefine01 ENABLE_CSS_STICKY_POSITION #cmakedefine01 ENABLE_CSS_VARIABLES +#cmakedefine01 ENABLE_CSS3_BACKGROUND #cmakedefine01 ENABLE_CSS3_CONDITIONAL_RULES #cmakedefine01 ENABLE_CUSTOM_SCHEME_HANDLER #cmakedefine01 ENABLE_DATALIST_ELEMENT diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 59f37ca69..8803a6f47 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,155 @@ +2012-11-24 Zan Dobersek <zandobersek@gmail.com> + + Add the --order option to NRWT + https://bugs.webkit.org/show_bug.cgi?id=102229 + + Reviewed by Dirk Pranke. + + The --order option controls in what order the gathered tests will be run. + There are 3 options: + - natural, the tests are sorted in natural order, + - random, the tests are sorted in random order, + - none, the tests are kept in the order in which they were specified through + arguments or the test list. + + The natural option is the default one and maintains the current behavior. + + The none option is primarily intended to be used with the --test-list option, + with the test list file expected to list specific test names. + When a directory is specified as one of the paths from under which tests should + be gathered and the none option is used, that path will expand to all the tests + under it, with these tests sorted in the natural order. + + Using --order=random duplicated the behavior of the --randomize-order option, so + the latter is removed. + + This patch also incorporates the change with which makes it is possible to specify + a test via arguments or the test list multiple tests and then have the test run + that many times. + + * Scripts/webkitpy/common/find_files.py: + (find): Accept an optional sorting key that is used to sort files found in the directories + that the given paths specify. + (_normalized_find): Both paths that are then searched for the tests and the tests that + were found are now kept in lists. This makes it possible to run a test multiple times + by specifying it multiple times through arguments or the test list file. + (_normalized_find.sort_by_directory_key): + * Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py: + (LayoutTestFinder.find_tests): Keep the paths where we should search for tests in a list. + (LayoutTestFinder.skip_tests): Subtracting from a set of paths is necessary. + * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py: + (LayoutTestRunner.__init__): The Sharder class no longer needs a test path separator. + (Sharder.__init__): Ditto. + (Sharder._resize_shards): + * Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py: + (SharderTests.get_shards): Modify the Shader initializing as required. + (SharderTests.test_multiple_locked_shards): The natural sorting and test name key unit tests + are now moved to the base Port unit tests. + * Scripts/webkitpy/layout_tests/controllers/manager.py: + (Manager._prepare_lists): Keep the test names in a list. Order that list as specified by + the new --order option. + * Scripts/webkitpy/layout_tests/port/base.py: + (Port.tests): This method should now return a list of all the tests found in the specified + paths. + (Port._real_tests): A list is required, so no conversion to a set is made. + (Port): + (Port.test_key): Place this method here for now, but it should really move into a separate + module. + (Port._natural_sort_key): Ditto. + (Port._natural_sort_key.tryint): + (Port._virtual_tests): A list is required, so the function now operates on that rather than + on a set. + * Scripts/webkitpy/layout_tests/port/base_unittest.py: + (PortTest.test_find_with_skipped_directories_2): Adjust the test case to check for an empty + list rather than an empty set. + (PortTest.test_dont_require_http_server): + (NaturalCompareTest): The natural sorting unit tests are placed here for now. + (NaturalCompareTest.assert_cmp): + (NaturalCompareTest.test_natural_compare): + (KeyCompareTest): The test name key unit tests are placed here for now. + (KeyCompareTest.assert_cmp): + (KeyCompareTest.test_test_key): + * Scripts/webkitpy/layout_tests/run_webkit_tests.py: + (parse_args): Remove the --randomize-order option, it's now possible to replicate its behavior + by using --order=random. + * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: Add unit tests covering + various aspects of this change. + (MainTest.test_natural_order): + (MainTest): + (MainTest.test_natural_order_test_specified_multiple_times): + (MainTest.test_random_order): + (MainTest.test_random_order_test_specified_multiple_times): + (MainTest.test_no_order): + (MainTest.test_no_order_test_specified_multiple_times): + (MainTest.test_no_order_with_directory_entries_in_natural_order): + * Scripts/webkitpy/tool/commands/queries.py: + (PrintExpectations.execute): Operate on a set of tests when printing out expectations. + +2012-11-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135600. + http://trac.webkit.org/changeset/135600 + https://bugs.webkit.org/show_bug.cgi?id=103173 + + It made EFL API test is failed (Requested by gyuyoung_mbp on + #webkit). + + * TestWebKitAPI/PlatformEfl.cmake: + * TestWebKitAPI/efl/PlatformUtilities.cpp: + (TestWebKitAPI::Util::sleep): + * TestWebKitAPI/efl/PlatformWebView.cpp: + +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Protect the new feature behind a feature flag. + + * Scripts/webkitperl/FeatureList.pm: + * qmake/mkspecs/features/features.pri: + +2012-11-23 Mario Sanchez Prada <mario@webkit.org> + + Unreviewed. Update my e-mail address. + + * Scripts/webkitpy/common/config/committers.py: + +2012-11-23 Mateusz Leszko <m.leszko@samsung.com> + + [EFL][GTK] Adapt accessibility feature to WebKitTestRunner. + https://bugs.webkit.org/show_bug.cgi?id=100757 + + Reviewed by Laszlo Gombos. + + Allow to build accessibility feature in WebkitTestRunner for EFL Platform. + Updating CMake files due to changes from Bug 99011. + + * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: + (WTR::AccessibilityController::AccessibilityController): + (WTR): + * WebKitTestRunner/InjectedBundle/AccessibilityController.h: + (AccessibilityController): + * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: + (WTR): + * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: + (AccessibilityUIElement): + * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: - Removed gtk/gtk.h dependency. + * WebKitTestRunner/PlatformEfl.cmake: - Adding atk includes. + +2012-11-16 Yury Semikhatsky <yurys@chromium.org> + + Memory instrumentation: extract MemoryObjectInfo declaration into a separate file + https://bugs.webkit.org/show_bug.cgi?id=102510 + + Reviewed by Pavel Feldman. + + Added missing includes. + + * TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp: + 2012-11-23 Sudarsana Nagineni <sudarsana.nagineni@intel.com> [EFL][WK2] Add support for PlatformWebView::simulateSpacebarKeyPress() in TestWebKitAPI diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index 6f7570ae2..f5d02675c 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -49,6 +49,7 @@ my ( $blobSupport, $channelMessagingSupport, $cspNextSupport, + $css3BackgroundSupport, $css3ConditionalRulesSupport, $css3TextSupport, $cssBoxDecorationBreakSupport, @@ -176,6 +177,9 @@ my @features = ( { option => "css-filters", desc => "Toggle CSS Filters support", define => "ENABLE_CSS_FILTERS", default => isAppleWebKit() || isBlackBerry(), value => \$cssFiltersSupport }, + { option => "css3-background", desc => "Toggle CSS3 Background support", + define => "ENABLE_CSS3_BACKGROUND", default => 0, value => \$css3BackgroundSupport }, + { option => "css3-conditional-rules", desc => "Toggle CSS3 Conditional Rules support (i.e. \@supports)", define => "ENABLE_CSS3_CONDITIONAL_RULES", default => 0, value => \$css3ConditionalRulesSupport }, diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py index ea92d9948..92a6a1ead 100644 --- a/Tools/Scripts/webkitpy/common/config/committers.py +++ b/Tools/Scripts/webkitpy/common/config/committers.py @@ -332,7 +332,7 @@ committers_unable_to_review = [ Committer("Mads Ager", "ager@chromium.org"), Committer("Mahesh Kulkarni", ["mahesh.kulkarni@nokia.com", "maheshk@webkit.org"], "maheshk"), Committer("Marcus Voltis Bulach", "bulach@chromium.org"), - Committer("Mario Sanchez Prada", ["msanchez@igalia.com", "mario@webkit.org"], "msanchez"), + Committer("Mario Sanchez Prada", ["mario@webkit.org"], "msanchez"), Committer("Mark Lam", "mark.lam@apple.com", "mlam"), Committer("Mary Wu", ["mary.wu@torchmobile.com.cn", "wwendy2007@gmail.com"], "marywu"), Committer("Matt Delaney", "mdelaney@apple.com"), diff --git a/Tools/Scripts/webkitpy/common/find_files.py b/Tools/Scripts/webkitpy/common/find_files.py index 32ce4d105..b65e77f9f 100644 --- a/Tools/Scripts/webkitpy/common/find_files.py +++ b/Tools/Scripts/webkitpy/common/find_files.py @@ -44,8 +44,10 @@ If a callback is passed in, it will be called for the each file and the file will be included into the result if the callback returns True. The callback has to take three arguments: filesystem, dirname and filename.""" +import itertools -def find(filesystem, base_dir, paths=None, skipped_directories=None, file_filter=None): + +def find(filesystem, base_dir, paths=None, skipped_directories=None, file_filter=None, directory_sort_key=None): """Finds the set of tests under a given list of sub-paths. Args: @@ -57,34 +59,27 @@ def find(filesystem, base_dir, paths=None, skipped_directories=None, file_filter paths = paths or ['*'] skipped_directories = skipped_directories or set(['.svn', '_svn']) - return _normalized_find(filesystem, _normalize(filesystem, base_dir, paths), skipped_directories, file_filter) + return _normalized_find(filesystem, _normalize(filesystem, base_dir, paths), skipped_directories, file_filter, directory_sort_key) def _normalize(filesystem, base_dir, paths): return [filesystem.normpath(filesystem.join(base_dir, path)) for path in paths] -def _normalized_find(filesystem, paths, skipped_directories, file_filter): +def _normalized_find(filesystem, paths, skipped_directories, file_filter, directory_sort_key): """Finds the set of tests under the list of paths. Args: paths: a list of absolute path expressions to search. Glob patterns are ok. """ - paths_to_walk = set() - - for path in paths: - # If there's an * in the name, assume it's a glob pattern. - if path.find('*') > -1: - filenames = filesystem.glob(path) - paths_to_walk.update(filenames) - else: - paths_to_walk.add(path) - - # FIXME: I'm not sure there's much point in this being a set. A list would probably be faster. - all_files = set() - for path in paths_to_walk: - files = filesystem.files_under(path, skipped_directories, file_filter) - all_files.update(set(files)) + paths_to_walk = itertools.chain(*(filesystem.glob(path) for path in paths)) + + def sort_by_directory_key(files_list): + if directory_sort_key: + files_list.sort(key=directory_sort_key) + return files_list + + all_files = itertools.chain(*(sort_by_directory_key(filesystem.files_under(path, skipped_directories, file_filter)) for path in paths_to_walk)) return all_files diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py index 6447c8fb4..429aeddfd 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py @@ -47,7 +47,6 @@ class LayoutTestFinder(object): paths = self._strip_test_dir_prefixes(args) if options.test_list: paths += self._strip_test_dir_prefixes(self._read_test_names_from_file(options.test_list, self._port.TEST_PATH_SEPARATOR)) - paths = set(paths) test_files = self._port.tests(paths) return (paths, test_files) @@ -108,7 +107,7 @@ class LayoutTestFinder(object): tests_to_skip = set() elif self._options.skipped != 'always': # make sure we're explicitly running any tests passed on the command line; equivalent to 'default'. - tests_to_skip -= paths + tests_to_skip -= set(paths) # unless of course we don't want to run the HTTP tests :) if not self._options.http: diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py index 17cbe3125..54ce5e6fe 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py @@ -68,7 +68,7 @@ class LayoutTestRunner(object): self._results_directory = results_directory self._expectations = None self._test_is_slow = test_is_slow_fn - self._sharder = Sharder(self._port.split_test, self._port.TEST_PATH_SEPARATOR, self._options.max_locked_shards) + self._sharder = Sharder(self._port.split_test, self._options.max_locked_shards) self._current_result_summary = None self._needs_http = None @@ -80,9 +80,6 @@ class LayoutTestRunner(object): self._worker_stats = {} self._filesystem = self._port.host.filesystem - def test_key(self, test_name): - return self._sharder.test_key(test_name) - def run_tests(self, test_inputs, expectations, result_summary, num_workers, needs_http, needs_websockets, retrying): """Returns a tuple of (interrupted, keyboard_interrupted, thread_timings, test_timings, individual_test_timings): interrupted is whether the run was interrupted @@ -474,9 +471,8 @@ class TestShard(object): class Sharder(object): - def __init__(self, test_split_fn, test_path_separator, max_locked_shards): + def __init__(self, test_split_fn, max_locked_shards): self._split = test_split_fn - self._sep = test_path_separator self._max_locked_shards = max_locked_shards def shard_tests(self, test_inputs, num_workers, fully_parallel): @@ -603,29 +599,3 @@ class Sharder(object): some_shards, remaining_shards = split_at(remaining_shards, num_old_per_new) new_shards.append(TestShard('%s_%d' % (shard_name_prefix, len(new_shards) + 1), extract_and_flatten(some_shards))) return new_shards - - def test_key(self, test_name): - """Turns a test name into a list with two sublists, the natural key of the - dirname, and the natural key of the basename. - - This can be used when sorting paths so that files in a directory. - directory are kept together rather than being mixed in with files in - subdirectories.""" - dirname, basename = self._split(test_name) - return (self.natural_sort_key(dirname + self._sep), self.natural_sort_key(basename)) - - @staticmethod - def natural_sort_key(string_to_split): - """ Turns a string into a list of string and number chunks, i.e. "z23a" -> ["z", 23, "a"] - - This can be used to implement "natural sort" order. See: - http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html - http://nedbatchelder.com/blog/200712.html#e20071211T054956 - """ - def tryint(val): - try: - return int(val) - except ValueError: - return val - - return [tryint(chunk) for chunk in re.split('(\d+)', string_to_split)] diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py index 501fb4326..13841c1e2 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py @@ -31,13 +31,15 @@ import unittest from webkitpy.common.host_mock import MockHost +from webkitpy.common.system.systemhost_mock import MockSystemHost from webkitpy.layout_tests import run_webkit_tests +from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunner, Sharder, TestRunInterruptedException from webkitpy.layout_tests.models import test_expectations from webkitpy.layout_tests.models import test_failures from webkitpy.layout_tests.models.result_summary import ResultSummary from webkitpy.layout_tests.models.test_input import TestInput from webkitpy.layout_tests.models.test_results import TestResult -from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunner, Sharder, TestRunInterruptedException +from webkitpy.layout_tests.port.test import TestPort TestExpectations = test_expectations.TestExpectations @@ -235,12 +237,8 @@ class SharderTests(unittest.TestCase): return TestInput(test_file, requires_lock=(test_file.startswith('http') or test_file.startswith('perf'))) def get_shards(self, num_workers, fully_parallel, test_list=None, max_locked_shards=1): - def split(test_name): - idx = test_name.rfind('/') - if idx != -1: - return (test_name[0:idx], test_name[idx + 1:]) - - self.sharder = Sharder(split, '/', max_locked_shards) + port = TestPort(MockSystemHost()) + self.sharder = Sharder(port.split_test, max_locked_shards) test_list = test_list or self.test_list return self.sharder.shard_tests([self.get_test_input(test) for test in test_list], num_workers, fully_parallel) @@ -335,48 +333,3 @@ class SharderTests(unittest.TestCase): 'http/tests/websocket/tests/websocket-protocol-ignored.html', 'http/tests/xmlhttprequest/supported-xml-content-types.html', 'perf/object-keys.html'])]) - - -class NaturalCompareTest(unittest.TestCase): - def assert_cmp(self, x, y, result): - self.assertEqual(cmp(Sharder.natural_sort_key(x), Sharder.natural_sort_key(y)), result) - - def test_natural_compare(self): - self.assert_cmp('a', 'a', 0) - self.assert_cmp('ab', 'a', 1) - self.assert_cmp('a', 'ab', -1) - self.assert_cmp('', '', 0) - self.assert_cmp('', 'ab', -1) - self.assert_cmp('1', '2', -1) - self.assert_cmp('2', '1', 1) - self.assert_cmp('1', '10', -1) - self.assert_cmp('2', '10', -1) - self.assert_cmp('foo_1.html', 'foo_2.html', -1) - self.assert_cmp('foo_1.1.html', 'foo_2.html', -1) - self.assert_cmp('foo_1.html', 'foo_10.html', -1) - self.assert_cmp('foo_2.html', 'foo_10.html', -1) - self.assert_cmp('foo_23.html', 'foo_10.html', 1) - self.assert_cmp('foo_23.html', 'foo_100.html', -1) - - -class KeyCompareTest(unittest.TestCase): - def setUp(self): - def split(test_name): - idx = test_name.rfind('/') - if idx != -1: - return (test_name[0:idx], test_name[idx + 1:]) - - self.sharder = Sharder(split, '/', 1) - - def assert_cmp(self, x, y, result): - self.assertEqual(cmp(self.sharder.test_key(x), self.sharder.test_key(y)), result) - - def test_test_key(self): - self.assert_cmp('/a', '/a', 0) - self.assert_cmp('/a', '/b', -1) - self.assert_cmp('/a2', '/a10', -1) - self.assert_cmp('/a2/foo', '/a10/foo', -1) - self.assert_cmp('/a/foo11', '/a/foo2', 1) - self.assert_cmp('/ab', '/a/a/b', -1) - self.assert_cmp('/a/a/b', '/ab', 1) - self.assert_cmp('/foo-bar/baz', '/foo/baz', -1) diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py index cc2f0f9b9..5986d5396 100644 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py +++ b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py @@ -305,14 +305,14 @@ class Manager(object): def _prepare_lists(self): tests_to_skip = self._finder.skip_tests(self._paths, self._test_names, self._expectations, self._http_tests()) - self._test_names = list(set(self._test_names) - tests_to_skip) + self._test_names = [test for test in self._test_names if test not in tests_to_skip] # Create a sorted list of test files so the subset chunk, # if used, contains alphabetically consecutive tests. - if self._options.randomize_order: + if self._options.order == 'natural': + self._test_names.sort(key=self._port.test_key) + elif self._options.order == 'random': random.shuffle(self._test_names) - else: - self._test_names.sort(key=self._runner.test_key) self._test_names, tests_in_other_chunks = self._finder.split_into_chunks(self._test_names) self._expectations.add_skipped_tests(tests_in_other_chunks) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py index a19af094c..8c4578dbf 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/base.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py @@ -578,7 +578,9 @@ class Port(object): def tests(self, paths): """Return the list of tests found. Both generic and platform-specific tests matching paths should be returned.""" expanded_paths = self._expanded_paths(paths) - return self._real_tests(expanded_paths).union(self._virtual_tests(expanded_paths, self.populated_virtual_test_suites())) + tests = self._real_tests(expanded_paths) + tests.extend(self._virtual_tests(expanded_paths, self.populated_virtual_test_suites())) + return tests def _expanded_paths(self, paths): expanded_paths = [] @@ -596,8 +598,8 @@ class Port(object): def _real_tests(self, paths): # When collecting test cases, skip these directories skipped_directories = set(['.svn', '_svn', 'resources', 'script-tests', 'reference', 'reftest']) - files = find_files.find(self._filesystem, self.layout_tests_dir(), paths, skipped_directories, Port._is_test_file) - return set([self.relative_test_filename(f) for f in files]) + files = find_files.find(self._filesystem, self.layout_tests_dir(), paths, skipped_directories, Port._is_test_file, self.test_key) + return [self.relative_test_filename(f) for f in files] # When collecting test cases, we include any file with these extensions. _supported_file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl', @@ -623,6 +625,31 @@ class Port(object): def _is_test_file(filesystem, dirname, filename): return Port._has_supported_extension(filesystem, filename) and not Port.is_reference_html_file(filesystem, dirname, filename) + def test_key(self, test_name): + """Turns a test name into a list with two sublists, the natural key of the + dirname, and the natural key of the basename. + + This can be used when sorting paths so that files in a directory. + directory are kept together rather than being mixed in with files in + subdirectories.""" + dirname, basename = self.split_test(test_name) + return (self._natural_sort_key(dirname + self.TEST_PATH_SEPARATOR), self._natural_sort_key(basename)) + + def _natural_sort_key(self, string_to_split): + """ Turns a string into a list of string and number chunks, i.e. "z23a" -> ["z", 23, "a"] + + This can be used to implement "natural sort" order. See: + http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html + http://nedbatchelder.com/blog/200712.html#e20071211T054956 + """ + def tryint(val): + try: + return int(val) + except ValueError: + return val + + return [tryint(chunk) for chunk in re.split('(\d+)', string_to_split)] + def test_dirs(self): """Returns the list of top-level test directories.""" layout_tests_dir = self.layout_tests_dir() @@ -1321,14 +1348,14 @@ class Port(object): return suites def _virtual_tests(self, paths, suites): - virtual_tests = set() + virtual_tests = list() for suite in suites: if paths: for test in suite.tests: if any(test.startswith(p) for p in paths): - virtual_tests.add(test) + virtual_tests.append(test) else: - virtual_tests.update(set(suite.tests.keys())) + virtual_tests.extend(suite.tests.keys()) return virtual_tests def lookup_virtual_test_base(self, test_name): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py index 77ef04a04..bcc64b601 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py @@ -325,7 +325,7 @@ class PortTest(unittest.TestCase): def test_find_with_skipped_directories_2(self): port = self.make_port(with_tests=True) tests = port.tests(['userscripts/resources']) - self.assertEqual(tests, set([])) + self.assertEqual(tests, []) def test_is_test_file(self): filesystem = MockFileSystem() @@ -455,5 +455,49 @@ class PortTest(unittest.TestCase): port = self.make_port() self.assertEqual(port.requires_http_server(), False) + +class NaturalCompareTest(unittest.TestCase): + def setUp(self): + self._port = TestPort(MockSystemHost()) + + def assert_cmp(self, x, y, result): + self.assertEqual(cmp(self._port._natural_sort_key(x), self._port._natural_sort_key(y)), result) + + def test_natural_compare(self): + self.assert_cmp('a', 'a', 0) + self.assert_cmp('ab', 'a', 1) + self.assert_cmp('a', 'ab', -1) + self.assert_cmp('', '', 0) + self.assert_cmp('', 'ab', -1) + self.assert_cmp('1', '2', -1) + self.assert_cmp('2', '1', 1) + self.assert_cmp('1', '10', -1) + self.assert_cmp('2', '10', -1) + self.assert_cmp('foo_1.html', 'foo_2.html', -1) + self.assert_cmp('foo_1.1.html', 'foo_2.html', -1) + self.assert_cmp('foo_1.html', 'foo_10.html', -1) + self.assert_cmp('foo_2.html', 'foo_10.html', -1) + self.assert_cmp('foo_23.html', 'foo_10.html', 1) + self.assert_cmp('foo_23.html', 'foo_100.html', -1) + + +class KeyCompareTest(unittest.TestCase): + def setUp(self): + self._port = TestPort(MockSystemHost()) + + def assert_cmp(self, x, y, result): + self.assertEqual(cmp(self._port.test_key(x), self._port.test_key(y)), result) + + def test_test_key(self): + self.assert_cmp('/a', '/a', 0) + self.assert_cmp('/a', '/b', -1) + self.assert_cmp('/a2', '/a10', -1) + self.assert_cmp('/a2/foo', '/a10/foo', -1) + self.assert_cmp('/a/foo11', '/a/foo2', 1) + self.assert_cmp('/ab', '/a/a/b', -1) + self.assert_cmp('/a/a/b', '/ab', 1) + self.assert_cmp('/foo-bar/baz', '/foo/baz', -1) + + if __name__ == '__main__': unittest.main() diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py index 2df57cf6f..c505cd399 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py @@ -353,9 +353,11 @@ def parse_args(args=None): help="Run all tests, even those marked SKIP in the test list (same as --skipped=ignore)"), optparse.make_option("--time-out-ms", help="Set the timeout for each test"), - optparse.make_option("--randomize-order", action="store_true", - default=False, help=("Run tests in random order (useful " - "for tracking down corruption)")), + optparse.make_option("--order", action="store", default="natural", + help=("determine the order in which the test cases will be run. " + "'none' == use the order in which the tests were listed either in arguments or test list, " + "'natural' == use the natural order (default), " + "'random' == randomize the test order.")), optparse.make_option("--run-chunk", help=("Run a specified chunk (n:l), the nth of len l, " "of the layout tests")), diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py index de1a21cc5..2bfe904d5 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py @@ -389,9 +389,41 @@ class MainTest(unittest.TestCase, StreamTestingMixin): self.assertEmpty(out) self.assertContains(err, 'No tests to run.\n') - def test_randomize_order(self): - # FIXME: verify order was shuffled - self.assertTrue(passing_run(['--randomize-order'])) + def test_natural_order(self): + tests_to_run = ['passes/audio.html', 'failures/expected/text.html', 'failures/expected/missing_text.html', 'passes/args.html'] + tests_run = get_tests_run(['--order=natural'] + tests_to_run, tests_included=True, flatten_batches=True) + self.assertEqual(['failures/expected/missing_text.html', 'failures/expected/text.html', 'passes/args.html', 'passes/audio.html'], tests_run) + + def test_natural_order_test_specified_multiple_times(self): + tests_to_run = ['passes/args.html', 'passes/audio.html', 'passes/audio.html', 'passes/args.html'] + tests_run = get_tests_run(['--order=natural'] + tests_to_run, tests_included=True, flatten_batches=True) + self.assertEqual(['passes/args.html', 'passes/args.html', 'passes/audio.html', 'passes/audio.html'], tests_run) + + def test_random_order(self): + tests_to_run = ['passes/audio.html', 'failures/expected/text.html', 'failures/expected/missing_text.html', 'passes/args.html'] + tests_run = get_tests_run(['--order=random'] + tests_to_run, tests_included=True, flatten_batches=True) + self.assertEqual(sorted(tests_to_run), sorted(tests_run)) + + def test_random_order_test_specified_multiple_times(self): + tests_to_run = ['passes/args.html', 'passes/audio.html', 'passes/audio.html', 'passes/args.html'] + tests_run = get_tests_run(['--order=random'] + tests_to_run, tests_included=True, flatten_batches=True) + self.assertEqual(tests_run.count('passes/audio.html'), 2) + self.assertEqual(tests_run.count('passes/args.html'), 2) + + def test_no_order(self): + tests_to_run = ['passes/audio.html', 'failures/expected/text.html', 'failures/expected/missing_text.html', 'passes/args.html'] + tests_run = get_tests_run(['--order=none'] + tests_to_run, tests_included=True, flatten_batches=True) + self.assertEqual(tests_to_run, tests_run) + + def test_no_order_test_specified_multiple_times(self): + tests_to_run = ['passes/args.html', 'passes/audio.html', 'passes/audio.html', 'passes/args.html'] + tests_run = get_tests_run(['--order=none'] + tests_to_run, tests_included=True, flatten_batches=True) + self.assertEqual(tests_to_run, tests_run) + + def test_no_order_with_directory_entries_in_natural_order(self): + tests_to_run = ['http/tests/ssl', 'perf/foo', 'http/tests/passes'] + tests_run = get_tests_run(['--order=none'] + tests_to_run, tests_included=True, flatten_batches=True) + self.assertEqual(tests_run, ['http/tests/ssl/text.html', 'perf/foo/test.html', 'http/tests/passes/image.html', 'http/tests/passes/text.html']) def test_gc_between_tests(self): self.assertTrue(passing_run(['--gc-between-tests'])) diff --git a/Tools/Scripts/webkitpy/tool/commands/queries.py b/Tools/Scripts/webkitpy/tool/commands/queries.py index 93e0df3d3..cbdb903ee 100644 --- a/Tools/Scripts/webkitpy/tool/commands/queries.py +++ b/Tools/Scripts/webkitpy/tool/commands/queries.py @@ -476,7 +476,7 @@ class PrintExpectations(AbstractDeclarativeCommand): print file return - tests = default_port.tests(args) + tests = set(default_port.tests(args)) for port_name in port_names: model = self._model(options, port_name, tests) tests_to_print = self._filter_tests(options, model, tests) diff --git a/Tools/TestWebKitAPI/GNUmakefile.am b/Tools/TestWebKitAPI/GNUmakefile.am index 759ccb9e0..01b115878 100644 --- a/Tools/TestWebKitAPI/GNUmakefile.am +++ b/Tools/TestWebKitAPI/GNUmakefile.am @@ -54,7 +54,6 @@ Programs_TestWebKitAPI_TestWTF_SOURCES = \ Tools/TestWebKitAPI/Tests/WTF/IntegerToStringConversion.cpp \ Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp \ Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp \ - Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp \ Tools/TestWebKitAPI/Tests/WTF/RedBlackTree.cpp \ Tools/TestWebKitAPI/Tests/WTF/SaturatedArithmeticOperations.cpp \ Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp \ diff --git a/Tools/TestWebKitAPI/PlatformEfl.cmake b/Tools/TestWebKitAPI/PlatformEfl.cmake index c6ea7302c..88f424e66 100644 --- a/Tools/TestWebKitAPI/PlatformEfl.cmake +++ b/Tools/TestWebKitAPI/PlatformEfl.cmake @@ -66,7 +66,6 @@ SET(test_webkit2_api_BINARIES ParentFrame PreventEmptyUserAgent PrivateBrowsingPushStateNoHistoryCallback - ResponsivenessTimerDoesntFireEarly WKConnection WKPreferences WKString @@ -92,6 +91,7 @@ ADD_DEFINITIONS(-DTHEME_DIR="${THEME_BINARY_DIR}") # # HitTestResultNodeHandle # MouseMoveAfterCrash +# ResponsivenessTimerDoesntFireEarly # SpacebarScrolling # # Flaky test, fails on Release but passes on Debug: diff --git a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp index 7348062d9..dad08dda4 100644 --- a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp +++ b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp @@ -45,6 +45,7 @@ #include <wtf/MemoryInstrumentationListHashSet.h> #include <wtf/MemoryInstrumentationString.h> #include <wtf/MemoryInstrumentationVector.h> +#include <wtf/MemoryObjectInfo.h> #include <wtf/RefCounted.h> #include <wtf/Vector.h> #include <wtf/text/AtomicString.h> diff --git a/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp b/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp index 65c54e1a7..50f586d60 100644 --- a/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp +++ b/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp @@ -42,7 +42,7 @@ void run(bool* done) void sleep(double seconds) { - usleep(seconds * 1000000); + sleep(seconds); } WKURLRef createURLForResource(const char* resource, const char* extension) diff --git a/Tools/TestWebKitAPI/efl/PlatformWebView.cpp b/Tools/TestWebKitAPI/efl/PlatformWebView.cpp index acec6ed84..2e87f7087 100644 --- a/Tools/TestWebKitAPI/efl/PlatformWebView.cpp +++ b/Tools/TestWebKitAPI/efl/PlatformWebView.cpp @@ -80,12 +80,4 @@ WKPageRef PlatformWebView::page() const return WKViewGetPage(toAPI(m_view)); } -void PlatformWebView::simulateSpacebarKeyPress() -{ - Evas* evas = ecore_evas_get(m_window); - evas_object_focus_set(m_view, true); - evas_event_feed_key_down(evas, "space", "space", " ", 0, 0, 0); - evas_event_feed_key_up(evas, "space", "space", " ", 0, 1, 0); -} - } // namespace TestWebKitAPI diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp index c6f7d75cc..0964064f1 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp @@ -44,7 +44,7 @@ PassRefPtr<AccessibilityController> AccessibilityController::create() } AccessibilityController::AccessibilityController() -#if PLATFORM(GTK) +#if PLATFORM(GTK) || PLATFORM(EFL) : m_stateChangeListenerId(0) , m_focusEventListenerId(0) , m_activeDescendantChangedListenerId(0) @@ -109,7 +109,7 @@ bool AccessibilityController::removeNotificationListener() { return false; } PassRefPtr<AccessibilityUIElement> AccessibilityController::accessibleElementById(JSStringRef attribute) { return 0; } #endif -#if !PLATFORM(GTK) +#if !PLATFORM(GTK) && !PLATFORM(EFL) void AccessibilityController::logAccessibilityEvents() { } void AccessibilityController::resetToConsistentState() { } #endif diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h index f02feac05..247de3420 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h +++ b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h @@ -68,7 +68,7 @@ private: RetainPtr<NotificationHandler> m_globalNotificationHandler; #endif -#if PLATFORM(GTK) +#if PLATFORM(GTK) || PLATFORM(EFL) unsigned m_stateChangeListenerId; unsigned m_focusEventListenerId; unsigned m_activeDescendantChangedListenerId; diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp index 42e25711c..edec732a2 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp @@ -52,9 +52,9 @@ bool AccessibilityUIElement::isValid() const { return m_element; } - + // Unsupported methods on various platforms. As they're implemented on other platforms this list should be modified. -#if !PLATFORM(MAC) && !PLATFORM(GTK) +#if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(EFL) AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement) { } AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement&) { } AccessibilityUIElement::~AccessibilityUIElement() { } diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h index 551f59174..2da56c3d8 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h +++ b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h @@ -49,7 +49,7 @@ typedef struct objc_object* PlatformUIElement; #include <oleacc.h> typedef COMPtr<IAccessible> PlatformUIElement; -#elif PLATFORM(GTK) +#elif PLATFORM(GTK) || PLATFORM(EFL) #include <atk/atk.h> typedef AtkObject* PlatformUIElement; #else @@ -245,7 +245,7 @@ private: void getDocumentLinks(Vector<RefPtr<AccessibilityUIElement> >&); #endif -#if PLATFORM(MAC) || PLATFORM(GTK) +#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) void getChildren(Vector<RefPtr<AccessibilityUIElement> >&); void getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >&, unsigned location, unsigned length); #endif diff --git a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp index 0bfe9ac96..0083e3544 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp @@ -31,7 +31,6 @@ #include "InjectedBundlePage.h" #include <JavaScriptCore/JSStringRef.h> #include <atk/atk.h> -#include <gtk/gtk.h> #include <wtf/Assertions.h> #include <wtf/gobject/GOwnPtr.h> #include <wtf/gobject/GRefPtr.h> diff --git a/Tools/WebKitTestRunner/PlatformEfl.cmake b/Tools/WebKitTestRunner/PlatformEfl.cmake index 1c6947258..39c68a975 100644 --- a/Tools/WebKitTestRunner/PlatformEfl.cmake +++ b/Tools/WebKitTestRunner/PlatformEfl.cmake @@ -21,7 +21,7 @@ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES ${TOOLS_DIR}/DumpRenderTree/efl/ ${WEBKIT2_DIR}/UIProcess/API/efl "${WTF_DIR}/wtf/gobject" - + ${ATK_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${ECORE_INCLUDE_DIRS} ${ECORE_EVAS_INCLUDE_DIRS} @@ -31,6 +31,7 @@ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES ) LIST(APPEND WebKitTestRunner_LIBRARIES + ${ATK_LIBRARIES} ${CAIRO_LIBRARIES} ${ECORE_LIBRARIES} ${ECORE_EVAS_LIBRARIES} @@ -55,6 +56,8 @@ ENDIF () LIST(APPEND WebKitTestRunnerInjectedBundle_SOURCES ${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp + ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityControllerAtk.cpp + ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityUIElementAtk.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/ActivateFontsEfl.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/InjectedBundleEfl.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/TestRunnerEfl.cpp diff --git a/Tools/qmake/mkspecs/features/features.pri b/Tools/qmake/mkspecs/features/features.pri index 05976985a..c3688922b 100644 --- a/Tools/qmake/mkspecs/features/features.pri +++ b/Tools/qmake/mkspecs/features/features.pri @@ -33,6 +33,7 @@ FEATURE_DEFAULTS = \ ENABLE_CSS_SHADERS=0 \ ENABLE_CSS_STICKY_POSITION=1 \ ENABLE_CSS_VARIABLES=0 \ + ENABLE_CSS3_BACKGROUND=0 \ ENABLE_CSS3_CONDITIONAL_RULES=0 \ ENABLE_CSS3_TEXT=0 \ ENABLE_DASHBOARD_SUPPORT=0 \ @@ -1,9 +1,9 @@ This is a snapshot of WebKit. It is based on the upstream trunk subversion -revision 135602 +revision 135696 You can browse the base of this snapshot at - http://trac.webkit.org/browser/trunk?rev=135602 + http://trac.webkit.org/browser/trunk?rev=135696 Additional patches may have been applied on top and files not required by the Qt port may have been removed. diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog index f006cf80e..5a5b1d002 100644 --- a/WebKitLibraries/ChangeLog +++ b/WebKitLibraries/ChangeLog @@ -1,3 +1,15 @@ +2012-11-23 Alexis Menard <alexis@webkit.org> + + [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing. + https://bugs.webkit.org/show_bug.cgi?id=102104 + + Reviewed by Julien Chaffraix. + + Protect the new feature behind a feature flag. + + * win/tools/vsprops/FeatureDefines.vsprops: + * win/tools/vsprops/FeatureDefinesCairo.vsprops: + 2012-11-19 Kihong Kwon <kihong.kwon@samsung.com> Add PROXIMITY_EVENTS feature diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops index 42534feb2..33e2f1ceb 100644 --- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops +++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops @@ -9,7 +9,7 @@ >
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CSS_STICKY_POSITION);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_BACKGROUND);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CSS_STICKY_POSITION);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_RENDERING"
@@ -37,6 +37,11 @@ PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_CSS3_BACKGROUND"
+ Value=""
+ PerformEnvironmentSet="false"
+ />
+ <UserMacro
Name="ENABLE_CSS3_CONDITIONAL_RULES"
Value=""
PerformEnvironmentSet="true"
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops index 660ca8c97..f303d47b7 100644 --- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops +++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops @@ -9,7 +9,7 @@ >
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_IFRAME_SEAMLESS);$(ENABLE_REQUEST_ANIMATION_FRAME);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_BACKGROUND);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_GRID_LAYOUT);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_NOTIFICATIONS);$(ENABLE_LINK_PREFETCH);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_ELEMENT);$(ENABLE_PROXIMITY_EVENTS);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHADOW_DOM);$(ENABLE_SHARED_WORKERS);$(ENABLE_STYLE_SCOPED);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_TEXT_AUTOSIZING);$(ENABLE_UNDO_MANAGER);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_RENDERING"
@@ -37,6 +37,11 @@ PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_CSS3_BACKGROUND"
+ Value=""
+ PerformEnvironmentSet="false"
+ />
+ <UserMacro
Name="ENABLE_CSS3_CONDITIONAL_RULES"
Value=""
PerformEnvironmentSet="true"
diff --git a/configure.ac b/configure.ac index 3feae6896..4e1f0e80c 100644 --- a/configure.ac +++ b/configure.ac @@ -808,6 +808,14 @@ AC_ARG_ENABLE(coverage, [],[enable_coverage="no"]) AC_MSG_RESULT([$enable_coverage]) +# check whether to enable CSS3 background support +AC_MSG_CHECKING([whether to enable CSS3 background support]) +AC_ARG_ENABLE(css3_background, + AC_HELP_STRING([--enable-css3-background], + [enable CSS3 background support [default=no]]), + [],[enable_css3_background="no"]) +AC_MSG_RESULT([$enable_css3_background]) + # check whether to enable CSS conditional rules support AC_MSG_CHECKING([whether to enable CSS3 conditional rules support]) AC_ARG_ENABLE(css3_conditional_rules, @@ -1204,6 +1212,7 @@ AM_CONDITIONAL([ENABLE_MEDIA_STREAM],[test "$enable_media_stream" = "yes"]) AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"]) AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"]) AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"]) +AM_CONDITIONAL([ENABLE_CSS3_BACKGROUND],[test "$enable_css3_background" = "yes"]) AM_CONDITIONAL([ENABLE_CSS3_CONDITIONAL_RULES],[test "$enable_css3_conditional_rules" = "yes"]) AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"]) AM_CONDITIONAL([ENABLE_WEB_AUDIO],[test "$enable_web_audio" = "yes"]) @@ -1270,6 +1279,7 @@ Features: ======= Accelerated Compositing : $enable_accelerated_compositing CSS3 Conditional Rules support : $enable_css3_conditional_rules + CSS3 background support : $enable_css3_background Filters support : $enable_filters Gamepad support : $enable_gamepad Geolocation support : $enable_geolocation |
