1. 12 Nov, 2009 1 commit
    • aroben@apple.com's avatar
      Replace worldIDs with world objects · f6cbb76a
      aroben@apple.com authored
      Part of <http://webkit.org/b/31414> Implement new SPI for dealing with
      user scripts/stylesheets and isolated worlds
      
      Reviewed by Sam Weinig.
      
      WebCore:
      
      Covered by existing tests.
      
      * WebCore.base.exp: Update exported symbols to match what now exists
      and is needed by WebKit.
      
      * bindings/js/ScheduledAction.cpp:
      (WebCore::ScheduledAction::execute): Updated for function rename.
      
      * bindings/js/ScriptController.cpp: Removed code that dealt with
      worldIDs.
      (WebCore::ScriptController::createWorld): Added. Returns a new world
      suitable for use on the main thread.
      (WebCore::ScriptController::executeScriptInWorld): Renamed from
      executeScriptInIsolatedWorld, since this works just fine with a
      "normal" world.
      
      * bindings/js/ScriptController.h: Added createWorld, removed functions
      that took worldIDs, renamed executeScriptInIsolatedWorld to
      executeScriptInWorld.
      
      * page/Frame.cpp:
      (WebCore::Frame::injectUserScripts):
      (WebCore::Frame::injectUserScriptsForWorld):
      Updated for changes to UserScriptMap and ScriptController.
      
      * page/Frame.h: Changed injectUserScriptsForWorld to take a
      DOMWrapperWorld* instead of a worldID.
      
      * page/PageGroup.cpp:
      (WebCore::PageGroup::addUserScriptToWorld):
      (WebCore::PageGroup::addUserStyleSheetToWorld):
      (WebCore::PageGroup::removeUserScriptFromWorld):
      (WebCore::PageGroup::removeUserStyleSheetFromWorld):
      (WebCore::PageGroup::removeUserScriptsFromWorld):
      (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
      * page/PageGroup.h:
      Changed these functions to take a DOMWrapperWorld* instead of a
      worldID. Also updated for changes to UserScript and UserStyleSheet.
      
      * page/UserScript.h:
      * page/UserStyleSheet.h: Changed not to hold a worldID, since it was
      never used.
      
      * page/UserScriptTypes.h:
      * page/UserStyleSheetTypes.h: Changed UserScriptMap and
      UserStyleSheetMap to use a RefPtr<DOMWrapperWorld> instead of a
      worldID as their key type.
      
      WebKit:
      
      * WebKit.xcodeproj/project.pbxproj: Added WebScriptWorld to the project.
      
      WebKit/mac:
      
      WebScriptWorld is the new object that represents a world.  The only
      place worldID is still used is in -[WebFrame
      _stringByEvaluatingJavaScriptInIsolatedWorld:WithGlobalObject:FromString:],
      but that will change soon.
      
      * WebKit.exp: Export WebScriptWorld.
      
      * WebView/WebFrame.mm:
      (-[WebFrame _stringByEvaluatingJavaScriptInIsolatedWorld:WithGlobalObject:FromString:]):
      Moved the bizarre world caching/creation logic that DRT depends on
      here from the findWorld function in ScriptController.cpp. Updated to
      use ScriptController::executeScriptInWorld instead of
      ScriptController::executeScriptInIsolatedWorld.
      (-[WebFrame _contextForWorld:]): Renamed from contextForWorldID:. Now
      takes a WebScriptWorld.
      
      * WebView/WebFramePrivate.h: Replaced contextForWorldID: with
      _contextForWorld:.
      
      * WebView/WebScriptWorld.h: Added.
      * WebView/WebScriptWorld.mm: Added.
      (-[WebScriptWorld initWithWorld:]): Store the passed-in world in our
      _private member.
      (-[WebScriptWorld init]): Create a new DOMWrapperWorld and pass it to
      -initWithWorld:.
      (-[WebScriptWorld dealloc]): Release _private.
      (+[WebScriptWorld standardWorld]): Returns a shared instance that
      represents WebCore's mainThreadNormalWorld().
      (+[WebScriptWorld world]): Returns a new instance.
      (core): Returns the DOMWrapperWorld for this WebScriptWorld.
      
      * WebView/WebScriptWorldInternal.h: Added.
      
      * WebView/WebView.mm:
      (+[WebView _addUserScriptToGroup:world:source:url:whitelist:blacklist:injectionTime:]):
      (+[WebView _addUserStyleSheetToGroup:world:source:url:whitelist:blacklist:]):
      (+[WebView _removeUserScriptFromGroup:world:url:]):
      (+[WebView _removeUserStyleSheetFromGroup:world:url:]):
      (+[WebView _removeUserScriptsFromGroup:world:]):
      (+[WebView _removeUserStyleSheetsFromGroup:world:]):
      * WebView/WebViewPrivate.h:
      Changed these functions to take a WebScriptWorld instead of a worldID.
      
      WebKit/win:
      
      WebScriptWorld is the new object that represents a world.  The only
      place worldID is still used is in
      IWebFramePrivate::stringByEvaluatingJavaScriptInIsolatedWorld, but
      that will change soon.
      
      * ForEachCoClass.h: Added WebScriptWorld.
      
      * Interfaces/IWebFramePrivate.idl: Replaced contextForWorldID with
      contextForWorld.
      
      * Interfaces/IWebScriptWorld.idl: Added.
      
      * Interfaces/IWebViewPrivate.idl: Changed the user script/stylesheet
      functions to take an IWebScriptWorld instead of a worldID.
      
      * Interfaces/WebKit.idl: Added WebScriptWorld.
      
      * WebFrame.cpp:
      (WebFrame::contextForWorld): Renamed from contextForWorldID. Now takes
      an IWebScriptWorld.
      (WebFrame::stringByEvaluatingJavaScriptInIsolatedWorld): Moved the
      bizarre world caching/creation logic that DRT depends on here from the
      findWorld function in ScriptController.cpp. Updated to use
      ScriptController::executeScriptInWorld instead of
      ScriptController::executeScriptInIsolatedWorld.
      
      * WebFrame.h: Replaced contextForWorldID with contextForWorld.
      
      * WebScriptWorld.cpp: Added.
      (WebScriptWorld::WebScriptWorld):
      (WebScriptWorld::~WebScriptWorld):
      (WebScriptWorld::createInstance):
      (WebScriptWorld::AddRef):
      (WebScriptWorld::Release):
      (WebScriptWorld::QueryInterface):
      Standard COM class implementations.
      
      (WebScriptWorld::standardWorld): Returns a shared instance that represents
      WebCore's mainThreadNormalWorld().
      
      * WebScriptWorld.h: Added.
      (WebScriptWorld::world): Simple getter.
      
      * WebKit.vcproj/Interfaces.vcproj: Added IWebScriptWorld.idl.
      
      * WebKit.vcproj/WebKit.vcproj: Added WebScriptWorld.
      
      * WebKitClassFactory.cpp: Added WebScriptWorld.
      
      * WebView.cpp:
      (WebView::addUserScriptToGroup):
      (WebView::addUserStyleSheetToGroup):
      (WebView::removeUserScriptFromGroup):
      (WebView::removeUserStyleSheetFromGroup):
      (WebView::removeUserScriptsFromGroup):
      (WebView::removeUserStyleSheetsFromGroup):
      * WebView.h:
      Changed these functions to take an IWebScriptWorld instead of a worldID.
      
      WebKitTools:
      
      * DumpRenderTree/mac/LayoutTestControllerMac.mm:
      (LayoutTestController::addUserScript):
      (LayoutTestController::addUserStyleSheet):
      * DumpRenderTree/win/LayoutTestControllerWin.cpp:
      (LayoutTestController::addUserScript):
      (LayoutTestController::addUserStyleSheet):
      Changed these functions to create a new WebJSWorld each time they're
      called and to pass that world to WebKit.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f6cbb76a
  2. 09 Nov, 2009 1 commit
  3. 19 Oct, 2009 1 commit
    • eric@webkit.org's avatar
      2009-10-19 Dmitry Titov <dimich@chromium.org> · b0a0159d
      eric@webkit.org authored
              Reviewed by Adam Barth.
      
              Crash in DOMWindow::clearTimeout etc when DOMWindow is not connected to a frame.
              https://bugs.webkit.org/show_bug.cgi?id=29832
      
              Need to make sure the script caches are reset when frame gets disconnected from still-alive DOMWindow.
              This will prevent JS from calling DOMWindow methods that can not be completed w/o the frame.
      
              I am not sure it's possible to test this since the only file that repros the problem need ~10 seconds to cause crash.
      
              * page/Frame.cpp:
              (WebCore::Frame::~Frame): Right after frame disconnects from DOMWindow, clear WindowShell.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b0a0159d
  4. 02 Oct, 2009 1 commit
    • hyatt@apple.com's avatar
      Add support for blacklist patterns to user stylesheets and scripts in addition... · 19fd5912
      hyatt@apple.com authored
      Add support for blacklist patterns to user stylesheets and scripts in addition to whitelist patterns.
      
      Reviewed by Adam Roben.
      
      WebCore: 
      
      * WebCore.base.exp:
      * dom/Document.cpp:
      (WebCore::Document::pageGroupUserSheets):
      * page/Frame.cpp:
      (WebCore::Frame::injectUserScriptsForWorld):
      * page/PageGroup.cpp:
      (WebCore::PageGroup::addUserScript):
      (WebCore::PageGroup::addUserStyleSheet):
      (WebCore::PageGroup::removeUserContentWithURLForWorld):
      (WebCore::PageGroup::removeUserContentForWorld):
      * page/PageGroup.h:
      * page/UserContentURLPattern.cpp:
      (WebCore::UserContentURLPattern::matchesPatterns):
      * page/UserContentURLPattern.h:
      * page/UserScript.h:
      (WebCore::UserScript::UserScript):
      (WebCore::UserScript::whitelist):
      (WebCore::UserScript::blacklist):
      * page/UserStyleSheet.h:
      (WebCore::UserStyleSheet::UserStyleSheet):
      (WebCore::UserStyleSheet::whitelist):
      (WebCore::UserStyleSheet::blacklist):
      
      WebKit/mac: 
      
      * WebView/WebView.mm:
      (toStringVector):
      (+[WebView _addUserScriptToGroup:source:url:worldID:whitelist:blacklist:injectionTime:]):
      (+[WebView _addUserStyleSheetToGroup:source:url:worldID:whitelist:blacklist:]):
      * WebView/WebViewPrivate.h:
      
      WebKit/win: 
      
      * Interfaces/IWebViewPrivate.idl:
      * WebView.cpp:
      (toStringVector):
      (WebView::addUserScriptToGroup):
      (WebView::addUserStyleSheetToGroup):
      * WebView.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      19fd5912
  5. 30 Sep, 2009 1 commit
    • abarth@webkit.org's avatar
      2009-09-30 Adam Barth <abarth@webkit.org> · 43d36a30
      abarth@webkit.org authored
              Reviewed by Maciej Stachowiak.
      
              Factor RedirectScheduler out of FrameLoader
              https://bugs.webkit.org/show_bug.cgi?id=29948
      
              This change introduces a new sub-object of Frame, redirectScheduler.
              The redirectScheduler is responsible for scheduling redirects.
      
              This change leaves the code for the redirectScheduler in
              FrameLoader.cpp.  A future change will move the class into its own
              file.
      
              No behavior change (hopefully!).
      
              * loader/FrameLoader.cpp:
              (WebCore::RedirectScheduler::RedirectScheduler):
              (WebCore::RedirectScheduler::~RedirectScheduler):
              (WebCore::RedirectScheduler::redirectScheduledDuringLoad):
              (WebCore::RedirectScheduler::clear):
              (WebCore::FrameLoader::FrameLoader):
              (WebCore::FrameLoader::setDefersLoading):
              (WebCore::FrameLoader::stopLoading):
              (WebCore::FrameLoader::didOpenURL):
              (WebCore::FrameLoader::didExplicitOpen):
              (WebCore::FrameLoader::cancelAndClear):
              (WebCore::FrameLoader::clear):
              (WebCore::FrameLoader::checkCompleted):
              (WebCore::FrameLoader::isScheduledLocationChangePending):
              (WebCore::FrameLoader::scheduleHTTPRedirection):
              (WebCore::RedirectScheduler::scheduleRedirect):
              (WebCore::RedirectScheduler::mustLockBackForwardList):
              (WebCore::FrameLoader::scheduleLocationChange):
              (WebCore::RedirectScheduler::scheduleLocationChange):
              (WebCore::FrameLoader::scheduleFormSubmission):
              (WebCore::RedirectScheduler::scheduleFormSubmission):
              (WebCore::FrameLoader::scheduleRefresh):
              (WebCore::RedirectScheduler::scheduleRefresh):
              (WebCore::RedirectScheduler::locationChangePending):
              (WebCore::FrameLoader::scheduleHistoryNavigation):
              (WebCore::RedirectScheduler::scheduleHistoryNavigation):
              (WebCore::RedirectScheduler::timerFired):
              (WebCore::FrameLoader::provisionalLoadStarted):
              (WebCore::RedirectScheduler::schedule):
              (WebCore::RedirectScheduler::startTimer):
              (WebCore::RedirectScheduler::cancel):
              (WebCore::FrameLoader::completed):
              (WebCore::FrameLoader::open):
              * loader/FrameLoader.h:
              (WebCore::FrameLoader::committedFirstRealDocumentLoad):
              * page/Frame.cpp:
              (WebCore::Frame::Frame):
              (WebCore::Frame::redirectScheduler):
              * page/Frame.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      43d36a30
  6. 29 Sep, 2009 1 commit
    • hyatt@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=29892 · 5d1c0e78
      hyatt@apple.com authored
      Add support for whitelist patterns to control conditional injection of user scripts and
      user stylesheets.
      
      Reviewed by Jon Honeycutt.
      
      No new tests. Not testable until WebKit portion is added in followup patch.
      
      * GNUmakefile.am:
      * WebCore.gypi:
      * WebCore.pro:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp:
      (WebCore::Document::pageGroupUserSheets):
      * page/Frame.cpp:
      (WebCore::Frame::injectUserScriptsForWorld):
      * page/UserContentURLPattern.cpp: Added.
      (WebCore::UserContentURLPattern::matchesPatterns):
      (WebCore::UserContentURLPattern::parse):
      (WebCore::UserContentURLPattern::matches):
      (WebCore::UserContentURLPattern::matchesHost):
      (WebCore::MatchTester::MatchTester):
      (WebCore::MatchTester::testStringFinished):
      (WebCore::MatchTester::patternStringFinished):
      (WebCore::MatchTester::eatWildcard):
      (WebCore::MatchTester::eatSameChars):
      (WebCore::MatchTester::test):
      (WebCore::UserContentURLPattern::matchesPath):
      * page/UserContentURLPattern.h: Added.
      (WebCore::UserContentURLPattern::UserContentURLPattern):
      (WebCore::UserContentURLPattern::scheme):
      (WebCore::UserContentURLPattern::host):
      (WebCore::UserContentURLPattern::path):
      (WebCore::UserContentURLPattern::matchSubdomains):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d1c0e78
  7. 23 Sep, 2009 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: Added the ability to swap vectors with inline capacities, so you can · 521f64b8
      ggaren@apple.com authored
      store a vector with inline capacity in a hash table.
      
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-23
      Reviewed by Sam Weinig.
      
      * wtf/Vector.h:
      (WTF::swap):
      (WTF::VectorBuffer::swap):
      
      WebCore: Bring a little sanity to this crazy EventTarget world of ours
      https://bugs.webkit.org/show_bug.cgi?id=29701
      
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-23
      Reviewed by Sam Weinig.
      
      Lots of EventTarget refactoring to achieve a single shared implementation
      that fixes some of the performance and correctness bugs of the many individual
      implementations, and makes reasoning about EventTargets and EventListeners
      much easier.
              
      The basic design is this:
          - EventTarget manages a set of EventListeners.
          - onXXX EventListener attributes forward to standard EventTarget APIs.
          - Since the onXXX code is repetitive, it is usually done with macros
            of the form DEFINE_ATTRIBUTE_EVENT_LISTENER(attributeName).
          - EventTarget provides a shared implementation of dispatchEvent,
            which subclasses with special event dispatch rules, like Node, override.
          - To support Node, which lazily instantiates its EventTarget data,
            EventTarget has no data members, and instead makes a virtual call
            to get its data from wherever its subclass chose to store it.
                    
      Code that used to call dispatchEvent, passing an ExceptionCode paratmeter,
      even though no exception could be thrown, has been changed not to do so,
      to improve clarity and performance.
              
      Code that used to call a special dispatchXXXEvent function, which just
      turned around and called dispatchEvent, has been changed to call
      dispatchEvent, to improve clarity and performance.
      
      * WebCore.base.exp:
      * WebCore.xcodeproj/project.pbxproj: Another day in the life of a WebKit
      engineer.
      
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::isObservableThroughDOM): Updated for Node API change. Added
      "is not in the document but is firing event listeners" as a condition
      that makes a Node observable in the DOM, so that event listeners firing
      on removed nodes are not destroyed midstream. (This was a long-standing
      bug that was somewhat hidden by the old implementation's habit of
      copying the RegisteredEventListener vector before firing events, which
      would keep almost all the relevant objects from being destroyed.)
      
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::handleEvent): Removed the isWindowEvent flag
      because it was one of the most elaborately planned no-ops in the history
      of software crime, and one of the reasons clients thought they needed more
      than one dispatchEvent function even though they didn't.
      * bindings/js/JSEventListener.h:
      
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::JSDOMWindow::markChildren):
      (WebCore::JSMessagePort::markChildren):
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::JSNode::markChildren):
      * bindings/js/JSAbstractWorkerCustom.cpp:
      * bindings/js/JSDOMApplicationCacheCustom.cpp:
      * bindings/js/JSDedicatedWorkerContextCustom.cpp:
      * bindings/js/JSEventSourceCustom.cpp:
      * bindings/js/JSMessagePortCustom.cpp:
      * bindings/js/JSSharedWorkerContextCustom.cpp: Removed.
      * bindings/js/JSWebSocketCustom.cpp:
      * bindings/js/JSWorkerContextCustom.cpp:
      (WebCore::JSWorkerContext::markChildren):
      * bindings/js/JSWorkerCustom.cpp:
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      (WebCore::JSXMLHttpRequest::markChildren):
      * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
      (WebCore::JSXMLHttpRequestUpload::markChildren): EventListener marking is
      now autogenerated. Classes that still have custom mark functions for other
      reasons now call a shared EventTarget API to mark their EventListeners.
      
      * bindings/objc/ObjCEventListener.h:
      * bindings/objc/ObjCEventListener.mm:
      (WebCore::ObjCEventListener::handleEvent): Bye bye isWindowEvent.
      
      * bindings/scripts/CodeGeneratorJS.pm: Autogeneration support for
      marking and invalidating event listeners.
      
      * dom/CharacterData.cpp:
      (WebCore::CharacterData::dispatchModifiedEvent):
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::insertBefore):
      (WebCore::ContainerNode::replaceChild):
      (WebCore::willRemoveChild):
      (WebCore::ContainerNode::appendChild):
      (WebCore::dispatchChildInsertionEvents):
      (WebCore::dispatchChildRemovalEvents):
      * dom/Document.cpp:
      (WebCore::Document::removeAllEventListeners):
      (WebCore::Document::implicitClose):
      (WebCore::Document::setFocusedNode):
      (WebCore::Document::dispatchWindowEvent):
      (WebCore::Document::dispatchWindowLoadEvent):
      (WebCore::Document::finishedParsing):
      * dom/Document.h: Use dispatchEvent directly.
      
      * dom/Element.h: Moved a few event listener attributes down from Node,
      since they don't apply to all Nodes, only Elements.
      
      * dom/EventListener.h: Removed isWindowEvent parameter.
      
      * dom/EventNames.h: Added the "display" event name, so it works correctly
      with attribute macros, and for performance.
      
      * dom/EventTarget.cpp:
      (WebCore::forbidEventDispatch):
      (WebCore::allowEventDispatch):
      (WebCore::eventDispatchForbidden): Made this code (embarrasingly) thread
      safe, since it's now called on multiple threads. (Currently, we only forbid
      event dispatch on the main thread. If we ever want to forbid event dispatch
      on secondary threads, we can improve it then.)
      
      (WebCore::EventTarget::addEventListener):
      (WebCore::EventTarget::removeEventListener):
      (WebCore::EventTarget::setAttributeEventListener):
      (WebCore::EventTarget::getAttributeEventListener):
      (WebCore::EventTarget::clearAttributeEventListener):
      (WebCore::EventTarget::dispatchEvent):
      (WebCore::EventTarget::fireEventListeners):
      (WebCore::EventTarget::getEventListeners):
      (WebCore::EventTarget::removeAllEventListeners):
      * dom/EventTarget.h:
      (WebCore::FiringEventEndIterator::FiringEventEndIterator):
      (WebCore::EventTarget::ref):
      (WebCore::EventTarget::deref):
      (WebCore::EventTarget::markEventListeners):
      (WebCore::EventTarget::invalidateEventListeners):
      (WebCore::EventTarget::isFiringEventListeners):
      (WebCore::EventTarget::hasEventListeners): The ONE TRUE IMPLEMENTATION of
      EventTarget APIs, crafted from an amalgam of all the different versions
      we used to have. The most significant change here is that we no longer
      make a copy of an EventListener vector before firing the events in the
      vector -- instead, we use a reference to the original vector, along with
      a notification mechanism for the unlikely case when an EventListener is
      removed from the vector. This substantially reduces malloc, copying, and
      refcount overhead, and complexity.
      
      * dom/InputElement.cpp:
      (WebCore::InputElement::setValueFromRenderer):
      * dom/MessageEvent.h:
      (WebCore::MessageEvent::create): Use dispatchEvent directly.
      
      * dom/MessagePort.cpp:
      (WebCore::MessagePort::dispatchMessages):
      (WebCore::MessagePort::eventTargetData):
      (WebCore::MessagePort::ensureEventTargetData):
      * dom/MessagePort.h:
      (WebCore::MessagePort::setOnmessage):
      (WebCore::MessagePort::onmessage):
      * dom/MessagePort.idl: Removed custom EventTarget implementation.
      
      * dom/MutationEvent.h:
      (WebCore::MutationEvent::create): Added some default values so callers
      can construct MutationEvents more easily, without calling a custom dispatch
      function.
      
      * dom/Node.cpp:
      (WebCore::Node::addEventListener):
      (WebCore::Node::removeEventListener):
      (WebCore::Node::eventTargetData):
      (WebCore::Node::ensureEventTargetData):
      (WebCore::Node::handleLocalEvents):
      (WebCore::Node::dispatchEvent):
      (WebCore::Node::dispatchGenericEvent):
      (WebCore::Node::dispatchSubtreeModifiedEvent):
      (WebCore::Node::dispatchUIEvent):
      (WebCore::Node::dispatchKeyEvent):
      (WebCore::Node::dispatchMouseEvent):
      (WebCore::Node::dispatchWheelEvent):
      (WebCore::Node::dispatchFocusEvent):
      (WebCore::Node::dispatchBlurEvent):
      * dom/Node.h:
      (WebCore::Node::preDispatchEventHandler):
      (WebCore::Node::postDispatchEventHandler):
      * dom/Node.idl:
      * dom/NodeRareData.h:
      (WebCore::NodeRareData::eventTargetData):
      (WebCore::NodeRareData::ensureEventTargetData): Use the shared EventTarget
      interface, and call dispatchEvent directly instead of custom dispatchXXXEvent
      functions that just forwarded to dispatchEvent.
      
      * dom/RegisteredEventListener.cpp:
      * dom/RegisteredEventListener.h:
      (WebCore::RegisteredEventListener::RegisteredEventListener):
      (WebCore::operator==): This is just a simple struct now, since we no longer
      do a complicated copy / refCount / isRemoved dance just to honor the rule
      that an EventListener can be removed during event dispatch.
      
      * history/CachedFrame.cpp:
      (WebCore::CachedFrameBase::restore): Removed another custom dispatchEvent.
      
      * html/HTMLBodyElement.cpp:
      * html/HTMLBodyElement.h: Use the shared EventTarget API.
      
      * html/HTMLFormControlElement.cpp:
      (WebCore::HTMLFormControlElement::dispatchFormControlChangeEvent):
      (WebCore::HTMLFormControlElement::checkValidity):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::handleLocalEvents):
      (WebCore::HTMLFormElement::prepareSubmit):
      (WebCore::HTMLFormElement::reset):
      * html/HTMLFormElement.h: Use the standard dispatchEvent API.
      
      * html/HTMLFrameSetElement.cpp:
      * html/HTMLFrameSetElement.h: Use the shared EventTarget API.
      
      * html/HTMLImageLoader.cpp:
      (WebCore::HTMLImageLoader::dispatchLoadEvent):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::onSearch):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::loadInternal):
      * html/HTMLScriptElement.cpp:
      (WebCore::HTMLScriptElement::dispatchLoadEvent):
      (WebCore::HTMLScriptElement::dispatchErrorEvent):
      * html/HTMLSourceElement.cpp:
      (WebCore::HTMLSourceElement::errorEventTimerFired):
      * html/HTMLTokenizer.cpp:
      (WebCore::HTMLTokenizer::notifyFinished): Use the standard dispatchEvent API.
      
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::handleEvent):
      * inspector/InspectorDOMAgent.h:
      * inspector/InspectorDOMStorageResource.cpp:
      (WebCore::InspectorDOMStorageResource::handleEvent):
      * inspector/InspectorDOMStorageResource.h:
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::stopLoading):
      (WebCore::FrameLoader::canCachePageContainingThisFrame):
      (WebCore::FrameLoader::logCanCacheFrameDecision):
      (WebCore::HashChangeEventTask::performTask):
      (WebCore::FrameLoader::pageHidden): No more isWindowEvent.
      
      * loader/ImageDocument.cpp:
      (WebCore::ImageEventListener::handleEvent):
      * loader/appcache/ApplicationCacheGroup.cpp:
      (WebCore::CallCacheListenerTask::performTask):
      * loader/appcache/ApplicationCacheHost.cpp:
      (WebCore::ApplicationCacheHost::notifyDOMApplicationCache):
      * loader/appcache/ApplicationCacheHost.h:
      * loader/appcache/DOMApplicationCache.cpp:
      (WebCore::DOMApplicationCache::eventTargetData):
      (WebCore::DOMApplicationCache::ensureEventTargetData):
      * loader/appcache/DOMApplicationCache.h:
      * loader/appcache/DOMApplicationCache.idl: Switched to the standard
      EventTarget API. As a part of this, I switched this class from using a
      custom internal event name enumeration to using the standard EventNames.
      
      * notifications/Notification.cpp:
      (WebCore::Notification::eventTargetData):
      (WebCore::Notification::ensureEventTargetData):
      * notifications/Notification.h:
      (WebCore::Notification::scriptExecutionContext):
      * notifications/Notification.idl: Switched to the standard EventTarget API.
      
      * page/DOMWindow.cpp:
      (WebCore::PostMessageTimer::event):
      (WebCore::windowsWithUnloadEventListeners):
      (WebCore::windowsWithBeforeUnloadEventListeners):
      (WebCore::allowsBeforeUnloadListeners):
      (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
      (WebCore::DOMWindow::pendingUnloadEventListeners):
      (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): Changed the "pending"
      unload / beforeunload listener tracker just to track which windows had
      such listeners, instead of actually keeping a copy of the listeners. Now,
      this code can use the standard EventTarget API.
      
      (WebCore::DOMWindow::~DOMWindow):
      (WebCore::DOMWindow::postMessageTimerFired):
      (WebCore::DOMWindow::addEventListener):
      (WebCore::DOMWindow::removeEventListener):
      (WebCore::DOMWindow::dispatchLoadEvent):
      (WebCore::DOMWindow::dispatchEvent):
      (WebCore::DOMWindow::removeAllEventListeners):
      (WebCore::DOMWindow::captureEvents):
      (WebCore::DOMWindow::releaseEvents):
      (WebCore::DOMWindow::eventTargetData):
      (WebCore::DOMWindow::ensureEventTargetData):
      * page/DOMWindow.h:
      * page/DOMWindow.idl: Use the standard EventTarget APIs.
      
      * page/EventHandler.cpp:
      (WebCore::EventHandler::canMouseDownStartSelect):
      (WebCore::EventHandler::canMouseDragExtendSelect):
      (WebCore::EventHandler::sendResizeEvent):
      (WebCore::EventHandler::sendScrollEvent): Use dispatchEvent directly.
      
      * page/EventSource.cpp:
      (WebCore::EventSource::endRequest):
      (WebCore::EventSource::didReceiveResponse):
      (WebCore::EventSource::parseEventStreamLine):
      (WebCore::EventSource::stop):
      (WebCore::EventSource::createMessageEvent):
      (WebCore::EventSource::eventTargetData):
      (WebCore::EventSource::ensureEventTargetData):
      * page/EventSource.h:
      * page/EventSource.idl: Use the standard EventTarget APIs.
      
      * page/FocusController.cpp:
      (WebCore::dispatchEventsOnWindowAndFocusedNode):
      (WebCore::FocusController::setFocusedFrame):
      * page/Frame.cpp:
      (WebCore::Frame::shouldClose):
      * page/Frame.h:
      * page/Page.cpp:
      (WebCore::networkStateChanged):
      * page/animation/AnimationController.cpp:
      (WebCore::AnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::valueChanged):
      * rendering/RenderTextControl.cpp:
      (WebCore::RenderTextControl::selectionChanged):
      * rendering/RenderTextControlMultiLine.cpp:
      (WebCore::RenderTextControlMultiLine::subtreeHasChanged): Use dispatchEvent.
      
      * svg/SVGElement.cpp:
      (WebCore::hasLoadListener): Rewritten for new EventTarget API.
      
      * svg/SVGElementInstance.cpp:
      (WebCore::dummyEventTargetData):
      (WebCore::SVGElementInstance::addEventListener):
      (WebCore::SVGElementInstance::removeEventListener):
      (WebCore::SVGElementInstance::removeAllEventListeners):
      (WebCore::SVGElementInstance::dispatchEvent):
      (WebCore::SVGElementInstance::eventTargetData):
      (WebCore::SVGElementInstance::ensureEventTargetData): Use the EventTarget API.
      
      * svg/SVGElementInstance.h:
      * svg/SVGImageLoader.cpp:
      (WebCore::SVGImageLoader::dispatchLoadEvent):
      * svg/SVGScriptElement.cpp:
      (WebCore::SVGScriptElement::dispatchErrorEvent): Use dispatchEvent directly.
      
      * svg/SVGUseElement.cpp:
      (WebCore::SVGUseElement::transferEventListenersToShadowTree): Updated for
      new EventTarget API.
      
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::ConditionEventListener::handleEvent): No more isWindowEvent.
      
      * websockets/WebSocket.cpp:
      (WebCore::ProcessWebSocketEventTask::create):
      (WebCore::ProcessWebSocketEventTask::performTask):
      (WebCore::ProcessWebSocketEventTask::ProcessWebSocketEventTask):
      (WebCore::WebSocket::didConnect):
      (WebCore::WebSocket::didReceiveMessage):
      (WebCore::WebSocket::didClose):
      (WebCore::WebSocket::eventTargetData):
      (WebCore::WebSocket::ensureEventTargetData):
      * websockets/WebSocket.h:
      * websockets/WebSocket.idl:
      * workers/AbstractWorker.cpp:
      (WebCore::AbstractWorker::eventTargetData):
      (WebCore::AbstractWorker::ensureEventTargetData):
      * workers/AbstractWorker.h:
      * workers/AbstractWorker.idl:
      * workers/DedicatedWorkerContext.cpp:
      * workers/DedicatedWorkerContext.h:
      * workers/DedicatedWorkerContext.idl:
      * workers/DefaultSharedWorkerRepository.cpp:
      (WebCore::SharedWorkerConnectTask::performTask):
      (WebCore::SharedWorkerScriptLoader::load):
      (WebCore::SharedWorkerScriptLoader::notifyFinished):
      * workers/SharedWorker.idl:
      * workers/SharedWorkerContext.cpp:
      (WebCore::createConnectEvent):
      * workers/SharedWorkerContext.h:
      * workers/SharedWorkerContext.idl:
      * workers/Worker.cpp:
      (WebCore::Worker::notifyFinished):
      * workers/Worker.h:
      * workers/Worker.idl:
      * workers/WorkerContext.cpp:
      (WebCore::WorkerContext::eventTargetData):
      (WebCore::WorkerContext::ensureEventTargetData):
      * workers/WorkerContext.h:
      * workers/WorkerContext.idl:
      * workers/WorkerMessagingProxy.cpp:
      (WebCore::MessageWorkerContextTask::performTask):
      (WebCore::MessageWorkerTask::performTask):
      (WebCore::WorkerExceptionTask::performTask):
      * xml/XMLHttpRequest.cpp:
      (WebCore::XMLHttpRequest::callReadyStateChangeListener):
      (WebCore::XMLHttpRequest::createRequest):
      (WebCore::XMLHttpRequest::abort):
      (WebCore::XMLHttpRequest::networkError):
      (WebCore::XMLHttpRequest::abortError):
      (WebCore::XMLHttpRequest::didSendData):
      (WebCore::XMLHttpRequest::didReceiveData):
      (WebCore::XMLHttpRequest::eventTargetData):
      (WebCore::XMLHttpRequest::ensureEventTargetData):
      * xml/XMLHttpRequest.h:
      * xml/XMLHttpRequest.idl:
      * xml/XMLHttpRequestProgressEvent.h:
      (WebCore::XMLHttpRequestProgressEvent::create):
      * xml/XMLHttpRequestUpload.cpp:
      (WebCore::XMLHttpRequestUpload::eventTargetData):
      (WebCore::XMLHttpRequestUpload::ensureEventTargetData):
      * xml/XMLHttpRequestUpload.h:
      * xml/XMLHttpRequestUpload.idl: Use new EventTarget API.
      
      WebKit/mac: Updated for a WebCore rename.
      
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-23
      Reviewed by Sam Weinig.
      
      * WebView/WebFrame.mm:
      (-[WebFrame _cacheabilityDictionary]):
      
      LayoutTests: Layout tests for event target sanitization.
              
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-23
      Reviewed by Sam Weinig.
      
      New tests for event dispatch:
      
      * fast/events/event-attributes-after-exception-expected.txt: Added.
      * fast/events/event-attributes-after-exception.html: Added.
      * fast/events/event-fire-order-expected.txt: Added.
      * fast/events/event-fire-order.html: Added.
      * fast/events/event-fired-after-removal-expected.txt: Added.
      * fast/events/event-fired-after-removal.html: Added.
              
      Fixed these tests:
      
      * fast/xmlhttprequest/xmlhttprequest-get-expected.txt: eventPhase should
      be AT_TARGET (2) when firing an event on an XHR, not INVALID (0).
      * http/tests/xmlhttprequest/infoOnProgressEvent-expected.txt: ditto
      
      * http/tests/xmlhttprequest/event-target-expected.txt:
      * http/tests/xmlhttprequest/event-target.html: Removing an event listener
      during event dispatch should prevent it from firing. (This test was backwards.)
              
      * svg/custom/loadevents-capturing.svg: Enhanced this test to tell you
      why it fails when it fails. Changed it to register runTest() (now named 
      reportResults()) using addEventListener() instead of the 'onload' attribute.
      The test relies on reportResults() running after handler(), so it needs
      to register reportResults() after handler().
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      521f64b8
  8. 21 Sep, 2009 1 commit
    • bolsinga@apple.com's avatar
      JavaScriptCore: Add ENABLE(ORIENTATION_EVENTS) · dcfc7898
      bolsinga@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=29508
      
      Reviewed by Simon Fraser & Sam Weinig.
      
      * wtf/Platform.h: Also sort PLATFORM(IPHONE) #defines.
      
      WebCore: Add ENABLE(ORIENTATION_EVENTS)
      https://bugs.webkit.org/show_bug.cgi?id=29508
      
      Reviewed by Simon Fraser & Sam Weinig.
      
      See documentation here:
      http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW16
      
      * DerivedSources.make: Use new WebCore.OrientationEvents.exp file if ENABLE_ORIENTATION_EVENTS.
      Add ENABLE_ORIENTATION_EVENTS to the new ADDITIONAL_IDL_DEFINES variable that is passed to the IDL
      code generator. This is because ENABLE_ORIENTATION_EVENTS is not in FEATURE_DEFINES.
      * WebCore.OrientationEvents.exp: Added.
      * WebCore.xcodeproj/project.pbxproj: Add WebCore.OrientationEvents.exp.
      * dom/EventNames.h: Add onorientationchange.
      * html/HTMLAttributeNames.in: Ditto.
      * html/HTMLBodyElement.cpp: Handle onorientationchange properly.
      (WebCore::HTMLBodyElement::parseMappedAttribute):
      (WebCore::HTMLBodyElement::onorientationchange):
      (WebCore::HTMLBodyElement::setOnorientationchange):
      * html/HTMLBodyElement.h: Ditto.
      * html/HTMLBodyElement.idl: Ditto.
      * html/HTMLFrameSetElement.cpp: Ditto.
      (WebCore::HTMLFrameSetElement::parseMappedAttribute):
      (WebCore::HTMLFrameSetElement::onorientationchange):
      (WebCore::HTMLFrameSetElement::setOnorientationchange):
      * html/HTMLFrameSetElement.h: Ditto.
      * html/HTMLFrameSetElement.idl: Ditto.
      * page/DOMWindow.cpp: Ditto.
      (WebCore::DOMWindow::orientation): Calls up the to the Frame for the orientation value.
      (WebCore::DOMWindow::onorientationchange):
      (WebCore::DOMWindow::setOnorientationchange):
      * page/DOMWindow.h: Handle onorientationchange properly.
      * page/DOMWindow.idl: Ditto.
      * page/Frame.cpp: Ditto.
      (WebCore::Frame::Frame):
      (WebCore::Frame::sendOrientationChangeEvent):
      * page/Frame.h: Ditto.
      (WebCore::Frame::orientation):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dcfc7898
  9. 19 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-09-19 Alex Milowski <alex@milowski.com> · 8af95f36
      eric@webkit.org authored
              Reviewed by Maciej Stachowiak.
      
              Basic tests for msub, msup, and mtable/mtr/mtd
      
              * mathml: Added.
              * mathml/presentation: Added.
              * mathml/presentation/sub.xhtml: Added.
              * mathml/presentation/sup.xhtml: Added.
              * mathml/presentation/tables.xhtml: Added.
              * platform/mac/mathml: Added.
              * platform/mac/mathml/presentation: Added.
              * platform/mac/mathml/presentation/sub-expected.txt: Added.
              * platform/mac/mathml/presentation/sup-expected.txt: Added.
              * platform/mac/mathml/presentation/tables-expected.txt: Added.
      2009-09-19  Alex Milowski  <alex@milowski.com>
      
              Reviewed by Maciej Stachowiak.
      
              Adds CSS styling and basic DOM element support for MathML
      
              * DerivedSources.make:
                Added user stylesheet and tag factory generation
      
              * WebCore.xcodeproj/project.pbxproj:
                Added new DOM element code
      
              * css/CSSParser.cpp:
              (WebCore::CSSParser::parseAttr):
                Added check for document since stylesheet can be added before there is a document
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::styleForElement):
                Added check to add MathML user agent stylesheet
      
              * css/mathml.css: Added.
                MathML user agent stylesheet
      
              * dom/Document.cpp:
              (WebCore::Document::createElement):
                Added support for creation of MathML DOM objects
      
              * dom/Node.h:
              (WebCore::Node::isMathMLElement):
                Added check method for whether the node is a MathML node
      
              * mathml: Added.
              * mathml/MathMLElement.cpp: Added.
              (WebCore::MathMLElement::MathMLElement):
              (WebCore::MathMLElement::create):
              (WebCore::MathMLElement::createRenderer):
              * mathml/MathMLElement.h: Added.
              (WebCore::MathMLElement::isMathMLElement):
                MathML DOM base class
      
              * mathml/MathMLInlineContainerElement.cpp: Added.
              (WebCore::MathMLInlineContainerElement::MathMLInlineContainerElement):
              (WebCore::MathMLInlineContainerElement::create):
              (WebCore::MathMLInlineContainerElement::createRenderer):
              * mathml/MathMLInlineContainerElement.h: Added.
                Base class for non-text containers
      
              * mathml/MathMLMathElement.cpp: Added.
              (WebCore::MathMLMathElement::MathMLMathElement):
              (WebCore::MathMLMathElement::create):
              * mathml/MathMLMathElement.h: Added.
                Root Math element
      
              * mathml/mathtags.in: Added.
                Element list mappings
      
              * page/Frame.cpp:
              (WebCore::Frame::Frame):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8af95f36
  10. 04 Sep, 2009 7 commits
    • andersca@apple.com's avatar
      <rdar://problem/7201063> · 65da02a9
      andersca@apple.com authored
              
      Reviewed by Adele Peterson.
      
      Detach any custom scrollbars before detaching the document.
              
      * page/Frame.cpp:
      (WebCore::Frame::setView):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      65da02a9
    • hyatt@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=28984, remove the remote stylesheet loader on Mac/Qt. · dd7e173a
      hyatt@apple.com authored
      Make sure the other code path (now used by everybody) can handle data URLs.
      
      Reviewed by Adam Roben.
      
      As per the post on webkit-dev, the ability to work remotely isn't working properly anyway (it doesn't
      hold up the pending sheet count, so you'd just FOUC on every Web page), and it's extremely unlikely
      that anybody is relying on this support.
              
      Tor Arne agreed it was ok to disable (he enabled it on the Qt side), and only Mac/Qt were using this
      code.
      
      * WebCore.pro:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp:
      (WebCore::Document::userStyleSheet):
      * dom/Document.h:
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::begin):
      * loader/UserStyleSheetLoader.cpp: Removed.
      * loader/UserStyleSheetLoader.h: Removed.
      * page/Frame.cpp:
      (WebCore::Frame::reapplyStyles):
      * page/Frame.h:
      * page/Page.cpp:
      (WebCore::Page::userStyleSheetLocationChanged):
      (WebCore::Page::userStyleSheet):
      * page/mac/FrameMac.mm:
      * page/qt/FrameQt.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dd7e173a
    • hyatt@apple.com's avatar
      Remove bogus assert that is affecting layout tests. · ca21e528
      hyatt@apple.com authored
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ca21e528
    • andersca@apple.com's avatar
      (Based on a patch from Adele). · 28eddcfe
      andersca@apple.com authored
              
      Reviewed by David Hyatt and Adele Peterson.
      
      Fix <rdar://problem/7185875>.
              
      * page/Frame.cpp:
      (WebCore::Frame::setView):
      Detach any custom scroll bars from the old view.
              
      * page/FrameView.cpp:
      (WebCore::FrameView::detachCustomScrollbars):
      Simplify the check (and make it work when body is null) by just checking that the scroll bar owner is
      not a RenderPart object.
      
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::destroy):
      ASSERT that frame() is not null here and also add a null check so that release builds won't crash.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      28eddcfe
    • hyatt@apple.com's avatar
      Make m_userStyleSheetLoader in Frame an OwnPtr. · 39313aa4
      hyatt@apple.com authored
      Reviewed by Adam Roben.
      
      * page/Frame.cpp:
      (WebCore::Frame::Frame):
      (WebCore::Frame::~Frame):
      * page/Frame.h:
      * page/mac/FrameMac.mm:
      (WebCore::Frame::setUserStyleSheetLocation):
      (WebCore::Frame::setUserStyleSheet):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      39313aa4
    • dglazkov@chromium.org's avatar
      WebCore: · f0234eb3
      dglazkov@chromium.org authored
      2009-09-04  Mark Mentovai  <mark@chromium.org>
      
              Reviewed by Dave Hyatt.
      
              https://bugs.webkit.org/show_bug.cgi?id=28614
      
              Account for scrollbar state changes that occur during layout.
      
              * platform/ScrollView.cpp:
              (WebCore::ScrollView::updateScrollbars):
      
              Perform a layout prior to checking whether the scrollbar modes are
              off, on, or automatic.  The modes may change during layout.
      
              * WebCore.base.exp:
              * WebCore.order:
              * page/Frame.cpp:
              (WebCore::Frame::createView):
              * page/FrameView.cpp:
              (WebCore::FrameView::FrameView):
              (WebCore::FrameView::resetScrollbars):
              (WebCore::FrameView::layout):
              * page/FrameView.h:
              * platform/ScrollView.h:
      
              Eliminate duplicated (and incorrect) scrollbar mode tracking between
              FrameView and ScrollView.
      
      WebKit/mac:
      
      2009-09-04  Mark Mentovai  <mark@chromium.org>
      
              Reviewed by Dave Hyatt.
      
              https://bugs.webkit.org/show_bug.cgi?id=28614
      
              Account for scrollbar state changes that occur during layout.
      
              * WebView/WebDynamicScrollBarsView.mm:
              (-[WebDynamicScrollBarsView updateScrollers]):
      
              Perform a layout prior to checking whether the scrollbar modes are
              off, on, or automatic.  The modes may change during layout.
      
              * WebView/WebFrameView.mm:
              (-[WebFrameView _install]):
      
              Eliminate duplicated (and incorrect) scrollbar mode tracking between
              FrameView and ScrollView.
      
      WebKit/qt:
      
      2009-09-04  Mark Mentovai  <mark@chromium.org>
      
              Reviewed by Dave Hyatt.
      
              https://bugs.webkit.org/show_bug.cgi?id=28614
      
              Account for scrollbar state changes that occur during layout.
      
              * Api/qwebframe.cpp:
              (QWebFrame::setScrollBarPolicy):
      
              Eliminate duplicated (and incorrect) scrollbar mode tracking between
              FrameView and ScrollView.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f0234eb3
    • hyatt@apple.com's avatar
      WebCore: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work. · 71960d78
      hyatt@apple.com authored
              
      Reviewed by Adam Roben.
      
      This patch adds new API for adding and removing user scripts from page groups.  User scripts
      are bundled together in isolated worlds (you can have multiple scripts together in the same
      world).
      
      Added userscripts/ directory for holding new tests (along with a simple test of script injection).
      
      * WebCore.base.exp:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/ScriptController.cpp:
      (WebCore::ScriptController::evaluateInIsolatedWorld):
      * bindings/js/ScriptController.h:
      * bindings/v8/ScriptController.cpp:
      (WebCore::ScriptController::evaluateInIsolatedWorld):
      * bindings/v8/ScriptController.h:
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::finishedParsing):
      (WebCore::FrameLoader::dispatchDocumentElementAvailable):
      * page/Frame.cpp:
      (WebCore::Frame::injectUserScripts):
      (WebCore::Frame::injectUserScriptsForWorld):
      * page/Frame.h:
      * page/PageGroup.cpp:
      (WebCore::PageGroup::~PageGroup):
      (WebCore::PageGroup::addUserScript):
      (WebCore::PageGroup::removeUserContentForWorld):
      (WebCore::PageGroup::removeAllUserContent):
      * page/PageGroup.h:
      (WebCore::PageGroup::userScripts):
      * page/UserScript.h: Added.
      (WebCore::UserScript::UserScript):
      (WebCore::UserScript::source):
      (WebCore::UserScript::url):
      (WebCore::UserScript::patterns):
      (WebCore::UserScript::worldID):
      (WebCore::UserScript::injectionTime):
      * page/UserScriptTypes.h: Added.
      (WebCore::):
      
      WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work.
              
      Reviewed by Adam Roben.
      
      This patch adds new API for adding and removing user scripts from page groups.  User scripts
      are bundled together in isolated worlds (you can have multiple scripts together in the same
      world).
      
      Added userscripts/ directory for holding new tests (along with a simple test of script injection).
      
      * WebView/WebView.mm:
      (+[WebView _addUserScriptToGroup:source:url:worldID:patterns:injectionTime:]):
      (+[WebView _removeUserContentFromGroup:worldID:]):
      (+[WebView _removeAllUserContentFromGroup:]):
      * WebView/WebViewPrivate.h:
      
      LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work.
              
      Reviewed by Adam Roben.
      
      This patch adds new API for adding and removing user scripts from page groups.  User scripts
      are bundled together in isolated worlds (you can have multiple scripts together in the same
      world).
      
      Added userscripts/ directory for holding new tests (along with a simple test of script injection).
      
      * platform/mac/userscripts: Added.
      * platform/mac/userscripts/script-run-at-end-expected.txt: Added.
      * userscripts: Added.
      * userscripts/script-run-at-end.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      71960d78
  11. 02 Sep, 2009 1 commit
    • beidson@apple.com's avatar
      WebCore: More partial work towards "Page Cache should support pages with Frames" · 24f92a52
      beidson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=13631
      
      Reviewed by Darin Adler.
      
      - More CachedFrame destruction work.
      - Including related Frame and FrameLoader changes and cleanup.
      
      No new tests. (No change in behavior, current tests pass).
      
      * history/CachedFrame.cpp:
      (WebCore::CachedFrameBase::restore): Rebuild up the whole FrameTree when restoring.
      (WebCore::CachedFrame::CachedFrame): Tear down the entire FrameTree when caching.
      (WebCore::CachedFrame::destroy): For child frames that are being destroyed while in
        the PageCache, do lightweight cleanup to:
        A - Prevent referring to a stale Page object.
        B - Prevent World Leaks of WebKit objects.
      
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::stopAllLoaders): stopAllLoaders() should never be called on Frames that are
        in the PageCache. ASSERT that fact.
      (WebCore::FrameLoader::open): Remove a bogus release-build workaround, as the comment right above it
        explains it is not effective, and it'd be better to see the crash locally instead of downstream.
      (WebCore::FrameLoader::closeAndRemoveChild): Make sure the owner element has a page pointer before
        referencing it.
      (WebCore::FrameLoader::detachFromParent): Use the new detachViewsAndDocumentLoader() call
      (WebCore::FrameLoader::detachViewsAndDocumentLoader): Does lightweight cleanup of client (WebKit) objects.
      * loader/FrameLoader.h:
      
      * page/Frame.cpp:
      (WebCore::Frame::detachFromPage): Simply clear the Page pointer without doing any other work.
      (WebCore::Frame::pageDestroyed): Use the new detachFromPage().
      * page/Frame.h:
      
      WebKit/mac: More partial work towards "Page Cache should support pages with Frames"
      https://bugs.webkit.org/show_bug.cgi?id=13631
      
      Reviewed by Darin Adler.
      
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView _topHTMLView]): Rework the ASSERT in this method to reflect the
        reality of calling this method for pages currently in the PageCache.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      24f92a52
  12. 05 Aug, 2009 1 commit
    • darin@apple.com's avatar
      2009-08-05 Darin Adler <darin@apple.com> · b6cb2561
      darin@apple.com authored
              Reviewed by David Levin.
      
              Use checked casts for render tree
              https://bugs.webkit.org/show_bug.cgi?id=23522
      
              Last patch. Makes all the casts of RenderObject use checked
              casts instead of using static_cast directly.
      
              * accessibility/AccessibilityListBox.cpp:
              (WebCore::AccessibilityListBox::visibleChildren):
              (WebCore::AccessibilityListBox::doAccessibilityHitTest):
              * accessibility/AccessibilityListBoxOption.cpp:
              (WebCore::AccessibilityListBoxOption::elementRect):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::textUnderElement):
              (WebCore::AccessibilityRenderObject::stringValue):
              (WebCore::AccessibilityRenderObject::titleUIElement):
              (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
              * accessibility/AccessibilitySlider.cpp:
              (WebCore::AccessibilitySliderThumb::elementRect):
              * dom/InputElement.cpp:
              (WebCore::InputElement::updatePlaceholderVisibility):
              * dom/SelectElement.cpp:
              (WebCore::SelectElement::scrollToSelection):
              (WebCore::SelectElement::recalcStyle):
              (WebCore::SelectElement::setRecalcListItems):
              (WebCore::SelectElement::menuListDefaultEventHandler):
              (WebCore::SelectElement::listBoxDefaultEventHandler):
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply):
              * html/HTMLAppletElement.cpp:
              (WebCore::HTMLAppletElement::renderWidgetForJSBindings):
              * html/HTMLCanvasElement.cpp:
              (WebCore::HTMLCanvasElement::reset):
              * html/HTMLEmbedElement.cpp:
              (WebCore::HTMLEmbedElement::updateWidget):
              * html/HTMLFrameElementBase.cpp:
              (WebCore::HTMLFrameElementBase::attach):
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::defaultEventHandler):
              * html/HTMLIFrameElement.cpp:
              (WebCore::HTMLIFrameElement::attach):
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::defaultEventHandler):
              (WebCore::HTMLInputElement::addSearchResult):
              (WebCore::HTMLInputElement::onSearch):
              * html/HTMLLIElement.cpp:
              (WebCore::HTMLLIElement::parseMappedAttribute):
              (WebCore::HTMLLIElement::attach):
              * html/HTMLMediaElement.cpp:
              (WebCore::HTMLMediaElement::setReadyState):
              (WebCore::HTMLMediaElement::mediaPlayerDurationChanged):
              (WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
              (WebCore::HTMLMediaElement::mediaPlayerRenderingCanBeAccelerated):
              (WebCore::HTMLMediaElement::mediaPlayerGraphicsLayer):
              (WebCore::HTMLMediaElement::defaultEventHandler):
              (WebCore::HTMLMediaElement::finishParsingChildren):
              * html/HTMLOListElement.cpp:
              (WebCore::HTMLOListElement::parseMappedAttribute):
              * html/HTMLObjectElement.cpp:
              (WebCore::HTMLObjectElement::updateWidget):
              * html/HTMLTextAreaElement.cpp:
              (WebCore::HTMLTextAreaElement::defaultEventHandler):
              * page/DragController.cpp:
              (WebCore::DragController::concludeEditDrag):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::selectCursor):
              (WebCore::EventHandler::capsLockStateMayHaveChanged):
              * page/Frame.cpp:
              (WebCore::Frame::ownerRenderer):
              * page/FrameView.cpp:
              (WebCore::FrameView::detachCustomScrollbars):
              * page/wince/FrameWince.cpp:
              (WebCore::computePageRectsForFrame):
              * rendering/InlineFlowBox.cpp:
              (WebCore::InlineFlowBox::placeBoxesHorizontally):
              * rendering/MediaControlElements.cpp:
              (WebCore::MediaControlTimelineElement::defaultEventHandler):
              * rendering/RenderBlockLineLayout.cpp:
              (WebCore::RenderBlock::findNextLineBreak):
              * rendering/RenderCounter.cpp:
              (WebCore::planCounter):
              * rendering/RenderFrameSet.cpp:
              (WebCore::RenderFrameSet::computeEdgeInfo):
              (WebCore::RenderFrameSet::setIsResizing):
              * rendering/RenderLayerBacking.cpp:
              (WebCore::RenderLayerBacking::contentsBox):
              * rendering/RenderLayerCompositor.cpp:
              (WebCore::RenderLayerCompositor::updateBacking):
              (WebCore::RenderLayerCompositor::requiresCompositingForVideo):
              * rendering/RenderListItem.cpp:
              (WebCore::previousListItem):
              (WebCore::RenderListItem::explicitValueChanged):
              * rendering/RenderObject.cpp:
              (WebCore::updateListMarkerNumbers):
              * rendering/RenderObjectChildList.cpp:
              (WebCore::updateListMarkerNumbers):
              (WebCore::invalidateCountersInContainer):
              * rendering/RenderScrollbarTheme.cpp:
              (WebCore::RenderScrollbarTheme::minimumThumbLength):
              (WebCore::RenderScrollbarTheme::backButtonRect):
              (WebCore::RenderScrollbarTheme::forwardButtonRect):
              (WebCore::RenderScrollbarTheme::trackRect):
              (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
              (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
              (WebCore::RenderScrollbarTheme::paintTrackBackground):
              (WebCore::RenderScrollbarTheme::paintTrackPiece):
              (WebCore::RenderScrollbarTheme::paintButton):
              (WebCore::RenderScrollbarTheme::paintThumb):
              * rendering/RenderSlider.cpp:
              (WebCore::SliderThumbElement::defaultEventHandler):
              * rendering/RenderThemeChromiumMac.mm:
              (WebCore::RenderThemeChromiumMac::paintSliderThumb):
              (WebCore::RenderThemeChromiumMac::paintMediaSliderTrack):
              * rendering/RenderThemeChromiumWin.cpp:
              (WebCore::RenderThemeChromiumWin::determineSliderThumbState):
              * rendering/RenderThemeMac.mm:
              (WebCore::RenderThemeMac::paintSliderThumb):
              * rendering/RenderThemeSafari.cpp:
              (WebCore::RenderThemeSafari::paintSliderThumb):
              * rendering/RenderThemeWin.cpp:
              (WebCore::RenderThemeWin::determineSliderThumbState):
              * rendering/SVGCharacterLayoutInfo.cpp:
              (WebCore::SVGCharacterLayoutInfo::addLayoutInformation):
              * rendering/SVGRootInlineBox.cpp:
              (WebCore::findSVGRootObject):
              * rendering/TextControlInnerElements.cpp:
              (WebCore::RenderTextControlInnerBlock::nodeAtPoint):
              (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
              * svg/SVGImageElement.cpp:
              (WebCore::SVGImageElement::attach):
              * svg/SVGMarkerElement.cpp:
              (WebCore::SVGMarkerElement::canvasResource):
              * svg/SVGTextContentElement.cpp:
              (WebCore::rootInlineBoxForTextContentElement):
              * wml/WMLInputElement.cpp:
              (WebCore::WMLInputElement::defaultEventHandler):
              Use checked casts.
      
              * rendering/RenderApplet.h:
              * rendering/RenderCounter.h:
              * rendering/RenderFieldset.h:
              * rendering/RenderFileUploadControl.h:
              * rendering/RenderFrame.h:
              * rendering/RenderFrameSet.h:
              * rendering/RenderHTMLCanvas.h:
              * rendering/RenderListBox.h:
              * rendering/RenderListItem.h:
              * rendering/RenderListMarker.h:
              * rendering/RenderMedia.h:
              * rendering/RenderMenuList.h:
              * rendering/RenderPart.h:
              * rendering/RenderPartObject.h:
              * rendering/RenderPath.h:
              * rendering/RenderSVGContainer.h:
              * rendering/RenderSVGRoot.h:
              * rendering/RenderSVGTextPath.h:
              * rendering/RenderSVGViewportContainer.h:
              * rendering/RenderScrollbar.h:
              * rendering/RenderSlider.h:
              * rendering/RenderTextControlMultiLine.h:
              * rendering/RenderTextControlSingleLine.h:
              * rendering/RenderVideo.h:
              Added a checked cast. Also made most members protected or private.
      
              * rendering/RenderBlock.h:
              * rendering/RenderInline.h:
              * rendering/RenderReplaced.h:
              * rendering/RenderSVGBlock.h:
              * rendering/RenderSVGImage.h:
              * rendering/RenderSVGInlineText.h:
              * rendering/RenderSVGText.h:
              * rendering/RenderTextControl.h:
              Made most members protected or private.
      
              * rendering/RenderInline.cpp:
              * rendering/RenderSVGContainer.cpp:
              * rendering/RenderSVGHiddenContainer.cpp:
              * rendering/RenderSVGImage.cpp:
              * rendering/RenderSVGRoot.cpp:
              Removed unneeded destructor.
      
              * rendering/RenderSVGHiddenContainer.h:
              Removed unneeded virtual function overrides that did the same as
              the default and base class.
      
              * rendering/RenderSVGViewportContainer.cpp:
              (WebCore::RenderSVGViewportContainer::paint): Updated to use m_viewport
              directly instead of using a function call.
              (WebCore::RenderSVGViewportContainer::applyViewportClip): Ditto.
              (WebCore::RenderSVGViewportContainer::viewportTransform): Ditto.
              (WebCore::RenderSVGViewportContainer::localToParentTransform): Ditto.
              (WebCore::RenderSVGViewportContainer::pointIsInsideViewportClip): Ditto.
      
              * rendering/RenderScrollbar.cpp:
              (WebCore::pseudoForScrollbarPart): Changed switch statement to use cases for
              all values instead of using a default case.
      
              * rendering/RenderTreeAsText.cpp:
              (WebCore::operator<<): Removed dependency on casting to types that don't
              have any public members we need to get at. Instead, use function names to
              identify the type rather than doing so much overloading. Changed to use
              checked casts.
              (WebCore::write): Ditto.
      
              * rendering/SVGRenderSupport.cpp:
              (WebCore::renderSubtreeToImage): Changed to use a checked cast and also
              added a comment about the fact that the code does not do sufficient type
              checking before doing the cast.
      
              * rendering/SVGRenderTreeAsText.cpp:
              (WebCore::writeRenderSVGTextBox): Renamed this from operator<<.
              (WebCore::writeSVGInlineTextBoxes): Renamed this from writeSVGInlineText.
              (WebCore::writeSVGText): Renamed this from write.
              (WebCore::writeSVGInlineText): Ditto.
              (WebCore::writeSVGImage): Ditto.
              * rendering/SVGRenderTreeAsText.h: Updated for name changes. Removed
              unneeded default arguments.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b6cb2561
  13. 31 Jul, 2009 1 commit
    • darin@apple.com's avatar
      WebCore: · 445c34f5
      darin@apple.com authored
      2009-07-30  Darin Adler  <darin@apple.com>
      
              Reviewed by David Levin.
      
              Use checked casts for render tree
              https://bugs.webkit.org/show_bug.cgi?id=23522
      
              Next step: Add casts for all the RenderTable classes and use them everywhere.
      
              Also added a few uses in places that were still using static_cast.
              Also made some virtual member functions private.
              Also changed RenderTable::m_tableLayout to use OwnPtr.
      
              * accessibility/AccessibilityTable.cpp:
              (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
              (WebCore::AccessibilityTable::addChildren):
              (WebCore::AccessibilityTable::cellForColumnAndRow):
              * accessibility/AccessibilityTableCell.cpp:
              (WebCore::AccessibilityTableCell::parentTable):
              (WebCore::AccessibilityTableCell::rowIndexRange):
              (WebCore::AccessibilityTableCell::columnIndexRange):
              (WebCore::AccessibilityTableCell::titleUIElement):
              * accessibility/AccessibilityTableColumn.cpp:
              (WebCore::AccessibilityTableColumn::headerObject):
              * accessibility/AccessibilityTableRow.cpp:
              (WebCore::AccessibilityTableRow::parentTable):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/TextIterator.cpp:
              (WebCore::shouldEmitTabBeforeNode):
              (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
              * html/HTMLTableCellElement.cpp:
              (WebCore::HTMLTableCellElement::parseMappedAttribute):
              * html/HTMLTableColElement.cpp:
              (WebCore::HTMLTableColElement::parseMappedAttribute):
              * page/Frame.cpp:
              (WebCore::Frame::searchForLabelsAboveCell):
              * page/mac/FrameMac.mm:
              (WebCore::Frame::searchForNSLabelsAboveCell):
              * rendering/AutoTableLayout.cpp:
              (WebCore::AutoTableLayout::recalcColumn):
              (WebCore::AutoTableLayout::fullRecalc):
              (WebCore::shouldScaleColumns):
              * rendering/FixedTableLayout.cpp:
              (WebCore::FixedTableLayout::calcWidthArray):
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::calcPrefWidths):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::calcPercentageHeight):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::addChild):
              (WebCore::RenderObject::containingBlock):
              * rendering/RenderTableCell.cpp:
              (WebCore::RenderTableCell::collapsedBottomBorder):
              * rendering/RenderTableCol.cpp:
              (WebCore::RenderTableCol::table):
              * rendering/RenderTableRow.cpp:
              (WebCore::RenderTableRow::addChild):
              (WebCore::RenderTableRow::layout):
              (WebCore::RenderTableRow::paint):
              * rendering/RenderTableSection.cpp:
              (WebCore::RenderTableSection::addChild):
              (WebCore::RenderTableSection::layoutRows):
              (WebCore::RenderTableSection::lowestPosition):
              (WebCore::RenderTableSection::rightmostPosition):
              (WebCore::RenderTableSection::leftmostPosition):
              (WebCore::RenderTableSection::paintObject):
              (WebCore::RenderTableSection::recalcCells):
              * rendering/RenderTreeAsText.cpp:
              (WebCore::operator<<):
              (WebCore::writeTextRun):
              Use checked casts.
      
              * rendering/RenderTable.cpp:
              (WebCore::RenderTable::styleDidChange): Updated to use OwnPtr.
              (WebCore::RenderTable::addChild): Use checked cast.
              (WebCore::RenderTable::layout): Ditto.
              (WebCore::RenderTable::setCellWidths): Ditto.
              (WebCore::RenderTable::paintObject): Ditto.
              (WebCore::RenderTable::splitColumn): Ditto.
              (WebCore::RenderTable::appendColumn): Ditto.
              (WebCore::RenderTable::colElement): Ditto.
              (WebCore::RenderTable::recalcSections): Ditto.
              (WebCore::RenderTable::outerBorderBottom): Ditto.
              (WebCore::RenderTable::outerBorderLeft): Ditto.
              (WebCore::RenderTable::outerBorderRight): Ditto.
              (WebCore::RenderTable::sectionAbove): Ditto.
              (WebCore::RenderTable::sectionBelow): Ditto.
      
              * rendering/RenderTable.h: Added checked cast. Made virtual
              functions private. Changed m_tableLayout to be a OwnPtr.
      
              * rendering/RenderTableCell.h: Added checked cast.
              * rendering/RenderTableCol.h: Ditto. Made virtual functions private.
              * rendering/RenderTableRow.h: Ditto.
              * rendering/RenderTableSection.h: Ditto.
      
      WebKit/mac:
      
      2009-07-30  Darin Adler  <darin@apple.com>
      
              Reviewed by David Levin.
      
              Use checked casts for render tree
              https://bugs.webkit.org/show_bug.cgi?id=23522
      
              * Misc/WebNSAttributedStringExtras.mm:
              (fileWrapperForElement):
              * Misc/WebNSPasteboardExtras.mm:
              (imageFromElement):
              (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]):
              * WebView/WebFrame.mm:
              (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]):
              (-[WebFrame _accessibilityTree]):
              * WebView/WebRenderNode.mm:
              (copyRenderNode):
              Use checked casts.
      
      WebKit/win:
      
      2009-07-30  Darin Adler  <darin@apple.com>
      
              Reviewed by David Levin.
      
              Use checked casts for render tree
              https://bugs.webkit.org/show_bug.cgi?id=23522
      
              * DOMHTMLClasses.cpp:
              (DOMHTMLInputElement::isUserEdited):
              (DOMHTMLTextAreaElement::isUserEdited):
              Use checked casts.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      445c34f5
  14. 30 Jul, 2009 1 commit
    • darin@apple.com's avatar
      2009-07-30 Darin Adler <darin@apple.com> · 9c962752
      darin@apple.com authored
              Reviewed by David Levin.
      
              Use checked casts for render tree
              https://bugs.webkit.org/show_bug.cgi?id=23522
      
              Next step: Add new toRenderWidget cast and use it everywhere.
      
              Use checked casts in all the places that were using static_cast
              but there is a checked cast available.
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::stringValue):
              (WebCore::AccessibilityRenderObject::widget):
              (WebCore::AccessibilityRenderObject::widgetForAttachmentView):
              (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (getPangoLayoutForAtk):
              * dom/Document.cpp:
              (WebCore::widgetForNode):
              (WebCore::Document::setFocusedNode):
              * html/HTMLEmbedElement.cpp:
              (WebCore::findWidgetRenderer):
              * html/HTMLMediaElement.cpp:
              (WebCore::HTMLMediaElement::defaultEventHandler):
              * html/HTMLObjectElement.cpp:
              (WebCore::HTMLObjectElement::renderWidgetForJSBindings):
              * html/HTMLPlugInElement.cpp:
              (WebCore::HTMLPlugInElement::defaultEventHandler):
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::loadSubframe):
              * loader/PluginDocument.cpp:
              (WebCore::PluginTokenizer::writeRawData):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::hitTestResultAtPoint):
              (WebCore::subframeForTargetNode):
              (WebCore::EventHandler::handleWheelEvent):
              * page/Frame.cpp:
              (WebCore::isFrameElement):
              * page/PrintContext.cpp:
              (WebCore::PrintContext::computePageRects):
              * page/android/EventHandlerAndroid.cpp:
              (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
              * page/chromium/EventHandlerChromium.cpp:
              (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
              * page/chromium/FrameChromium.cpp:
              (WebCore::computePageRectsForFrame):
              * page/gtk/EventHandlerGtk.cpp:
              (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
              * page/haiku/EventHandlerHaiku.cpp:
              (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
              * page/mac/EventHandlerMac.mm:
              (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
              (WebCore::EventHandler::passSubframeEventToSubframe):
              * page/win/FrameWin.cpp:
              (WebCore::computePageRectsForFrame):
              * page/wx/EventHandlerWx.cpp:
              (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
              * platform/chromium/ClipboardChromium.cpp:
              (WebCore::getCachedImage):
              * platform/chromium/PasteboardChromium.cpp:
              (WebCore::Pasteboard::writeImage):
              * platform/gtk/PasteboardGtk.cpp:
              (WebCore::Pasteboard::writeImage):
              * platform/mac/PasteboardMac.mm:
              (WebCore::Pasteboard::writeImage):
              * platform/qt/ClipboardQt.cpp:
              (WebCore::getCachedImage):
              * platform/qt/PasteboardQt.cpp:
              (WebCore::Pasteboard::writeImage):
              * platform/win/ClipboardWin.cpp:
              (WebCore::getCachedImage):
              * platform/win/PasteboardWin.cpp:
              (WebCore::Pasteboard::writeImage):
              * rendering/InlineBox.h:
              (WebCore::InlineBox::boxModelObject):
              * rendering/RenderInline.cpp:
              (WebCore::RenderInline::splitInlines):
              (WebCore::RenderInline::addChildToContinuation):
              * rendering/RenderLayerBacking.cpp:
              (WebCore::RenderLayerBacking::updateImageContents):
              * rendering/TextControlInnerElements.cpp:
              (WebCore::RenderTextControlInnerBlock::positionForPoint):
              Use checked cast instead of static_cast.
              
              * rendering/RenderWidget.h: Added toRenderWidget.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9c962752
  15. 25 Jul, 2009 1 commit
    • abarth@webkit.org's avatar
      2009-07-25 Mike Fenton <mike.fenton@torchmobile.com> · 583e2c94
      abarth@webkit.org authored
              Reviewed by George Staikos.
      
              Update WebCore/page/Frame.cpp/h to conform to WebKit
              Style Guidelines as identified by cpplint.py.
              https://bugs.webkit.org/show_bug.cgi?id=27654
      
              * page/Frame.cpp:
              (WebCore::Frame::Frame):
              (WebCore::Frame::~Frame):
              (WebCore::Frame::setDocument):
              (WebCore::Frame::firstRectForRange):
              (WebCore::createRegExpForLabels):
              (WebCore::Frame::searchForLabelsBeforeElement):
              (WebCore::Frame::matchLabelsAgainstElement):
              (WebCore::Frame::selectionLayoutChanged):
              (WebCore::Frame::setZoomFactor):
              (WebCore::Frame::reapplyStyles):
              (WebCore::Frame::isContentEditable):
              (WebCore::Frame::computeAndSetTypingStyle):
              (WebCore::Frame::selectionStartStylePropertyValue):
              (WebCore::Frame::selectionComputedStyle):
              (WebCore::Frame::applyEditingStyleToBodyElement):
              (WebCore::Frame::removeEditingStyleFromBodyElement):
              (WebCore::Frame::applyEditingStyleToElement):
              (WebCore::Frame::selectionBounds):
              (WebCore::Frame::currentForm):
              (WebCore::Frame::revealSelection):
              (WebCore::Frame::styleForSelectionStart):
              (WebCore::Frame::setSelectionFromNone):
              (WebCore::Frame::findString):
              (WebCore::Frame::markAllMatchesForText):
              (WebCore::Frame::setMarkedTextMatchesAreHighlighted):
              (WebCore::Frame::clearFormerDOMWindow):
              (WebCore::Frame::unfocusWindow):
              (WebCore::Frame::respondToChangedSelection):
              (WebCore::Frame::documentAtPoint):
              * page/Frame.h:
              (WebCore::Frame::create):
              (WebCore::Frame::displayStringModifiedByEncoding):
              (WebCore::Frame::pageZoomFactor):
              (WebCore::Frame::textZoomFactor):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      583e2c94
  16. 10 Jul, 2009 1 commit
    • ddkilzer@apple.com's avatar
      2009-07-10 Shinichiro Hamaji <hamaji@chromium.org> · 9c4dacca
      ddkilzer@apple.com authored
              Reviewed by David Kilzer.
      
              WebKit needs a style linting tool
              https://bugs.webkit.org/show_bug.cgi?id=25884
      
              Fix bunch of style issues by autofix of cpplint.
              This patch is created to demonstrate the autofix of cpplint.py.
      
              No new testcases because it's a style fix
      
              * css/CSSParser.cpp:
              (WebCore::CSSParser::parseMediaQuery):
              (WebCore::CSSParser::validUnit):
              (WebCore::CSSParser::parseValue):
              (WebCore::skipCommaInDashboardRegion):
              (WebCore::CSSParser::parseDashboardRegions):
              (WebCore::ShadowParseContext::commitValue):
              (WebCore::ShadowParseContext::commitLength):
              (WebCore::ShadowParseContext::commitColor):
              (WebCore::BorderImageParseContext::commitNumber):
              (WebCore::BorderImageParseContext::commitWidth):
              (WebCore::BorderImageParseContext::commitRule):
              (WebCore::BorderImageParseContext::commitBorderImage):
              (WebCore::CSSParser::lex):
              (WebCore::CSSParser::text):
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::applyProperty):
              * css/MediaList.cpp:
              (WebCore::MediaList::deleteMedium):
              * css/MediaQuery.h:
              * css/MediaQueryEvaluator.cpp:
              (WebCore::parseAspectRatio):
              * css/MediaQueryEvaluator.h:
              * css/MediaQueryExp.h:
              (WebCore::MediaQueryExp::operator==):
              * css/WebKitCSSMatrix.h:
              * dom/Comment.h:
              * dom/Document.cpp:
              (WebCore::Document::setFocusedNode):
              * dom/Document.h:
              (WebCore::Document::setHasDashboardRegions):
              * dom/DocumentFragment.cpp:
              (WebCore::DocumentFragment::nodeName):
              * dom/DocumentFragment.h:
              * dom/DynamicNodeList.h:
              * dom/EditingText.h:
              * dom/Element.cpp:
              (WebCore::Element::dispatchAttrAdditionEvent):
              * dom/NamedAttrMap.cpp:
              (WebCore::NamedNodeMap::item):
              * dom/Node.cpp:
              (WebCore::Node::nodeValue):
              (WebCore::Node::nodeIndex):
              * dom/NodeRareData.h:
              (WebCore::NodeListsNodeData::create):
              * dom/Notation.h:
              * dom/ProcessingInstruction.h:
              * dom/Range.cpp:
              (WebCore::Range::processContents):
              * dom/StyledElement.cpp:
              (WebCore::toHex):
              * dom/XMLTokenizerLibxml2.cpp:
              (WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
              (WebCore::PendingCallbacks::PendingStartElementNSCallback::call):
              (WebCore::PendingCallbacks::):
              (WebCore::OffsetBuffer::readOutBytes):
              (WebCore::handleElementNamespaces):
              (WebCore::handleElementAttributes):
              (WebCore::attributesStartElementNsHandler):
              * dom/XMLTokenizerQt.cpp:
              (WebCore::attributesStartElementNsHandler):
              (WebCore::XMLTokenizer::parseStartElement):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyle):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/Editor.cpp:
              (WebCore::Editor::pasteAsPlainText):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::directionOfEnclosingBlock):
              * editing/SmartReplaceICU.cpp:
              (WebCore::addAllCodePoints):
              * history/HistoryItem.cpp:
              (WebCore::HistoryItem::icon):
              (WebCore::HistoryItem::adoptVisitCounts):
              * html/CanvasStyle.cpp:
              (WebCore::CanvasStyle::applyFillColor):
              * html/HTMLAnchorElement.cpp:
              (WebCore::HTMLAnchorElement::setActive):
              (WebCore::HTMLAnchorElement::isLiveLink):
              * html/HTMLAppletElement.h:
              * html/HTMLAudioElement.h:
              * html/HTMLBRElement.h:
              * html/HTMLBaseElement.h:
              * html/HTMLBaseFontElement.h:
              * html/HTMLDListElement.h:
              * html/HTMLDirectoryElement.h:
              * html/HTMLFieldSetElement.cpp:
              (WebCore::HTMLFieldSetElement::HTMLFieldSetElement):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::reset):
              * html/HTMLHRElement.cpp:
              (WebCore::HTMLHRElement::parseMappedAttribute):
              * html/HTMLHeadElement.h:
              * html/HTMLHtmlElement.h:
              * html/HTMLImageElement.h:
              (WebCore::HTMLImageElement::setLoadManually):
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::selection):
              * html/HTMLIsIndexElement.h:
              * html/HTMLMarqueeElement.cpp:
              * html/HTMLMediaElement.h:
              (WebCore::HTMLMediaElement::):
              * html/HTMLMenuElement.h:
              * html/HTMLMetaElement.h:
              * html/HTMLModElement.h:
              * html/HTMLOListElement.h:
              * html/HTMLOptionElement.cpp:
              (WebCore::HTMLOptionElement::childrenChanged):
              * html/HTMLParamElement.h:
              * html/HTMLQuoteElement.h:
              * html/HTMLStyleElement.h:
              * html/HTMLTableCaptionElement.h:
              * html/HTMLTableCellElement.h:
              * html/HTMLTableColElement.h:
              * html/HTMLTableSectionElement.cpp:
              (WebCore::HTMLTableSectionElement::deleteRow):
              * html/HTMLTitleElement.h:
              * html/HTMLTokenizer.cpp:
              (WebCore::HTMLTokenizer::parseNonHTMLText):
              (WebCore::HTMLTokenizer::parseEntity):
              (WebCore::HTMLTokenizer::parseTag):
              (WebCore::HTMLTokenizer::write):
              * html/HTMLUListElement.h:
              * html/HTMLVideoElement.h:
              * html/TimeRanges.h:
              (WebCore::TimeRanges::Range::Range):
              * inspector/InspectorController.cpp:
              (WebCore::InspectorController::enableResourceTracking):
              (WebCore::InspectorController::disableResourceTracking):
              * inspector/InspectorFrontend.cpp:
              (WebCore::InspectorFrontend::newInspectorJSONObject):
              * page/Console.cpp:
              (WebCore::Console::addMessage):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEvent):
              (WebCore::EventHandler::selectCursor):
              (WebCore::EventHandler::defaultKeyboardEventHandler):
              * page/Frame.cpp:
              (WebCore::Frame::jsDefaultStatusBarText):
              * page/android/DragControllerAndroid.cpp:
              (WebCore::DragController::dragOperation):
              * page/android/EventHandlerAndroid.cpp:
              (WebCore::EventHandler::tabsToAllControls):
              (WebCore::EventHandler::eventActivatedView):
              * page/animation/AnimationController.cpp:
              (WebCore::AnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
              * page/gtk/DragControllerGtk.cpp:
              (WebCore::DragController::dragOperation):
              * page/qt/DragControllerQt.cpp:
              * page/win/DragControllerWin.cpp:
              (WebCore::DragController::isCopyKeyDown):
              * page/win/FrameWin.h:
              * rendering/RenderSlider.cpp:
              (WebCore::RenderSlider::mouseEventOffsetToThumb):
              * rendering/style/RenderStyle.h:
              (WebCore::InheritedFlags::setVerticalAlignLength):
              (WebCore::InheritedFlags::setUnicodeBidi):
              (WebCore::InheritedFlags::setCursor):
              * rendering/style/RenderStyleConstants.h:
              (WebCore::):
              * rendering/style/SVGRenderStyleDefs.h:
              * rendering/style/StyleInheritedData.h:
              (WebCore::StyleInheritedData::operator!=):
              * storage/DatabaseTask.h:
              * svg/GradientAttributes.h:
              * svg/LinearGradientAttributes.h:
              * svg/PatternAttributes.h:
              * svg/RadialGradientAttributes.h:
              * svg/SVGAnimatedPathData.h:
              * svg/SVGAnimatedPoints.h:
              * svg/SVGAnimationElement.h:
              * svg/SVGClipPathElement.h:
              * svg/SVGElementInstance.h:
              * svg/SVGFEBlendElement.cpp:
              (WebCore::SVGFEBlendElement::build):
              * svg/SVGFEBlendElement.h:
              * svg/SVGFEColorMatrixElement.cpp:
              (WebCore::SVGFEColorMatrixElement::build):
              * svg/SVGFEComponentTransferElement.cpp:
              (WebCore::SVGFEComponentTransferElement::build):
              * svg/SVGFECompositeElement.cpp:
              (WebCore::SVGFECompositeElement::build):
              * svg/SVGFEDiffuseLightingElement.cpp:
              (WebCore::SVGFEDiffuseLightingElement::build):
              * svg/SVGFEDisplacementMapElement.cpp:
              (WebCore::SVGFEDisplacementMapElement::build):
              * svg/SVGFEDistantLightElement.h:
              * svg/SVGFEFloodElement.cpp:
              (WebCore::SVGFEFloodElement::build):
              * svg/SVGFEFloodElement.h:
              * svg/SVGFEFuncAElement.h:
              * svg/SVGFEFuncBElement.h:
              * svg/SVGFEFuncGElement.h:
              * svg/SVGFEFuncRElement.h:
              * svg/SVGFEGaussianBlurElement.cpp:
              (WebCore::SVGFEGaussianBlurElement::build):
              * svg/SVGFEImageElement.cpp:
              (WebCore::SVGFEImageElement::build):
              * svg/SVGFEMergeElement.cpp:
              (WebCore::SVGFEMergeElement::build):
              * svg/SVGFEOffsetElement.cpp:
              (WebCore::SVGFEOffsetElement::build):
              * svg/SVGFEPointLightElement.h:
              * svg/SVGFESpecularLightingElement.cpp:
              (WebCore::SVGFESpecularLightingElement::build):
              * svg/SVGFESpotLightElement.h:
              * svg/SVGFETileElement.cpp:
              (WebCore::SVGFETileElement::build):
              * svg/SVGLineElement.cpp:
              (WebCore::SVGLineElement::parseMappedAttribute):
              * svg/SVGList.h:
              * svg/SVGListTraits.h:
              (WebCore::):
              * svg/SVGMPathElement.h:
              * svg/SVGMetadataElement.h:
              * svg/SVGParserUtilities.cpp:
              (WebCore::SVGPathParser::parseSVG):
              (WebCore::SVGPathParser::calculateArc):
              * svg/SVGPathElement.h:
              * svg/SVGPathSegClosePath.h:
              * svg/SVGSVGElement.h:
              * svg/SVGSetElement.h:
              * svg/SVGSwitchElement.h:
              * svg/SVGTextPathElement.cpp:
              (WebCore::SVGTextPathElement::parseMappedAttribute):
              * svg/SVGTextPathElement.h:
              * svg/SVGTitleElement.h:
              * svg/SVGTransformable.cpp:
              (WebCore::):
              * svg/SVGViewSpec.cpp:
              (WebCore::):
              * svg/animation/SMILTime.cpp:
              (WebCore::operator+):
              (WebCore::operator-):
              (WebCore::operator*):
              * svg/animation/SVGSMILElement.h:
              * svg/graphics/SVGResource.cpp:
              (WebCore::clientMap):
              * wml/WMLPostfieldElement.cpp:
              (WebCore::WMLPostfieldElement::value):
              * wml/WMLSetvarElement.cpp:
              (WebCore::WMLSetvarElement::value):
              * workers/WorkerRunLoop.cpp:
              * xml/XMLHttpRequest.cpp:
              (WebCore::XMLHttpRequest::dropProtection):
              * xml/XPathPath.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9c4dacca
  17. 09 Jul, 2009 1 commit
    • bdakin@apple.com's avatar
      WebCore: · 33a4d05b
      bdakin@apple.com authored
      2009-07-09  Beth Dakin and Jon Honeycutt <bdakin@apple.com>
      
              Reviewed by Dave Hyatt.
      
              Make Widget RefCounted to fix or make fixable:
      
              <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs 
              at WebCore::Widget::afterMouseDown() after clicking To Do's close 
              box
              <rdar://problem/6978804> WER #16: Repro Access Violation in 
              WebCore::PluginView::bindingInstance (1310178023)
              -and-
              <rdar://problem/6991251> WER #13: Crash in WebKit!
              WebCore::PluginView::performRequest+203 (1311461169) 
      
              * loader/EmptyClients.h:
              (WebCore::EmptyFrameLoaderClient::createPlugin):
              Changed to return PassRefPtr
              (WebCore::EmptyFrameLoaderClient::createJavaAppletWidget):
              Ditto.
      
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::loadSubframe):
              (WebCore::FrameLoader::loadPlugin):
              Make the widget variable a RefPtr. Use .get() when passing it to
              RenderPart::setWidget().
              (WebCore::FrameLoader::createJavaAppletWidget):
              Make the widget variable a RefPtr.
      
              * loader/FrameLoader.h:
              Changed the return type of createJavaAppletWidget().
      
              * loader/FrameLoaderClient.h:
              Change the return types of createPlugin() and 
              createJavaAppletWidget().
      
              * page/Frame.cpp:
              (WebCore::Frame::createView):
              No need to call .get() since setWidget() takes a RefPtr.
      
              * page/FrameView.cpp:
              (WebCore::FrameView::layoutIfNeededRecursive):
              children() now returns a HashSet of RefPtrs.
      
              * page/FrameView.h:
              Remove inheritance from RefCounted; we pick this up from ScrollView
              through Widget.
      
              * platform/ScrollView.cpp:
              (WebCore::ScrollView::addChild):
              addChild() now takes a PassRefPtr and m_children now keeps a 
              HashSet of RefPtrs.
      
              * platform/ScrollView.h:
              ScrollView constructor is now protected.
              (WebCore::ScrollView::children):
              m_children is now a HashSet of RefPtrs.
      
              * platform/Scrollbar.h:
              Remove inheritance from RefCounted; we pick this up from ScrollView
              through Widget.
      
              * platform/Widget.h:
              Inherit from RefCounted. Cleaned up some whitespace. Make m_widget 
              a RefPtr.
      
              * plugins/PluginView.cpp:
              (WebCore::PluginView::create):
              Adopt the PluginView when returning it.
      
              * plugins/PluginView.h:
              Changed create() to return a PassRefPtr.
      
              * rendering/RenderApplet.cpp:
              Receive result in a RefPtr when calling createJavaAppletWidget().
      
              * rendering/RenderPart.cpp:
              (WebCore::RenderPart::setWidget): 
              setWidget() now takes a PassRefPtr. Also removed the manual ref of 
              FrameViews. This is handled by having m_widget be a RefPtr. Removed 
              deleteWidget().
      
              * rendering/RenderPart.h:
              Removed override of deleteWidget().
      
              * rendering/RenderWidget.cpp:
              (WebCore::RenderWidget::destroy):
              (WebCore::RenderWidget::setWidget):
              (WebCore::RenderWidget::paint):
              (WebCore::RenderWidget::setOverlapTestResult):
              (WebCore::RenderWidget::updateWidgetPosition):
              Use .get().
              (WebCore::RenderWidget::clearWidget):
              Don't call deleteWidget(). It was removed. 
      
              * rendering/RenderWidget.h:
              Removed deleteWidget(). Made m_widget a RefPtr.
              (WebCore::RenderWidget::widget):
              Use .get().
      
      WebKit/gtk:
      
      2009-07-09  Beth Dakin and Jon Honeycutt <bdakin@apple.com>
      
              Reviewed by Dave Hyatt.
      
              Make Widget RefCounted to fix:
      
              <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs 
              at WebCore::Widget::afterMouseDown() after clicking To Do's close 
              box
              <rdar://problem/6978804> WER #16: Repro Access Violation in 
              WebCore::PluginView::bindingInstance (1310178023)
              -and-
              <rdar://problem/6991251> WER #13: Crash in WebKit!
              WebCore::PluginView::performRequest+203 (1311461169) 
      
              * WebCoreSupport/FrameLoaderClientGtk.cpp:
              (WebKit::FrameLoaderClient::createPlugin):
              (WebKit::FrameLoaderClient::createJavaAppletWidget):
              * WebCoreSupport/FrameLoaderClientGtk.h:
      
      WebKit/mac:
      
      2009-07-09  Beth Dakin and Jon Honeycutt <bdakin@apple.com>
      
              Reviewed by Dave Hyatt.
      
              Make Widget RefCounted to fix:
      
              <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs 
              at WebCore::Widget::afterMouseDown() after clicking To Do's close 
              box
              <rdar://problem/6978804> WER #16: Repro Access Violation in 
              WebCore::PluginView::bindingInstance (1310178023)
              -and-
              <rdar://problem/6991251> WER #13: Crash in WebKit!
              WebCore::PluginView::performRequest+203 (1311461169) 
      
              * WebCoreSupport/WebFrameLoaderClient.h:
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::createPlugin):
      
      WebKit/qt:
      
      2009-07-09  Beth Dakin  <bdakin@apple.com>
      
              Reviewed by Dave Hyatt.
      
              Make Widget RefCounted to fix:
      
              <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs 
              at WebCore::Widget::afterMouseDown() after clicking To Do's close 
              box
              <rdar://problem/6978804> WER #16: Repro Access Violation in 
              WebCore::PluginView::bindingInstance (1310178023)
              -and-
              <rdar://problem/6991251> WER #13: Crash in WebKit!
              WebCore::PluginView::performRequest+203 (1311461169) 
      
              * WebCoreSupport/FrameLoaderClientQt.cpp:
              (WebCore::FrameLoaderClientQt::createPlugin):
              (WebCore::FrameLoaderClientQt::createJavaAppletWidget):
              * WebCoreSupport/FrameLoaderClientQt.h:
      
      WebKit/win:
      
      2009-07-09  Beth Dakin and Jon Honeycutt <bdakin@apple.com>
      
              Reviewed by Dave Hyatt.
      
              Make Widget RefCounted to fix:
      
              <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs 
              at WebCore::Widget::afterMouseDown() after clicking To Do's close 
              box
              <rdar://problem/6978804> WER #16: Repro Access Violation in 
              WebCore::PluginView::bindingInstance (1310178023)
              -and-
              <rdar://problem/6991251> WER #13: Crash in WebKit!
              WebCore::PluginView::performRequest+203 (1311461169) 
      
              * WebCoreSupport/WebFrameLoaderClient.cpp:
              (WebFrameLoaderClient::createPlugin):
              * WebCoreSupport/WebFrameLoaderClient.h:
              * WebFrame.cpp:
              (WebFrame::createJavaAppletWidget):
              * WebFrame.h:
      
      WebKit/wx:
      
      2009-07-09  Beth Dakin and Jon Honeycutt <bdakin@apple.com>
      
              Reviewed by Dave Hyatt.
      
              Make Widget RefCounted to fix:
      
              <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs 
              at WebCore::Widget::afterMouseDown() after clicking To Do's close 
              box
              <rdar://problem/6978804> WER #16: Repro Access Violation in 
              WebCore::PluginView::bindingInstance (1310178023)
              -and-
              <rdar://problem/6991251> WER #13: Crash in WebKit!
              WebCore::PluginView::performRequest+203 (1311461169) 
      
              * WebKitSupport/FrameLoaderClientWx.cpp:
              (WebCore::FrameLoaderClientWx::createPlugin):
              (WebCore::FrameLoaderClientWx::createJavaAppletWidget):
              * WebKitSupport/FrameLoaderClientWx.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      33a4d05b
  18. 17 Jun, 2009 1 commit
    • aroben@apple.com's avatar
      2009-06-16 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> · cb3261ef
      aroben@apple.com authored
      Reviewed by Dave Hyatt and Adam Roben.
      
              https://bugs.webkit.org/show_bug.cgi?id=26278
              Patch that make WebCore have a RenderTheme per page
      
              Create a different RenderTheme per page, so that RenderTheme has
              access to page specific theming. This is needed for the Qt port, as Qt
              supports setting the theme (style) per widget.
      
              This change was suggested and discussed with Dave Hyatt.
      
              More detailed:
      
              1) Create a theme per page or one global one, depending on the needs
                 of the platform.
              2) Add an accesser to the theme from RenderObject.
              3) Change all uses of the theming to access the theme through
                 RenderObject, using the global default theme as fallback, when the
                 document of RenderObject has no page.
                 When we don't have access to a RenderObject, use the default theme.
              4) Modify all RenderTheme platform implementations to work with the
                 above changes, still creating only one global theme.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cb3261ef
  19. 04 Jun, 2009 1 commit
    • hyatt@apple.com's avatar
      WebCore: · d4bc96cc
      hyatt@apple.com authored
      2009-06-03  David Hyatt  <hyatt@apple.com>
      
              Reviewed by Sam Weinig.
      
              Improvements in how selection behaves with focus/activation and a reversion back to using isActive
              in the scrollbar theme code to remove a Chromium ifdef.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::SelectionController):
              Make the controller set its focused state correctly upon initial creation.
      
              (WebCore::SelectionController::setSelection):
              Make selection willing to shift the focus node if the selection is focused even if the
              selection is not active.  Whether or not the Page is active is irrelevant to focus changes.
      
              (WebCore::SelectionController::setFocused):
              * editing/SelectionController.h:
              (WebCore::SelectionController::isFocused):
              Add a new isFocused() method so that code can check if the Selection is focused without caring
              about the active state.
      
              * page/Frame.cpp:
              (WebCore::Frame::setFocusedNodeIfNeeded):
              Allow focus shifts even when the selection is not active.
      
              * platform/mac/ScrollbarThemeMac.mm:
              (WebCore::ScrollbarThemeMac::paint):
              Revert Dan's change to directly talk to AppKit for checking active state.  Now that the WebCore isActive
              method works, ditch the Chromium-specific #ifdef and go back to the original code.
      
      WebKit/mac:
      
      2009-06-03  David Hyatt  <hyatt@apple.com>
      
              Reviewed by Sam Weinig.
      
              Reworking of focus and active state updating for WebHTMLViews so that it actually works instead of reporting wrong answers.
      
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::transitionToCommittedForNewPage):
              WebHTMLViews become first responders before they are able to reach their Frames/Pages.  This happens because the NSClipView
              becomes first responder when the WebHTMLView gets destroyed, and then we transfer the responder state back to the new WebHTMLView
              when it is first connected.  Once we have transitioned to a new page and have the Frame/Page available, go ahead and explicitly
              focus the frame in WebCore and update our focused state.  This change allows us to remove the updateFocusedActive timer and the
              code from viewDidMoveToWindow.
              
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView close]):
              (-[WebHTMLView addWindowObservers]):
              (-[WebHTMLView viewWillMoveToWindow:]):
              (-[WebHTMLView viewDidMoveToWindow]):
              (-[WebHTMLView _removeWindowObservers]):
              Remove all the updateFocusedActiveState timer code, since it no longer exists.
      
              (-[WebHTMLView windowDidBecomeKey:]):
              (-[WebHTMLView windowDidResignKey:]):
              Active state updating is no longer done by WebHTMLViews.   It is handled by the WebView instead.
          
              (-[WebHTMLView becomeFirstResponder]):
              (-[WebHTMLView resignFirstResponder]):
              Reworking of WebHTMLView's code for gaining/losing responder status.  No longer update active state here, since the active state
              can never change just because of responder changes.  Make sure that the focused frame gets updated properly (and most importantly
              actually cleared when a WebHTMLView resigns responder status).
      
              * WebView/WebHTMLViewInternal.h:
              * WebView/WebHTMLViewPrivate.h:
              State updating for focused and active states has been made independent.
      
              * WebView/WebView.mm:
              (-[WebView _updateActiveState]):
              WebView now handles updating of active state in _updateActiveState.  It is now purely based off whether the window is key and nothing
              else.
      
              (-[WebView addWindowObserversForWindow:]):
              (-[WebView removeWindowObservers]):
              Start listening for the window becoming/losing key even in the usesDocumentViews case.
      
              (-[WebView _updateFocusedStateForFrame:]):
              Focused state updating is split into its own method now and called when WebHTMLViews gain and lose responder status.
      
              (-[WebView _windowDidBecomeKey:]):
              (-[WebView _windowDidResignKey:]):
              Make sure to call _updateActiveState as the window gains/loses key.
      
              (-[WebView _windowWillOrderOnScreen:]):
              Run this code now that WebHTMLView no longer does it.
      
              * WebView/WebViewInternal.h:
              * WebView/WebViewPrivate.h:
              Updating for the split of focused and active state updating into separate methods.
      
      WebKitTools:
      
      2009-06-03  David Hyatt  <hyatt@apple.com>
      
              Reviewed by Sam Weinig.
      
              * DumpRenderTree/mac/FrameLoadDelegate.mm:
              (-[FrameLoadDelegate webView:didCommitLoadForFrame:]):
              * DumpRenderTree/mac/LayoutTestControllerMac.mm:
              (LayoutTestController::setMainFrameIsFirstResponder):
              Remove explicit calls to _updateFocusedActiveState when the view is made first responder.
              Focused state already properly updates when views become first responders, so these calls
              are unnecessary.
      
              (LayoutTestController::setWindowIsKey):
              Explicitly call _updateActiveState when our window becomes key, since we're just faking it
              and the notification won't be sent.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d4bc96cc
  20. 02 Jun, 2009 1 commit
    • darin@apple.com's avatar
      WebCore: · bd433bc4
      darin@apple.com authored
      2009-06-02  Darin Adler  <darin@apple.com>
      
              Reviewed by David Hyatt.
      
              Bug 26112: viewless WebKit -- make events work
              https://bugs.webkit.org/show_bug.cgi?id=26112
      
              The main fix here is to make mouse and wheel event coordinates in the coordinate
              system of the top level NSView rather than the NSWindow when in the viewless mode.
              This is the design Hyatt chose, but the event part of it wasn't done yet.
      
              Also fix FrameView to do normal reference counting instead of a strange model with
              an explicit deref near creation time.
      
              * WebCore.base.exp: Updated.
      
              * page/EventHandler.cpp:
              (WebCore::EventHandler::eventLoopHandleMouseUp): Moved this function into the file
              to reduce conditionals in the header.
              (WebCore::EventHandler::eventLoopHandleMouseDragged): Ditto.
      
              * page/EventHandler.h: Reduced includes. Fixed formatting of Objective-C types.
              Made currentNSEvent a static member function. Added sendContextMenuEvent and
              eventMayStartDrag functions that takes NSEvent * so the conversion to PlatformMouseEvent
              can be done here rather than in WebKit. Reduced #if by making eventLoopHandleMouseUp and
              eventLoopHandleMouseDragged unconditional.
      
              * page/Frame.cpp:
              (WebCore::Frame::setView): Made this take a PassRefPtr since it takes ownership.
              (WebCore::Frame::createView): Changed to use RefPtr and FrameView::create and remove
              the explicit deref.
      
              * page/Frame.h: Changed setView to take a PassRefPtr.
      
              * page/FrameTree.cpp: Added newly-needed include.
      
              * page/FrameView.cpp:
              (WebCore::FrameView::FrameView): Got rid of one of the two constructors, and removed
              the initialization of m_refCount and call to show from the reamining one.
              (WebCore::FrameView::create): Added two create functions that do what the two
              constructors did before, except that they return a PassRefPtr to make sure the
              reference counting is handled correctly.
              (WebCore::FrameView::~FrameView): Removed assertion from when FrameView implemented
              its own reference counting.
      
              * page/FrameView.h: Inherit from RefCounted for reference counting. Made the
              constructor private and added create functions. Got rid of the hand-implemented
              reference counting in this class.
      
              * page/mac/EventHandlerMac.mm:
              (WebCore::currentNSEventSlot): Renamed currentEvent to currentNSEventSlot to
              make it more clear how it relates to currentNSEvent.
              (WebCore::EventHandler::currentNSEvent): Updated.
              (WebCore::CurrentEventScope::CurrentEventScope): Added. Use to set/reset the
              current event in a foolproof way.
              (WebCore::CurrentEventScope::~CurrentEventScope): Ditto.
              (WebCore::EventHandler::wheelEvent): Use CurrentEventScope. Pass the platform
              window in when constructing the PlatformWheelEvent.
              (WebCore::EventHandler::keyEvent): Use CurrentEventScope.
              (WebCore::lastEventIsMouseUp): Use currentNSEvent.
              (WebCore::EventHandler::passMouseDownEventToWidget): Ditto.
              (WebCore::EventHandler::eventLoopHandleMouseDragged): Ditto.
              (WebCore::EventHandler::eventLoopHandleMouseUp): Ditto.
              (WebCore::EventHandler::passSubframeEventToSubframe): Use
              currentPlatformMouseEvent to get a mouse event that has the appropriate
              platform window passed to create it.
              (WebCore::EventHandler::passWheelEventToWidget): Ditto.
              (WebCore::EventHandler::mouseDown): Ditto.
              (WebCore::EventHandler::mouseDragged): Ditto.
              (WebCore::EventHandler::mouseUp): Ditto.
              (WebCore::EventHandler::mouseMoved): Ditto.
              (WebCore::EventHandler::currentPlatformMouseEvent): Added. Passes the
              platform window that's now needed to create a PlatformMouseEvent.
              (WebCore::EventHandler::sendContextMenuEvent): Added.
              (WebCore::EventHandler::eventMayStartDrag): Added.
      
              * platform/HostWindow.h: Removed unneeded includes and constructor definition.
      
              * platform/PlatformMouseEvent.h: Sorted things in alphabetical order.
              Changed Mac constructor to take a windowView as well as the event. This is
              needed in viewless mode, since the "window" is actually an NSView, so the
              event has to know which view to compute the coordinates with. Made the
              same change to pointForEvent.
              * platform/PlatformWheelEvent.h: Ditto.
      
              * platform/mac/PlatformMouseEventMac.mm:
              (WebCore::pointForEvent): Convert point from window coordinates to view
              coordinates if a windowView is passed in. This is used in viewless mode.
              (WebCore::PlatformMouseEvent::PlatformMouseEvent): Ditto.
              * platform/mac/WheelEventMac.mm:
              (WebCore::PlatformWheelEvent::PlatformWheelEvent): Ditto.
      
              * platform/mac/WidgetMac.mm:
              (WebCore::Widget::convertFromContainingWindow): Fixed case where there
              is no platform widget and no parent. Before it would yield unpredictable
              results because of dispatching to a nil object and returning a structure.
              Now it returns the point without changing coordinates at all, which is what
              we need for this case in viewless mode.
      
              * rendering/RenderApplet.cpp: Removed unneeded includes.
              (WebCore::RenderApplet::intrinsicSize): Use widget function.
              (WebCore::RenderApplet::createWidgetIfNecessary): Ditto.
      
              * rendering/RenderApplet.h: Make more things private. Get rid of unneeded
              explicit destructor.
      
              * rendering/RenderFrame.cpp: Removed unneeded includes.
              (WebCore::RenderFrame::edgeInfo): Updated to use node function so header
              doesn't have to define element function.
              (WebCore::RenderFrame::viewCleared): Ditto. Also changed to use widget
              function.
      
              * rendering/RenderFrame.h: Removed unneeded includes. Made some things
              private. Got rid of element function.
      
              * rendering/RenderPart.cpp: Removed unneeded includes.
              (WebCore::RenderPart::~RenderPart): Changed to use clearWidget function.
              (WebCore::RenderPart::setWidget): Changed to use widget function.
              (WebCore::RenderPart::deleteWidget): Changed to use passed-in widget.
              This is now only called by the clearWidget function.
      
              * rendering/RenderPart.h: Removed unneeded forward declarations.
              Made more functions private. Updated deleteWidget to take widget argument.
      
              * rendering/RenderPartObject.cpp:
              (WebCore::RenderPartObject::~RenderPartObject): use frameView function
              instead of getting at m_view directly.
              (WebCore::RenderPartObject::updateWidget): Ditto.
              (WebCore::RenderPartObject::layout): Ditto. Same for widget and m_widget.
              (WebCore::RenderPartObject::viewCleared): Ditto.
      
              * rendering/RenderPartObject.h: Made some functions private.
      
              * rendering/RenderWidget.cpp:
              (WebCore::RenderWidget::RenderWidget): Initialize m_frameView with
              construction syntax instead of assignment.
              (WebCore::RenderWidget::destroy): Updated for name change of m_view
              to m_frameView.
              (WebCore::RenderWidget::~RenderWidget): Use clearWidget to delete
              the widget.
              (WebCore::RenderWidget::setWidget): Use clearWidget.
              (WebCore::RenderWidget::paint): Updated for name change of m_view
              to m_frameView.
              (WebCore::RenderWidget::deleteWidget): Changed to use passed-in widget.
      
              * rendering/RenderWidget.h: Made many functions protected, others
              private and made all data members private.
      
              * svg/animation/SMILTime.h: Removed unhelpful max and min functions. These
              just do what std::max and std::min will already do automatically for this
              type, so they are not helpful.
      
              * svg/graphics/SVGImage.cpp:
              (WebCore::SVGImage::SVGImage): Removed unneeded initial values for types
              that initialize to zero without anything explicit.
              (WebCore::SVGImage::~SVGImage): Update since m_frame and m_frameView are
              no longer stored.
              (WebCore::SVGImage::setContainerSize): Ditto.
              (WebCore::SVGImage::usesContainerSize): Ditto.
              (WebCore::SVGImage::size): Ditto.
              (WebCore::SVGImage::hasRelativeWidth): Ditto.
              (WebCore::SVGImage::hasRelativeHeight): Ditto.
              (WebCore::SVGImage::draw): Ditto.
              (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
              (WebCore::SVGImage::dataChanged): Ditto.
      
              * svg/graphics/SVGImage.h: Removed unneeded includes and unneeded data
              members m_document, m_frame, m_frameView, and m_minSize.
      
      WebKit/mac:
      
      2009-06-02  Darin Adler  <darin@apple.com>
      
              Reviewed by David Hyatt.
      
              Bug 26112: viewless WebKit -- make events work
              https://bugs.webkit.org/show_bug.cgi?id=26112
      
              One change here is to make the -[WebFrame frameView] function assert if ever called
              in viewless mode, and fix many callers that would trip that assertion.
      
              A major change is to put some methods and data in WebView that are currently in
              WebHTMLView, used only in viewless mode. A next step will be to use the WebView
              methods whenever possible, even when not in the viewless mode.
      
              Also fix FrameView to do normal reference counting instead of a strange model with
              an explicit deref near creation time.
      
              * WebCoreSupport/WebChromeClient.mm:
              (WebChromeClient::scrollRectIntoView): Add code to start in the appropriate place
              when dealing with viewless mode. This gets triggered when visiting the Google home page.
              (WebChromeClient::setToolTip): Changed to call WebView instead of WebHTMLView.
              (WebChromeClient::print): Changed to use a new selector that doesn't require a
              WebFrameView if present. Also don't even try to use the old selector in viewless mode.
      
              * WebCoreSupport/WebEditorClient.mm:
              (WebEditorClient::respondToChangedSelection): Changed to call WebView instead of WebHTMLView.
      
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::transitionToCommittedForNewPage): Added more code paths for
              viewless mode to skip things we can't do in that mode, with appropriate FIXME.
              Use Frame::create and RefPtr and eliminate the strange reference counting of FrameView.
      
              * WebView/WebDataSource.mm:
              (-[WebDataSource _receivedData:]): Added a _usesDocumentViews guard around code that's
              specific to document views.
      
              * WebView/WebFrame.mm:
              (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Added a _usesDocumentViews
              guard around code that's specific to document views.
              (-[WebFrame _hasSelection]): Added an implementation for viewless mode.
              (-[WebFrame _clearSelection]): Assert we're not in viewless mode; it doesn't really
              make sense to clear the selection in only one frame in viewless mode. Later we can
              decide what to do.
              (-[WebFrame _dragSourceMovedTo:]): Assert we're not in viewless mode; the dragging
              code for viewless mode shouldn't have to involve the WebFrame object at all.
              (-[WebFrame _dragSourceEndedAt:operation:]): Ditto.
              (-[WebFrame frameView]): Assert we're not in viewless mode. This assertion fires
              often, but it's a great pointer to code that needs to be changed.
      
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView hitTest:]): Tweaked a comment.
              (-[WebHTMLView _updateMouseoverWithEvent:]): Fixed a bug where the fake event for
              moving the mouse out of the old view ended up overwriting the event for moving
              the mouse within the new view.
              (-[WebHTMLView mouseDown:]): Got rid of explicit conversion of event to
              PlatformMouseEvent in call to sendContextMenuEvent; that's no longer possible
              without passing another argument, and it's now handled in EventHandler.
      
              * WebView/WebTextCompletionController.h: Copied from WebKit/mac/WebView/WebHTMLView.mm.
              Removed everything except for the WebTextCompletionController class.
              * WebView/WebTextCompletionController.mm: Copied from WebKit/mac/WebView/WebHTMLView.mm.
              Ditto.
      
              * WebView/WebUIDelegatePrivate.h: Added webView:printFrame: method.
      
              * WebView/WebView.mm: Moved includes and fields in from WebHTMLView.
              (-[WebView _usesDocumentViews]): Updated for name change from useDocumentViews
              to usesDocumentViews.
              (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Ditto.
              (-[WebView drawSingleRect:]): Ditto.
              (-[WebView isFlipped]): Ditto.
              (-[WebView setFrameSize:]): Ditto. Also changed to use _mainCoreFrame method.
              (-[WebView _viewWillDrawInternal]): Ditto.
              (-[WebView viewWillDraw]): Ditto.
              (-[WebView drawRect:]): Ditto.
              (-[WebView _close]): Added code to nil out the lastMouseoverView global.
              (-[WebView _dashboardRegions]): Use _mainCoreFrame.
              (-[WebView setProhibitsMainFrameScrolling:]): Ditto.
              (-[WebView _setInViewSourceMode:]): Ditto.
              (-[WebView _inViewSourceMode]): Ditto.
              (-[WebView _attachScriptDebuggerToAllFrames]): Ditto.
              (-[WebView _detachScriptDebuggerFromAllFrames]): Ditto.
              (-[WebView textIteratorForRect:]): Ditto.
              (-[WebView _executeCoreCommandByName:value:]): Ditto.
              (-[WebView addWindowObserversForWindow:]): Ditto.
              (-[WebView removeWindowObservers]): Ditto.
              (-[WebView _updateFocusedAndActiveState]): Ditto.
              (-[WebView _updateFocusedAndActiveStateForFrame:]): Turned into a class method.
              Added code to handle the viewless case without calling frameView.
              (-[WebView _windowDidBecomeKey:]): Updated for name change from useDocumentViews
              to usesDocumentViews.
              (-[WebView _windowDidResignKey:]): Ditto.
              (-[WebView _windowWillOrderOnScreen:]): Ditto.
              (-[WebView mainFrame]): Tweaked.
              (-[WebView selectedFrame]): Added a conditional to avoid trying to get at the
              frame view in viewless case.
              (-[WebView _setZoomMultiplier:isTextOnly:]): Use _mainCoreFrame.
              (-[WebView setCustomTextEncodingName:]): Ditto.
              (-[WebView windowScriptObject]): Ditto.
              (-[WebView setHostWindow:]): Ditto. Also put some code that's needed only for
              document views inside _private->usesDocumentViews.
              (-[WebView _hitTest:dragTypes:]): Tweaked.
              (-[WebView acceptsFirstResponder]): Added case for viewless mode along with a
              FIXME, since it's not complete.
              (-[WebView becomeFirstResponder]): Ditto.
              (-[WebView _webcore_effectiveFirstResponder]): Put the body of this inside
              a usesDocumentView check, because we don't need the first responder forwarding
              in viewless mode.
              (-[WebView setNextKeyView:]): Ditto.
              (-[WebView mouseDown:]): Added. Copied from WebHTMLView. FIXME in here suggests
              that we make WebHTMLView share this one soon, which I think is practical.
              (-[WebView mouseUp:]): Ditto.
              (-[WebView setHoverFeedbackSuspended:]): Added a code path for viewless mode.
              (-[WebView shouldClose]): Use _mainCoreFrame.
              (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto.
              (-[WebView setEditable:]): Ditto.
              (-[WebView _frameViewAtWindowPoint:]): Added an assertion that we're not in
              viewless mode since this method makes no sense in that mode.
              (-[WebView _setMouseDownEvent:]): Added. Copied from WebHTMLView. I plan to
              eliminate the one in WebHTMLView soon.
              (-[WebView _cancelUpdateMouseoverTimer]): Ditto.
              (-[WebView _stopAutoscrollTimer]): Ditto.
              (+[WebView _updateMouseoverWithEvent:]): Ditto.
              (-[WebView _updateMouseoverWithFakeEvent]): Ditto.
              (-[WebView _setToolTip:]): Added. Calls through to the WebHTMLView version.
              (-[WebView _selectionChanged]): Ditto.
              (-[WebView _mainCoreFrame]): Added.
              (-[WebView _needsOneShotDrawingSynchronization]): Moved into the WebInternal
              category.
              (-[WebView _setNeedsOneShotDrawingSynchronization:]): Ditto.
              (-[WebView _startedAcceleratedCompositingForFrame:]): Ditto.
              (-[WebView _stoppedAcceleratedCompositingForFrame:]): Ditto.
              (viewUpdateRunLoopObserverCallBack): Ditto.
              (-[WebView _scheduleViewUpdate]): Ditto.
      
              * WebView/WebViewInternal.h: Made most of the file not compile at all when
              included from non-C++ source files, elminating some excess declarations and
              typedefs. Moved more methods into the real internal category. Added new
              methods _setMouseDownEvent, _cancelUpdateMouseoverTimer, _stopAutoscrollTimer,
              _updateMouseoverWithFakeEvent, _selectionChanged, and _setToolTip:.
      
      WebKit/wx:
      
      2009-06-02  Darin Adler  <darin@apple.com>
      
              Reviewed by David Hyatt.
      
              * WebKitSupport/FrameLoaderClientWx.cpp:
              (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage): Use FrameView::create
              and RefPtr instead of the old "crazy" reference counting.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bd433bc4
  21. 27 May, 2009 1 commit
    • weinig@apple.com's avatar
      2009-05-27 Sam Weinig <sam@webkit.org> · b3eafe1d
      weinig@apple.com authored
              Reviewed by David Hyatt.
      
              Miscellaneous cleanup of DOMWindow related functions.
      
              * bindings/js/JSDOMGlobalObject.cpp:
              (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject): Fix poorly named variables.
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::supportsProfiling): Don't jump through hoops
              checking for null frames if the build does not support profiling.
              (WebCore::JSDOMWindowBase::clear): Use setCurrentEvent(0) instead of calling
              clearHelperObjectProperties().  It is clearer.
              * bindings/js/JSDOMWindowBase.h:
              Removed now unused clearHelperObjectProperties() function, empty disconnectFrame()
              function, and the empty destructor.
              * bindings/js/JSDOMWindowShell.cpp:
              * bindings/js/JSDOMWindowShell.h:
              Remove disconnectFrame() which only called JSDOMWindowBase::disconnectFrame(), which
              is a no-op.
              * page/Frame.cpp:
              (WebCore::Frame::~Frame):
              (WebCore::Frame::pageDestroyed):
              Remove calls to JSDOMWindowShell::disconnectFrame() which only called
              JSDOMWindowBase::disconnectFrame(), which is a no-op.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b3eafe1d
  22. 08 May, 2009 1 commit
    • ap@webkit.org's avatar
      2009-05-08 Robert Hogan <robert@roberthogan.net> · fbfb0f90
      ap@webkit.org authored
              Reviewed, tweaked and landed by Alexey Proskuryakov.
      
              https://bugs.webkit.org/show_bug.cgi?id=24992
              [Qt] crash at http://browserspy.dk/browser.php
      
              This cannot be easily tested in DRT, because it relies on interaction with QApplication,
              but the added assertions guard against re-introducing this issue.
      
              * loader/FrameLoader.cpp: (WebCore::FrameLoader::didOpenURL): Don't make client calls
              while the frame is being constructed, because the intermediate state without a document
              is something we don't want to expose.
      
              * page/Frame.cpp:
              (WebCore::Frame::setJSStatusBarText): Assert that the frame has a document, which is an
              approximation of it being in a consistent state for client calls.
              (WebCore::Frame::setJSDefaultStatusBarText): Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fbfb0f90
  23. 04 May, 2009 1 commit
    • darin@apple.com's avatar
      WebCore: · 9a925fa1
      darin@apple.com authored
      2009-05-04  Darin Adler  <darin@apple.com>
      
              Reviewed by Eric Seidel.
      
              Bug 24924: remove Document.h include of Attr.h and HTMLCollection.h,
              and NamedMappedAttrMap.h include of MappedAttribute.h
              https://bugs.webkit.org/show_bug.cgi?id=24924
      
              Make compiles faster, and debugging info smaller.
      
              * GNUmakefile.am: Added new source files.
              * WebCore.pro: Ditto.
              * WebCore.scons: Ditto.
              * WebCore.vcproj/WebCore.vcproj: Ditto.
              * WebCore.xcodeproj/project.pbxproj: Ditto.
              * WebCoreSources.bkl: Ditto.
      
              * bindings/js/JSHTMLCollectionCustom.cpp:
              (WebCore::toJS): Updated for new collection type names.
      
              * dom/Document.cpp:
              (WebCore::Document::createAttribute): Added. No longer inline.
              (WebCore::Document::images): Updated for new collection type names.
              (WebCore::Document::applets): Ditto.
              (WebCore::Document::embeds): Ditto.
              (WebCore::Document::plugins): Ditto.
              (WebCore::Document::objects): Ditto.
              (WebCore::Document::scripts): Ditto.
              (WebCore::Document::links): Ditto.
              (WebCore::Document::forms): Ditto.
              (WebCore::Document::anchors): Ditto.
              (WebCore::Document::all): Ditto.
              (WebCore::Document::windowNamedItems): Ditto.
              (WebCore::Document::documentNamedItems): Ditto.
              (WebCore::Document::nameCollectionInfo): Ditto.
      
              * dom/Document.h: Changed around includes and forward declarations.
              Updated for changes to collection types.
      
              * dom/NamedMappedAttrMap.h: Removed include of MappedAttribute.h.
      
              * html/CollectionCache.cpp: Copied from WebCore/html/HTMLCollection.cpp.
              Contains the class that used to be HTMLCollection::CollectionInfo.
              * html/CollectionCache.h: Copied from WebCore/html/HTMLCollection.h.
              Ditto.
      
              * html/CollectionType.h: Copied from WebCore/html/HTMLCollection.h.
              Has the enum that used to be HTMLCollection::Type.
      
              * html/HTMLCollection.cpp:
              (WebCore::HTMLCollection::HTMLCollection): Update for collection type change.
              (WebCore::HTMLCollection::create): Ditto.
              (WebCore::HTMLCollection::resetCollectionInfo): Ditto.
              (WebCore::HTMLCollection::itemAfter): Ditto.
              * html/HTMLCollection.h: Ditto.
      
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::children): Updated for new collection type names.
              * html/HTMLFormCollection.cpp:
              (WebCore::HTMLFormCollection::formCollectionInfo): Ditto.
              (WebCore::HTMLFormCollection::HTMLFormCollection): Ditto.
              * html/HTMLFormCollection.h: Ditto.
              * html/HTMLFormElement.h: Ditto.
              * html/HTMLMapElement.cpp:
              (WebCore::HTMLMapElement::areas): Ditto.
              * html/HTMLNameCollection.cpp:
              (WebCore::HTMLNameCollection::HTMLNameCollection): Ditto.
              * html/HTMLNameCollection.h:
              (WebCore::HTMLNameCollection::create): Ditto.
              * html/HTMLSelectElement.h:
              (WebCore::HTMLSelectElement::collectionInfo): Ditto.
              * html/HTMLTableElement.cpp:
              (WebCore::HTMLTableElement::tBodies):Ditto.
              * html/HTMLTableRowElement.cpp:
              (WebCore::HTMLTableRowElement::cells):Ditto.
              * html/HTMLTableRowsCollection.cpp:
              (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): Ditto.
              * html/HTMLTableSectionElement.cpp:
              (WebCore::HTMLTableSectionElement::rows): Ditto.
      
              * bindings/js/JSDOMWindowBase.cpp: Added newly-needed includes.
              * bindings/js/JSHTMLFrameSetElementCustom.cpp: Ditto.
              * css/CSSStyleSelector.cpp: Ditto.
              * dom/Element.cpp: Ditto.
              * dom/InputElement.cpp: Ditto.
              * dom/NamedAttrMap.cpp: Ditto.
              * dom/NamedMappedAttrMap.cpp: Ditto.
              * dom/Node.cpp: Ditto.
              * dom/StyledElement.cpp: Ditto.
              * dom/StyledElement.h: Ditto.
              * editing/ApplyStyleCommand.cpp: Ditto.
              * editing/DeleteSelectionCommand.cpp: Ditto.
              * editing/Editor.cpp: Ditto.
              * editing/EditorCommand.cpp: Ditto.
              * editing/InsertParagraphSeparatorCommand.cpp: Ditto.
              * editing/ReplaceSelectionCommand.cpp: Ditto.
              * editing/markup.cpp: Ditto.
              * html/CanvasRenderingContext2D.cpp: Ditto.
              * html/HTMLAnchorElement.cpp: Ditto.
              * html/HTMLAppletElement.cpp: Ditto.
              * html/HTMLAreaElement.cpp: Ditto.
              * html/HTMLBRElement.cpp: Ditto.
              * html/HTMLBaseElement.cpp: Ditto.
              * html/HTMLBodyElement.cpp: Ditto.
              * html/HTMLButtonElement.cpp: Ditto.
              * html/HTMLCanvasElement.cpp: Ditto.
              * html/HTMLDivElement.cpp: Ditto.
              * html/HTMLEmbedElement.cpp: Ditto.
              * html/HTMLFontElement.cpp: Ditto.
              * html/HTMLFormControlElement.cpp: Ditto.
              * html/HTMLFormElement.cpp: Ditto.
              * html/HTMLFrameElement.cpp: Ditto.
              * html/HTMLFrameElementBase.cpp: Ditto.
              * html/HTMLFrameSetElement.cpp: Ditto.
              * html/HTMLHRElement.cpp: Ditto.
              * html/HTMLIFrameElement.cpp: Ditto.
              * html/HTMLImageElement.cpp: Ditto.
              * html/HTMLInputElement.cpp: Ditto.
              * html/HTMLIsIndexElement.cpp: Ditto.
              * html/HTMLKeygenElement.cpp: Ditto.
              * html/HTMLLIElement.cpp: Ditto.
              * html/HTMLLinkElement.cpp: Ditto.
              * html/HTMLMarqueeElement.cpp: Ditto.
              * html/HTMLMetaElement.cpp: Ditto.
              * html/HTMLOListElement.cpp: Ditto.
              * html/HTMLObjectElement.cpp: Ditto.
              * html/HTMLOptionElement.cpp: Ditto.
              * html/HTMLParagraphElement.cpp: Ditto.
              * html/HTMLParamElement.cpp: Ditto.
              * html/HTMLPlugInElement.cpp: Ditto.
              * html/HTMLPreElement.cpp: Ditto.
              * html/HTMLScriptElement.cpp: Ditto.
              * html/HTMLSelectElement.cpp: Ditto.
              * html/HTMLStyleElement.cpp: Ditto.
              * html/HTMLTableCaptionElement.cpp: Ditto.
              * html/HTMLTableCellElement.cpp: Ditto.
              * html/HTMLTableColElement.cpp: Ditto.
              * html/HTMLTablePartElement.cpp: Ditto.
              * html/HTMLTextAreaElement.cpp: Ditto.
              * html/HTMLTokenizer.cpp: Ditto.
              * html/HTMLUListElement.cpp: Ditto.
              * html/HTMLVideoElement.cpp: Ditto.
              * html/HTMLViewSourceDocument.cpp: Ditto.
              * loader/ImageDocument.cpp: Ditto.
              * page/Frame.cpp: Ditto.
              * rendering/RenderTreeAsText.cpp: Ditto.
              * svg/SVGAElement.cpp: Ditto.
              * svg/SVGAnimateMotionElement.cpp: Ditto.
              * svg/SVGAnimateTransformElement.cpp: Ditto.
              * svg/SVGAnimationElement.cpp: Ditto.
              * svg/SVGCircleElement.cpp: Ditto.
              * svg/SVGClipPathElement.cpp: Ditto.
              * svg/SVGCursorElement.cpp: Ditto.
              * svg/SVGElement.cpp: Ditto.
              * svg/SVGEllipseElement.cpp: Ditto.
              * svg/SVGExternalResourcesRequired.cpp: Ditto.
              * svg/SVGFitToViewBox.cpp: Ditto.
              * svg/SVGFontFaceElement.cpp: Ditto.
              * svg/SVGFontFaceUriElement.cpp: Ditto.
              * svg/SVGForeignObjectElement.cpp: Ditto.
              * svg/SVGGlyphElement.cpp: Ditto.
              * svg/SVGGradientElement.cpp: Ditto.
              * svg/SVGImageElement.cpp: Ditto.
              * svg/SVGLangSpace.cpp: Ditto.
              * svg/SVGLineElement.cpp: Ditto.
              * svg/SVGLinearGradientElement.cpp: Ditto.
              * svg/SVGMarkerElement.cpp: Ditto.
              * svg/SVGMaskElement.cpp: Ditto.
              * svg/SVGPathElement.cpp: Ditto.
              * svg/SVGPatternElement.cpp: Ditto.
              * svg/SVGPolyElement.cpp: Ditto.
              * svg/SVGRadialGradientElement.cpp: Ditto.
              * svg/SVGRectElement.cpp: Ditto.
              * svg/SVGSVGElement.cpp: Ditto.
              * svg/SVGScriptElement.cpp: Ditto.
              * svg/SVGStopElement.cpp: Ditto.
              * svg/SVGStyleElement.cpp: Ditto.
              * svg/SVGStyledElement.cpp: Ditto.
              * svg/SVGStyledTransformableElement.cpp: Ditto.
              * svg/SVGTests.cpp: Ditto.
              * svg/SVGTextContentElement.cpp: Ditto.
              * svg/SVGTextElement.cpp: Ditto.
              * svg/SVGTextPathElement.cpp: Ditto.
              * svg/SVGTextPositioningElement.cpp: Ditto.
              * svg/SVGURIReference.cpp: Ditto.
              * svg/SVGUseElement.cpp: Ditto.
              * svg/SVGViewElement.cpp: Ditto.
              * svg/animation/SVGSMILElement.cpp: Ditto.
              * xml/XPathStep.cpp: Ditto.
      
      WebKit/mac:
      
      2009-05-04  Darin Adler  <darin@apple.com>
      
              Reviewed by Eric Seidel.
      
              Bug 24924: remove Document.h include of Attr.h and HTMLCollection.h,
              and NamedMappedAttrMap.h include of MappedAttribute.h
              https://bugs.webkit.org/show_bug.cgi?id=24924
      
              * WebView/WebFrame.mm: Added include of CSSMutableStyleDeclaration.h
              and ScriptValue.h.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9a925fa1
  24. 29 Apr, 2009 1 commit
    • eric@webkit.org's avatar
      Reviewed by Darin Adler. · 4e32ebc3
      eric@webkit.org authored
              Make m_offset private and change all callers to use deprecatedEditingOffset().
              https://bugs.webkit.org/show_bug.cgi?id=25472
      
              Per Darin's suggestion, this was just a simple search replace
              of .m_offset with .deprecatedEditingOffset().
      
              There was one change in InsertParagraphSeparatorCommand::doApply to use
              Position::moveToOffset(0) instead of .m_offset = 0;
      
              * dom/Position.cpp:
              (WebCore::Position::rendersInDifferentPosition):
              (WebCore::Position::leadingWhitespacePosition):
              * dom/Position.h:
              (WebCore::Position::deprecatedEditingOffset):
              (WebCore::Position::moveToOffset):
              (WebCore::operator==):
              * dom/PositionIterator.h:
              (WebCore::PositionIterator::PositionIterator):
              * dom/Range.cpp:
              (WebCore::Range::create):
              (WebCore::Range::compareBoundaryPoints):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::applyInlineStyleToRange):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::nodeFullySelected):
              (WebCore::ApplyStyleCommand::nodeFullyUnselected):
              (WebCore::ApplyStyleCommand::splitTextAtStartIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextAtEndIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
              (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
              (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
              (WebCore::ApplyStyleCommand::joinChildTextNodes):
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              (WebCore::CompositeEditCommand::positionOutsideTabSpan):
              (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
              (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
              (WebCore::CompositeEditCommand::deleteInsignificantText):
              (WebCore::CompositeEditCommand::moveParagraphs):
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::updatePositionForNodeRemoval):
              (WebCore::updatePositionForTextRemoval):
              (WebCore::DeleteSelectionCommand::handleGeneralDelete):
              (WebCore::DeleteSelectionCommand::fixupWhitespace):
              * editing/Editor.cpp:
              (WebCore::Editor::setComposition):
              (WebCore::Editor::advanceToNextMisspelling):
              (WebCore::Editor::getCompositionSelection):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::performTrivialReplace):
              (WebCore::InsertTextCommand::input):
              (WebCore::InsertTextCommand::insertTab):
              * editing/MoveSelectionCommand.cpp:
              (WebCore::MoveSelectionCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::debugRenderer):
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::rangeFromLocationAndLength):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::deleteKeyPressed):
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::characterAfter):
              (WebCore::VisiblePosition::debugPosition):
              (WebCore::makeRange):
              (WebCore::setStart):
              (WebCore::setEnd):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::toNormalizedRange):
              (WebCore::makeSearchRange):
              (WebCore::VisibleSelection::debugPosition):
              (WebCore::VisibleSelection::showTreeForThis):
              * editing/htmlediting.cpp:
              (WebCore::comparePositions):
              (WebCore::rangeCompliantEquivalent):
              * editing/visible_units.cpp:
              (WebCore::previousBoundary):
              (WebCore::nextBoundary):
              (WebCore::startPositionForLine):
              (WebCore::startOfLine):
              (WebCore::endPositionForLine):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::logicalStartPositionForLine):
              (WebCore::logicalEndPositionForLine):
              * page/AccessibilityObject.cpp:
              (WebCore::updateAXLineStartForVisiblePosition):
              * page/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::anchorOffset):
              (WebCore::DOMSelection::focusOffset):
              (WebCore::DOMSelection::baseOffset):
              (WebCore::DOMSelection::extentOffset):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick):
              * page/Frame.cpp:
              (WebCore::Frame::selectionLayoutChanged):
              * page/mac/AccessibilityObjectWrapper.mm:
              (textMarkerForVisiblePosition):
              (visiblePositionForTextMarker):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::indexForVisiblePosition):
              * rendering/RenderTreeAsText.cpp:
              (WebCore::writeSelection):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4e32ebc3
  25. 28 Apr, 2009 2 commits
    • timothy@apple.com's avatar
      Rename -[DOMRange lineBoxRects] to -[DOMRange textRects] and change how it · df6a405c
      timothy@apple.com authored
              collects the individual rects, making sure to only include RenderText.
      
              <rdar://problem/6810061>
      
              Reviewed by Sam Weinig.
      
              * bindings/objc/DOM.mm:
              (-[DOMNode textRects]): Added. Make a Range and call textRects.
              (-[DOMNode lineBoxRects]): Call textRects method.
              (-[DOMRange textRects]): Call Range::textRects.
              (-[DOMRange lineBoxRects]): Call textRects method.
              * bindings/objc/DOMPrivate.h: Add the new methods and a comment
              about lineBoxRects being deprecated.
              * dom/Range.cpp:
              (WebCore::Range::boundingBox): Call textRects (renamed from addLineBoxRects).
              (WebCore::Range::textRects): Renamed from addLineBoxRects. Iterate over the
              nodes instead of the RenderObjects to correctly account for offsets. Also
              only call absoluteRectsForRange on RenderText.
              * dom/Range.h: Renamed addLineBoxRects to textRects.
              * page/Frame.cpp:
              (WebCore::Frame::selectionTextRects): Call textRects (renamed from addLineBoxRects).
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::absoluteRectsForRange): Remove if conditions that made this
              function very specific for the lineBoxRects API. These functions are still used
              by the InspectorController, and this change improves what the Inspector shows.
              (WebCore::RenderObject::absoluteQuadsForRange): Ditto.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      df6a405c
    • xan@webkit.org's avatar
      2009-04-28 Xan Lopez <xlopez@igalia.com> · 441078c9
      xan@webkit.org authored
              Reviewed by Justin Garcia.
      
              https://bugs.webkit.org/show_bug.cgi?id=16135
              [GTK] Support caret browsing
      
              Based on a patch by Alp Toker.
      
              Implement basic support for caret browsing, active only when the
              corresponding setting is enabled.
      
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseReleaseEvent):
              * page/FocusController.cpp:
              (WebCore::FocusController::advanceFocus):
              (WebCore::clearSelectionIfNeeded):
              (WebCore::FocusController::setFocusedNode):
              * page/Frame.cpp:
              (WebCore::Frame::setFocusedNodeIfNeeded):
              (WebCore::Frame::setSelectionFromNone):
              (WebCore::Frame::respondToChangedSelection):
              * page/Settings.cpp:
              (WebCore::Settings::Settings):
              * page/Settings.h:
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::paintCaret):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      441078c9
  26. 27 Apr, 2009 1 commit
    • weinig@apple.com's avatar
      2009-04-27 Sam Weinig <sam@webkit.org> · f23f7715
      weinig@apple.com authored
              Reviewed by Geoffrey Garen.
      
              Move more window event related code into DOMWindow.
      
              * dom/Document.cpp:
              (WebCore::Document::implicitClose):
              (WebCore::Document::setWindowAttributeEventListener):
              (WebCore::Document::dispatchWindowEvent):
              (WebCore::Document::dispatchLoadEvent):
              * dom/Document.h:
              * dom/Element.cpp:
              * dom/Element.h:
              * dom/Node.cpp:
              * dom/Node.h:
              * html/HTMLBodyElement.cpp:
              (WebCore::HTMLBodyElement::parseMappedAttribute):
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::parseMappedAttribute):
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::stopLoading):
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
              (WebCore::DOMWindow::postMessageTimerFired):
              (WebCore::DOMWindow::dispatchEvent):
              (WebCore::DOMWindow::dispatchEventWithDocumentAsTarget):
              (WebCore::DOMWindow::dispatchLoadEvent):
              (WebCore::DOMWindow::dispatchUnloadEvent):
              (WebCore::DOMWindow::dispatchBeforeUnloadEvent):
              * page/DOMWindow.h:
              * page/Frame.cpp:
              (WebCore::Frame::shouldClose):
              * svg/SVGSVGElement.cpp:
              (WebCore::SVGSVGElement::parseMappedAttribute):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f23f7715
  27. 21 Apr, 2009 1 commit
    • timothy@apple.com's avatar
      Change pending unload and beforeunload counts to store the listeners in a... · c9fbbab7
      timothy@apple.com authored
      Change pending unload and beforeunload counts to store the listeners in a single data structure that can be quickly iterated for dispatch.
      
      WebCore:
      
      2009-04-17  Timothy Hatcher  <timothy@apple.com>
      
              Change pending unload and beforeunload counts to store the listeners
              in a single data structure that can be quickly iterated for dispatch.
      
              <rdar://problem/6383352&6383379&6383940>
      
              Reviewed by Darin Adler.
      
              * WebCore.base.exp: Change what symbols are exported.
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::stopLoading): Remove count updating code
              and move an if inside a block already checking m_frame->document().
              * page/Chrome.cpp: Remove disableSuddenTermination/enableSuddenTermination.
              * page/Chrome.h: Ditto.
              * page/ChromeClient.h: Ditto.
              * page/DOMWindow.cpp:
              (WebCore::pendingUnloadEventListenerMap): Create a static map.
              (WebCore::pendingBeforeUnloadEventListenerMap): Ditto.
              (WebCore::addPendingEventListener): Add the event listener to the map.
              (WebCore::removePendingEventListener): Remove the event listener from the map.
              (WebCore::removePendingEventListeners): Remove all listeners for the window.
              (WebCore::dispatchWindowEventToListeners): Dispatch the event to the given listeners.
              (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents): Send the beforeunload event.
              (WebCore::DOMWindow::pendingUnloadEventListeners): Return a count of pending listeners.
              (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): Send the unload event.
              (WebCore::DOMWindow::~DOMWindow): Remove the window from both event listener maps.
              (WebCore::DOMWindow::addEventListener): Call addPendingEventListener when needed.
              (WebCore::DOMWindow::removeEventListener): Call removePendingEventListener when needed.
              (WebCore::DOMWindow::removeAllEventListeners): Call removePendingEventListeners.
              (WebCore::DOMWindow::removeInlineEventListenerForType): Call removePendingEventListener when needed.
              * page/DOMWindow.h:
              (WebCore::DOMWindow::frame): Changed to be const.
              * page/EventHandler.cpp:
              (WebCore::EventHandler::EventHandler): Remove count tracking code.
              * page/EventHandler.h: Ditto.
              * page/Page.cpp:
              (WebCore::Page::Page): Ditto.
              * page/Page.h: Ditto.
      
      WebKit/mac:
      
      2009-04-17  Timothy Hatcher  <timothy@apple.com>
      
              Change how sudden termination works with WebView teardown.
      
              <rdar://problem/6383352&6383379&6383940>
      
              Reviewed by Darin Adler.
      
              * WebCoreSupport/WebChromeClient.h: Remove disableSuddenTermination/enableSuddenTermination.
              * WebCoreSupport/WebChromeClient.mm: Ditto.
              * WebView/WebFrame.mm:
              (-[WebFrame _pendingFrameUnloadEventCount]): Ask the DOMWindow.
              * WebView/WebView.mm:
              (+[WebView canCloseAllWebViews]): Call DOMWindow::dispatchAllPendingBeforeUnloadEvents.
              (+[WebView closeAllWebViews]): Call DOMWindow::dispatchAllPendingUnloadEvents and
              call close on all the WebViews.
              (-[WebView _closeWithFastTeardown]): Remove code for unload event dispatch.
              (-[WebView _close]): Correct a comment.
              (+[WebView _applicationWillTerminate]): Call closeAllWebViews.
              * WebView/WebViewPrivate.h: Add canCloseAllWebViews and closeAllWebViews.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c9fbbab7
  28. 13 Apr, 2009 1 commit
    • ggaren@apple.com's avatar
      2009-04-13 Geoffrey Garen <ggaren@apple.com> · bc6ef281
      ggaren@apple.com authored
              Reviewed by Sam Weinig.
      
              Moved storage for window event listeners into the window object.
      
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::addEventListener):
              (WebCore::JSDOMWindow::removeEventListener): Add / remove window event
              listeners to / from the window object.
      
              * dom/Document.cpp:
              (WebCore::Document::removeAllEventListeners):
              (WebCore::Document::clear):
              (WebCore::Document::setWindowInlineEventListenerForTypeAndAttribute): Moved
              a bunch of code to the DOMWindow class, and left behind a few calls through
              to DOMWindow, to support legacy clients. (Eventually, these will go away, too.)
      
              * dom/Document.h: ditto.
      
              * dom/Node.cpp:
              (WebCore::Node::dispatchGenericEvent):
              (WebCore::Node::dispatchWindowEvent): Dipatch window events on the window
              object, not the document.
      
              * dom/Node.h:
              * dom/RegisteredEventListener.h: Moved RegisteredEventListenerVector
              declaration, since it's required in more places now.
      
              * history/CachedFrame.cpp:
              (WebCore::CachedFrame::clear): Updated for rename. Also, remove event
              listeners before detaching and clearing the document's window pointer,
              since the the document needs its window pointer in order to tell the window
              to clear its event listeners.
      
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::stopLoading):
              (WebCore::FrameLoader::canCachePageContainingThisFrame):
              (WebCore::FrameLoader::logCanCacheFrameDecision): Updated for rename, and
              movement of window event listeners into the window.
      
              * loader/ImageDocument.cpp:
              (WebCore::ImageDocument::createDocumentStructure): Updated for movement
              of window event listeners into the window.
      
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::handleEvent):
              (WebCore::DOMWindow::addEventListener):
              (WebCore::DOMWindow::removeEventListener):
              (WebCore::DOMWindow::removeAllEventListeners):
              (WebCore::DOMWindow::hasEventListener):
              (WebCore::DOMWindow::setInlineEventListenerForType):
              (WebCore::DOMWindow::removeInlineEventListenerForType):
              (WebCore::DOMWindow::inlineEventListenerForType):
              (WebCore::DOMWindow::addPendingFrameUnloadEventCount):
              (WebCore::DOMWindow::removePendingFrameUnloadEventCount):
              (WebCore::DOMWindow::addPendingFrameBeforeUnloadEventCount):
              (WebCore::DOMWindow::removePendingFrameBeforeUnloadEventCount):
              * page/DOMWindow.h: Moved a bunch of code to the DOMWindow class, from the Document.
      
              * page/Frame.cpp:
              (WebCore::Frame::shouldClose): Updated for movement of window event listeners into the window.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bc6ef281
  29. 01 Apr, 2009 2 commits
    • antti@apple.com's avatar
      2009-04-01 Antti Koivisto <antti@apple.com> · 75459197
      antti@apple.com authored
              Reviewed by Darin Adler.
      
              <rdar://problem/6748609> Use ActiveDOMObject to suspend marquees
              
              Make marquees ActiveDOMObjects, get rid of the special suspension code.
      
              * html/HTMLMarqueeElement.cpp:
              (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
              (WebCore::HTMLMarqueeElement::canSuspend):
              (WebCore::HTMLMarqueeElement::suspend):
              (WebCore::HTMLMarqueeElement::resume):
              * html/HTMLMarqueeElement.h:
              * page/Frame.cpp:
              (WebCore::Frame::clearTimers):
              * rendering/RenderLayer.cpp:
              * rendering/RenderLayer.h:
              (WebCore::RenderLayer::marquee):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      75459197
    • darin@apple.com's avatar
      WebCore: · 0f88bda0
      darin@apple.com authored
      2009-04-01  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff Garen.
      
              Bug 22378: Crash submitting a form when parsing an XHTML document
              https://bugs.webkit.org/show_bug.cgi?id=22378
              rdar://problem/6388377
      
              Tests: fast/loader/submit-form-while-parsing-1.xhtml
                     fast/loader/submit-form-while-parsing-2.html
      
              * WebCore.base.exp: Updated.
      
              * history/HistoryItem.cpp:
              (WebCore::HistoryItem::HistoryItem): Renamed m_subItems to m_children.
              Used uncheckedAppend because we reserveInitialCapacity.
              (WebCore::HistoryItem::addChildItem): Renamed m_subItems to m_children.
              Added an assertion that this is only used to add items that don't have
              duplicate frame names.
              (WebCore::HistoryItem::setChildItem): Added. Replaces an existing item
              if any, preserving the isTargetItem flag.
              (WebCore::HistoryItem::childItemWithTarget): Renamed from childItemWithName
              for consistency with the other functions here that all call the frame name the
              "target". Also updated for rename of m_subItems to m_children.
              (WebCore::HistoryItem::findTargetItem): Renamed from recurseToFindTargetItem.
              Removed unneeded size check.
              (WebCore::HistoryItem::targetItem): Changed to always return the top item
              if no item has the isTargetItem flag set. The old version would instead return
              0 in some cases, but return the top item if it had no children.
              (WebCore::HistoryItem::children): Renamed m_subItems to m_children.
              (WebCore::HistoryItem::hasChildren): Ditto.
              (WebCore::HistoryItem::showTreeWithIndent): Ditto.
      
              * history/HistoryItem.h: Name changes.
      
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::submit): Create and pass a FormState instead of
              attaching "recorded form values" and "form about to be submitted" to the frame
              loader. Parameter work fine for this; there's no need to store state on the
              FrameLoader.
      
              * loader/FormState.cpp:
              (WebCore::FormState::FormState): Adopt a vector instead of copying a hash map.
              (WebCore::FormState::create): Ditto.
              * loader/FormState.h: Update to use a vector that we adopt instead of hash map
              that we copy for auto-fill text field values.
      
              * loader/FrameLoader.cpp:
              (WebCore::ScheduledRedirection::ScheduledRedirection): Added a new case for
              form submissions and turned the "wasDuringLoad" state into a separate boolean
              instead of using a special redirection type to track it.
              (WebCore::FrameLoader::createWindow): Updated for name and argument change of
              loadFrameRequest.
              (WebCore::FrameLoader::urlSelected): Ditto.
              (WebCore::FrameLoader::submitForm): Removed the "deferred form submission"
              machinery, replacing it with the "scheduled redirection" mechanism, shared
              with other kinds of redirection and navigation. Moved frame targeting here
              so we can schedule the redirection on the right frame. Moved the multiple
              form submission protection here. Moved the code to implement the rule that
              m_navigationDuringLoad was used for here too.
              (WebCore::FrameLoader::didOpenURL): Use the new wasDuringLoad flag instead
              of the locationChangeDuringLoad type to detect location change during a load.
              (WebCore::FrameLoader::executeScript): Removed call to now-obsolete function,
              submitFormAgain.
              (WebCore::FrameLoader::scheduleLocationChange): Moved the code to stop loading
              out of this function into scheduleRedirection, so it can be shared with the
              new scheduleFormSubmission function.
              (WebCore::FrameLoader::scheduleFormSubmission): Added. Almost the same as
              scheduleLocationChange, but with the arguments for a form submission.
              (WebCore::FrameLoader::scheduleRefresh): Updated for the change to the
              duringLoad flag.
              (WebCore::FrameLoader::isLocationChange): Added case for formSubmission
              and removed case for locationChangeDuringLoad.
              (WebCore::FrameLoader::redirectionTimerFired): Ditto. Also removed unneeded
              completeURL call and just use KURL constructor to match the other cases.
              (WebCore::FrameLoader::provisionalLoadStarted): Removed the code to set up
              the m_navigationDuringLoad, which is no longer needed. The new version of
              this is in the submitForm function and sets the lockHistory boolean.
              (WebCore::FrameLoader::scheduleRedirection): Moved the code to stop a load
              in here that used to be in scheduleLocationChange.
              (WebCore::FrameLoader::startRedirectionTimer): Added case for formSubmission
              and removed case for locationChangeDuringLoad.
              (WebCore::FrameLoader::stopRedirectionTimer): Ditto.
              (WebCore::FrameLoader::completed): Removed call to now-obsolete function,
              submitFormAgain.
              (WebCore::FrameLoader::loadFrameRequest): Renamed from
              loadFrameRequestWithFormAndValues. Replaced form element and form values
              argument with a single FormState argument. Changed frame targeting code
              to use the source frame in the case of a form submission to better match
              the actual target frame.
              (WebCore::FrameLoader::loadURL): Don't search for existing frames in the
              form submission case since we already did that in the submitForm function.
              (WebCore::FrameLoader::clientRedirected): Changed to work with the
              m_isExecutingJavaScriptFormAction data member directly instead of taking
              it as a function parameter.
              (WebCore::FrameLoader::loadPostRequest): Don't search for existing frames
              in the form submission case since we already did that in the submitForm
              function.
              (WebCore::FrameLoader::addBackForwardItemClippedAtTarget): Moved comment
              in here that was misplaced elsewhere in the file.
              (WebCore::FrameLoader::findFrameForNavigation): Changed to use the early
              return idiom.
              (WebCore::FrameLoader::recursiveGoToItem): Updated for HistoryItem changes.
              (WebCore::FrameLoader::childFramesMatchItem): Ditto.
              (WebCore::FrameLoader::updateHistoryForStandardLoad): Removed the
              m_navigationDuringLoad logic; that's now handled by setting lockHistory
              to true in the submitForm function.
              (WebCore::FrameLoader::updateHistoryForRedirectWithLockedBackForwardList):
              Use the new setChildItem function so we don't get multiple items for the
              same frame name in the history item tree in the back/forward list.
      
              * loader/FrameLoader.h: Renamed loadFrameRequestWithFormAndValues to
              loadFrameRequest and made it take a form state object instead of the
              form element and form values. Removed the unused functions
              loadEmptyDocumentSynchronously, provisionalDocumentLoader,
              notifyIconChnaged, and updateBaseURLForEmptyDocument. Changed the
              submitForm function to take a form state argument. Eliminated the
              clearRecordedFormValues, setFormAboutToBeSubmitted, and recordFormValue
              functions, which are replaced by the form state arguments to submitForm
              and loadFrameRequest. Removed the isJavaScriptFormAction argument from
              the clientRedirected function; instead it looks at a data member directly.
              Eliminated the submitFormAgain and overload of the submitForm function;
              these are now subsumed into the remaining submitForm function and the
              scheduleFormSubmission function. Removed unused and obsolete data
              members m_navigationDuringLoad, m_deferredFormSubmission,
              m_formAboutToBeSubmitted and m_formValuesAboutToBeSubmitted.
      
              * page/ContextMenuController.cpp:
              (WebCore::ContextMenuController::contextMenuItemSelected):
              Updated for name and argument change of loadFrameRequest.
      
              * page/Frame.cpp:
              (WebCore::Frame::~Frame): Removed call to the now-unneeded
              clearRecordedFormValues function.
      
      WebKit/mac:
      
      2009-04-01  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff Garen.
      
              Bug 22378: Crash submitting a form when parsing an XHTML document
              https://bugs.webkit.org/show_bug.cgi?id=22378
              rdar://problem/6388377
      
              * History/WebHistoryItem.mm:
              (-[WebHistoryItem targetItem]): Call targetItem directly instead of callling
              isTargetItem, hasChildren, and recurseToFindTargetItem.
      
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::dispatchWillSubmitForm): Updated for the new
              textFieldValues function in FormState.
      
              * WebView/WebPDFView.mm:
              (-[WebPDFView PDFViewWillClickOnLink:withURL:]): Updated for name and
              argument change of loadFrameRequest.
      
      WebKit/win:
      
      2009-04-01  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff Garen.
      
              Bug 22378: Crash submitting a form when parsing an XHTML document
              https://bugs.webkit.org/show_bug.cgi?id=22378
              rdar://problem/6388377
      
              * WebFrame.cpp:
              (WebFrame::dispatchWillSubmitForm): Updated for the new
              textFieldValues function in FormState.
      
      LayoutTests:
      
      2009-04-01  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff Garen.
      
              Bug 22378: Crash submitting a form when parsing an XHTML document
              https://bugs.webkit.org/show_bug.cgi?id=22378
              rdar://problem/6388377
      
              * fast/loader/onunload-form-submit-crash-2-expected.txt: Updated for change to the test.
              * fast/loader/onunload-form-submit-crash-2.html: Updated test to expect the form submission
              during the onunload handler to be ineffective.
              * fast/loader/onunload-form-submit-crash-expected.txt: Updated for change to the test.
              * fast/loader/onunload-form-submit-crash.html: Updated test to expect the form submission
              during the onunload handler to be ineffective.
      
              * fast/loader/resources/onunload-form-submit-crash2.html: Removed.
              * fast/loader/resources/onunload-form-submit-failure.html: Copied from
              LayoutTests/fast/loader/resources/onunload-form-submit-crash2.html.
              * fast/loader/resources/onunload-form-submit-success.html: Copied from
              LayoutTests/fast/loader/resources/onunload-form-submit-crash2.html.
      
              * fast/loader/resources/submit-form-while-parsing-subframe.html: Added.
              * fast/loader/resources/submit-form-while-parsing-success.html: Added.
              * fast/loader/submit-form-while-parsing-1-expected.txt: Added.
              * fast/loader/submit-form-while-parsing-1.xhtml: Added.
              * fast/loader/submit-form-while-parsing-2-expected.txt: Added.
              * fast/loader/submit-form-while-parsing-2.html: Added.
      
              * platform/mac/http/tests/navigation/success200-frames-loadsame-expected.txt: Updated
              to expect proper results, without the duplicate history items for the same frame name
              that were present before.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0f88bda0
  30. 16 Mar, 2009 1 commit
  31. 10 Mar, 2009 2 commits