2007-12-12 Alp Toker Reviewed by Maciej. http://bugs.webkit.org/show_bug.cgi?id=16388 [GTK] Widget::setCursor() gets called frequently Cache the current cursor to avoid calling gdk_window_set_cursor() when there's no change in cursor. * platform/gtk/WidgetGtk.cpp: (WebCore::Widget::Widget): (WebCore::Widget::cursor): (WebCore::Widget::setCursor): 2007-12-12 Rodney Dawes Reviewed by Maciej. http://bugs.webkit.org/show_bug.cgi?id=16342 Build Warning and Error fixes in WebCore GTK+ Use C-style casts for casting function pointers to gpointer Use static_cast to cast a float to int to fix a warning * platform/gtk/PlatformScrollBarGtk.cpp: (PlatformScrollbar::PlatformScrollbar): (PlatformScrollbar::~PlatformScrollbar): (PlatformScrollbar::gtkValueChanged): * platform/gtk/ThreadingGtk.cpp: (callFunctionOnMainThread): (callOnMainThread): 2007-12-12 Dan Bernstein Reviewed by Darin Adler. - better fix for a crash when pressing a key that is not associated with a command * editing/EditorCommand.cpp: (WebCore::Editor::command): Return the empty command if the command name is empty. 2007-12-12 Alexey Proskuryakov Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=16410 Implement isKeypadEvent() on Windows Test: platform/win/fast/events/keyLocation-numpad.html * platform/win/KeyEventWin.cpp: (WebCore::isKeypadEvent): Added. (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Also fixed a mistake with autorepeat. 2007-12-12 Oliver Hunt Reviewed by Maciej. window.mouseout events are not sent to window when mouse moves out of window Make PlatformMouseEvent recognise WM_MOUSELEAVE. * platform/win/PlatformMouseEventWin.cpp: (WebCore::messageToEventType): (WebCore::PlatformMouseEvent::PlatformMouseEvent): 2007-12-12 Sam Weinig Fix Mac release build. * WebCore.base.exp: 2007-12-12 Sam Weinig Build fix for Qt, Gtk, and Wx. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): * loader/win/FrameLoaderWin.cpp: (WebCore::FrameLoader::urlSelected): * platform/network/curl/ResourceHandleManager.cpp: (WebCore::parseDataUrl): (WebCore::ResourceHandleManager::startJob): * platform/network/win/CookieJarWin.cpp: (WebCore::setCookies): (WebCore::cookies): * platform/network/win/ResourceHandleWin.cpp: (WebCore::ResourceHandle::start): * platform/qt/PasteboardQt.cpp: (WebCore::Pasteboard::writeURL): 2007-12-11 Dan Bernstein Reviewed by Maciej Stachowiak. - allow non-integer font sizes on Windows for small caps * platform/graphics/win/FontDataWin.cpp: (WebCore::FontData::smallCapsFontData): * platform/graphics/win/FontPlatformData.h: (WebCore::FontPlatformData::size): (WebCore::FontPlatformData::setSize): * platform/graphics/win/FontPlatformDataWin.cpp: (WebCore::FontPlatformData::FontPlatformData): 2007-12-11 Sam Weinig Build fix for Qt, Gtk, and Wx. * platform/gtk/CookieJarGtk.cpp: (WebCore::setCookies): (WebCore::cookies): * platform/qt/ClipboardQt.cpp: (WebCore::ClipboardQt::writeURL): * platform/qt/CookieJarQt.cpp: (WebCore::setCookies): (WebCore::cookies): * platform/wx/PasteboardWx.cpp: (WebCore::Pasteboard::writeURL): 2007-12-11 Sam Weinig Reviewed by Darin Adler. Scrub URL out of the tree in preparation for renaming KURL to URL. - Renames Document::URL() -> Document::url() - Renames DocumentLoader::URL() -> DocumentLoader::url() - Renames KURL::url() to KURL::string() and KURL::deprecatedString() - Remove FrameLoader::URL() - Various variable renames. The change from Document::URL() to Document::url() required changes to the bindings scripts as well, because URL() is the name of a DOM method. The code generation scripts now have code to special case URL() to url(). * WebCore.base.exp: * bindings/js/kjs_events.cpp: (WebCore::JSLazyEventListener::parseCode): * bindings/js/kjs_navigator.cpp: (KJS::Navigator::getValueProperty): * bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::initScript): * bindings/js/kjs_window.cpp: (KJS::Window::put): (KJS::Window::allowsAccessFrom): (KJS::Location::put): (KJS::LocationProtoFuncReplace::callAsFunction): (KJS::LocationProtoFuncReload::callAsFunction): (KJS::LocationProtoFuncAssign::callAsFunction): * bindings/scripts/CodeGenerator.pm: * bindings/scripts/CodeGeneratorCOM.pm: * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/CodeGeneratorObjC.pm: * css/CSSImportRule.cpp: (WebCore::CSSImportRule::insertedIntoParent): * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): (WebCore::CSSParser::parseContent): (WebCore::CSSParser::parseBackgroundImage): (WebCore::CSSParser::parseFontFaceSrc): (WebCore::CSSParser::parseBorderImage): (WebCore::CSSParser::createImportRule): * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::setEncodedURL): * dom/Document.cpp: (WebCore::Document::processHttpEquiv): (WebCore::Document::cookie): (WebCore::Document::setCookie): (WebCore::Document::domain): (WebCore::Document::setDomain): (WebCore::Document::getImageMap): (WebCore::Document::completeURL): * dom/Document.h: (WebCore::Document::url): (WebCore::Document::baseURL): * dom/Element.cpp: (WebCore::Element::baseURI): * dom/ProcessingInstruction.h: * dom/StyledElement.cpp: (WebCore::StyledElement::addCSSImageProperty): * dom/StyledElement.h: * dom/XMLTokenizer.cpp: (WebCore::XMLTokenizer::endElementNs): (WebCore::XMLTokenizer::end): (WebCore::): * dom/XMLTokenizer.h: * editing/Editor.cpp: (WebCore::Editor::copy): * editing/markup.cpp: (WebCore::completeURLs): * history/CachedPage.h: (WebCore::CachedPage::url): * history/HistoryItem.cpp: (WebCore::HistoryItem::HistoryItem): (WebCore::HistoryItem::setURL): (WebCore::HistoryItem::isCurrentDocument): * html/HTMLBaseElement.cpp: (WebCore::HTMLBaseElement::process): * html/HTMLParser.cpp: (WebCore::HTMLParser::reportErrorToConsole): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::childrenChanged): (WebCore::HTMLScriptElement::insertedIntoDocument): (WebCore::HTMLScriptElement::evaluateScript): * html/HTMLScriptElement.h: * html/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::scriptExecution): * loader/Cache.cpp: (WebCore::createResource): (WebCore::Cache::requestResource): * loader/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::checkNotify): * loader/CachedResource.cpp: (WebCore::CachedResource::CachedResource): * loader/CachedResource.h: (WebCore::CachedResource::): * loader/CachedScript.h: * loader/DocLoader.cpp: (WebCore::DocLoader::checkForReload): (WebCore::DocLoader::requestResource): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::url): (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll): (WebCore::DocumentLoader::setRequest): (WebCore::DocumentLoader::startLoadingMainResource): * loader/DocumentLoader.h: * loader/FrameLoader.cpp: (WebCore::FormSubmission::FormSubmission): (WebCore::ScheduledRedirection::ScheduledRedirection): (WebCore::FrameLoader::changeLocation): (WebCore::FrameLoader::urlSelected): (WebCore::FrameLoader::requestFrame): (WebCore::FrameLoader::loadSubframe): (WebCore::FrameLoader::submitFormAgain): (WebCore::FrameLoader::submitForm): (WebCore::FrameLoader::didExplicitOpen): (WebCore::FrameLoader::replaceContentsWithScriptResult): (WebCore::FrameLoader::executeScript): (WebCore::FrameLoader::receivedFirstData): (WebCore::FrameLoader::begin): (WebCore::FrameLoader::startIconLoader): (WebCore::FrameLoader::commitIconURLToIconDatabase): (WebCore::FrameLoader::scheduleRefresh): (WebCore::FrameLoader::redirectionTimerFired): (WebCore::FrameLoader::loadPlugin): (WebCore::FrameLoader::didNotOpenURL): (WebCore::FrameLoader::updatePolicyBaseURL): (WebCore::FrameLoader::scrollToAnchor): (WebCore::FrameLoader::startRedirectionTimer): (WebCore::FrameLoader::load): (WebCore::FrameLoader::canLoad): (WebCore::FrameLoader::shouldHideReferrer): (WebCore::FrameLoader::shouldAllowNavigation): (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::clientRedirected): (WebCore::FrameLoader::open): (WebCore::FrameLoader::didTellBridgeAboutLoad): (WebCore::FrameLoader::haveToldBridgeAboutLoad): (WebCore::FrameLoader::post): (WebCore::FrameLoader::loadResourceSynchronously): (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy): (WebCore::FrameLoader::shouldTreatURLAsSameAsCurrent): (WebCore::FrameLoader::createHistoryItem): (WebCore::FrameLoader::addBackForwardItemClippedAtTarget): (WebCore::FrameLoader::loadItem): (WebCore::FrameLoader::urlsMatchItem): (WebCore::FrameLoader::recursiveGoToItem): (WebCore::FrameLoader::updateHistoryForStandardLoad): (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory): * loader/FrameLoader.h: (WebCore::FrameLoader::url): * loader/ImageDocument.cpp: (WebCore::ImageDocument::createDocumentStructure): * loader/MainResourceLoader.cpp: (WebCore::shouldLoadAsEmptyDocument): (WebCore::MainResourceLoader::didFinishLoading): * loader/NavigationAction.cpp: (WebCore::NavigationAction::NavigationAction): * loader/NavigationAction.h: (WebCore::NavigationAction::url): * loader/PluginDocument.cpp: (WebCore::PluginTokenizer::createDocumentStructure): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::load): (WebCore::SubresourceLoader::create): * loader/icon/IconLoader.cpp: (WebCore::IconLoader::startLoading): (WebCore::IconLoader::finishLoading): * loader/loader.cpp: (WebCore::Loader::servePendingRequests): * loader/mac/LoaderNSURLExtras.m: (urlOriginalData): * page/Chrome.cpp: (WebCore::Chrome::setToolTip): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/Frame.cpp: (WebCore::Frame::setUserStyleSheetLocation): * page/InspectorController.cpp: (WebCore::InspectorResource::type): (WebCore::addSourceToFrame): (WebCore::InspectorController::addScriptResource): (WebCore::InspectorController::updateScriptResourceRequest): (WebCore::InspectorController::didCommitLoad): * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge getData:andResponse:forURL:]): * platform/KURL.h: (WebCore::KURL::string): (WebCore::KURL::deprecatedString): * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::getData): * platform/mac/CookieJar.mm: (WebCore::cookies): (WebCore::setCookies): * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::writeURL): (WebCore::fileWrapperForImage): (WebCore::Pasteboard::writeImage): (WebCore::Pasteboard::plainText): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::isNull): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::willSendRequest): (WebCore::didReceiveResponse): (WebCore::didReceiveData): (WebCore::didFinishLoading): (WebCore::didFail): (WebCore::didReceiveChallenge): (WebCore::ResourceHandleInternal::~ResourceHandleInternal): (WebCore::ResourceHandle::~ResourceHandle): (WebCore::ResourceHandle::start): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::createGlobalData): (WebCore::urlToMarkup): * platform/win/ClipboardWin.cpp: (WebCore::writeURL): (WebCore::writeImageToDataObject): (WebCore::ClipboardWin::writeURL): (WebCore::ClipboardWin::writeRange): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeSelection): (WebCore::Pasteboard::writeURL): * plugins/win/PluginDatabaseWin.cpp: (WebCore::PluginDatabaseWin::findPlugin): * plugins/win/PluginStreamWin.cpp: (WebCore::PluginStreamWin::startStream): (WebCore::PluginStreamWin::destroyStream): * plugins/win/PluginViewWin.cpp: (WebCore::scriptStringIfJavaScriptURL): (WebCore::PluginViewWin::performRequest): * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::updateFromElement): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::getResponseXML): (WebCore::XMLHttpRequest::urlMatchesDocumentDomain): * xml/XSLImportRule.cpp: (WebCore::XSLImportRule::loadSheet): * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::createDocumentFromSource): (WebCore::xsltStylesheetPointer): (WebCore::xmlDocPtrFromNode): 2007-12-11 Beth Dakin Reviewed by Darin. Fix for SVGs with width and height 100% fail to render when used as background images CachedImage now has a setImageContainerSize function. It is only needed for SVG right now. * loader/CachedImage.cpp: (WebCore::CachedImage::setImageContainerSize): * loader/CachedImage.h: Relatively sized SVGs have no intrinsic size. Because this call is low-level enough that we cannot pass in the container size and get the real size of the SVG, we need to know if it has relative dimensions, and if so, we need to get the size from scaledTileSize. * platform/graphics/Image.cpp: (WebCore::Image::drawTiled): * platform/graphics/Image.h: (WebCore::Image::setContainerSize): (WebCore::Image::hasRelativeWidth): (WebCore::Image::hasRelativeHeight): Re-factored calculateBackgroundSize a bit so that it returns an IntSize. Made it a member function so that it can send m_width and m_height along to setImageContainerSize. * rendering/RenderBox.cpp: (WebCore::RenderBox::calculateBackgroundSize): (WebCore::RenderBox::calculateBackgroundImageGeometry): * rendering/RenderBox.h: Need to account for relatively sized SVGs in calcViewport() * rendering/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::calcViewport): Added new member variables to store the size of the SVG container. relativeWidthValue() and relativeHeightValue() use the stored SVG container size to correctly calculate the width and height of a relatively sized SVG. * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::SVGSVGElement): (WebCore::SVGSVGElement::setContainerSize): (WebCore::SVGSVGElement::relativeWidthValue): (WebCore::SVGSVGElement::relativeHeightValue): * svg/SVGSVGElement.h: (WebCore::SVGSVGElement::containerSize): Re-factored size calculations to use the size of the container. * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::setContainerSize): (WebCore::SVGImage::size): (WebCore::SVGImage::hasRelativeWidth): (WebCore::SVGImage::hasRelativeHeight): * svg/graphics/SVGImage.h: 2007-12-11 Darin Adler * editing/Editor.cpp: (WebCore::Editor::yankFromKillRing): Try to fix non-Mac builds by adding a missing return statement. 2007-12-11 Darin Adler Reviewed by Geoff. - exposed many new commands to the DOM Document executeCommand function by merging the JSEditor and Editor executeCommand implementations - replaced the execCommand function with a EditorCommand class - replaced the WTF::StrHash<> class template with the WebCore::StringHash class - replaced the WTF::CaseInsensitiveHash<> class template with the WebCore::CaseFoldingHash class * WebCore.base.exp: Updated. * WebCore.pro: Added EditorCommand.cpp, removed JSEditor.cpp. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * WebCoreSources.bkl: Ditto. * dom/Document.cpp: (WebCore::Document::Document): Removed code to set up m_jsEditor. (WebCore::Document::~Document): Removed code to delete m_jsEditor. (WebCore::command): Added. Helper function that gets an Editor::Command. (WebCore::Document::executeCommand): Changed to use Editor::Command instead of JSEditor. (WebCore::Document::queryCommandEnabled): Ditto. (WebCore::Document::queryCommandIndeterm): (WebCore::Document::queryCommandState): Ditto. (WebCore::Document::queryCommandSupported): Ditto. (WebCore::Document::queryCommandValue): Ditto. * dom/Document.h: Removed JSEditor, jsEditor, m_jsEditor. Changed to use CaseFoldingHash. * editing/Editor.cpp: (WebCore::Editor::selectionForCommand): Renamed from selectionForEvent and made into a member function so it is accessible from the new EditorCommand.cpp file. Also changed to get the selection from the passed-in frame instead of from the page, because this should work on the targeted frame unless the event overrides it. (WebCore::Editor::handleKeypress): Updated for selectionForCommand change. (WebCore::Editor::handleInputMethodKeypress): Ditto. (WebCore::imageElementFromImageDocument): Renamed and changed to return a HTMLImageElement instead of a Node*. (WebCore::Editor::canCopy): Updated for name change. (WebCore::Editor::selectionUnorderedListState): Updated for TriState change. (WebCore::Editor::selectionOrderedListState): Ditto. (WebCore::Editor::selectionStartHasStyle): Make type of local more specific. (WebCore::updateState): Moved here from Frame. (WebCore::Editor::selectionHasStyle): Ditto. (WebCore::Editor::Editor): Initialize m_shouldStartNewKillRingSequence. (WebCore::Editor::insertTextWithoutSendingTextEvent): Updated for selectionForCommand change. (WebCore::Editor::copy): Updated for imageElementFromImageDocument change. (WebCore::Editor::toggleBold): Call the ToggleBold command via the command machinery since it's no longer in this file as a local function. (WebCore::Editor::toggleUnderline): Call the ToggleUnderline command. (WebCore::Editor::setBaseWritingDirection): Change type of argument and of local variable. (WebCore::Editor::addToKillRing): Moved here from EditorMac. Not useful without a kill ring, but it's relatively straightforward to implement one. (WebCore::Editor::appendToKillRing): Put default implementation here for platforms other than Mac. We should probably put a simple kill ring implementation here -- doesn't need to be shared with the OS oh platforms other than Mac. (WebCore::Editor::prependToKillRing): Ditto. (WebCore::Editor::yankFromKillRing): Ditto. (WebCore::Editor::startNewKillRingSequence): Ditto. (WebCore::Editor::setKillRingToYankedState): Ditto. * editing/Editor.h: Moved the TriState enum here instead of inside the Frame class. Added EditorCommandSource enum. Moved selectionHasStyle here from the Frame class. Added Editor::Command class with five functions for the various things you can do with a command (execute it, check if it can be used, and its state and value). Changed hte parameter of setBaseWritingDirection to be a const String& rather than a String. Got rid of the kill-ring-related operations, but added the kill ring functions themselves. Made selectedRange() public. Made the m_startNewKillRingSequence not Mac-specific and added "should" to its name. * editing/EditorCommand.cpp: Copied from WebCore/editing/Editor.cpp. Retained only the editing commands. (WebCore::targetFrame): Moved to the top of the file. (WebCore::executeApplyStyle): Added. Helper function for commands that need to apply styles. (WebCore::executeToggleStyle): Added. Helper function for commands that need to toggle styles based on the style of the start of selection. (WebCore::executeApplyParagraphStyle): Added. Like executeApplyStyle, but for paragraph styles. (WebCore::executeInsertFragment): Added. Helper function for commands that need to insert a DOM fragment. (WebCore::executeInsertNode): Added. Helper function for commands that need to insert a tree rooted in a single DOM node. (WebCore::stateStyle): Added. Helper function for the state of commands that represent style. (WebCore::valueStyle): Added. Helper function for the value of commands that represent style. (WebCore::canScroll): Added. Helper functions for some move and scroll commands that need to determine if the renderer they are in can scroll. (WebCore::unionDOMRanges): Moved here from EditorMac. (WebCore::executeBackColor): (WebCore::executeBackwardDelete): (WebCore::executeCopy): (WebCore::executeCreateLink): (WebCore::executeCut): (WebCore::executeDelete): (WebCore::executeDeleteToMark): (WebCore::executeDeleteWordBackward): (WebCore::executeDeleteWordForward): (WebCore::executeFindString): (WebCore::executeFontName): (WebCore::executeFontSize): (WebCore::executeFontSizeDelta): (WebCore::executeForeColor): (WebCore::executeFormatBlock): (WebCore::executeForwardDelete): (WebCore::executeIndent): (WebCore::executeInsertBacktab): (WebCore::executeInsertHorizontalRule): (WebCore::executeInsertHTML): (WebCore::executeInsertImage): (WebCore::executeInsertLineBreak): (WebCore::executeInsertNewline): (WebCore::executeInsertNewlineInQuotedContent): (WebCore::executeInsertOrderedList): (WebCore::executeInsertParagraph): (WebCore::executeInsertTab): (WebCore::executeInsertText): (WebCore::executeInsertUnorderedList): (WebCore::executeJustifyCenter): (WebCore::executeJustifyFull): (WebCore::executeJustifyLeft): (WebCore::executeJustifyRight): (WebCore::executeMoveBackward): (WebCore::executeMoveBackwardAndModifySelection): (WebCore::executeMoveDown): (WebCore::executeMoveDownAndModifySelection): (WebCore::executeMoveDownByPageAndModifyCaret): (WebCore::executeMoveForward): (WebCore::executeMoveForwardAndModifySelection): (WebCore::executeMoveLeft): (WebCore::executeMoveLeftAndModifySelection): (WebCore::executeMoveRight): (WebCore::executeMoveRightAndModifySelection): (WebCore::executeMoveToBeginningOfDocument): (WebCore::executeMoveToBeginningOfDocumentAndModifySelection): (WebCore::executeMoveToBeginningOfLine): (WebCore::executeMoveToBeginningOfLineAndModifySelection): (WebCore::executeMoveToBeginningOfParagraph): (WebCore::executeMoveToBeginningOfParagraphAndModifySelection): (WebCore::executeMoveToBeginningOfSentence): (WebCore::executeMoveToBeginningOfSentenceAndModifySelection): (WebCore::executeMoveToEndOfDocument): (WebCore::executeMoveToEndOfDocumentAndModifySelection): (WebCore::executeMoveToEndOfSentence): (WebCore::executeMoveToEndOfSentenceAndModifySelection): (WebCore::executeMoveToEndOfLine): (WebCore::executeMoveToEndOfLineAndModifySelection): (WebCore::executeMoveToEndOfParagraph): (WebCore::executeMoveToEndOfParagraphAndModifySelection): (WebCore::executeMoveParagraphBackwardAndModifySelection): (WebCore::executeMoveParagraphForwardAndModifySelection): (WebCore::executeMoveUp): (WebCore::executeMoveUpAndModifySelection): (WebCore::executeMoveUpByPageAndModifyCaret): (WebCore::executeMoveWordBackward): (WebCore::executeMoveWordBackwardAndModifySelection): (WebCore::executeMoveWordForward): (WebCore::executeMoveWordForwardAndModifySelection): (WebCore::executeMoveWordLeft): (WebCore::executeMoveWordLeftAndModifySelection): (WebCore::executeMoveWordRight): (WebCore::executeMoveWordRightAndModifySelection): (WebCore::executeOutdent): (WebCore::executePaste): (WebCore::executePasteAndMatchStyle): (WebCore::executePrint): (WebCore::executeRedo): (WebCore::executeRemoveFormat): (WebCore::executeSelectAll): (WebCore::executeSelectToMark): (WebCore::executeSetMark): (WebCore::executeStrikethrough): (WebCore::executeSubscript): (WebCore::executeSuperscript): (WebCore::executeSwapWithMark): (WebCore::executeToggleBold): (WebCore::executeToggleItalic): (WebCore::executeTranspose): (WebCore::executeUnderline): (WebCore::executeUndo): (WebCore::executeUnlink): (WebCore::executeUnscript): (WebCore::executeUnselect): (WebCore::executeYank): (WebCore::executeYankAndSelect): (WebCore::supported): (WebCore::supportedPaste): (WebCore::enabled): (WebCore::enabledAnySelection): (WebCore::enabledAnySelectionAndMark): (WebCore::enableCaretInEditableText): (WebCore::enabledCopy): (WebCore::enabledCut): (WebCore::enabledInEditableText): (WebCore::enabledInRichlyEditableText): (WebCore::enabledPaste): (WebCore::enabledRangeInEditableText): (WebCore::enabledRangeInRichlyEditableText): (WebCore::enabledRedo): (WebCore::enabledUndo): (WebCore::stateNone): (WebCore::stateBold): (WebCore::stateItalic): (WebCore::stateOrderedList): (WebCore::stateStrikethrough): (WebCore::stateSubscript): (WebCore::stateSuperscript): (WebCore::stateUnderline): (WebCore::stateUnorderedList): (WebCore::valueNull): (WebCore::valueBackColor): (WebCore::valueFontName): (WebCore::valueFontSize): (WebCore::valueFontSizeDelta): (WebCore::valueForeColor): (WebCore::createCommandMap): Added lots of commands, including all the commands from JSEditor. A few commands needed different behavior based on whether they are invoked from the DOM or a keyboard binding. (WebCore::Editor::command): Added. Gets a command object given a name. (WebCore::Editor::Command::Command): Added. (WebCore::Editor::Command::execute): Added. (WebCore::Editor::Command::isSupported): Added. (WebCore::Editor::Command::isEnabled): Added. (WebCore::Editor::Command::state): Added. (WebCore::Editor::Command::value): Added. (WebCore::Editor::execCommand): Changed to call command().execute(). * editing/JSEditor.cpp: Removed. * editing/JSEditor.h: Removed. * editing/mac/EditorMac.mm: Changed to provide kill ring primitives intead of kill ring commands, so the kill ring commands can be cross-platform. (WebCore::Editor::appendToKillRing): Added. (WebCore::Editor::prependToKillRing): Added. (WebCore::Editor::yankFromKillRing): Added. (WebCore::Editor::startNewKillRingSequence): Added. (WebCore::Editor::setKillRingToYankedState): Added. * page/Frame.cpp: Removed selectionHasStyle, TriState, and updateState. * page/Frame.h: Ditto. * page/mac/WebCoreFrameBridge.mm: Removed selectionHasStyle. * page/mac/WebCoreFrameBridge.h: Ditto. * platform/ContextMenu.cpp: (WebCore::ContextMenu::checkOrEnableIfNeeded): Updated for TriState change. * platform/text/StringHash.h: (WebCore::StringHash::hash): Merged the StrHash<> template classes into this. (WebCore::StringHash::equal): Ditto. (WebCore::CaseFoldingHash::hash): Merged the CaseInsensitiveHash<> template classes into this. (WebCore::CaseFoldingHash::equal): Ditto. * platform/text/StringImpl.cpp: (WebCore::equal): Changed to invoke StringHash. (WebCore::equalIgnoringCase): Changed to invoke CaseFoldingHash. * dom/DOMImplementation.cpp: (WebCore::addString): Updated to use StringHash and CaseFoldingHash. (WebCore::isSVG10Feature): Ditto. (WebCore::isSVG11Feature): Ditto. * loader/FrameLoader.cpp: (WebCore::localSchemes): Ditto. * platform/graphics/FontCache.cpp: (WebCore::computeHash): Ditto. * platform/network/HTTPHeaderMap.h: Ditto. * platform/text/PlatformString.h: Ditto. * platform/text/StringImpl.h: Ditto. * rendering/RenderPartObject.cpp: (WebCore::RenderPartObject::updateWidget): Ditto. * xml/XMLHttpRequest.cpp: (WebCore::canSetRequestHeader): Ditto. * rendering/RenderTreeAsText.cpp: Removed stray include of JSEditor.h. 2007-12-11 Darin Adler * platform/wx/KeyboardEventWx.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Another try at fixing the WX build. Changes the code around a little bit. 2007-12-11 Darin Adler * platform/wx/KeyboardEventWx.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Quick try at fixing build. 2007-12-11 Dan Bernstein Reviewed by Darin Adler. - fix Text doesn't wrap properly at Tamil version of Wikipedia Test: fast/text/international/complex-character-based-fallback.html * platform/graphics/Font.cpp: (WebCore::Font::glyphDataForCharacter): Added a forceSmallCaps argument that forces this function to use the small caps font. It is used for combining marks that need to combine with a small cap. * platform/graphics/Font.h: * platform/win/UniscribeController.cpp: (WebCore::UniscribeController::advance): Changed to split the string into runs of characters that will be rendered using the same FontData. This is done by calling glyphDataForCharacter() for each cahracter to find the FontData it should be rendered with. (WebCore::UniscribeController::itemizeShapeAndPlace): Added a fontData argument that is passed on to shapeAndPlaceItem() instead of the smallCaps argument. (WebCore::UniscribeController::shapeAndPlaceItem): Added a fontData argument and removed the font fallback logic from this function, as it is now expected to be called with an item all of whose characters can be rendered with the given fontData. * platform/win/UniscribeController.h: 2007-12-07 Alexey Proskuryakov Reviewed by Darin. Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard. http://bugs.webkit.org/show_bug.cgi?id=13916 JavaScript detects Tab as a character input on a textfield validation Test: platform/win/fast/events/double-dead-char.html * platform/PlatformKeyboardEvent.h: (WebCore::PlatformKeyboardEvent::): (WebCore::PlatformKeyboardEvent::type): (WebCore::PlatformKeyboardEvent::windowsVirtualKeyCode): (WebCore::PlatformKeyboardEvent::setWindowsVirtualKeyCode): (WebCore::PlatformKeyboardEvent::keyIdentifier): (WebCore::PlatformKeyboardEvent::setIsAutoRepeat): Added an explicit type member to differentiate different kinds of events: RawKeyDown == keydown == WM_KEYDOWN KeyUp == keyup == WM_KEYUP Char == keypress == WM_CHAR KeyDown == e.g. NSKeyDown or NSFlagsChanged, used on platforms that have a different model for event processing, and needs to be converted to RawKeyDown (+ Char) for processing in DOM. * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Updated for changed data members. Fix Enter (numeric keypad) charCode to match Return, as we check for it from keypress default handlers. (WebCore::windowsKeyCodeForKeyEvent): (WebCore::isKeyUpEvent): Made it do something closer to what it claims; added a FIXME explaining that it still fails. (WebCore::disambiguateKeyDownEvent): Downgrade from KeyDown to RawKeyDown or Char, removing information that should not be available in those (because it cannot be provided on Windows). * platform/win/KeyEventWin.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Updated for changed data members. Used standard Windows constants for bit masks instead of our own ones. (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Should never be called on Windows. * platform/gtk/KeyEventGtk.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): * platform/qt/PlatformKeyboardEventQt.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): * platform/wx/KeyboardEventWx.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Updated for cross-platform changes as much as it was possible without appropriate build environments. * WebCore.base.exp: Export PlatformKeyboardEvent::disambiguateKeyDownEvent(), used by platforms that need to convert their fancy key events to RawKeyDown/Char pairs. Export Editor::isTextInsertionCommand(). * bridge/EditorClient.h: Renamed handleKeypress() to handleKeyboardEvent(), as it gets both keydowns and keypresses. Renamed handleInputMethodKeypress() to handleInputMethodKeydown(), as IMs work with raw keydowns. * dom/Document.h: * dom/Document.cpp: (WebCore::Document::defaultEventHandler): Moved accesskey processing to EventHandler. * dom/KeyboardEvent.h: Added comments describing keyCode/charCode behavior. * dom/KeyboardEvent.cpp: (WebCore::eventTypeForKeyboardEventType): (WebCore::KeyboardEvent::KeyboardEvent): Conversion between platform and DOM event types is now straightforward, so scary hacks such as using autorepeat to distinguish types are not needed. (WebCore::KeyboardEvent::keyCode): Added a comment describing other browsers' behavior. (WebCore::KeyboardEvent::charCode): Added a comment describing other browsers' behavior. Changed to a more compatible behavior: raw keydown/keyup events do not and can not have character codes. * editing/Editor.h: * editing/Editor.cpp: (WebCore::Editor::isTextInsertionCommand): Is this command actually text input in disguise? (WebCore::Editor::handleKeyboardEvent): Updated for new function names. (WebCore::Editor::handleInputMethodKeydown): Ditto. * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler): Perform the default action when handling an appropriate event. Enter is processed on keypress (and thus should be checked for via charCode, not keyIdentifier), Space is processed on keydown+keyup! We now match IE in that a button is highlighted when Space is pressed. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::menuListDefaultEventHandler): (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Made a number of fixes to when default actions take place, similar to HTMLButtonElement ones described above. * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): Unless we have a combined KeyDown, just forward the event to the target. Call accesskey handling directly, as it doesn't seem to be part of normal event handling in IE. Also streamlined the code in KeyDown case, thanks to handleInputMethodKeypress() now being handleInputMethodKeydown(). (WebCore::EventHandler::handleTextInputEvent): Check that we were not called from keydown. (WebCore::EventHandler::defaultTextInputEventHandler): Removed a call to defaultTabEventHandler, as default tab handling happens when processing keydown. (WebCore::handleAccessKey): Moved from Document, as access keys are processed outside normal event handling. Fixed accesskey processing to use information that's available in a raw keydown event. (WebCore::EventHandler::defaultKeyboardEventHandler): Do not ignore keydown; in particular, handle tabs during keydown processing. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::currentKeyboardEvent): Disambiguate KeyDown as RawKeyDown, as this is what callers want. * platform/text/PlatformString.h: * platform/text/String.cpp: (WebCore::String::characterStartingAt): * platform/text/StringImpl.cpp: (WebCore::StringImpl::characterStartingAt): * platform/text/StringImpl.h: Added a UChar32 accessor. * svg/graphics/SVGImageEmptyClients.h: (WebCore::SVGEmptyEditorClient::handleKeyboardEvent): (WebCore::SVGEmptyEditorClient::handleInputMethodKeydown): Updated for new function names. 2007-12-11 John Sullivan Reviewed by Adele Tiger build fix -- don't call QTMovieView setDelegate: directly because it's not public * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::MediaPlayerPrivate::createQTMovieView): (WebCore::MediaPlayerPrivate::detachQTMovieView): 2007-12-11 Alexey Proskuryakov Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=16325 REGRESSION: www.xerox.ru doesn't work Fix this on Windows, too! Test: http/tests/misc/empty-cookie.html * platform/network/win/CookieJarWin.cpp: (WebCore::setCookies): (WebCore::cookies): Same fix as on Mac, translated into CF. * platform/win/CookieJarWin.cpp: Removed - the real one is in platform/network/win. 2007-12-11 Christian Dywan Reviewed by Alp Toker. http://bugs.webkit.org/show_bug.cgi?id=16371 Implement additional mouse cursors for Gtk Added cursor bitmaps from Mozilla: http://lxr.mozilla.org/mozilla1.8/source/widget/src/gtk2/nsGtkCursors.h * platform/gtk/CursorGtk.cpp: (WebCore::customCursorNew): (WebCore::verticalTextCursor): (WebCore::cellCursor): (WebCore::contextMenuCursor): (WebCore::noDropCursor): (WebCore::copyCursor): (WebCore::progressCursor): (WebCore::aliasCursor): (WebCore::noneCursor): (WebCore::notAllowedCursor): (WebCore::zoomInCursor): (WebCore::zoomOutCursor): * platform/gtk/CursorGtk.h: Added. 2007-12-10 Oliver Hunt Reviewed by Weinig, Dan, and Alexey. Fix character set used for dynamically loaded scripts. Fix for: Safari can not display the mouse over pop menu on ChinaTimes News site correctly. [Safari]? :Leopard9A576: The typed CH characters displays as garbage in Sina website after reloading the webpage. All menus for chinese IBM site have wrong encoding Use the same logic to determine the charset for a script loaded dynamically as we do for a statically loaded script. * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::insertedIntoDocument): 2007-12-10 Justin Garcia Reviewed by Oliver Hunt. GoogleDocs: After FormatBlock in an empty document, certain functions are disabled We were trying to insert a block of the requested type before the body element. * editing/FormatBlockCommand.cpp: (WebCore::FormatBlockCommand::doApply): Removed unnecessary ()s in the if condition. Removed "|| !upstreamStart.node()->isDescendantOf(root)" from the if condition, since a) upstreamStart will never be outside the root editable element, since in that case there would be no block inside the editable root to Format, and b) if upstreamStart.node() *is* the root, then refNode is the root, and we shouldn't insert before the root, we should insert at [root, 0]. Added comments to explain the use of upstream() in the second if-clause. Added an early return for case where there is nothing selected, in that case, there is nothing to move. 2007-12-10 Adele Peterson Reviewed and partially fixed by Tim Hatcher. Remaining part of fix for Transformed