1. 28 Jan, 2013 40 commits
    • ggaren@apple.com's avatar
      Static size inference for JavaScript objects · c862eacf
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108093
      
      Reviewed by Phil Pizlo.
      
      ../JavaScriptCore: 
      
      * API/JSObjectRef.cpp:
      * JavaScriptCore.order:
      * JavaScriptCore.xcodeproj/project.pbxproj: Pay the tax man.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dumpBytecode): op_new_object and op_create_this now
      have an extra inferredInlineCapacity argument. This is the statically
      inferred inline capacity, just from analyzing source text. op_new_object
      also gets a pointer to an allocation profile. (For op_create_this, the
      profile is in the construtor function.)
      
      (JSC::CodeBlock::CodeBlock): Link op_new_object.
      
      (JSC::CodeBlock::stronglyVisitStrongReferences): Mark our profiles.
      
      * bytecode/CodeBlock.h:
      (CodeBlock): Removed some dead code. Added object allocation profiles.
      
      * bytecode/Instruction.h:
      (JSC): New union type, since an instruction operand may point to an
      object allocation profile now.
      
      * bytecode/ObjectAllocationProfile.h: Added.
      (JSC):
      (ObjectAllocationProfile):
      (JSC::ObjectAllocationProfile::offsetOfAllocator):
      (JSC::ObjectAllocationProfile::offsetOfStructure):
      (JSC::ObjectAllocationProfile::ObjectAllocationProfile):
      (JSC::ObjectAllocationProfile::isNull):
      (JSC::ObjectAllocationProfile::initialize):
      (JSC::ObjectAllocationProfile::structure):
      (JSC::ObjectAllocationProfile::inlineCapacity):
      (JSC::ObjectAllocationProfile::clear):
      (JSC::ObjectAllocationProfile::visitAggregate):
      (JSC::ObjectAllocationProfile::possibleDefaultPropertyCount): New class
      for tracking a prediction about object allocation: structure, inline
      capacity, allocator to use.
      
      * bytecode/Opcode.h:
      (JSC):
      (JSC::padOpcodeName): Updated instruction sizes.
      
      * bytecode/UnlinkedCodeBlock.cpp:
      (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
      * bytecode/UnlinkedCodeBlock.h:
      (JSC):
      (JSC::UnlinkedCodeBlock::addObjectAllocationProfile):
      (JSC::UnlinkedCodeBlock::numberOfObjectAllocationProfiles):
      (UnlinkedCodeBlock): Unlinked support for allocation profiles.
      
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::generate): Kill all remaining analyses at the
      end of codegen, since this is our last opportunity.
      
      (JSC::BytecodeGenerator::BytecodeGenerator): Added a static property
      analyzer to bytecode generation. It tracks initializing assignments and
      makes a guess about how many will happen.
      
      (JSC::BytecodeGenerator::newObjectAllocationProfile):
      (JSC):
      (JSC::BytecodeGenerator::emitProfiledOpcode):
      (JSC::BytecodeGenerator::emitMove):
      (JSC::BytecodeGenerator::emitResolve):
      (JSC::BytecodeGenerator::emitResolveBase):
      (JSC::BytecodeGenerator::emitResolveBaseForPut):
      (JSC::BytecodeGenerator::emitResolveWithBaseForPut):
      (JSC::BytecodeGenerator::emitResolveWithThis):
      (JSC::BytecodeGenerator::emitGetById):
      (JSC::BytecodeGenerator::emitPutById):
      (JSC::BytecodeGenerator::emitDirectPutById):
      (JSC::BytecodeGenerator::emitPutGetterSetter):
      (JSC::BytecodeGenerator::emitGetArgumentByVal):
      (JSC::BytecodeGenerator::emitGetByVal): Added hooks to the static property
      analyzer, so it can observe allocations and stores.
      
      (JSC::BytecodeGenerator::emitCreateThis): Factored this into a helper
      function because it was a significant amount of logic, and I wanted to
      add to it.
      
      (JSC::BytecodeGenerator::emitNewObject):
      (JSC::BytecodeGenerator::emitExpectedFunctionSnippet):
      (JSC::BytecodeGenerator::emitCall):
      (JSC::BytecodeGenerator::emitCallVarargs):
      (JSC::BytecodeGenerator::emitConstruct): Added a hook to profiled opcodes
      to track their stores, in case a store kills a profiled allocation. Since
      profiled opcodes are basically the only interesting stores we do, this
      is a convenient place to notice any store that might kill an allocation.
      
      * bytecompiler/BytecodeGenerator.h:
      (BytecodeGenerator): As above.
      
      * bytecompiler/StaticPropertyAnalysis.h: Added.
      (JSC):
      (StaticPropertyAnalysis):
      (JSC::StaticPropertyAnalysis::create):
      (JSC::StaticPropertyAnalysis::addPropertyIndex):
      (JSC::StaticPropertyAnalysis::record):
      (JSC::StaticPropertyAnalysis::propertyIndexCount):
      (JSC::StaticPropertyAnalysis::StaticPropertyAnalysis): Simple helper
      class for tracking allocations and stores.
      
      * bytecompiler/StaticPropertyAnalyzer.h: Added.
      (StaticPropertyAnalyzer):
      (JSC::StaticPropertyAnalyzer::StaticPropertyAnalyzer):
      (JSC::StaticPropertyAnalyzer::createThis):
      (JSC::StaticPropertyAnalyzer::newObject):
      (JSC::StaticPropertyAnalyzer::putById):
      (JSC::StaticPropertyAnalyzer::mov):
      (JSC::StaticPropertyAnalyzer::kill): Helper class for observing allocations
      and stores and making an inline capacity guess. The heuristics here are
      intentionally minimal because we don't want this one class to try to
      re-create something like a DFG or a runtime analysis. If we discover that
      we need those kinds of analyses, we should just replace this class with
      something else.
      
      This class tracks multiple registers that alias the same object -- that
      happens a lot, when moving locals into temporary registers -- but it
      doesn't track control flow or multiple objects that alias the same register.
      
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::execute): Updated for rename.
      
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock): Updated for inline capacity and
      allocation profile.
      
      * dfg/DFGNode.h:
      (JSC::DFG::Node::hasInlineCapacity):
      (Node):
      (JSC::DFG::Node::inlineCapacity):
      (JSC::DFG::Node::hasFunction): Give the graph a good way to represent
      inline capacity for an allocation.
      
      * dfg/DFGNodeType.h:
      (DFG): Updated for rename.
      
      * dfg/DFGOperations.cpp: Updated for interface change.
      
      * dfg/DFGOperations.h: We pass the inline capacity to the slow case as
      an argument. This is the simplest way, since it's stored as a bytecode operand.
      
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::propagate): Updated for rename.
      
      * dfg/DFGRepatch.cpp:
      (JSC::DFG::tryCacheGetByID): Fixed a horrible off-by-one-half bug that only
      appears when doing an inline cached load for property number 64 on a 32-bit
      system. In JSVALUE32_64 land, "offsetRelativeToPatchedStorage" is the
      offset of the 64bit JSValue -- but we'll actually issue two loads, one for
      the payload at that offset, and one for the tag at that offset + 4. We need
      to ensure that both loads have a compact representation, or we'll corrupt
      the instruction stream.
      
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::emitAllocateJSArray):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::callOperation):
      (JSC::DFG::SpeculativeJIT::emitAllocateBasicStorage):
      (SpeculativeJIT):
      (JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile): Lots of refactoring to support
      passing an allocator to our allocation function, and/or passing a Structure
      as a register instead of an immediate.
      
      * heap/MarkedAllocator.h:
      (DFG):
      (MarkedAllocator):
      (JSC::MarkedAllocator::offsetOfFreeListHead): Added an accessor to simplify
      JIT code generation of allocation from an arbitrary allocator.
      
      * jit/JIT.h:
      (JSC):
      * jit/JITInlines.h:
      (JSC):
      (JSC::JIT::emitAllocateJSObject):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_new_object):
      (JSC::JIT::emitSlow_op_new_object):
      (JSC::JIT::emit_op_create_this):
      (JSC::JIT::emitSlow_op_create_this):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_new_object):
      (JSC::JIT::emitSlow_op_new_object):
      (JSC::JIT::emit_op_create_this):
      (JSC::JIT::emitSlow_op_create_this): Same refactoring as done for the DFG.
      
      * jit/JITStubs.cpp:
      (JSC::tryCacheGetByID): Fixed the same bug mentioned above.
      
      (JSC::DEFINE_STUB_FUNCTION): Updated for interface changes.
      
      * llint/LLIntData.cpp:
      (JSC::LLInt::Data::performAssertions): Updated for interface changes.
      
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      * llint/LowLevelInterpreter.asm:
      * llint/LowLevelInterpreter32_64.asm:
      * llint/LowLevelInterpreter64.asm: Same refactoring as for the JITs.
      
      * profiler/ProfilerBytecode.cpp:
      * profiler/ProfilerBytecodes.cpp:
      * profiler/ProfilerCompilation.cpp:
      * profiler/ProfilerCompiledBytecode.cpp:
      * profiler/ProfilerDatabase.cpp:
      * profiler/ProfilerOSRExit.cpp:
      * profiler/ProfilerOrigin.cpp:
      * profiler/ProfilerProfiledBytecodes.cpp: Include ObjectConstructor.h
      because that's where createEmptyObject() lives now.
      
      * runtime/Executable.h:
      (JSC::JSFunction::JSFunction): Updated for rename.
      
      * runtime/JSCellInlines.h:
      (JSC::allocateCell): Updated to match the allocator selection code in
      the JIT, so it's clearer that both are correct.
      
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::JSFunction):
      (JSC::JSFunction::createAllocationProfile):
      (JSC::JSFunction::visitChildren):
      (JSC::JSFunction::getOwnPropertySlot):
      (JSC::JSFunction::put):
      (JSC::JSFunction::defineOwnProperty):
      (JSC::JSFunction::getConstructData):
      * runtime/JSFunction.h:
      (JSC::JSFunction::offsetOfScopeChain):
      (JSC::JSFunction::offsetOfExecutable):
      (JSC::JSFunction::offsetOfAllocationProfile):
      (JSC::JSFunction::allocationProfile):
      (JSFunction):
      (JSC::JSFunction::tryGetAllocationProfile):
      (JSC::JSFunction::addAllocationProfileWatchpoint): Changed inheritorID
      data member to be an ObjectAllocationProfile, which includes a pointer
      to the desired allocator. This simplifies JIT code, since we don't have
      to compute the allocator on the fly. I verified by code inspection that
      JSFunction is still only 64 bytes.
      
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      (JSC::JSGlobalObject::visitChildren):
      * runtime/JSGlobalObject.h:
      (JSGlobalObject):
      (JSC::JSGlobalObject::dateStructure): No direct pointer to the empty
      object structure anymore, because now clients need to specify how much
      inline capacity they want.
      
      * runtime/JSONObject.cpp:
      * runtime/JSObject.h:
      (JSC):
      (JSFinalObject):
      (JSC::JSFinalObject::defaultInlineCapacity):
      (JSC::JSFinalObject::maxInlineCapacity):
      (JSC::JSFinalObject::createStructure): A little refactoring to try to 
      clarify where some of these constants derive from.
      
      (JSC::maxOffsetRelativeToPatchedStorage): Used for bug fix, above.
      
      * runtime/JSProxy.cpp:
      (JSC::JSProxy::setTarget): Ugly, but effective.
      
      * runtime/LiteralParser.cpp:
      * runtime/ObjectConstructor.cpp:
      (JSC::constructObject):
      (JSC::constructWithObjectConstructor):
      (JSC::callObjectConstructor):
      (JSC::objectConstructorCreate): Updated for interface changes.
      
      * runtime/ObjectConstructor.h:
      (JSC::constructEmptyObject): Clarified your options for how to allocate
      an empty object, to emphasize what things can actually vary.
      
      * runtime/PropertyOffset.h: These constants have moved because they're
      really higher level concepts to do with the layout of objects and the
      collector. PropertyOffset is just an abstract number line, independent
      of those things.
      
      * runtime/PrototypeMap.cpp:
      (JSC::PrototypeMap::emptyObjectStructureForPrototype):
      (JSC::PrototypeMap::clearEmptyObjectStructureForPrototype):
      * runtime/PrototypeMap.h:
      (PrototypeMap): The map key is now a pair of prototype and inline capacity,
      since Structure encodes inline capacity.
      
      * runtime/Structure.cpp:
      (JSC::Structure::Structure):
      (JSC::Structure::materializePropertyMap):
      (JSC::Structure::addPropertyTransition):
      (JSC::Structure::nonPropertyTransition):
      (JSC::Structure::copyPropertyTableForPinning):
      * runtime/Structure.h:
      (Structure):
      (JSC::Structure::totalStorageSize):
      (JSC::Structure::transitionCount):
      (JSC::Structure::create): Fixed a nasty refactoring bug that only shows
      up after enabling variable-sized inline capacities: we were passing our
      type info where our inline capacity was expected. The compiler didn't
      notice because both have type int :(.
      
      ../WebCore: 
      
      * ForwardingHeaders/runtime/ObjectConstructor.h: Added.
      
      * bindings/js/JSInjectedScriptHostCustom.cpp:
      * bindings/js/JSSQLResultSetRowListCustom.cpp: Include ObjectConstructor.h because
      that's where createEmptyObject() is located now.
      
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::CloneDeserializer::deserialize): Updated for interface change.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c862eacf
    • alecflett@chromium.org's avatar
      IndexedDB: Pass metadata in to IDBOpenDBRequest.onUpgradeNeeded/onSuccess · a5b12aca
      alecflett@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=103920
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      Update IDBCallbacks::onSuccess and IDBCallbacks::onUpgradeNeeded to
      pass through a metadata parameter. While there, remove the unused
      IDBTransactionBackendInterface parameter to onUpgradeNeeded.
      
      As this is another step in the IDB refactor, I've simplified future cleanup
      work by making the WebKit API code still use the old API. This
      will make it possible to outright remove code on the chromium side rather
      than another three-step checkin.
      
      No new tests, as this is more refactoring.
      
      * Modules/indexeddb/IDBCallbacks.h:
      (WebCore::IDBCallbacks::onUpgradeNeeded): new method signature.
      (WebCore::IDBCallbacks::onSuccess): new method signature.
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
      (WebCore::IDBDatabaseBackendImpl::openConnection):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded): use passed-in metadata.
      (WebCore::IDBOpenDBRequest::onSuccess): use passed-in metadata.
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      
      Source/WebKit/chromium:
      
      Support the new IDBCallbacks::onSuccess and IDBCallbacks::onUpgradeNeeded
      while maintaining chromium compatibility by shimming in the old API
      in the WebKit side. Future code will clean this up so that it is just a
      pass-through as it was before.
      
      * public/WebIDBCallbacks.h:
      (WebKit):
      (WebKit::WebIDBCallbacks::onSuccess): new method signature.
      (WebKit::WebIDBCallbacks::onUpgradeNeeded): new method signature.
      * src/IDBCallbacksProxy.cpp:
      (WebKit::IDBCallbacksProxy::onSuccess): call on new method signature proxies through old API.
      (WebKit):
      (WebKit::IDBCallbacksProxy::onUpgradeNeeded): call on new method signature proxies through old API.
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      (WebKit::WebIDBCallbacksImpl::onSuccess): call on old WebKit proxy signature calls new API.
      (WebKit):
      (WebKit::WebIDBCallbacksImpl::onUpgradeNeeded): call on old WebKit proxy signature calls new API.
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp: new method signature.
      (WebCore::MockIDBCallbacks::onSuccess):
      * tests/IDBDatabaseBackendTest.cpp: new method signature.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a5b12aca
    • commit-queue@webkit.org's avatar
      Add window occlusion criteria to determine page visibility on Mac · 85d0140e
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107494
      
      Patch by Kiran Muppala <cmuppala@apple.com> on 2013-01-28
      Reviewed by Simon Fraser.
      
      Source/WebKit2:
      
      * UIProcess/API/mac/PageClientImpl.mm:
      (WebKit::PageClientImpl::isViewVisible): Add window occlusion check.
      * UIProcess/API/mac/WKView.mm:
      (-[WKView dealloc]): Remove self from the all views vector.
      (-[WKView addWindowObserversForWindow:]): Register observer for
      NSWindowWillOrderOffScreenNotification.
      (-[WKView removeWindowObservers]): Unregister observer for
      NSWindowWillOrderOffScreenNotification.
      (-[WKView viewWillMoveToWindow:]): Disable occlusion notifications.
      (-[WKView viewDidMoveToWindow]): Enable occlusion notifications.
      (-[WKView _windowWillOrderOffScreen:]): Disable occlusion notifications.
      (-[WKView _windowDidOrderOnScreen:]): Enable occlusion notifications.
      This notification ensures that occlusion notifications are registered
      correctly even if the NSWindow object is assigned a window number after
      the viewDidMoveToWindow notification has been received.  This occurs
      for instance during application launch.
      (-[WKView _setIsWindowOccluded:]):
      (-[WKView _enableWindowOcclusionNotifications]):
      (-[WKView _disableWindowOcclusionNotifications]):
      (windowBecameVisible):
      (windowBecameOccluded):
      (+[WKView _registerWindowOcclusionNotificationHandlers]):
      (+[WKView _unregisterWindowOcclusionNotificationHandlers]):
      (+[WKView _allViews]):
      (-[WKView _isWindowOccluded]):
      (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]): Add
      self to the all views vector.
      * UIProcess/API/mac/WKViewInternal.h:
      
      WebKitLibraries:
      
      Add enum constants to specify window occlusion notification type to
      notification registration/unregistration methods.  Add typedef for
      window ID data passed to the window occlusion notification handler.
      Add method to enable occlusion notifications for a particular window.
      
      * WebKitSystemInterface.h: Add
      WKOcclusionNotificationTypeWindowBecameVisible,
      WKOcclusionNotificationTypeWindowBecameOccluded,
      WKWindowID,
      WKEnableWindowOcclusionNotifications().
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      85d0140e
    • keishi@webkit.org's avatar
      [Chromium] Rebaselining integer-modulo after r141031. · 2b13e24d
      keishi@webkit.org authored
      Unreviewed. Gardening.
      
      * platform/chromium/fast/js/regress/integer-modulo-expected.txt: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2b13e24d
    • commit-queue@webkit.org's avatar
      [BlackBerry] Small animated zoom level adjustments are unnecessary · b588c0d6
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108104
      
      Patch by Andrew Lo <anlo@rim.com> on 2013-01-28
      Reviewed by Rob Buis.
      Internally reviewed by Mike Fenton.
      
      Internal PR 285861.
      If the difference between the target scale and current scale is
      less than a given threshold, don't perform a zoom animation.
      
      * WebKitSupport/InputHandler.cpp:
      (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b588c0d6
    • commit-queue@webkit.org's avatar
      fix multi-touch-inside-iframes Layout test · 5460c824
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108113
      
      Patch by Min Qin <qinmin@chromium.org> on 2013-01-28
      Reviewed by Adam Barth.
      
      The ordering of OnLoad() of the 2 child iframes is racy.
      Fixed by assigning title from the parent frame.
      
      * fast/events/touch/multi-touch-inside-iframes.html:
      * fast/events/touch/resources/multi-touch-inside-iframes2.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5460c824
    • nghanavatian@rim.com's avatar
      [BlackBerry] Reduce the region that is spellchecked on keystroke · 8c5c6dde
      nghanavatian@rim.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108115
      
      Reviewed by Rob Buis.
      
      PR288217
      Instead of blindly checking text until endOfDocument, we should be honoring the boundaries of
      the VisibleSelection that is passed into SpellingHandler. Though this results in the same behavior
      on focus, this dramatically reduces the region that is rechecked when a key is hit.
      
      Internally reviewed by Mike Fenton.
      
      * WebKitSupport/InputHandler.cpp:
      (BlackBerry::WebKit::InputHandler::requestCheckingOfString):
      * WebKitSupport/SpellingHandler.cpp:
      (BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):
      (BlackBerry::WebKit::SpellingHandler::parseBlockForSpellChecking):
      * WebKitSupport/SpellingHandler.h:
      (SpellingHandler):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8c5c6dde
    • commit-queue@webkit.org's avatar
      [TexMap] Enable debug borders and repaint counter via Settings. · 9b55c5b8
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107198
      
      Patch by Huang Dongsung <luxtella@company100.net> on 2013-01-28
      Reviewed by Benjamin Poulain.
      
      Source/WebKit/efl:
      
      If WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS is set to 1, set
      showDebugBorders and showRepaintCounter in Settings to true.
      
      * ewk/ewk_view.cpp:
      (_ewk_view_priv_new):
      
      Source/WebKit/gtk:
      
      If WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS is set to 1, set
      showDebugBorders and showRepaintCounter in Settings to true.
      
      * webkit/webkitwebview.cpp:
      (webkit_web_view_update_settings):
      
      Source/WebKit/qt:
      
      If WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS is set to 1, set
      showDebugBorders and showRepaintCounter in Settings to true.
      
      * Api/qwebsettings.cpp:
      (QWebSettingsPrivate::apply):
      
      Source/WebKit2:
      
      Currently, if the environment variable WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS
      is set to 1, only CoordinatedBacking shows debug borders and repaint counter.
      
      This patch makes the environment variable change Settings.
      
      In addition, Qt uses WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS instead of
      QT_WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS from now.
      
      After Bug 105787, all backing stores and platform layers in TextureMapper can
      show debug borders and repaint counter.
      
      * UIProcess/API/efl/EwkView.cpp:
      (EwkView::EwkView):
      * UIProcess/API/gtk/WebKitSettings.cpp:
      (webKitSettingsSetProperty):
      * UIProcess/API/qt/qquickwebview.cpp:
      (QQuickWebViewPrivate::initialize):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9b55c5b8
    • simon.fraser@apple.com's avatar
      position:fixed that doesn't render any content should not force compositing · 90b35d85
      simon.fraser@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108112
      
      Source/WebCore:
      
      Reviewed by Beth Dakin.
      
      It's not uncommon for pages to have position:fixed elements with no content.
      When these are behind other elements, they can cause those other elements
      to become composited, using lots of backing store memory.
      
      Optimize for the case where the position:fixed element has no rendered
      content and no children by not making it composited in that case.
      
      Test: compositing/layer-creation/fixed-position-no-content.html
      
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::hasNonEmptyChildRenderers): Moved from RenderLayerBacking.cpp.
      (WebCore::hasBoxDecorations): Ditto.
      (WebCore::RenderLayer::hasBoxDecorationsOrBackground): Ditto.
      (WebCore::RenderLayer::hasVisibleBoxDecorations): Check for visibility:visible, box decorations and
      overflow controls.
      (WebCore::RenderLayer::isVisuallyNonEmpty): Returns true if this layer has some visible
      representation.
      * rendering/RenderLayer.h:
      * rendering/RenderLayerBacking.cpp:
      (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Need to call updateDescendantDependentFlags()
      to ensure that the visibility flags are up to date.
      (WebCore::RenderLayerBacking::updateDrawsContent): Call RenderLayer::hasBoxDecorationsOrBackground() now.
      (WebCore::RenderLayerBacking::paintsBoxDecorations): Call RenderLayer::hasVisibleBoxDecorations() now.
      (WebCore::RenderLayerBacking::paintsChildren): Call RenderLayer::hasNonEmptyChildRenderers().
      (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer): Whitespace.
      (WebCore::RenderLayerBacking::containsPaintedContent): Call RenderLayer::hasBoxDecorationsOrBackground().
      (WebCore::RenderLayerBacking::isDirectlyCompositedImage): Ditto.
      * rendering/RenderLayerBacking.h:
      (RenderLayerBacking):
      * rendering/RenderLayerCompositor.cpp:
      (WebCore::RenderLayerCompositor::requiresCompositingForPosition): If the layer has no content to paint,
      or visible descendant layers, then don't make it composited.
      
      LayoutTests:
      
      Reviewed by Beth Dakin.
      
      Change tests to put a background color on position:fixed elements that need to be composited.
      New test with an empty fixed position element.
      
      * compositing/layer-creation/fixed-position-change-out-of-view-in-view.html:
      * compositing/layer-creation/fixed-position-no-content-expected.txt: Added.
      * compositing/layer-creation/fixed-position-no-content.html: Copied from LayoutTests/compositing/layer-creation/fixed-position-out-of-view.html.
      * compositing/layer-creation/fixed-position-out-of-view-scaled-scroll.html:
      * compositing/layer-creation/fixed-position-out-of-view-scaled.html:
      * compositing/layer-creation/fixed-position-out-of-view.html:
      * platform/mac/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex.html:
      * platform/mac/tiled-drawing/fixed/fixed-position-out-of-view.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      90b35d85
    • keishi@webkit.org's avatar
      [Chromium] Skipping mathml tests because MATHML was disasbled. · 2ef2e0af
      keishi@webkit.org authored
      Unreviewed. Gardening.
      
      * platform/chromium/TestExpectations:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2ef2e0af
    • andersca@apple.com's avatar
      Move Mach port handling from WorkQueue to Connection · 367b7c76
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108140
      
      Reviewed by Sam Weinig.
      
      Instead of having WorkQueue know about Mach port sources, just fold that
      functionality directly into Connection. This lets us get rid of the generic source
      handling from WorkQueue.
      
      * Platform/CoreIPC/Connection.h:
      (Connection):
      * Platform/CoreIPC/mac/ConnectionMac.cpp:
      (CoreIPC::Connection::platformInvalidate):
      (CoreIPC::createDataAvailableSource):
      (CoreIPC):
      (CoreIPC::Connection::open):
      (CoreIPC::Connection::initializeDeadNameSource):
      * Platform/WorkQueue.h:
      (WorkQueue::dispatchQueue):
      (WorkQueue):
      * Platform/mac/WorkQueueMac.cpp:
      (WorkQueue::platformInvalidate):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      367b7c76
    • simon.fraser@apple.com's avatar
      Avoid doing work at 60fps for tiled layers when not necessary · 55250145
      simon.fraser@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108135
      
      Reviewed by Dean Jackson.
      
      When there were any tiled layers on the page, we would run a CVDisplayLink
      to cause GraphicsLayerCA to flush, in order to update tiled layer visible rects.
      This is overkill; we should only do this if the tiled layer is affected by
      an accelerated animation.
      
      Fix by tracking whether an ancestor has a running animation when committing
      GraphicsLayerCAs.
      
      * platform/graphics/ca/GraphicsLayerCA.cpp:
      (WebCore::GraphicsLayerCA::flushCompositingState): Start with an empty CommitState.
      (WebCore::GraphicsLayerCA::recursiveCommitChanges): Push CommitState for
      each layer, which tracks whether an ancestor has a running transform animation.
      (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): updateLayerAnimations() renamed.
      (WebCore::GraphicsLayerCA::updateAnimations): Renamed from updateLayerAnimations().
      (WebCore::GraphicsLayerCA::isRunningTransformAnimation): Look in the map of running
      animations for one affecting transform. This list is normally small (one item).
      * platform/graphics/ca/GraphicsLayerCA.h:
      (WebCore::GraphicsLayerCA::CommitState::CommitState):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      55250145
    • simon.fraser@apple.com's avatar
      compositing/reflections/become-simple-composited-reflection.html pixel result shows bug · 8ddd381c
      simon.fraser@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107174
      
      Reviewed by Dean Jackson.
      
      When we have a content layer for solid color, we need to update reflection
      clones when that color changes.
      
      Tested by the pixel test for compositing/reflections/become-simple-composited-reflection.html.
      
      * platform/graphics/ca/GraphicsLayerCA.cpp:
      (WebCore::GraphicsLayerCA::updateContentsColorLayer):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8ddd381c
    • abarth@webkit.org's avatar
      [v8] Security feature: JavaScript Bindings hardening · 7929995e
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=106608
      
      Source/WebCore: 
      
      The patch adds a check at wrapper creation time to enuse that the
      object being wrapped is not already free, to the extent that we know
      the information about the type of the object as provided in the IDL.
      
      Patch by Tom Sepez <tsepez@chromium.org> on 2013-01-28
      Reviewed by Adam Barth.
      
      Patch is correct if existing tests pass without new crashes.
      
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateImplementation):
      (GenerateToV8Converters):
      (GetNativeTypeForConversions):
      (GetGnuVTableRefForInterface):
      (GetGnuVTableNameForInterface):
      (GetGnuMangledNameForInterface):
      (GetGnuVTableOffsetForType):
      (GetWinVTableRefForInterface):
      (GetWinVTableNameForInterface):
      (GetWinMangledNameForInterface):
      (GetNamespaceForInterface):
      (GetImplementationLacksVTableForInterface):
      (GetV8SkipVTableValidationForInterface):
      Update code generation to add object validity tests under the control
      of the ENABLE_BINDING_INTEGRITY option.
              
      * Modules/filesystem/DirectoryReader.idl:
      * Modules/filesystem/DirectoryReaderSync.idl:
      * Modules/filesystem/EntryArray.idl:
      * Modules/filesystem/EntryArraySync.idl:
      * Modules/filesystem/Metadata.idl:
      * Modules/gamepad/Gamepad.idl:
      * Modules/gamepad/GamepadList.idl:
      * Modules/geolocation/Geoposition.idl:
      * Modules/geolocation/PositionError.idl:
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBIndex.idl:
      * Modules/indexeddb/IDBKeyRange.idl:
      * Modules/indexeddb/IDBObjectStore.idl:
      * Modules/mediastream/RTCStatsElement.idl:
      * Modules/mediastream/RTCStatsReport.idl:
      * Modules/quota/StorageInfo.idl:
      * Modules/speech/SpeechGrammar.idl:
      * Modules/speech/SpeechGrammarList.idl:
      * Modules/speech/SpeechRecognitionAlternative.idl:
      * Modules/speech/SpeechRecognitionResult.idl:
      * Modules/speech/SpeechRecognitionResultList.idl:
      * Modules/webaudio/AudioBuffer.idl:
      * Modules/webaudio/AudioDestinationNode.idl:
      * Modules/webaudio/AudioListener.idl:
      * Modules/webaudio/AudioSourceNode.idl:
      * Modules/webaudio/WaveTable.idl:
      * Modules/webdatabase/SQLError.idl:
      * Modules/webdatabase/SQLException.idl:
      * Modules/webdatabase/SQLResultSet.idl:
      * Modules/webdatabase/SQLResultSetRowList.idl:
      * Modules/webdatabase/SQLTransaction.idl:
      * Modules/webdatabase/SQLTransactionSync.idl:
      * bindings/scripts/IDLAttributes.txt:
      * css/CSSPrimitiveValue.idl:
      * css/CSSRule.idl:
      * css/CSSRuleList.idl:
      * css/CSSStyleDeclaration.idl:
      * css/CSSValue.idl:
      * css/CSSValueList.idl:
      * css/Counter.idl:
      * css/MediaList.idl:
      * css/MediaQueryList.idl:
      * css/RGBColor.idl:
      * css/Rect.idl:
      * css/StyleSheetList.idl:
      * css/WebKitCSSFilterValue.idl:
      * css/WebKitCSSMixFunctionValue.idl:
      * css/WebKitCSSTransformValue.idl:
      * dom/ClientRect.idl:
      * dom/ClientRectList.idl:
      * dom/Clipboard.idl:
      * dom/DOMCoreException.idl:
      * dom/DOMError.idl:
      * dom/DOMImplementation.idl:
      * dom/DOMNamedFlowCollection.idl:
      * dom/DOMStringList.idl:
      * dom/DOMStringMap.idl:
      * dom/DataTransferItem.idl:
      * dom/DataTransferItemList.idl:
      * dom/DocumentFragment.idl:
      * dom/Element.idl:
      * dom/Entity.idl:
      * dom/Event.idl:
      * dom/EventException.idl:
      * dom/MessageChannel.idl:
      * dom/MouseEvent.idl:
      * dom/MutationObserver.idl:
      * dom/MutationRecord.idl:
      * dom/NamedNodeMap.idl:
      * dom/NodeFilter.idl:
      * dom/NodeIterator.idl:
      * dom/NodeList.idl:
      * dom/Range.idl:
      * dom/RangeException.idl:
      * dom/Touch.idl:
      * dom/TouchList.idl:
      * dom/TreeWalker.idl:
      * fileapi/FileError.idl:
      * fileapi/FileException.idl:
      * fileapi/FileList.idl:
      * html/DOMFormData.idl:
      * html/DOMTokenList.idl:
      * html/DOMURL.idl:
      * html/HTMLAllCollection.idl:
      * html/HTMLCollection.idl:
      * html/HTMLDialogElement.idl:
      * html/HTMLDivElement.idl:
      * html/HTMLDocument.idl:
      * html/HTMLElement.idl:
      * html/HTMLImageElement.idl:
      * html/HTMLInputElement.idl:
      * html/HTMLSelectElement.idl:
      * html/HTMLSpanElement.idl:
      * html/HTMLUnknownElement.idl:
      * html/ImageData.idl:
      * html/MediaError.idl:
      * html/MediaKeyError.idl:
      * html/TimeRanges.idl:
      * html/ValidityState.idl:
      * html/canvas/ArrayBuffer.idl:
      * html/canvas/ArrayBufferView.idl:
      * html/canvas/CanvasGradient.idl:
      * html/canvas/CanvasPattern.idl:
      * html/canvas/Float32Array.idl:
      * html/canvas/Float64Array.idl:
      * html/canvas/Int16Array.idl:
      * html/canvas/Int32Array.idl:
      * html/canvas/Int8Array.idl:
      * html/canvas/Uint16Array.idl:
      * html/canvas/Uint32Array.idl:
      * html/canvas/Uint8Array.idl:
      * html/canvas/Uint8ClampedArray.idl:
      * html/canvas/WebGLActiveInfo.idl:
      * html/canvas/WebGLShaderPrecisionFormat.idl:
      * html/track/TextTrack.idl:
      * html/track/TextTrackCue.idl:
      * html/track/TextTrackCueList.idl:
      * inspector/InjectedScriptHost.idl:
      * inspector/InspectorFrontendHost.idl:
      * inspector/JavaScriptCallFrame.idl:
      * page/Coordinates.idl:
      * page/Crypto.idl:
      * page/MemoryInfo.idl:
      * page/PagePopupController.idl:
      * page/PerformanceEntryList.idl:
      * page/SpeechInputResult.idl:
      * page/SpeechInputResultList.idl:
      * page/WebKitPoint.idl:
      * svg/SVGAnimatedAngle.idl:
      * svg/SVGAnimatedBoolean.idl:
      * svg/SVGAnimatedEnumeration.idl:
      * svg/SVGAnimatedInteger.idl:
      * svg/SVGAnimatedLength.idl:
      * svg/SVGAnimatedLengthList.idl:
      * svg/SVGAnimatedNumber.idl:
      * svg/SVGAnimatedNumberList.idl:
      * svg/SVGAnimatedPreserveAspectRatio.idl:
      * svg/SVGAnimatedRect.idl:
      * svg/SVGAnimatedString.idl:
      * svg/SVGAnimatedTransformList.idl:
      * svg/SVGColor.idl:
      * svg/SVGException.idl:
      * svg/SVGPaint.idl:
      * svg/SVGPathSeg.idl:
      * svg/SVGRenderingIntent.idl:
      * svg/SVGUnitTypes.idl:
      * svg/SVGZoomAndPan.idl:
      * testing/MallocStatistics.idl:
      * testing/TypeConversions.idl:
      * workers/WorkerLocation.idl:
      * xml/DOMParser.idl:
      * xml/XMLHttpRequestException.idl:
      * xml/XMLSerializer.idl:
      * xml/XPathEvaluator.idl:
      * xml/XPathException.idl:
      * xml/XPathExpression.idl:
      * xml/XPathNSResolver.idl:
      * xml/XPathResult.idl:
      * xml/XSLTProcessor.idl:
      Add exceptions to binding integrity checks to IDL.
      
      Source/WebKit/chromium: 
      
      Patch by Tom Sepez <tsepez@chromium.org> on 2013-01-28
      Reviewed by Adam Barth.
      
      * features.gypi:
      Added ENABLE_BINDING_INTEGRITY option.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7929995e
    • hclam@chromium.org's avatar
      [chromium] Build fix. · 49fdc9a5
      hclam@chromium.org authored
      Unreviewed build fix. Remove the use of SkMutex from DiscardablePixelRef.
      
      * platform/graphics/chromium/DiscardablePixelRef.cpp:
      (WebCore::DiscardablePixelRefAllocator::allocPixelRef):
      (WebCore::DiscardablePixelRef::DiscardablePixelRef):
      * platform/graphics/chromium/DiscardablePixelRef.h:
      (DiscardablePixelRef):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      49fdc9a5
    • gyuyoung.kim@samsung.com's avatar
      Add StorageManager class to cmake ports · b877f992
      gyuyoung.kim@samsung.com authored
      Unreviewed build fix. Though StorageManager was added to WK2 in r141024,
      it is not added to cmake ports(EFL).
      
      * CMakeLists.txt:
      * PlatformEfl.cmake:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b877f992
    • msaboff@apple.com's avatar
      Make integer-modulo.js a try JS-Regress test · 0468bdc3
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108130
      
      Reviewed by Filip Pizlo.
      
      Eliminated the LayoutTest calls.  Sum the values and throw an expection if it doesn't
      match up.
      
      * fast/js/regress/script-tests/integer-modulo.js:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0468bdc3
    • benjamin@webkit.org's avatar
      String constructed from Literals should be non-empty · 4a05de07
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108103
      
      Reviewed by Eric Carlson.
      
      Source/WebCore: 
      
      Strings from literal should not be constructed from empty strings. Use emptyString()
      instead.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::canPlayType):
      
      Source/WTF: 
      
      For efficiency, the construction from literal only works with valid non-empty strings.
      One of the constructor was changed to fix an error from HTMLMediaElement.
      
      This patch replaces the branch with an assertions.
      
      * wtf/text/StringImpl.cpp:
      (WTF::StringImpl::createFromLiteral):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4a05de07
    • oliver@apple.com's avatar
      Add more assertions to the property storage use in arrays · 5468c770
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107728
      
      Reviewed by Filip Pizlo.
      
      Add a bunch of assertions to array and object butterfly
      usage.  This should make debugging somewhat easier.
      
      I also converted a couple of assertions to release asserts
      as they were so low cost it seemed a sensible thing to do.
      
      * runtime/JSArray.cpp:
      (JSC::JSArray::sortVector):
      (JSC::JSArray::compactForSorting):
      * runtime/JSObject.h:
      (JSC::JSObject::getHolyIndexQuickly):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5468c770
    • haraken@chromium.org's avatar
      Implement CompositionEvent constructor · eab5fb4d
      haraken@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107919
      
      Reviewed by Sam Weinig.
      
      This patch implements a CompositionEvent constructor under
      a DOM4_EVENTS_CONSTRUCTOR flag.
      
      Spec: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm
      
      Source/WebCore:
      
      Test: fast/events/constructors/composition-event-constructor.html
      
      * dom/CompositionEvent.cpp:
      (WebCore::CompositionEventInit::CompositionEventInit):
      (WebCore):
      (WebCore::CompositionEvent::CompositionEvent):
      * dom/CompositionEvent.h:
      (CompositionEventInit):
      (WebCore):
      (CompositionEvent):
      (WebCore::CompositionEvent::create):
      (WebCore::CompositionEvent::data):
      * dom/CompositionEvent.idl:
      
      LayoutTests:
      
      * fast/dom/constructed-objects-prototypes-expected.txt:
      * fast/events/constructors/composition-event-constructor-expected.txt: Added.
      * fast/events/constructors/composition-event-constructor.html: Added.
      * platform/efl/TestExpectations:
      * platform/gtk/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win/TestExpectations:
      * platform/wincairo/TestExpectations:
      
      * fast/dom/constructed-objects-prototypes-expected.txt:
      * platform/efl/TestExpectations:
      * platform/gtk/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win/TestExpectations:
      * platform/wincairo/TestExpectations:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eab5fb4d
    • weinig@apple.com's avatar
      <rdar://problem/13098777> · 125d746d
      weinig@apple.com authored
      Add (allow mach-lookup (global-name "com.apple.tccd.system"))
      
      Reviewed by Maciej Stachowiak.
      
      * WebProcess/com.apple.WebProcess.sb.in:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      125d746d
    • beidson@apple.com's avatar
      WebKit2 should notify the client if the NetworkProcess crashes. · c68004bc
      beidson@apple.com authored
      <rdar://problem/13090513> and https://bugs.webkit.org/show_bug.cgi?id=108126
      
      Reviewed by Sam Weinig.
      
      Add new client callback to the ContextClient:
      * UIProcess/API/C/WKContext.h:
      * UIProcess/WebContextClient.cpp:
      (WebKit::WebContextClient::networkProcessDidCrash):
      * UIProcess/WebContextClient.h:
      
      Call out to the client when the NetworkProcess crashes:
      * UIProcess/WebContext.cpp:
      (WebKit::WebContext::networkProcessCrashed):
      * UIProcess/WebContext.h:
      
      * UIProcess/Network/NetworkProcessProxy.cpp:
      (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c68004bc
    • psolanki@apple.com's avatar
      PLATFORM(IOS) should come before __MAC_OS_X_VERSION_MIN_REQUIRED · 1fa6d924
      psolanki@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108101
      
      Reviewed by Benjamin Poulain.
      
      Since iOS does not define __MAC_OS_X_VERSION_MIN_REQUIRED, any usage of
      __MAC_OS_X_VERSION_MIN_REQUIRED should be after a PLATFORM(IOS) check.
      
      Source/WebCore:
      
      * platform/mac/WebCoreSystemInterface.h:
      * platform/mac/WebCoreSystemInterface.mm:
      
      Source/WebKit/mac:
      
      * WebCoreSupport/WebSystemInterface.mm:
      (InitWebCoreSystemInterface):
      
      Source/WebKit2:
      
      * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
      (InitWebCoreSystemInterface):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1fa6d924
    • andersca@apple.com's avatar
      Add StorageManager class · c4aa811a
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108127
      
      Reviewed by Sam Weinig.
      
      The StorageManager will be in charge of handling access to local and session storage
      in the UI process.
      
      * UIProcess/Storage/StorageManager.cpp: Added.
      * UIProcess/Storage/StorageManager.h: Added.
      * WebKit2.xcodeproj/project.pbxproj:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c4aa811a
    • commit-queue@webkit.org's avatar
      [GTK] Pass ICU cppflags to libWebCoreSVG.la build · 7afc0e13
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108032
      
      Patch by Kalev Lember <kalevlember@gmail.com> on 2013-01-28
      Reviewed by Martin Robinson.
      
      Fixes a linking error with new libicu 50 on Fedora rawhide.
      
      * GNUmakefile.am:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7afc0e13
    • commit-queue@webkit.org's avatar
      Refactor ChangeLog and PrepareChangeLog to use FileSystem objects · 468ea899
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107903
      
      Patch by Timothy Loh <timloh@chromium.com> on 2013-01-28
      Reviewed by Eric Seidel.
      
      To make ChangeLog and PrepareChangeLog easier to test, we can use
      FileSystem objects instead of just passing around paths.
      
      * Scripts/webkitpy/common/checkout/changelog.py:
      (ChangeLog.__init__):
      (ChangeLog.parse_latest_entry_from_file):
      (ChangeLog.parse_entries_from_file):
      (ChangeLog.latest_entry):
      (ChangeLog.update_with_unreviewed_message):
      (ChangeLog.set_reviewer):
      (ChangeLog.set_short_description_and_bug_url):
      (ChangeLog.delete_entries):
      (ChangeLog.prepend_text):
      * Scripts/webkitpy/common/checkout/changelog_unittest.py:
      (ChangeLogTest):
      (test_parse_log_entries_from_changelog):
      (test_latest_entry_parse_single_entry):
      (test_set_reviewer):
      (test_set_short_description_and_bug_url):
      (test_delete_entries):
      (test_prepend_text):
      * Scripts/webkitpy/common/system/filesystem_mock.py:
      (ReadableTextFileObject.__init__):
      * Scripts/webkitpy/tool/steps/preparechangelog.py:
      (PrepareChangeLog._ensure_bug_url):
      (PrepareChangeLog._resolve_existing_entry):
      (PrepareChangeLog.run):
      * Scripts/webkitpy/tool/steps/preparechangelog_unittest.py:
      (test_ensure_bug_url):
      * Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py:
      (_assert_message_for_revert_output):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      468ea899
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r141006. · 013f4b26
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/141006
      https://bugs.webkit.org/show_bug.cgi?id=108123
      
      Broke chromium build (Requested by arv on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-28
      
      * public/WebConsoleMessage.h:
      * src/AssertMatchingEnums.cpp:
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::addMessageToConsole):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      013f4b26
    • wangxianzhu@chromium.org's avatar
      adding support for DiscardablePixelRef for caching lazily decoded images · e5629195
      wangxianzhu@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=106842
      
      Patch by Min Qin <qinmin@chromium.org> on 2013-01-28
      Reviewed by Stephen White.
      
      Source/WebCore:
      
      This change allows using discardable memory in the deferred image decoding path.
      Fully decoded images are unpinned and stored in ImageDecodingStore.
      Partially decoded images are pinned and stored in ImageDecodingStore.
      Discardable memory allocation could fail. Fall back to heap allocation in that case.
      There is a separate size limit for heap entries and no limit on discardable entries.
      New tests are added to ImageDecodingStoreTests
      
      * WebCore.gypi:
      * platform/graphics/chromium/DiscardablePixelRef.cpp: Added.
        Added implementation of the DiscardablePixelRef object that is backed by discardable memory.
        Memory allocated to the DiscardablePixelRef can be purged when it is unlocked.
      (WebCore::DiscardablePixelRefAllocator::allocPixelRef):
      (WebCore):
      (WebCore::DiscardablePixelRef::DiscardablePixelRef):
      (WebCore::DiscardablePixelRef::~DiscardablePixelRef):
      (WebCore::DiscardablePixelRef::allocAndLockDiscardableMemory):
      (WebCore::DiscardablePixelRef::onLockPixels):
      (WebCore::DiscardablePixelRef::onUnlockPixels):
      (WebCore::DiscardablePixelRef::isDiscardable):
      * platform/graphics/chromium/DiscardablePixelRef.h: Added.
        Added class definition of the DiscardablePixelRef.
      (WebCore):
      (DiscardablePixelRefAllocator):
      (DiscardablePixelRef):
      * platform/graphics/chromium/ImageDecodingStore.cpp:
        Added new cache replacement strategy for DiscardablePixelRef.
      (WebCore::ImageDecodingStore::lockCache):
      (WebCore::ImageDecodingStore::overwriteAndLockCache):
      (WebCore::ImageDecodingStore::prune):
      (WebCore::ImageDecodingStore::insertCacheInternal):
      (WebCore::ImageDecodingStore::removeFromCacheInternal):
      * platform/graphics/chromium/ImageDecodingStore.h:
        Added isDiscardable() calls to check if a cache entry is discardable.
      (WebCore::ImageDecodingStore::CacheEntry::CacheEntry):
      (WebCore::ImageDecodingStore::CacheEntry::overwriteCachedImage):
      (WebCore::ImageDecodingStore::CacheEntry::isDiscardable):
      (CacheEntry):
      * platform/graphics/chromium/ImageFrameGenerator.cpp:
        Added some code to pass DiscardableMemoryAllocator to the image decoder.
      (WebCore::ImageFrameGenerator::tryToScale):
      (WebCore::ImageFrameGenerator::decode):
      * platform/graphics/chromium/ImageFrameGenerator.h:
        Added a new member variable of type DiscardableMemoryAllocator.
      (ImageFrameGenerator):
      * platform/image-decoders/ImageDecoder.h:
        Added methods to pass Allocator to ImageFrame.
      (ImageFrame):
      (WebCore::ImageFrame::setMemoryAllocator):
      (WebCore::ImageFrame::allocator):
      (ImageDecoder):
      (WebCore::ImageDecoder::setMemoryAllocator):
      * platform/image-decoders/skia/ImageDecoderSkia.cpp:
        Added code to allocate pixel memory using the allocator passed from the caller.
      (WebCore::ImageFrame::ImageFrame):
      (WebCore::ImageFrame::operator=):
      (WebCore::ImageFrame::setSize):
      
      Source/WebKit/chromium:
      
      Adding new tests for ImageDecodingStore
      
      * WebKit.gypi:
      * tests/ImageDecodingStoreTest.cpp:
      (WebCore::ImageDecodingStoreTest::createCompleteImage):
      (WebCore::ImageDecodingStoreTest::createIncompleteImage):
      (WebCore::TEST_F):
      (WebCore):
      * tests/MockDiscardablePixelRef.h: Added.
      (WebCore):
      (MockDiscardablePixelRef):
      (WebCore::MockDiscardablePixelRef::MockDiscardablePixelRef):
      (WebCore::MockDiscardablePixelRef::~MockDiscardablePixelRef):
      (WebCore::MockDiscardablePixelRef::discard):
      (WebCore::MockDiscardablePixelRef::onLockPixels):
      (WebCore::MockDiscardablePixelRef::onUnlockPixels):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e5629195
    • commit-queue@webkit.org's avatar
      [Chromium, Mobile] Do not show disambiguation pop up in mobile sites · eca002e0
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107607
      
      Patch by Dan Alcantara <dfalcantara@chromium.org> on 2013-01-28
      Reviewed by Adam Barth.
      
      Add a check before showing the disambiguation popup to prevent it from appearing
      on mobile sites.  Makes a similar test to the current disambiguation popup test
      that expects the popup to never appear.
      
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::handleGestureEvent):
      (WebKit):
      (WebKit::WebViewImpl::isLikelyMobileSite):
      * src/WebViewImpl.h:
      (WebViewImpl):
      * tests/WebFrameTest.cpp:
      * tests/data/disambiguation_popup_mobile_site.html: Added.
      
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::handleGestureEvent):
      (WebKit):
      (WebKit::WebViewImpl::shouldDisableDesktopWorkarounds):
      * src/WebViewImpl.h:
      (WebViewImpl):
      * tests/WebFrameTest.cpp:
      * tests/data/disambiguation_popup_mobile_site.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eca002e0
    • schenney@chromium.org's avatar
      [Chromium] Fix the build. · 1028bcf4
      schenney@chromium.org authored
      Unreviewed build fix.
      
      * src/AssertMatchingEnums.cpp: Move the include to the right place and remove the bad directory prefix.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1028bcf4
    • andersca@apple.com's avatar
      More work on UI side local storage · ec9bce76
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108119
      
      Reviewed by Beth Dakin.
      
      * WebKit2.xcodeproj/project.pbxproj:
      * WebProcess/Storage/StorageNamespaceProxy.cpp:
      (WebKit::StorageNamespaceProxy::createSessionStorageNamespace):
      Rename create to createSessionStorageNamespace and make it take a WebPage.
      
      (WebKit::StorageNamespaceProxy::StorageNamespaceProxy):
      Add WebPage parameter.
      
      * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
      (WebKit::WebPlatformStrategies::sessionStorageNamespace):
      Add an #ifdef for enabling UI side storage.
      
      * WebProcess/WebPage/WebFrame.cpp:
      (WebKit::WebFrame::page):
      Call new WebPage::fromCorePage helper.
      
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::fromCorePage):
      Add new function for getting a WebPage from a WebCore::Page.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ec9bce76
    • rtoy@google.com's avatar
      Add myself to committers.py · fa3dbf2c
      rtoy@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107992
      
      Reviewed by kbr@google.com.
      
      * Scripts/webkitpy/common/config/committers.py:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fa3dbf2c
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140869. · ba884922
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140869
      https://bugs.webkit.org/show_bug.cgi?id=108120
      
      "Crashes on http://en.wikipedia.org/wiki/Wikipedia" (Requested
      by tonyg-cr on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-28
      
      Source/WebCore:
      
      * page/FrameView.cpp:
      (WebCore::FrameView::visibleContentsResized):
      * platform/ScrollView.cpp:
      (WebCore::ScrollView::setFixedLayoutSize):
      (WebCore::ScrollView::setUseFixedLayout):
      
      Source/WebKit/chromium:
      
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::resize):
      (WebKit::WebViewImpl::computePageScaleFactorLimits):
      * tests/WebFrameTest.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ba884922
    • jsbell@chromium.org's avatar
      [Chromium] Unreviewed gardening, removing Crash expectations from storage/indexeddb tests. · 6c02b816
      jsbell@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108048
      
      Unreviewed.
      
      * platform/chromium/TestExpectations:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6c02b816
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r140934, r140935, and r140937. · 1b629091
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/140934
      http://trac.webkit.org/changeset/140935
      http://trac.webkit.org/changeset/140937
      https://bugs.webkit.org/show_bug.cgi?id=108117
      
      Re-land some speculative rollouts - see wkbug.com/108048 for
      context (Requested by jsbell on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-28
      
      Source/WebCore:
      
      * CMakeLists.txt:
      * DerivedSources.make:
      * GNUmakefile.list.am:
      * Modules/indexeddb/IDBCallbacks.h:
      (IDBCallbacks):
      * Modules/indexeddb/IDBCursorBackendImpl.cpp:
      (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
      * Modules/indexeddb/IDBCursorBackendImpl.h:
      (WebCore::IDBCursorBackendImpl::create):
      (IDBCursorBackendImpl):
      * Modules/indexeddb/IDBDatabase.cpp:
      (WebCore::IDBDatabase::onVersionChange):
      * Modules/indexeddb/IDBDatabase.h:
      * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
      (WebCore::IDBDatabaseBackendImpl::setIndexesReady):
      (WebCore::OpenCursorOperation::perform):
      (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
      * Modules/indexeddb/IDBFactory.cpp:
      (WebCore::IDBFactory::openInternal):
      (WebCore::IDBFactory::deleteDatabase):
      * Modules/indexeddb/IDBFactory.h:
      (WebCore):
      (IDBFactory):
      * Modules/indexeddb/IDBFactory.idl:
      * Modules/indexeddb/IDBObjectStore.cpp:
      (WebCore::IDBObjectStore::createIndex):
      (WebCore::IDBObjectStore::openCursor):
      * Modules/indexeddb/IDBObjectStore.h:
      (WebCore::IDBObjectStore::openCursor):
      (IDBObjectStore):
      * Modules/indexeddb/IDBOpenDBRequest.cpp:
      (WebCore::IDBOpenDBRequest::create):
      (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
      (WebCore::IDBOpenDBRequest::onBlocked):
      (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
      (WebCore::IDBOpenDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBOpenDBRequest.h:
      (IDBOpenDBRequest):
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::create):
      (WebCore::IDBRequest::IDBRequest):
      * Modules/indexeddb/IDBRequest.h:
      (IDBRequest):
      (WebCore::IDBRequest::taskType):
      * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      * Modules/indexeddb/IDBTransactionBackendImpl.h:
      (WebCore::IDBTransactionBackendImpl::scheduleTask):
      (IDBTransactionBackendImpl):
      * Modules/indexeddb/IDBTransactionBackendInterface.h:
      * Modules/indexeddb/IDBUpgradeNeededEvent.cpp: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.h: Removed.
      * Modules/indexeddb/IDBUpgradeNeededEvent.idl: Removed.
      * Modules/indexeddb/IDBVersionChangeEvent.cpp:
      (WebCore::IDBVersionChangeEvent::create):
      (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
      * Modules/indexeddb/IDBVersionChangeEvent.h:
      (IDBVersionChangeEvent):
      (WebCore::IDBVersionChangeEvent::oldVersion):
      (WebCore::IDBVersionChangeEvent::newVersion):
      * Modules/indexeddb/IDBVersionChangeEvent.idl:
      * Modules/indexeddb/IDBVersionChangeRequest.cpp: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.h: Removed.
      * Modules/indexeddb/IDBVersionChangeRequest.idl: Removed.
      * WebCore.gypi:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/EventNames.in:
      * dom/EventTarget.h:
      (WebCore):
      * dom/EventTargetFactory.in:
      
      Source/WebKit/chromium:
      
      * public/WebIDBCallbacks.h:
      (WebIDBCallbacks):
      * src/AssertMatchingEnums.cpp:
      * src/IDBCallbacksProxy.cpp:
      * src/IDBCallbacksProxy.h:
      (IDBCallbacksProxy):
      * src/WebIDBCallbacksImpl.cpp:
      * src/WebIDBCallbacksImpl.h:
      (WebIDBCallbacksImpl):
      * tests/IDBAbortOnCorruptTest.cpp:
      * tests/IDBDatabaseBackendTest.cpp:
      
      LayoutTests:
      
      * storage/indexeddb/delete-in-upgradeneeded-close-in-open-success-expected.txt:
      * storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-blocked-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers-expected.txt:
      * storage/indexeddb/deletedatabase-delayed-by-versionchange-expected.txt:
      * storage/indexeddb/deletedatabase-not-blocked-expected.txt:
      * storage/indexeddb/events-expected.txt: Added.
      * storage/indexeddb/events.html: Added.
      * storage/indexeddb/intversion-gated-on-delete-expected.txt:
      * storage/indexeddb/intversion-long-queue-expected.txt:
      * storage/indexeddb/intversion-upgrades-expected.txt:
      * storage/indexeddb/removed-expected.txt:
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-open-success.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/delete-in-upgradeneeded-close-in-versionchange.js:
      (versionChangeCallback):
      * storage/indexeddb/resources/deletedatabase-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
      (prepareDatabase.h.onversionchange):
      * storage/indexeddb/resources/deletedatabase-delayed-by-versionchange.js:
      (h1OpenSuccess.h1.onversionchange.h1OnVersionChange.h1.onversionchange):
      (h1OpenSuccess.h1.onversionchange):
      (h1OpenSuccess.request.onsuccess.h2OpenSuccess.h2.onversionchange):
      * storage/indexeddb/resources/deletedatabase-not-blocked.js:
      (test.request.onsuccess.openOnSuccess.h.onversionchange):
      * storage/indexeddb/resources/events.js: Added.
      (test):
      * storage/indexeddb/resources/intversion-gated-on-delete.js:
      (firstSuccessCallback):
      (connection1VersionChangeCallback):
      * storage/indexeddb/resources/intversion-long-queue.js:
      (connection1VersionChangeCallback):
      (deleteDatabaseBlockedCallback):
      (deleteDatabaseSuccessCallback):
      (connection2VersionChangeEvent):
      * storage/indexeddb/resources/removed.js:
      (test):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1b629091
    • joepeck@webkit.org's avatar
      Unreviewed Mac build fix. Add an export for a function that may be · 8ce0a892
      joepeck@webkit.org authored
      accessed outside of WebCore (RenderLayer::needsCompositedScrolling).
      
      * WebCore.exp.in:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8ce0a892
    • joepeck@webkit.org's avatar
      [Mac] Update PageVisibilityState when WebView is hidden / visible · 2152e36f
      joepeck@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107509
      
      Source/WebKit/mac:
      
      Reviewed by NOBODY (OOPS!).
      
      * WebView/WebView.mm:
      * WebView/WebViewPrivate.h:
      (-[WebView _commonInitializationWithFrameName:groupName:]):
      Set the initial visibility of the page.
      
      (-[WebView addWindowObserversForWindow:]):
      (-[WebView removeWindowObservers]):
      (-[WebView _isViewVisible]):
      (-[WebView _updateVisibilityState]):
      (-[WebView viewDidMoveToWindow]):
      (-[WebView _windowVisibilityChanged:]):
      Update visibility state in the same ways WK2 does. This involves
      listening for some new NSWindow delegates.
      
      Tools:
      
      Add a test that PageVisibility of WK1 WebViews and WK2 WKViews
      automatically changes between hidden and visible as the view is added
      and removed from window, or when it is in a window that changes
      visibility, for instance by minimizing / deminimizing.
      
      Reviewed by NOBODY (OOPS!).
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.html: Added.
      * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm: Added.
      (-[PageVisibilityStateDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]):
      (runJavaScriptAlert):
      (PageVisibilityStateWithWindowChanges):
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView):
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::deinitializeView):
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest):
      (TestWebKitAPI::TEST_F):
      Test visibility state of a page in a WebView/WKView with different window states.
      
      * TestWebKitAPI/mac/WebKitAgnosticTest.h:
      * TestWebKitAPI/mac/WebKitAgnosticTest.mm:
      (TestWebKitAPI::WebKitAgnosticTest::deinitializeView):
      (TestWebKitAPI::WebKitAgnosticTest::runWebKit1Test):
      (TestWebKitAPI::WebKitAgnosticTest::runWebKit2Test):
      Add a WK1 and WK2 deinitializeView to balance initializeView.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2152e36f
    • joepeck@webkit.org's avatar
      Improve PageVisibility API with enums · 5fd52db0
      joepeck@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107364
      
      Reviewed by Sam Weinig.
      
      Source/WebKit/mac:
      
      * WebView/WebView.mm:
      * WebView/WebViewPrivate.h:
      (corePageVisibilityState):
      (-[WebView _setVisibilityState:isInitialState:]):
      Switch the private API form int to a WebPageVisibilityState enum.
      
      Source/WebKit2:
      
      * Shared/API/c/WKPageVisibilityTypes.h: Added.
      * Shared/API/c/WKSharedAPICast.h:
      (WebKit::toPageVisibilityState):
      Create an enum for page visibility APIs and a conversion function
      for the WK2 values to WebCore values.
      
      * Target.pri:
      * GNUmakefile.list.am:
      * WebKit2.xcodeproj/project.pbxproj:
      Add WKPageVisibilityTypes.h to the build as a private export.
      
      * UIProcess/API/C/WKPage.h:
      * UIProcess/API/C/WKPage.cpp:
      (WKPageSetVisibilityState):
      * UIProcess/WebPageProxy.h:
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::setVisibilityState):
      UIProcess API to set visibility state. WebPageProxy already
      had m_visibilityState, so update that when setter is used.
      
      * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
      * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
      * WebProcess/InjectedBundle/InjectedBundle.cpp:
      * WebProcess/InjectedBundle/InjectedBundle.h:
      Remove the old SPI for WebKitTestRunner. Tests now use the C API.
      
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::setVisibilityState):
      * WebProcess/WebPage/WebPage.messages.in:
      Update the existing WebPage API to use uint32_t, which matches
      other enum message types.
      
      Tools:
      
      * DumpRenderTree/mac/TestRunnerMac.mm:
      (TestRunner::resetPageVisibility):
      (TestRunner::setPageVisibility):
      Update the WK1 test code to use the new WK1 enums.
      
      * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
      (WTR::InjectedBundle::setVisibilityState):
      * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
      (InjectedBundle):
      * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
      (WTR::TestRunner::setPageVisibility):
      (WTR::TestRunner::resetPageVisibility):
      * WebKitTestRunner/TestController.cpp:
      (WTR::TestController::setVisibilityState):
      * WebKitTestRunner/TestController.h:
      (TestController):
      * WebKitTestRunner/TestInvocation.cpp:
      (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
      Update the WK2 test code to use the new WK2 API and enums.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp: Added.
      (TestWebKitAPI):
      (TestWebKitAPI::setPageVisibilityStateWithEvalContinuation):
      (TestWebKitAPI::assertSerializedScriptValueIsStringValue):
      (TestWebKitAPI::didRunStep1StateChangeVisibleToHidden):
      (TestWebKitAPI::didRunStep2StateChangeHiddenToPrerender):
      (TestWebKitAPI::didRunStep3StateChangePrerenderToPreview):
      (TestWebKitAPI::didRunStep4InStatePreview):
      (TestWebKitAPI::TEST):
      Test the new WK2 API with all enum types.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5fd52db0
    • jchaffraix@webkit.org's avatar
      Crash inside RenderBlock::layoutRunsAndFloatsInRange in the widow code · 0f22514f
      jchaffraix@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108084
      
      Reviewed by Dean Jackson.
      
      This is a blind fix based on the code and Chromium's stack-traces.
      
      Unfortunately no new test as I couldn't get a local reproduction.
      
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::RenderBlock::layoutRunsAndFloatsInRange):
      Added a missing NULL-check: the previous 'while' finish if |lineBox|
      is NULL and we don't want to crash in this case.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0f22514f
    • christophe.dumez@intel.com's avatar
      [EFL][WK2] Use C API inside ewk_download_job · 0cab182a
      christophe.dumez@intel.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107810
      
      Reviewed by Anders Carlsson.
      
      Use C API inside ewk_download_job instead of accessing internal C++
      classes directly, to avoid violating API layering.
      
      * UIProcess/API/C/WKDownload.cpp:
      (WKDownloadGetID): Add C API to get the download ID as we need it to
      support our public API and it seems like a useful addition.
      * UIProcess/API/C/WKDownload.h:
      * UIProcess/API/efl/ewk_download_job.cpp:
      (EwkDownloadJob::EwkDownloadJob):
      (EwkDownloadJob::id):
      (EwkDownloadJob::request):
      (EwkDownloadJob::cancel):
      * UIProcess/API/efl/ewk_download_job_private.h:
      (EwkDownloadJob::create):
      (EwkDownloadJob):
      * UIProcess/efl/DownloadManagerEfl.cpp:
      (WebKit::DownloadManagerEfl::decideDestinationWithSuggestedFilename):
      (WebKit::DownloadManagerEfl::didReceiveResponse):
      (WebKit::DownloadManagerEfl::didCreateDestination):
      (WebKit::DownloadManagerEfl::didReceiveData):
      (WebKit::DownloadManagerEfl::didFail):
      (WebKit::DownloadManagerEfl::didCancel):
      (WebKit::DownloadManagerEfl::didFinish):
      (WebKit::DownloadManagerEfl::registerDownloadJob): Rename
      registerDownload() to registerDownloadJob() for consistency with
      unregisterDownloadJob().
      (WebKit::DownloadManagerEfl::ewkDownloadJob): Rename downloadJob() to
      ewkDownloadJob() for clarity since it returns a EwkDownload object.
      Also take a WKDownloadRef in argument instead of an identifier since
      all the callers have a WKDownloadRef and it makes their code simpler.
      Finally, make the getter non-const since it returns a non-const pointer.
      (WebKit::DownloadManagerEfl::unregisterDownloadJob): Take a
      WKDownloadRef in argument instead of an identifier since all the
      callers have a WKDownloadRef and it makes their code simpler.
      * UIProcess/efl/DownloadManagerEfl.h:
      (DownloadManagerEfl):
      * UIProcess/efl/PageClientBase.cpp:
      (WebKit::PageClientBase::handleDownloadRequest):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0cab182a