1. 02 Oct, 2009 2 commits
    • 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
    • hausmann@webkit.org's avatar
      .: Disable a few more harmless MSVC warnings. · d422fa0e
      hausmann@webkit.org authored
      Patch by Prasanth Ullattil <prasanth.ullattil@nokia.com> on 2009-10-02
      Reviewed by Simon Hausmann.
      
      * WebKit.pri:
      
      WebCore: Fix compiler warnings about unused function arguments.
      
      Patch by Prasanth Ullattil <prasanth.ullattil@nokia.com> on 2009-10-02
      Reviewed by Simon Hausmann.
      
      * bridge/qt/qt_class.h:
      * bridge/qt/qt_runtime.cpp:
      (JSC::Bindings::QtRuntimeMetaMethod::call):
      (JSC::Bindings::QtRuntimeConnectionMethod::call):
      * dom/XMLTokenizerQt.cpp:
      (WebCore::XMLTokenizer::initializeParserContext):
      * platform/graphics/qt/FontCacheQt.cpp:
      (WebCore::FontCache::getTraitsInFamily):
      (WebCore::FontCache::getCachedFontPlatformData):
      * platform/graphics/qt/FontFallbackListQt.cpp:
      (WebCore::FontFallbackList::setPlatformFont):
      * platform/graphics/qt/FontQt.cpp:
      (WebCore::Font::offsetForPositionForComplexText):
      * platform/graphics/qt/GraphicsContextQt.cpp:
      (WebCore::GraphicsContext::drawLineForText):
      (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
      (WebCore::GraphicsContext::setPlatformShadow):
      (WebCore::GraphicsContext::setURLForRect):
      * platform/graphics/qt/IconQt.cpp:
      (WebCore::Icon::createIconForFiles):
      * platform/graphics/qt/ImageBufferQt.cpp:
      (WebCore::ImageBuffer::ImageBuffer):
      * platform/graphics/qt/ImageDecoderQt.cpp:
      (WebCore::ImageDecoderQt::frameBufferAtIndex):
      * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
      (WebCore::MediaPlayerPrivate::supportsType):
      (WebCore::MediaPlayerPrivate::setEndTime):
      * platform/graphics/qt/SimpleFontDataQt.cpp:
      (WebCore::SimpleFontData::containsCharacters):
      * platform/graphics/qt/StillImageQt.h:
      (WebCore::StillImage::destroyDecodedData):
      * platform/network/qt/DnsPrefetchHelper.h:
      (WebCore::DnsPrefetchHelper::lookedUp):
      * platform/qt/ContextMenuQt.cpp:
      (WebCore::ContextMenu::setPlatformDescription):
      * platform/qt/DragDataQt.cpp:
      (WebCore::DragData::asURL):
      * platform/qt/PopupMenuQt.cpp:
      (WebCore::PopupMenu::populate):
      * platform/qt/RenderThemeQt.cpp:
      (WebCore::RenderThemeQt::supportsFocusRing):
      (WebCore::RenderThemeQt::systemFont):
      (WebCore::RenderThemeQt::adjustButtonStyle):
      (WebCore::RenderThemeQt::adjustMenuListButtonStyle):
      (WebCore::RenderThemeQt::paintMediaSeekBackButton):
      (WebCore::RenderThemeQt::paintMediaSeekForwardButton):
      * platform/qt/ScrollViewQt.cpp:
      (WebCore::ScrollView::platformAddChild):
      * platform/qt/SearchPopupMenuQt.cpp:
      (WebCore::SearchPopupMenu::saveRecentSearches):
      (WebCore::SearchPopupMenu::loadRecentSearches):
      * platform/qt/TemporaryLinkStubs.cpp:
      (WebCore::signedPublicKeyAndChallengeString):
      * platform/qt/WidgetQt.cpp:
      (WebCore::Widget::paint):
      * xml/XSLStyleSheetQt.cpp:
      (WebCore::XSLStyleSheet::loadChildSheet):
      (WebCore::XSLStyleSheet::setParentStyleSheet):
      * xml/XSLTProcessorQt.cpp:
      (WebCore::XSLTMessageHandler::handleMessage):
      (WebCore::XSLTProcessor::transformToString):
      
      WebKit/qt: Fix compiler warnings about unused function arguments.
      
      Patch by Prasanth Ullattil <prasanth.ullattil@nokia.com> on 2009-10-02
      Reviewed by Simon Hausmann.
      
      * Api/qwebframe.cpp:
      (QWebFrame::scrollBarMinimum):
      * Api/qwebpage.cpp:
      (QWebPagePrivate::focusInEvent):
      (QWebPagePrivate::focusOutEvent):
      (QWebPagePrivate::leaveEvent):
      (QWebPage::javaScriptAlert):
      (QWebPage::javaScriptConfirm):
      (QWebPage::javaScriptPrompt):
      (QWebPage::triggerAction):
      (QWebPage::acceptNavigationRequest):
      (QWebPage::chooseFile):
      * WebCoreSupport/ChromeClientQt.cpp:
      (WebCore::ChromeClientQt::repaint):
      (WebCore::ChromeClientQt::mouseDidMoveOverElement):
      (WebCore::ChromeClientQt::reachedMaxAppCacheSize):
      * WebCoreSupport/ContextMenuClientQt.cpp:
      (WebCore::ContextMenuClientQt::downloadURL):
      * WebCoreSupport/FrameLoaderClientQt.cpp:
      (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect):
      (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady):
      (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
      (WebCore::FrameLoaderClientQt::generatedMIMETypeForURLScheme):
      (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
      (WebCore::FrameLoaderClientQt::pluginWillHandleLoadError):
      (WebCore::FrameLoaderClientQt::assignIdentifierToInitialRequest):
      (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading):
      (WebCore::FrameLoaderClientQt::createJavaAppletWidget):
      * WebCoreSupport/InspectorClientQt.cpp:
      (WebCore::InspectorClientQt::setAttachedWindowHeight):
      (WebCore::InspectorClientQt::highlight):
      (WebCore::InspectorClientQt::removeSetting):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d422fa0e
  2. 01 Oct, 2009 1 commit
    • abarth@webkit.org's avatar
      2009-10-01 Adam Barth <abarth@webkit.org> · 5d1a968f
      abarth@webkit.org authored
              Reviewed by Darin Adler.
      
              Remove FrameLoader::schedule* APIs
              https://bugs.webkit.org/show_bug.cgi?id=29950
      
              Change clients of FrameLoader::schedule* to call redirectScheduler
              directly.
      
              No behavior change.
      
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::setLocation):
              (WebCore::createWindow):
              (WebCore::JSDOMWindow::open):
              * bindings/js/JSDocumentCustom.cpp:
              (WebCore::JSDocument::setLocation):
              * bindings/js/JSLocationCustom.cpp:
              (WebCore::navigateIfAllowed):
              (WebCore::JSLocation::reload):
              * bindings/v8/V8Utilities.cpp:
              (WebCore::navigateIfAllowed):
              * bindings/v8/custom/V8DOMWindowCustom.cpp:
              (WebCore::createWindow):
              (WebCore::CALLBACK_FUNC_DECL):
              * bindings/v8/custom/V8LocationCustom.cpp:
              (WebCore::CALLBACK_FUNC_DECL):
              * dom/Document.cpp:
              (WebCore::Document::implicitClose):
              (WebCore::Document::processHttpEquiv):
              * html/HTMLTokenizer.cpp:
              (WebCore::HTMLTokenizer::write):
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::requestFrame):
              (WebCore::FrameLoader::submitForm):
              (WebCore::FrameLoader::receivedFirstData):
              * loader/FrameLoader.h:
              * loader/appcache/ApplicationCacheGroup.cpp:
              (WebCore::ApplicationCacheGroup::selectCache):
              * page/History.cpp:
              (WebCore::History::back):
              (WebCore::History::forward):
              (WebCore::History::go):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d1a968f
  3. 29 Sep, 2009 2 commits
    • 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
    • ap@apple.com's avatar
      Reviewed by Darin Adler and Sam Weinig. · 06431f3d
      ap@apple.com authored
              Onclick not fired for an element copied with cloneContents() or cloneNode()
              https://bugs.webkit.org/show_bug.cgi?id=25130
      
              The change here is that JS event listeners don't keep a reference to a global object from
              where they were created, and instead take it as a parameter when parsing source code. Also,
              the listener creation won't fail just because it happens for an element in a frameless
              document.
              Thus, moving nodes between documents no longer results in having incorrect registered
              lazy event listeners on them.
      
              Tests: fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html
                     fast/events/attribute-listener-cloned-from-frameless-doc-context.html
                     fast/events/attribute-listener-cloned-from-frameless-doc.xhtml
                     fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html
                     fast/events/attribute-listener-extracted-from-frameless-doc-context.html
      
              * bindings/js/JSEventListener.cpp:
              (WebCore::JSEventListener::JSEventListener): Don't take a reference to JSDOMGlobalObject.
              (WebCore::JSEventListener::jsFunction): Take ScriptExecutionContext as a parameter for
              getting to JSDOMGlobalObject. It's not used in base class, but is in JSLazyEventListner.
              (WebCore::JSEventListener::markJSFunction): Don't mark the global object.
              (WebCore::JSEventListener::handleEvent): Get global object from ScriptExecutionContext.
              (WebCore::JSEventListener::reportError): Ditto.
      
              * bindings/js/JSEventListener.h: (WebCore::JSEventListener::create): Don't keep a reference
              to JSDOMGlobalObject.
      
              * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::parseCode): Listener
              creation was split between this function and ScriptEventListener; moved it here, as JS
              global object can be different now.
      
              * bindings/js/JSLazyEventListener.h: (WebCore::JSLazyEventListener::create): Keep source URL,
              which can not be determined at parsing time.
      
              * bindings/js/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): Moved code
              for listener creation to JSLazyEventListener. XSSAuditor code remains here, because tests
              expect that errors are logged at document parsing time, and because I don't know what other
              side effects moving it vould have.
      
              * dom/EventListener.h: handleEvent() and reportError() now take ScriptExecutionContext,
              because JSC needs a global context here.
      
              * bindings/js/JSAbstractWorkerCustom.cpp:
              (WebCore::JSAbstractWorker::addEventListener):
              (WebCore::JSAbstractWorker::removeEventListener):
              * bindings/js/JSDOMApplicationCacheCustom.cpp:
              (WebCore::JSDOMApplicationCache::addEventListener):
              (WebCore::JSDOMApplicationCache::removeEventListener):
              * bindings/js/JSDOMGlobalObject.cpp:
              (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::addEventListener):
              (WebCore::JSDOMWindow::removeEventListener):
              * bindings/js/JSEventSourceCustom.cpp:
              (WebCore::JSEventSource::addEventListener):
              (WebCore::JSEventSource::removeEventListener):
              * bindings/js/JSMessagePortCustom.cpp:
              (WebCore::JSMessagePort::addEventListener):
              (WebCore::JSMessagePort::removeEventListener):
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::JSNode::addEventListener):
              (WebCore::JSNode::removeEventListener):
              * bindings/js/JSSVGElementInstanceCustom.cpp:
              (WebCore::JSSVGElementInstance::addEventListener):
              (WebCore::JSSVGElementInstance::removeEventListener):
              * bindings/js/JSWorkerContextCustom.cpp:
              (WebCore::JSWorkerContext::addEventListener):
              (WebCore::JSWorkerContext::removeEventListener):
              * bindings/js/JSXMLHttpRequestCustom.cpp:
              (WebCore::JSXMLHttpRequest::addEventListener):
              (WebCore::JSXMLHttpRequest::removeEventListener):
              * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
              (WebCore::JSXMLHttpRequestUpload::addEventListener):
              (WebCore::JSXMLHttpRequestUpload::removeEventListener):
              * bindings/objc/ObjCEventListener.h:
              * bindings/objc/ObjCEventListener.mm:
              (WebCore::ObjCEventListener::handleEvent):
              * bindings/scripts/CodeGeneratorJS.pm:
              * dom/EventTarget.cpp:
              (WebCore::EventTarget::fireEventListeners):
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::handleEvent):
              * inspector/InspectorDOMAgent.h:
              * inspector/InspectorDOMStorageResource.cpp:
              (WebCore::InspectorDOMStorageResource::handleEvent):
              * inspector/InspectorDOMStorageResource.h:
              * loader/ImageDocument.cpp:
              (WebCore::ImageEventListener::handleEvent):
              * svg/animation/SVGSMILElement.cpp:
              (WebCore::ConditionEventListener::handleEvent):
              * workers/WorkerContext.cpp:
              (WebCore::WorkerContext::reportException):
              Don't pass global object to JSEventListener::create(), which no longer needs it.
              Note that some of these functions still have an early return for null global object, which
              can probably be removed in a later patch.
              Pass ScriptExecutionContext to EventListener methods that now need it.
      
              * bindings/scripts/CodeGeneratorCOM.pm: Don't force EventTarget implementation on Node -
              it doesn't work yet (it didn't quite work before this patch, too, because it assumed that
              any object implementing EventTarget COM interface originated from WebCore).
      
              * dom/EventListener.idl: Just like in ObjC, EventListener should be a pure interface in
              COM bindings.
      
      WebKit/win:
              * DOMCreateInstance.cpp: GEN_DOMEventListener is a pure interface now.
      
              * WebKit.vcproj/WebKit.vcproj: Removed GEN_DOMEventListener.cpp.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      06431f3d
  4. 28 Sep, 2009 2 commits
    • hausmann@webkit.org's avatar
      [Qt] Implement XSLT support with QtXmlPatterns. · 06b7e555
      hausmann@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=28303
      
      Patch by Jakub Wieczorek <faw217@gmail.com> on 2009-09-28
      Reviewed by Simon Hausmann.
      
      JavaScriptCore:
      
      * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define.
      
      WebCore:
      
      * GNUmakefile.am:
      * WebCore.gypi:
      * WebCore.pro:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCoreSources.bkl:
      * dom/Document.cpp:
      (WebCore::Document::Document):
      (WebCore::Document::~Document):
      (WebCore::Document::setTransformSource):
      * dom/Document.h:
      (WebCore::Document::transformSource):
      * dom/TransformSource.h: Added.
      (WebCore::TransformSource::platformSource):
      * dom/TransformSourceLibxslt.cpp: Added.
      (WebCore::TransformSource::TransformSource): Wraps a libxml2 document.
      (WebCore::TransformSource::~TransformSource):
      * dom/TransformSourceQt.cpp: Added.
      (WebCore::TransformSource::TransformSource): Wraps a plain string.
      (WebCore::TransformSource::~TransformSource):
      * dom/XMLTokenizerLibxml2.cpp:
      (WebCore::XMLTokenizer::doEnd):
      * dom/XMLTokenizerQt.cpp:
      (WebCore::XMLTokenizer::doEnd):
      (WebCore::XMLTokenizer::parseProcessingInstruction):
      * xml/XSLStyleSheet.h:
      (WebCore::XSLStyleSheet::sheetString):
      * xml/XSLStyleSheetLibxslt.cpp:
      (WebCore::XSLStyleSheet::document):
      * xml/XSLStyleSheetQt.cpp: Added.
      * xml/XSLTProcessor.h:
      * xml/XSLTProcessorLibxslt.cpp:
      (WebCore::xmlDocPtrFromNode):
      * xml/XSLTProcessorQt.cpp: Added.
      (WebCore::XSLTMessageHandler::XSLTMessageHandler): A subclass of QAbstractMessageHandler.
      (WebCore::XSLTMessageHandler::handleMessage): Forwards all processor messages to the Console.
      (WebCore::XSLTProcessor::transformToString): Uses QXmlQuery.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      06b7e555
    • pfeldman@chromium.org's avatar
      2009-09-28 Joseph Pecoraro <joepeck@webkit.org> · a5c785e8
      pfeldman@chromium.org authored
              Reviewed by Timothy Hatcher.
      
              Inspector Should Show Event Listeners/Handlers Registered on each Node
              https://bugs.webkit.org/show_bug.cgi?id=17429
              
                Extracted a method from dispatchEvent to get the event ancestor chain
              
              * dom/Node.cpp:
              (WebCore::Node::eventAncestors): the extracted method
              (WebCore::Node::dispatchGenericEvent): use eventAncestors
              * dom/Node.h:
      
                Asynchronous Flow For the Inspector, Backend -> DOM Agent -> Frontend
                The DOMAgent's getEventListenersForNode handles the logic of finding
                all the relevant listeners in the event flow.
      
              * inspector/InspectorBackend.cpp:
              (WebCore::InspectorBackend::getEventListenersForNode):
              * inspector/InspectorBackend.h:
              * inspector/InspectorBackend.idl:
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::getEventListenersForNode):
              (WebCore::InspectorDOMAgent::buildObjectForEventListener):
              (WebCore::InspectorDOMAgent::buildObjectForNode): added localName
              * inspector/InspectorDOMAgent.h:
              (WebCore::EventListenerInfo::EventListenerInfo):
              * inspector/InspectorFrontend.cpp:
              (WebCore::InspectorFrontend::didGetEventListenersForNode):
              * inspector/InspectorFrontend.h:
              (WebCore::InspectorFrontend::scriptState):
              * inspector/front-end/DOMAgent.js: added localName to WebInspector.DOMNode from payload
              (WebInspector.EventListeners.getEventListenersForNodeAsync.mycallback):
              (WebInspector.EventListeners.getEventListenersForNodeAsync):
      
                New Sidebar Pane in the Element's Panel
                Includes Gear Menu for filtering the Event Listeners on the
                "Selected Node Only" or "All Nodes"
      
              * inspector/front-end/ElementsPanel.js: Handles refreshing the Pane when necessary
              (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
              (WebInspector.ElementsPanel):
              (WebInspector.ElementsPanel.prototype.updateEventListeners):
              * inspector/front-end/EventListenersSidebarPane.js: Added. 
              (WebInspector.EventListenersSidebarPane): The 1st level in the Pane
              (WebInspector.EventListenersSidebarPane.prototype.update.callback):
              (WebInspector.EventListenersSidebarPane.prototype.update):
              (WebInspector.EventListenersSection): The 2nd level in the Pane
              (WebInspector.EventListenersSection.prototype.update): filters on Preference
              (WebInspector.EventListenersSection.prototype.addListener):
              (WebInspector.EventListenerBar): The 3rd level in the Pane
              (WebInspector.EventListenerBar.prototype._getNodeDisplayName):
              (WebInspector.EventListenerBar.prototype._getFunctionDisplayName):
              (WebInspector.EventListenersSidebarPane.prototype._changeSetting): For the Gear Menu
              
                Consolidated "appropriateSelectorForNode"
      
              * inspector/front-end/StylesSidebarPane.js:
              * inspector/front-end/utilities.js:
      
                Miscellaneous Updates
      
              * English.lproj/localizedStrings.js: "Event Listeners", "No Event Listeners", "Selected Node Only", "All Nodes"
              * WebCore.gypi: included the new inspector files
              * WebCore.vcproj/WebCore.vcproj: included source files that were missing
              * inspector/front-end/Images/grayConnectorPoint.png: Added. Thanks to Timothy Hatcher.
              * inspector/front-end/Images/whiteConnectorPoint.png: Added. Thanks to Timothy Hatcher.
              * inspector/front-end/inspector.js: Preferences for the Gear Menu Event Listeners filter
              * inspector/front-end/inspector.css: reused as much as possible
              * inspector/front-end/inspector.html: include the new script
              * inspector/front-end/WebKit.qrc: included the new inspector files
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a5c785e8
  5. 27 Sep, 2009 1 commit
    • weinig@apple.com's avatar
      WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=29760 · a09f5201
      weinig@apple.com authored
      Implement CSSOM Range.getClientRects/getBoundingClientRect 
      
      Reviewed by Dan Bernstein.
      
      Tests: fast/dom/Range/getBoundingClientRect-getClientRects-relative-to-viewport.html
             fast/dom/Range/getBoundingClientRect.html
             fast/dom/Range/getClientRects.html
      
      * dom/Range.cpp:
      (WebCore::Range::getClientRects):
      (WebCore::Range::getBoundingClientRect):
      (WebCore::adjustFloatQuadsForScrollAndAbsoluteZoom):
      (WebCore::Range::getBorderAndTextQuads):
      * dom/Range.h:
      * dom/Range.idl:
      Implement Range.getClientRects/getBoundingClientRect.
      
      * dom/Element.cpp:
      * rendering/RenderObject.h: 
      (WebCore::adjustForAbsoluteZoom):
      (WebCore::adjustIntRectForAbsoluteZoom):
      (WebCore::adjustFloatPointForAbsoluteZoom):
      (WebCore::adjustFloatQuadForAbsoluteZoom):
      Move point/quad adjustment methods from Element.cpp to RenderObject.h
      so that Range.cpp can use them as well.
      
      LayoutTests: Tests for https://bugs.webkit.org/show_bug.cgi?id=29760
      Implement CSSOM Range.getClientRects/getBoundingClientRect 
      
      Reviewed by Dan Bernstein.
      
      * fast/dom/Element/getBoundingClientRect-expected.txt: Copied from LayoutTests/fast/dom/getBoundingClientRect-expected.txt.
      * fast/dom/Element/getBoundingClientRect-getClientRects-relative-to-viewport-expected.txt: Copied from LayoutTests/fast/dom/getBoundingClientRect-getClientRects-relative-to-viewport-expected.txt.
      * fast/dom/Element/getBoundingClientRect-getClientRects-relative-to-viewport.html: Copied from LayoutTests/fast/dom/getBoundingClientRect-getClientRects-relative-to-viewport.html.
      * fast/dom/Element/getBoundingClientRect.html: Copied from LayoutTests/fast/dom/getBoundingClientRect.html.
      * fast/dom/Element/getClientRects-expected.txt: Copied from LayoutTests/fast/dom/getClientRects-expected.txt.
      * fast/dom/Element/getClientRects.html: Copied from LayoutTests/fast/dom/getClientRects.html.
      * fast/dom/Range/getBoundingClientRect-expected.txt: Added.
      * fast/dom/Range/getBoundingClientRect-getClientRects-relative-to-viewport-expected.txt: Added.
      * fast/dom/Range/getBoundingClientRect-getClientRects-relative-to-viewport.html: Added.
      * fast/dom/Range/getBoundingClientRect.html: Added.
      * fast/dom/Range/getClientRects-expected.txt: Added.
      * fast/dom/Range/getClientRects.html: Added.
      * fast/dom/Window/window-properties-expected.txt:
      * fast/dom/getBoundingClientRect-expected.txt: Removed.
      * fast/dom/getBoundingClientRect-getClientRects-relative-to-viewport-expected.txt: Removed.
      * fast/dom/getBoundingClientRect-getClientRects-relative-to-viewport.html: Removed.
      * fast/dom/getBoundingClientRect.html: Removed.
      * fast/dom/getClientRects-expected.txt: Removed.
      * fast/dom/getClientRects.html: Removed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48806 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a09f5201
  6. 26 Sep, 2009 2 commits
    • eric@webkit.org's avatar
      2009-09-26 Kent Tamura <tkent@chromium.org> · e6cd79ca
      eric@webkit.org authored
              Reviewed by David Kilzer.
      
              Move placeholder-related code to HTMLTextFormControlElement from
              HTMLInputElement, WMLInputElement, InputElement, and
              HTMLTextAreaElement.
              https://bugs.webkit.org/show_bug.cgi?id=28703
      
              * dom/InputElement.cpp:
              (WebCore::InputElement::dispatchFocusEvent):
              (WebCore::InputElement::dispatchBlurEvent):
              (WebCore::InputElement::setValueFromRenderer):
              * dom/InputElement.h:
              * html/HTMLFormControlElement.cpp:
              (WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
              (WebCore::HTMLTextFormControlElement::~HTMLTextFormControlElement):
              (WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
              (WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
              (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
              (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
              * html/HTMLFormControlElement.h:
              (WebCore::HTMLTextFormControlElement::handleFocusEvent):
              (WebCore::HTMLTextFormControlElement::handleBlurEvent):
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::HTMLInputElement):
              (WebCore::HTMLInputElement::handleFocusEvent):
              (WebCore::HTMLInputElement::handleBlurEvent):
              (WebCore::HTMLInputElement::parseMappedAttribute):
              (WebCore::HTMLInputElement::createRenderer):
              (WebCore::HTMLInputElement::setValue):
              (WebCore::HTMLInputElement::setValueFromRenderer):
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::supportsPlaceholder):
              (WebCore::HTMLInputElement::isEmptyValue):
              * html/HTMLIsIndexElement.cpp:
              (WebCore::HTMLIsIndexElement::parseMappedAttribute):
              * html/HTMLTextAreaElement.cpp:
              (WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
              (WebCore::HTMLTextAreaElement::createRenderer):
              * html/HTMLTextAreaElement.h:
              (WebCore::HTMLTextAreaElement::supportsPlaceholder):
              (WebCore::HTMLTextAreaElement::isEmptyValue):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::RenderTextControl):
              * rendering/RenderTextControl.h:
              * rendering/RenderTextControlMultiLine.cpp:
              (WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
              * rendering/RenderTextControlMultiLine.h:
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
              (WebCore::RenderTextControlSingleLine::updateFromElement):
              * rendering/RenderTextControlSingleLine.h:
              * wml/WMLInputElement.cpp:
              (WebCore::WMLInputElement::setValue):
              (WebCore::WMLInputElement::createRenderer):
              * wml/WMLInputElement.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e6cd79ca
    • eric@webkit.org's avatar
      2009-09-26 Shu Chang <Chang.Shu@nokia.com> · e967f240
      eric@webkit.org authored
              Reviewed by Alexey Proskuryakov.
      
              Optimize the code so only the text from start to end is scanned.
              https://bugs.webkit.org/show_bug.cgi?id=29092
      
              On a platform with webkit+Qt+Symbian, the parsing time for a 600K text
              file improved from 400ms to 40ms (10x faster).
      
              * dom/Text.cpp:
              (WebCore::Text::createWithLengthLimit):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e967f240
  7. 25 Sep, 2009 6 commits
    • ap@apple.com's avatar
      Reverting r48767, as it broke Windows build in a non-trivial way. · 9b999edb
      ap@apple.com authored
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9b999edb
    • darin@chromium.org's avatar
      2009-09-25 Darin Fisher <darin@chromium.org> · 5c6a8437
      darin@chromium.org authored
              Reviewed by Dimitri Glazkov.
      
              Declare RegisteredEventListener as a class instead of a struct.
              This fixes a warning in the Chromium build.
      
              * dom/RegisteredEventListener.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5c6a8437
    • hyatt@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=24399 · 1cfc800e
      hyatt@apple.com authored
      Make @import work in user stylesheets.  The first bug was that the URL wasn't being set on the
      user sheets themselves, so relative @import URLs couldn't resolve properly.  The second bug
      was that the loads would be denied.  This is fixed by using the requestUserCSSStyleSheet method
      instead of the normal request method.  In order to know when to do this, CSSStyleSheets now have
      a propagated boolean, m_isUserStyleSheet, that lets them know if they are user stylesheets or not.
      
      Reviewed by Anders Carlsson.
      
      * css/CSSImportRule.cpp:
      (WebCore::CSSImportRule::insertedIntoParent):
      * css/CSSStyleSheet.cpp:
      (WebCore::CSSStyleSheet::CSSStyleSheet):
      * css/CSSStyleSheet.h:
      (WebCore::CSSStyleSheet::setIsUserStyleSheet):
      (WebCore::CSSStyleSheet::isUserStyleSheet):
      * dom/Document.cpp:
      (WebCore::Document::pageUserSheet):
      (WebCore::Document::pageGroupUserSheets):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1cfc800e
    • darin@apple.com's avatar
      Null-deref when first access to an Attr node is after its Element is destroyed · b3314e50
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=29748
      
      Patch by Darin Adler <darin@apple.com> on 2009-09-25
      Reviewed by Geoffrey Garen.
      
      WebCore: 
      
      Test: fast/dom/Attr/access-after-element-destruction.html
      
      * bindings/js/JSAttrCustom.cpp:
      (WebCore::JSAttr::markChildren): Added. Keeps the ownerElement alive as
      long as the Attr is alive.
      
      * bindings/js/JSNamedNodeMapCustom.cpp:
      (WebCore::JSNamedNodeMap::markChildren): Added. Keeps the Element alive as
      long as the NamedNodeMap is alive.
      
      * dom/Attr.idl: Added CustomMarkFunction attribute.
      
      * dom/NamedAttrMap.cpp:
      (WebCore::NamedNodeMap::getAttributeItem): Tweaked formatting.
      (WebCore::NamedNodeMap::detachFromElement): Call clearAttributes so we don't
      have attributes hanging around that might need an Attr node created; that way
      we won't crash with a null-dereference trying to deal with one of them. This
      can't happen when working with JavaScript since the Element will be kept
      alive due to the change above.
      (WebCore::NamedNodeMap::addAttribute): Fix function name in comment.
      (WebCore::NamedNodeMap::removeAttribute): Removed unneeded "+ 1" and added
      missing braces.
      
      * dom/NamedAttrMap.h: Made the element function public so it can be used by
      the JavaScript binding to keep the Element alive.
      
      * dom/NamedNodeMap.idl: Added CustomMarkFunction attribute.
      
      LayoutTests: 
      
      * fast/dom/Attr/access-after-element-destruction-expected.txt: Added.
      * fast/dom/Attr/access-after-element-destruction.html: Added.
      * fast/dom/Attr/script-tests/TEMPLATE.html: Copied from LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html.
      * fast/dom/Attr/script-tests/access-after-element-destruction.js: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b3314e50
    • ap@apple.com's avatar
      Reviewed by Darin Adler and Sam Weinig. · ed84b35a
      ap@apple.com authored
              Onclick not fired for an element copied with cloneContents() or cloneNode()
              https://bugs.webkit.org/show_bug.cgi?id=25130
      
              The change here is that JS event listeners don't keep a reference to a global object from
              where they were created, and instead take it as a parameter when parsing source code. Also,
              the listener creation won't fail just because it happens for an element in a frameless
              document.
              Thus, moving nodes between documents no longer results in having incorrect registered
              lazy event listeners on them.
      
              Tests: fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html
                     fast/events/attribute-listener-cloned-from-frameless-doc-context.html
                     fast/events/attribute-listener-cloned-from-frameless-doc.xhtml
                     fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html
                     fast/events/attribute-listener-extracted-from-frameless-doc-context.html
      
              * bindings/js/JSEventListener.cpp:
              (WebCore::JSEventListener::JSEventListener): Don't take a reference to JSDOMGlobalObject.
              (WebCore::JSEventListener::jsFunction): Take ScriptExecutionContext as a parameter for
              getting to JSDOMGlobalObject. It's not used in base class, but is in JSLazyEventListner.
              (WebCore::JSEventListener::markJSFunction): Don't mark the global object.
              (WebCore::JSEventListener::handleEvent): Get global object from ScriptExecutionContext.
              (WebCore::JSEventListener::reportError): Ditto.
      
              * bindings/js/JSEventListener.h: (WebCore::JSEventListener::create): Don't keep a reference
              to JSDOMGlobalObject.
      
              * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::parseCode): Listener
              creation was split between this function and ScriptEventListener; moved it here, as JS
              global object can be different now.
      
              * bindings/js/JSLazyEventListener.h: (WebCore::JSLazyEventListener::create): Keep source URL,
              which can not be determined at parsing time.
      
              * bindings/js/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): Moved code
              for listener creation to JSLazyEventListener. XSSAuditor code remains here, because tests
              expect that errors are logged at document parsing time, and because I don't know what other
              side effects moving it vould have.
      
              * dom/EventListener.h: handleEvent() and reportError() now take ScriptExecutionContext,
              because JSC needs a global context here.
      
              * bindings/js/JSAbstractWorkerCustom.cpp:
              (WebCore::JSAbstractWorker::addEventListener):
              (WebCore::JSAbstractWorker::removeEventListener):
              * bindings/js/JSDOMApplicationCacheCustom.cpp:
              (WebCore::JSDOMApplicationCache::addEventListener):
              (WebCore::JSDOMApplicationCache::removeEventListener):
              * bindings/js/JSDOMGlobalObject.cpp:
              (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::addEventListener):
              (WebCore::JSDOMWindow::removeEventListener):
              * bindings/js/JSEventSourceCustom.cpp:
              (WebCore::JSEventSource::addEventListener):
              (WebCore::JSEventSource::removeEventListener):
              * bindings/js/JSMessagePortCustom.cpp:
              (WebCore::JSMessagePort::addEventListener):
              (WebCore::JSMessagePort::removeEventListener):
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::JSNode::addEventListener):
              (WebCore::JSNode::removeEventListener):
              * bindings/js/JSSVGElementInstanceCustom.cpp:
              (WebCore::JSSVGElementInstance::addEventListener):
              (WebCore::JSSVGElementInstance::removeEventListener):
              * bindings/js/JSWorkerContextCustom.cpp:
              (WebCore::JSWorkerContext::addEventListener):
              (WebCore::JSWorkerContext::removeEventListener):
              * bindings/js/JSXMLHttpRequestCustom.cpp:
              (WebCore::JSXMLHttpRequest::addEventListener):
              (WebCore::JSXMLHttpRequest::removeEventListener):
              * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
              (WebCore::JSXMLHttpRequestUpload::addEventListener):
              (WebCore::JSXMLHttpRequestUpload::removeEventListener):
              * bindings/objc/ObjCEventListener.h:
              * bindings/objc/ObjCEventListener.mm:
              (WebCore::ObjCEventListener::handleEvent):
              * bindings/scripts/CodeGeneratorJS.pm:
              * dom/EventTarget.cpp:
              (WebCore::EventTarget::fireEventListeners):
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::handleEvent):
              * inspector/InspectorDOMAgent.h:
              * inspector/InspectorDOMStorageResource.cpp:
              (WebCore::InspectorDOMStorageResource::handleEvent):
              * inspector/InspectorDOMStorageResource.h:
              * loader/ImageDocument.cpp:
              (WebCore::ImageEventListener::handleEvent):
              * svg/animation/SVGSMILElement.cpp:
              (WebCore::ConditionEventListener::handleEvent):
              * workers/WorkerContext.cpp:
              (WebCore::WorkerContext::reportException):
              Don't pass global object to JSEventListener::create(), which no longer needs it.
              Note that some of these functions still have an early return for null global object, which
              can probably be removed in a later patch.
              Pass ScriptExecutionContext to EventListener methods that now need it.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ed84b35a
    • eric@webkit.org's avatar
      2009-09-25 Yuan Song <song.yuan@ericsson.com> · e13621e6
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=14566
      
              Add test "invalid-domain-change-throws-exception.html" to ensure a SECURITY_ERR exception is raised if an attempt is made to change document.domain to an invalid value. In the existing test case "basic-textareas.html", fix the faulty behavior of setting document.domain to invalid value, and replace the data URL to a file URL that points to "basic-textareas-standards.html" in order to make "basic-textareas.html" runnable in a browser.
      
              * fast/forms/basic-textareas.html:
              * fast/forms/resources/basic-textareas-standards.html: Added.
              * fast/js/invalid-domain-change-throws-exception-expected.txt: Added.
              * fast/js/invalid-domain-change-throws-exception.html: Added.
              * fast/js/resources/invalid-domain-change-throws-exception.js: Added.
      2009-09-25  Yuan Song  <song.yuan@ericsson.com>
      
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=14566
      
              Raise SECURITY_ERR exception if an attempt is made to change document.domain to an invalid value.
      
              Test: fast/js/invalid-domain-change-throws-exception.html
      
              * dom/Document.cpp:
              (WebCore::Document::setDomain):
              * dom/Document.h:
              * dom/Document.idl:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e13621e6
  8. 24 Sep, 2009 4 commits
    • weinig@apple.com's avatar
      Fix windows build. · 126d1251
      weinig@apple.com authored
      * dom/Element.idl:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      126d1251
    • weinig@apple.com's avatar
      WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=29703 · ee5bc0a2
      weinig@apple.com authored
      Add a function to element to check whether it matches a CSS selector
      
      Reviewed by Dan Bernstein.
      
      Implement Element.webkitMatchesSelector.
      
      * css/CSSSelectorList.cpp:
      (WebCore::forEachTagSelector):
      (WebCore::forEachSelector):
      (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
      (WebCore::CSSSelectorList::selectorsNeedNamespaceResolution):
      * css/CSSSelectorList.h:
      Moved code to iterate the CSSSelectorList and determine if any
      selectors need namespace resolution from a static function in
      Node.cpp to CSSSelectorList so that it can be used by webkitMatchesSelector
      as well as querySelector/querySelectorAll.
      
      * dom/Element.cpp:
      (WebCore::Element::webkitMatchesSelector):
      * dom/Element.h: 
      * dom/Element.idl:
      Implement the new function. Handles exceptional cases identically to
      querySelector/querySelectorAll.
      
      * dom/Node.cpp:
      (WebCore::Node::querySelector):
      (WebCore::Node::querySelectorAll):
      Moved selectorsNeedNamespaceResolution to CSSSelectorList from here.
      
      LayoutTests: Update tests for https://bugs.webkit.org/show_bug.cgi?id=29703
      Add a function to element to check whether it matches a CSS selector
      
      Reviewed by Dan Bernstein.
      
      Add webkitMatchesSelector to SelectorAPI tests.
      
      * fast/dom/SelectorAPI/caseID-almost-strict-expected.txt:
      * fast/dom/SelectorAPI/caseID-almost-strict.html:
      * fast/dom/SelectorAPI/caseID-expected.txt:
      * fast/dom/SelectorAPI/caseID-strict-expected.txt:
      * fast/dom/SelectorAPI/caseID-strict.html:
      * fast/dom/SelectorAPI/caseID.html:
      * fast/dom/SelectorAPI/caseTag-expected.txt:
      * fast/dom/SelectorAPI/caseTag.html:
      * fast/dom/SelectorAPI/caseTagX-expected.txt:
      * fast/dom/SelectorAPI/caseTagX.xhtml:
      * fast/dom/SelectorAPI/detached-element-expected.txt:
      * fast/dom/SelectorAPI/not-supported-namespace-in-selector-expected.txt:
      * fast/dom/SelectorAPI/not-supported-namespace-in-selector.html:
      * fast/dom/SelectorAPI/script-tests/detached-element.js:
      * fast/dom/SelectorAPI/script-tests/undefined-null-stringify.js:
      * fast/dom/SelectorAPI/script-tests/viewless-document.js:
      * fast/dom/SelectorAPI/undefined-null-stringify-expected.txt:
      * fast/dom/SelectorAPI/viewless-document-expected.txt:
      * fast/dom/Window/window-properties-expected.txt:
      * fast/dom/domListEnumeration-expected.txt:
      * fast/dom/script-tests/domListEnumeration.js:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ee5bc0a2
    • pfeldman@chromium.org's avatar
      2009-09-24 Vitaly Repeshko <vitalyr@chromium.org> · e57df819
      pfeldman@chromium.org authored
              Reviewed by Dimitri Glazkov.
      
              [V8] Fixed bindings build after http://trac.webkit.org/changeset/48701
              https://bugs.webkit.org/show_bug.cgi?id=29713
      
              Got rid of isWindowEvent in function signatures:
              * bindings/v8/V8AbstractEventListener.cpp:
              (WebCore::V8AbstractEventListener::invokeEventHandler):
              (WebCore::V8AbstractEventListener::handleEvent):
              (WebCore::V8AbstractEventListener::getReceiverObject):
              * bindings/v8/V8AbstractEventListener.h:
              * bindings/v8/V8LazyEventListener.cpp:
              (WebCore::V8LazyEventListener::callListenerFunction):
              * bindings/v8/V8LazyEventListener.h:
              * bindings/v8/V8WorkerContextEventListener.cpp:
              (WebCore::V8WorkerContextEventListener::handleEvent):
              (WebCore::V8WorkerContextEventListener::callListenerFunction):
              (WebCore::V8WorkerContextEventListener::getReceiverObject):
              * bindings/v8/V8WorkerContextEventListener.h:
              * bindings/v8/custom/V8CustomEventListener.cpp:
              (WebCore::V8EventListener::callListenerFunction):
              * bindings/v8/custom/V8CustomEventListener.h:
      
              Switched to EventTarget methods of adding/removing listeners:
              * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp:
              (WebCore::toEventID):
              (WebCore::ACCESSOR_SETTER):
      
              * dom/EventTarget.h: Some functions were incorrectly marked
              as JSC-specific.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e57df819
    • ggaren@apple.com's avatar
      Windows build fix: Declare set/unsetPendingActivity public, so · 78c1c642
      ggaren@apple.com authored
      SharedWorkerScriptLoader can call them.
      
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-24
      * dom/ActiveDOMObject.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      78c1c642
  9. 23 Sep, 2009 3 commits
    • 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
    • eric@webkit.org's avatar
      2009-09-23 Kent Tamura <tkent@chromium.org> · fa588e67
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              Tests for maxLength of <textarea>
              https://bugs.webkit.org/show_bug.cgi?id=29292
      
              * fast/forms/script-tests/textarea-maxlength.js: Added.
              * fast/forms/textarea-maxlength-expected.txt: Added.
              * fast/forms/textarea-maxlength.html: Added.
      2009-09-23  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              - Support for maxLength of <textarea>
              - Move numGraphemeClusters() and numCharactersInGraphemeClusters() from InputElement to String.
              https://bugs.webkit.org/show_bug.cgi?id=29292
      
              Test: fast/forms/textarea-maxlength.html
      
              * dom/InputElement.cpp:
              (WebCore::InputElement::sanitizeUserInputValue):
              (WebCore::InputElement::handleBeforeTextInsertedEvent):
              * html/HTMLTextAreaElement.cpp:
              (WebCore::HTMLTextAreaElement::defaultEventHandler):
              (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
              (WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
              (WebCore::HTMLTextAreaElement::maxLength):
              (WebCore::HTMLTextAreaElement::setMaxLength):
              * html/HTMLTextAreaElement.h:
              * html/HTMLTextAreaElement.idl:
              * platform/text/PlatformString.h:
              * platform/text/String.cpp:
              (WebCore::String::numGraphemeClusters):
              (WebCore::String::numCharactersInGraphemeClusters):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fa588e67
    • darin@apple.com's avatar
      Crash when website does a history.back() followed by an alert() · f53381bf
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=29686
      rdar://problem/6984996
      
      Patch by Darin Adler <darin@apple.com> on 2009-09-23
      Reviewed by Sam Weinig.
      
      When loading is deferred, we need to defer timer-based loads
      too, not just networking-driven loads. Otherwise we can get
      syncronouse navigation while running a script, which leads to
      crashes and other badness.
      
      This patch includes a manual test; an automated test may be
      possible some time in the future.
      
      * dom/Document.cpp:
      (WebCore::Document::processHttpEquiv): Use scheduleLocationChange
      instead of scheduleHTTPRedirection to implement the navigation
      needed for x-frame-options.
      
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::FrameLoader): Updated for data members with
      new names and new data members.
      (WebCore::FrameLoader::setDefersLoading): When turning deferral
      off, call startRedirectionTimer and startCheckCompleteTimer, since
      either of them might have been fired and ignored while defersLoading
      was true.
      (WebCore::FrameLoader::clear): Updated for replacement of the
      m_checkCompletedTimer and m_checkLoadCompleteTimer timers.
      (WebCore::FrameLoader::allAncestorsAreComplete): Added.
      (WebCore::FrameLoader::checkCompleted): Added code to set
      m_shouldCallCheckCompleted to false. Changed code that calls
      startRedirectionTimer to call it unconditionally, since that
      function now knows when to do work and doesn't expect callers
      to handle that any more.
      (WebCore::FrameLoader::checkTimerFired): Added. Replaces the old
      timer fired callbacks. Calls checkCompleted and checkLoadComplete
      as appropriate, but not when defersLoading is true.
      (WebCore::FrameLoader::startCheckCompleteTimer): Added. Replaces
      the two different calls to start timers before. Only starts the
      timers if they are needed.
      (WebCore::FrameLoader::scheduleCheckCompleted): Changed to call
      startCheckCompleteTimer after setting boolean.
      (WebCore::FrameLoader::scheduleCheckLoadComplete): Ditto.
      (WebCore::FrameLoader::scheduleHistoryNavigation): Removed
      canGoBackOrForward check. The logic works more naturally when
      we don't do anything until the timer fires.
      (WebCore::FrameLoader::redirectionTimerFired): Do nothing if
      defersLoading is true. Also moved canGoBackOrForward check here.
      (WebCore::FrameLoader::scheduleRedirection): Changed code that
      calls startRedirectionTimer to do so unconditionally. That
      function now handles the rules about when to start the timer
      rather than expecting the caller to do so.
      (WebCore::FrameLoader::startRedirectionTimer): Added code to
      handle the case where there is no redirection scheduled,
      where the timer is already active, or where this is a classic
      redirection and there is an ancestor that has not yet completed
      loading.
      (WebCore::FrameLoader::completed): Call startRedirectionTimer
      here directly instead of calling a cover named parentCompleted.
      Hooray! One less function in the giant FrameLoader class!
      (WebCore::FrameLoader::checkLoadComplete): Added code to set
      m_shouldCallCheckLoadComplete to false.
      
      * loader/FrameLoader.h: Replaced the two functions
      checkCompletedTimerFired and checkLoadCompleteTimerFired with
      one function, checkTimerFired. Removed the parentCompleted
      function. Added the startCheckCompleteTimer and
      allAncestorsAreComplete functions. Replaced the
      m_checkCompletedTimer and m_checkLoadCompleteTimer data
      members with m_checkTimer, m_shouldCallCheckCompleted, and
      m_shouldCallCheckLoadComplete.
      
      * manual-tests/go-back-after-alert.html: Added.
      * manual-tests/resources/alert-and-go-back.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f53381bf
  10. 22 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-09-22 Yury Semikhatsky <yurys@chromium.org> · 28fe0111
      eric@webkit.org authored
              Reviewed by Timothy Hatcher.
      
              WebInspector: Migrate Databases tab to InjectedScript /
              serialized interaction.
      
              DOMStorage interaction is now serialized into JSON messages
              and doesn't require quarantined objects.
      
              https://bugs.webkit.org/show_bug.cgi?id=28873
      
              * dom/EventListener.h:
              (WebCore::EventListener::):
              * inspector/InspectorBackend.cpp:
              (WebCore::InspectorBackend::selectDOMStorage):
              (WebCore::InspectorBackend::getDOMStorageEntries):
              (WebCore::InspectorBackend::setDOMStorageItem):
              (WebCore::InspectorBackend::removeDOMStorageItem):
              * inspector/InspectorBackend.h:
              * inspector/InspectorBackend.idl:
              * inspector/InspectorController.cpp:
              (WebCore::InspectorController::didCommitLoad):
              (WebCore::InspectorController::selectDOMStorage):
              (WebCore::InspectorController::getDOMStorageEntries):
              (WebCore::InspectorController::setDOMStorageItem):
              (WebCore::InspectorController::removeDOMStorageItem):
              (WebCore::InspectorController::getDOMStorageResourceForId):
              * inspector/InspectorController.h:
              * inspector/InspectorDOMStorageResource.cpp:
              (WebCore::InspectorDOMStorageResource::InspectorDOMStorageResource):
              (WebCore::InspectorDOMStorageResource::bind):
              (WebCore::InspectorDOMStorageResource::unbind):
              (WebCore::InspectorDOMStorageResource::startReportingChangesToFrontend):
              (WebCore::InspectorDOMStorageResource::handleEvent):
              (WebCore::InspectorDOMStorageResource::operator==):
              * inspector/InspectorDOMStorageResource.h:
              (WebCore::InspectorDOMStorageResource::cast):
              (WebCore::InspectorDOMStorageResource::id):
              (WebCore::InspectorDOMStorageResource::domStorage):
              * inspector/InspectorFrontend.cpp:
              (WebCore::InspectorFrontend::selectDOMStorage):
              (WebCore::InspectorFrontend::didGetDOMStorageEntries):
              (WebCore::InspectorFrontend::didSetDOMStorageItem):
              (WebCore::InspectorFrontend::didRemoveDOMStorageItem):
              (WebCore::InspectorFrontend::updateDOMStorage):
              * inspector/InspectorFrontend.h:
              * inspector/front-end/DOMStorage.js:
              (WebInspector.DOMStorage):
              (WebInspector.DOMStorage.prototype.get id):
              (WebInspector.DOMStorage.prototype.get domStorage):
              (WebInspector.DOMStorage.prototype.get isLocalStorage):
              (WebInspector.DOMStorage.prototype.getEntriesAsync):
              (WebInspector.DOMStorage.prototype.setItemAsync):
              (WebInspector.DOMStorage.prototype.removeItemAsync):
              * inspector/front-end/DOMStorageDataGrid.js:
              (WebInspector.DOMStorageDataGrid):
              (WebInspector.DOMStorageDataGrid.prototype._startEditingColumnOfDataGridNode):
              (WebInspector.DOMStorageDataGrid.prototype._startEditing):
              (WebInspector.DOMStorageDataGrid.prototype._editingCommitted):
              (WebInspector.DOMStorageDataGrid.prototype._editingCancelled):
              (WebInspector.DOMStorageDataGrid.prototype.deleteSelectedRow):
              * inspector/front-end/DOMStorageItemsView.js:
              (WebInspector.DOMStorageItemsView.prototype.update):
              (WebInspector.DOMStorageItemsView.prototype._showDOMStorageEntries):
              (WebInspector.DOMStorageItemsView.prototype._dataGridForDOMStorageEntries):
              * inspector/front-end/StoragePanel.js:
              (WebInspector.StoragePanel.prototype.show):
              (WebInspector.StoragePanel.prototype.reset):
              (WebInspector.StoragePanel.prototype.selectDOMStorage):
              (WebInspector.StoragePanel.prototype.updateDOMStorage):
              (WebInspector.StoragePanel.prototype._domStorageForId):
              * inspector/front-end/inspector.js:
              (WebInspector.addDOMStorage):
              (WebInspector.updateDOMStorage):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      28fe0111
  11. 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
  12. 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
  13. 16 Sep, 2009 5 commits
    • eric@webkit.org's avatar
      2009-09-15 Kent Tamura <tkent@chromium.org> · e2353175
      eric@webkit.org authored
              Reviewed by Eric Seidel.
      
              <input maxlength=> should restrict only values specified by users.
              https://bugs.webkit.org/show_bug.cgi?id=21271
      
              * fast/forms/input-appearance-maxlength-expected.txt:
              * fast/forms/input-appearance-maxlength.html:
              * fast/forms/input-maxlength-expected.txt:
              * fast/forms/input-maxlength.html:
              * fast/forms/input-text-maxlength-expected.txt: Added.
              * fast/forms/input-text-maxlength.html:
              * fast/forms/input-text-paste-maxlength-expected.txt: Added.
              * fast/forms/input-text-paste-maxlength.html:
              * platform/mac-leopard/fast/forms/input-text-maxlength-expected.checksum: Removed.
              * platform/mac-leopard/fast/forms/input-text-maxlength-expected.png: Removed.
              * platform/mac-leopard/fast/forms/input-text-maxlength-expected.txt: Removed.
              * platform/mac-leopard/fast/forms/input-text-paste-maxlength-expected.checksum: Removed.
              * platform/mac-leopard/fast/forms/input-text-paste-maxlength-expected.png: Removed.
              * platform/mac-leopard/fast/forms/input-text-paste-maxlength-expected.txt: Removed.
              * platform/mac/fast/forms/input-text-maxlength-expected.txt: Removed.
              * platform/mac/fast/forms/input-text-paste-maxlength-expected.txt: Removed.
              * platform/qt/fast/forms/input-text-maxlength-expected.txt: Removed.
              * platform/qt/fast/forms/input-text-paste-maxlength-expected.txt: Removed.
              * platform/win/fast/forms/input-text-maxlength-expected.txt: Removed.
              * platform/win/fast/forms/input-text-paste-maxlength-expected.txt: Removed.
      2009-09-15  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Eric Seidel.
      
              <input maxlength=> should restrict only values specified by users.
              https://bugs.webkit.org/show_bug.cgi?id=21271
      
              * dom/InputElement.cpp:
              (WebCore::InputElement::setValueFromRenderer):
              (WebCore::InputElement::sanitizeValue):
              (WebCore::InputElement::sanitizeUserInputValue): Rename from constrainValue().
              (WebCore::InputElement::handleBeforeTextInsertedEvent):
              (WebCore::InputElement::updateValueIfNeeded):
              * dom/InputElement.h:
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::setInputType):
              (WebCore::HTMLInputElement::value):
              (WebCore::HTMLInputElement::setValue):
              (WebCore::HTMLInputElement::sanitizeValue):
              * html/HTMLInputElement.h:
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::subtreeHasChanged):
              * wml/WMLInputElement.cpp:
              (WebCore::WMLInputElement::constrainValue):
              * wml/WMLInputElement.h:
              (WebCore::WMLInputElement::sanitizeValue):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e2353175
    • ggaren@apple.com's avatar
      WebCore: Removed some vestigial and potentially crashy code that makes consolidating · 2984d4f5
      ggaren@apple.com authored
      event listeners hard.
      
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-16
      Reviewed by Sam Weinig and Anders Carlsson.
      
      * dom/Node.cpp:
      (WebCore::Node::addEventListener): No need to limit when event listeners
      can be added. Other EventTargets don't do this.
              
      Also, check for null when accessing document(). Technically, the JS bindings
      do this check for us, but let's not rely on that.
      
      LayoutTests: Added a test for a potential crash when adding an event listener to a
      doctype node.
      
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-16
      Reviewed by Sam Weinig.
      
      * fast/dom/doctype-event-listener-crash-expected.txt: Added.
      * fast/dom/doctype-event-listener-crash.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2984d4f5
    • bolsinga@apple.com's avatar
      Add ENABLE(INSPECTOR) · d19fa0b4
      bolsinga@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=29260
      
      Reviewed by David Kilzer.
      
      JavaScriptCore:
      
      * wtf/Platform.h:
      
      WebCore:
      
      No new tests. (No change in default behavior.)
      
      * DerivedSources.make: Use new WebCore.Inspector.exp file if ENABLE_DRAG_SUPPORT.
      * WebCore.base.exp: Move Inspector only exports to WebCore.Inspector.exp.
      * WebCore.xcodeproj/project.pbxproj: Add WebCore.Inspector.exp.
      * bindings/js/JSDOMWindowBase.cpp: Use ENABLE(INSPECTOR) where applicable.
      (WebCore::JSDOMWindowBase::supportsProfiling):
      * bindings/js/JSInspectedObjectWrapper.cpp: Wrap entire file in ENABLE(INSPECTOR).
      * bindings/js/JSInspectorBackendCustom.cpp: Ditto.
      * bindings/js/JSInspectorCallbackWrapper.cpp: Ditto.
      * bindings/js/ScriptObject.cpp: Use ENABLE(INSPECTOR) where applicable.
      * bindings/js/ScriptObject.h: Ditto.
      * bindings/js/ScriptObjectQuarantine.cpp: Wrap entire file in ENABLE(INSPECTOR).
      * dom/Document.cpp: Use ENABLE(INSPECTOR) where applicable.
      (WebCore::Document::recalcStyle):
      (WebCore::Document::addMessage):
      (WebCore::Document::resourceRetrievedByXMLHttpRequest):
      (WebCore::Document::scriptImported):
      * dom/Document.h: Ditto.
      * dom/Node.cpp: Ditto.
      (WebCore::Node::dispatchGenericEvent):
      * dom/ScriptExecutionContext.h: Ditto.
      (WebCore::):
      * html/HTMLDocument.cpp: Ditto.
      (WebCore::HTMLDocument::createTokenizer):
      * html/HTMLTokenizer.cpp: Ditto.
      (WebCore::HTMLTokenizer::write):
      * inspector/ConsoleMessage.cpp: Ditto.
      (WebCore::ConsoleMessage::ConsoleMessage):
      (WebCore::ConsoleMessage::isEqual):
      * inspector/ConsoleMessage.h: Ditto.
      * inspector/DOMDispatchTimelineItem.cpp: Wrap entire file in ENABLE(INSPECTOR).
      * inspector/InspectorBackend.cpp: Ditto.
      * inspector/InspectorController.cpp: Ditto.
      * inspector/InspectorDOMAgent.cpp: Ditto.
      * inspector/InspectorDOMStorageResource.cpp: Ditto.
      * inspector/InspectorDatabaseResource.cpp: Ditto.
      * inspector/InspectorFrontend.cpp: Ditto.
      * inspector/InspectorResource.cpp: Ditto.
      * inspector/InspectorTimelineAgent.cpp: Ditto.
      * inspector/TimelineItem.cpp: Ditto.
      * loader/FrameLoader.cpp: Use ENABLE(INSPECTOR) where applicable.
      (WebCore::FrameLoader::detachFromParent):
      (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
      (WebCore::FrameLoader::loadedResourceFromMemoryCache):
      (WebCore::FrameLoader::dispatchWindowObjectAvailable):
      (WebCore::FrameLoader::dispatchDidCommitLoad):
      (WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest):
      (WebCore::FrameLoader::dispatchWillSendRequest):
      (WebCore::FrameLoader::dispatchDidReceiveResponse):
      (WebCore::FrameLoader::dispatchDidReceiveContentLength):
      (WebCore::FrameLoader::dispatchDidFinishLoading):
      * page/Chrome.cpp: Ditto.
      (WebCore::Chrome::mouseDidMoveOverElement):
      * page/Console.cpp: Ditto.
      (WebCore::Console::addMessage):
      (WebCore::Console::count):
      (WebCore::Console::profile):
      (WebCore::Console::profileEnd):
      (WebCore::Console::time):
      (WebCore::Console::timeEnd):
      (WebCore::Console::group):
      (WebCore::Console::groupEnd):
      * page/ContextMenuController.cpp: Ditto.
      (WebCore::ContextMenuController::handleContextMenuEvent):
      (WebCore::ContextMenuController::contextMenuItemSelected):
      * page/DOMWindow.cpp: Ditto.
      (WebCore::DOMWindow::sessionStorage):
      (WebCore::DOMWindow::localStorage):
      * page/EventHandler.cpp: Ditto.
      (WebCore::EventHandler::handleMousePressEvent):
      * page/FrameView.cpp: Ditto.
      (WebCore::FrameView::layout):
      (WebCore::FrameView::paintContents):
      * page/FrameView.h: Ditto.
      * page/Page.cpp: Ditto.
      (WebCore::Page::Page):
      (WebCore::Page::~Page):
      * page/Page.h: Ditto.
      * platform/ContextMenu.cpp: Ditto.
      (WebCore::ContextMenu::checkOrEnableIfNeeded):
      * platform/ContextMenuItem.h: Ditto.
      (WebCore::):
      * storage/Database.cpp: Ditto.
      (WebCore::Database::openDatabase):
      * workers/WorkerContext.cpp: Ditto.
      (WebCore::WorkerContext::importScripts):
      * xml/XMLHttpRequest.cpp: Ditto.
      (WebCore::XMLHttpRequest::didFinishLoading):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d19fa0b4
    • bolsinga@apple.com's avatar
      Add ENABLE(CONTEXT_MENUS) · 08a4e0b1
      bolsinga@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=29225
      
      Reviewed by David Kilzer.
      
      JavaScriptCore:
      
      * wtf/Platform.h:
      
      WebCore:
      
      No new tests. (No change in default behavior.)
      
      * DerivedSources.make: Use new WebCore.ContextMenus.exp file if ENABLE_CONTEXT_MENUS.
      * WebCore.base.exp: Move ContextMenu only exports to WebCore.ContextMenus.exp.
      * WebCore.xcodeproj/project.pbxproj: Add WebCore.ContextMenus.exp.
      * dom/Node.cpp: Use ENABLE(CONTEXT_MENUS) where applicable.
      (WebCore::Node::defaultEventHandler):
      * loader/EmptyClients.h: Ditto.
      * page/ContextMenuController.cpp: Wrap entire file in ENABLE(CONTEXT_MENUS).
      * page/EventHandler.cpp: Use ENABLE(CONTEXT_MENUS) where applicable.
      * page/EventHandler.h: Ditto.
      * page/Page.cpp: Ditto.
      (WebCore::Page::Page):
      * page/Page.h: Ditto.
      * page/mac/EventHandlerMac.mm: Ditto.
      * page/mac/WebCoreViewFactory.h: Ditto.
      * platform/ContextMenu.cpp: Wrap entire file in ENABLE(CONTEXT_MENUS).
      * platform/LocalizedStrings.h: Use ENABLE(CONTEXT_MENUS) where applicable.
      * platform/mac/ContextMenuItemMac.mm: Wrap entire file in ENABLE(CONTEXT_MENUS).
      * platform/mac/ContextMenuMac.mm: Ditto.
      * platform/mac/LocalizedStringsMac.mm: Use ENABLE(CONTEXT_MENUS) where applicable.
      * svg/graphics/SVGImage.cpp: Ditto.
      (WebCore::SVGImage::dataChanged):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      08a4e0b1
    • bolsinga@apple.com's avatar
      Add ENABLE(DRAG_SUPPORT) · 5db11076
      bolsinga@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=29233
      
      Reviewed by David Kilzer.
      
      JavaScriptCore:
      
      * wtf/Platform.h:
      
      WebCore:
      
      No new tests. (No change in default behavior.)
      
      * DerivedSources.make: Use new WebCore.DragSupport.exp file if ENABLE_DRAG_SUPPORT.
      * WebCore.base.exp: Move Drag Support only exports to WebCore.DragSupport.exp.
      * WebCore.xcodeproj/project.pbxproj: Add WebCore.DragSupport.exp.
      * dom/Clipboard.h: Use ENABLE(DRAG_SUPPORT) where applicable.
      * loader/EmptyClients.h: Ditto.
      * page/DragController.cpp: Wrap entire file in ENABLE(DRAG_SUPPORT).
      * page/EventHandler.cpp: Use ENABLE(DRAG_SUPPORT) where applicable.
      (WebCore::EventHandler::EventHandler):
      (WebCore::EventHandler::clear):
      (WebCore::EventHandler::handleMousePressEvent):
      (WebCore::EventHandler::handleMouseReleaseEvent):
      (WebCore::EventHandler::handleMouseMoveEvent):
      * page/EventHandler.h: Ditto.
      * page/Page.cpp: Ditto.
      (WebCore::Page::Page):
      * page/Page.h: Ditto.
      * page/mac/DragControllerMac.mm: Wrap entire file in ENABLE(DRAG_SUPPORT).
      * page/mac/EventHandlerMac.mm: Use ENABLE(DRAG_SUPPORT) where applicable.
      (WebCore::EventHandler::passSubframeEventToSubframe):
      * platform/DragData.cpp: Wrap entire file in ENABLE(DRAG_SUPPORT).
      * platform/DragImage.cpp: Wrap entire file in ENABLE(DRAG_SUPPORT).
      * platform/mac/ClipboardMac.h: Use ENABLE(DRAG_SUPPORT) where applicable.
      * platform/mac/ClipboardMac.mm: Ditto.
      * platform/mac/DragDataMac.mm: Wrap entire file in ENABLE(DRAG_SUPPORT).
      * platform/mac/DragImageMac.mm: Wrap entire file in ENABLE(DRAG_SUPPORT).
      * rendering/RenderLayer.cpp: Use ENABLE(DRAG_SUPPORT) where applicable.
      (WebCore::RenderLayer::autoscroll):
      * rendering/RenderObject.cpp: Ditto.
      * rendering/RenderObject.h: Ditto.
      * svg/graphics/SVGImage.cpp: Ditto.
      (WebCore::SVGImage::dataChanged):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5db11076
  14. 15 Sep, 2009 5 commits
    • ggaren@apple.com's avatar
      Removed the notion of "disconnected nodes with event listeners" because · e0980d3c
      ggaren@apple.com authored
      it was vestigial. The reference cycle it tried to solve was solved another
      way in https://bugs.webkit.org/show_bug.cgi?id=21260.
      
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-15
      Reviewed by Sam Weinig.
      
      * dom/Document.cpp:
      (WebCore::Document::removeAllEventListeners):
      * dom/Document.h:
      * dom/Node.cpp:
      (WebCore::Node::~Node):
      (WebCore::Node::insertedIntoDocument):
      (WebCore::Node::removedFromDocument):
      (WebCore::Node::willMoveToNewOwnerDocument):
      (WebCore::Node::didMoveToNewOwnerDocument):
      (WebCore::Node::addEventListener):
      (WebCore::Node::removeEventListener):
      (WebCore::Node::clearAttributeEventListener):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e0980d3c
    • cfleizach@apple.com's avatar
      WAI-ARIA: add support for ranges, including the progressbar, slider, and spinbutton roles · 8ccd5aae
      cfleizach@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=28841
      
      Reviewed by Beth Dakin.
      
      WebCore: 
      
      Allow certain ARIA roles to change value with AXIncrement and AXDecrement. 
      Consolidate increment/decrement/changeValue methods. 
      
      Test: accessibility/aria-slider-value-change.html
      
      * accessibility/AccessibilityObject.cpp:
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::increment):
      (WebCore::AccessibilityRenderObject::decrement):
      (WebCore::AccessibilityRenderObject::changeValueByPercent):
      (WebCore::AccessibilityRenderObject::setValue):
      (WebCore::AccessibilityRenderObject::canSetFocusAttribute):
      * accessibility/AccessibilityRenderObject.h:
      * accessibility/AccessibilitySlider.cpp:
      * accessibility/AccessibilitySlider.h:
      * dom/Element.cpp:
      (WebCore::Element::updateAfterAttributeChanged):
      
      LayoutTests: 
      
      * accessibility/aria-slider-value-change-expected.txt: Added.
      * accessibility/aria-slider-value-change.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8ccd5aae
    • ggaren@apple.com's avatar
      Removed the jsEventListeners set from JSDOMGlobalObject, to simplify · f493144c
      ggaren@apple.com authored
      creation and destruction of JSDOMGlobalObject and event listeners.
              
      Patch by Geoffrey Garen <ggaren@apple.com> on 2009-09-15
      Reviewed by Sam Weinig.
      
      Added an abstract operator==() to EventListener, to replace the
      jsEventListeners set's role in determining if two event listeners are
      equal from the DOM's perspective.
              
      Added a type field to EventListener, and casting operations, to support
      operator==() and other abstract operations.
      
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/JSAbstractWorkerCustom.cpp:
      (WebCore::JSAbstractWorker::addEventListener):
      (WebCore::JSAbstractWorker::removeEventListener):
      * bindings/js/JSDOMApplicationCacheCustom.cpp:
      (WebCore::JSDOMApplicationCache::addEventListener):
      (WebCore::JSDOMApplicationCache::removeEventListener):
      * bindings/js/JSDOMGlobalObject.cpp:
      * bindings/js/JSDOMGlobalObject.h:
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::JSDOMWindow::addEventListener):
      (WebCore::JSDOMWindow::removeEventListener):
      * bindings/js/JSDesktopNotificationsCustom.cpp:
      (WebCore::JSNotification::addEventListener):
      (WebCore::):
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::JSEventListener):
      (WebCore::JSEventListener::~JSEventListener):
      (WebCore::JSEventListener::markJSFunction):
      (WebCore::JSEventListener::handleEvent):
      (WebCore::JSEventListener::reportError):
      (WebCore::JSEventListener::operator==):
      * bindings/js/JSEventListener.h:
      (WebCore::JSEventListener::cast):
      * bindings/js/JSEventSourceCustom.cpp:
      (WebCore::JSEventSource::addEventListener):
      (WebCore::JSEventSource::removeEventListener):
      * bindings/js/JSMessagePortCustom.cpp:
      (WebCore::JSMessagePort::addEventListener):
      (WebCore::JSMessagePort::removeEventListener):
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::JSNode::addEventListener):
      (WebCore::JSNode::removeEventListener):
      * bindings/js/JSSVGElementInstanceCustom.cpp:
      (WebCore::JSSVGElementInstance::addEventListener):
      (WebCore::JSSVGElementInstance::removeEventListener):
      * bindings/js/JSWorkerContextCustom.cpp:
      (WebCore::JSWorkerContext::addEventListener):
      (WebCore::JSWorkerContext::removeEventListener):
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      (WebCore::JSXMLHttpRequest::addEventListener):
      (WebCore::JSXMLHttpRequest::removeEventListener):
      * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
      (WebCore::JSXMLHttpRequestUpload::addEventListener):
      (WebCore::JSXMLHttpRequestUpload::removeEventListener):
      * bindings/objc/ObjCEventListener.h:
      (WebCore::ObjCEventListener::cast):
      * bindings/objc/ObjCEventListener.mm:
      (WebCore::ObjCEventListener::ObjCEventListener):
      (WebCore::ObjCEventListener::operator==):
      * dom/EventListener.h:
      (WebCore::EventListener::):
      (WebCore::EventListener::type):
      (WebCore::EventListener::EventListener):
      * dom/MessagePort.cpp:
      (WebCore::MessagePort::addEventListener):
      (WebCore::MessagePort::removeEventListener):
      * dom/Node.cpp:
      (WebCore::Node::removeEventListener):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::InspectorDOMAgent):
      (WebCore::InspectorDOMAgent::mainFrameDocument):
      (WebCore::InspectorDOMAgent::operator==):
      * inspector/InspectorDOMAgent.h:
      (WebCore::InspectorDOMAgent::cast):
      * loader/ImageDocument.cpp:
      (WebCore::ImageEventListener::cast):
      (WebCore::ImageEventListener::ImageEventListener):
      (WebCore::ImageEventListener::operator==):
      * loader/appcache/DOMApplicationCache.cpp:
      (WebCore::DOMApplicationCache::addEventListener):
      (WebCore::DOMApplicationCache::removeEventListener):
      * notifications/Notification.cpp:
      (WebCore::Notification::removeEventListener):
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::removeEventListener):
      * page/EventSource.cpp:
      (WebCore::EventSource::addEventListener):
      (WebCore::EventSource::removeEventListener):
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::ConditionEventListener::cast):
      (WebCore::ConditionEventListener::ConditionEventListener):
      (WebCore::ConditionEventListener::operator==):
      (WebCore::ConditionEventListener::handleEvent):
      * workers/AbstractWorker.cpp:
      (WebCore::AbstractWorker::addEventListener):
      (WebCore::AbstractWorker::removeEventListener):
      * workers/WorkerContext.cpp:
      (WebCore::WorkerContext::addEventListener):
      (WebCore::WorkerContext::removeEventListener):
      * xml/XMLHttpRequest.cpp:
      (WebCore::XMLHttpRequest::addEventListener):
      (WebCore::XMLHttpRequest::removeEventListener):
      * xml/XMLHttpRequestUpload.cpp:
      (WebCore::XMLHttpRequestUpload::addEventListener):
      (WebCore::XMLHttpRequestUpload::removeEventListener):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f493144c
    • mrowe@apple.com's avatar
      WebCore: Document.elementFromPoint() and Document.caretRangeFromPoint()... · bc939268
      mrowe@apple.com authored
      WebCore: Document.elementFromPoint() and Document.caretRangeFromPoint() erroneously returning null at points visible only after scrolling.
      https://bugs.webkit.org/show_bug.cgi?id=29245
      
      Patch by Andrew Richards <randrew@gmail.com> on 2009-09-14
      Reviewed by Sam Weinig.
      
      Use visibleContentRect() instead of boundsRect() when checking hit point bounds on viewport.
      
      * dom/Document.cpp:
      (WebCore::Document::elementFromPoint):
      (WebCore::Document::caretRangeFromPoint):
      
      LayoutTests: Document.elementFromPoint() and Document.caretRangeFromPoint() returning null at points visible only after scrolling.
      https://bugs.webkit.org/show_bug.cgi?id=29245
      
      Patch by Andrew Richards <randrew@gmail.com> on 2009-09-14
      Reviewed by Sam Weinig.
      
      Extend tests to include hits in areas that are not in the initial containing block of the page.
      
      * fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport-expected.txt:
      * fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html:
      * fast/dom/elementFromPoint-relative-to-viewport-expected.txt:
      * fast/dom/elementFromPoint-relative-to-viewport.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bc939268
    • atwilson@chromium.org's avatar
      MessageEvent should not be cancelable by default · 70fae526
      atwilson@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=27846
      
      Reviewed by Darin Adler.
      
      WebCore:
      
      * dom/MessageEvent.cpp:
      (WebCore::MessageEvent::MessageEvent):
      Changed constructor to set cancelable=false by default, per the HTML5 spec.
      
      LayoutTests:
      
      * fast/events/message-port-expected.txt:
      * fast/events/message-port.html:
      Added test case to check state of MessageEvent.cancelable attribute.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      70fae526
  15. 14 Sep, 2009 2 commits
  16. 12 Sep, 2009 2 commits
    • weinig@apple.com's avatar
      WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=29219 · d2427961
      weinig@apple.com authored
      Document.elementFromPoint() should take page scroll into consideration
      
      Reviewed by Anders Carlsson.
      
      Test: fast/dom/elementFromPoint-relative-to-viewport.html
      
      * dom/Document.cpp:
      (WebCore::Document::elementFromPoint):
      (WebCore::Document::caretRangeFromPoint):
      
      LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=29219
      Document.elementFromPoint() should take page scroll into consideration
      
      Reviewed by Anders Carlsson.
      
      * fast/dom/elementFromPoint-relative-to-viewport-expected.txt: Added.
      * fast/dom/elementFromPoint-relative-to-viewport.html: Added.
      * fast/events/offsetX-offsetY.html: Change to use clientX/Y instead of pageX/Y.
      * fast/forms/slider-transformed.html: Ditto.
      * fast/forms/slider-zoomed.html: Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d2427961
    • weinig@apple.com's avatar
      WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=29217 · 4ff6c71c
      weinig@apple.com authored
      Document.caretRangeFromPoint should take the scroll offset into account before hit testing
      
      Reviewed by Maciej Stachowiak.
      
      In accordance with the CSSOM View Module spec, Document.caretRangeFromPoint should interpret
      the point passed to it as relative to the viewport, not the document.
      
      Test: fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html
      
      * dom/Document.cpp:
      (WebCore::Document::caretRangeFromPoint):
      
      LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=29217
      Document.caretRangeFromPoint should take the scroll offset into account before hit testing
      
      Reviewed by Maciej Stachowiak.
      
      * fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport-expected.txt: Added.
      * fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4ff6c71c