2007-11-11 Adam Roben Add wrappers around CoCreateInstance to COMPtr I followed the example of the Query constructor and query method by adding a Create constructor and create method. Reviewed by Darin. * platform/win/COMPtr.h: (COMPtr::COMPtr): Added a new constructor that calls CoCreateInstance. (COMPtr::create): Added. (COMPtr::createInstance): Added. 2007-11-11 Alexey Proskuryakov Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=15896 More editing cleanup No functionality changes. * dom/Node.h: Moved several editing-related methods elsewhere. * dom/Node.cpp: (WebCore::Node::maxCharacterOffset): Renamed from maxOffset() to highlight that it is a match to offsetInCharacters(), and much different from other offset-related methods. Added ASSERT_NOT_REACHED(), as callers are supposed to check offsetInCharacters() before calling this. * dom/CharacterData.cpp: (WebCore::CharacterData::maxCharacterOffset): * dom/CharacterData.h: (WebCore::CharacterData::isCharacterDataNode): Updated for above renamings. * dom/Comment.{h,cpp}: Removed an override for offsetInCharacters(), which is already present in CharacterData. * dom/Document.{h,cpp}: Folded updateSelection() into Frame::selectionLayoutChanged(). * dom/Position.h: * dom/Position.cpp: (WebCore::Position::uncheckedPreviousOffset): Moved from Node::previousOffset(). (WebCore::Position::uncheckedNextOffset): Moved from Node::NextOffset(). (WebCore::Position::previous): Adapted to the above move. (WebCore::Position::next): Ditto. (WebCore::Position::upstream): Removed an isBR() check, since a non-BR element cannot have a BR renderer (I think), and BR elements are covered by editingIgnoresContent(). (WebCore::Position::downstream): Ditto. (WebCore::caretMaxRenderedOffset): Moved from Node::caretMaxRenderedOffset(). (WebCore::Position::rendersInDifferentPosition): Updated for the above moves. * dom/PositionIterator.h: Added a comment describing this class from the original check-in. * dom/PositionIterator.cpp: (WebCore::PositionIterator::increment): Updated for the above moves. (WebCore::PositionIterator::decrement): Ditto. * dom/ProcessingInstruction.h: * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::maxCharacterOffset): ProcessingInstruction was already returning true from offsetInCharacters(), but didn't override maxCharacterOffset(). I think that implementing it has no actual effect, as PIs are not rendered, but it looks cleaner this way. * dom/Range.cpp: (WebCore::Range::selectNodeContents): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): (WebCore::ApplyStyleCommand::applyInlineStyle): (WebCore::maxRangeOffset): (WebCore::ApplyStyleCommand::removeInlineStyle): (WebCore::ApplyStyleCommand::splitTextAtStartIfNeeded): (WebCore::ApplyStyleCommand::splitTextAtEndIfNeeded): (WebCore::ApplyStyleCommand::splitTextElementAtStartIfNeeded): (WebCore::ApplyStyleCommand::splitTextElementAtEndIfNeeded): (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::insertNodeAt): (WebCore::CompositeEditCommand::positionOutsideTabSpan): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleGeneralDelete): * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::insertTab): * editing/visible_units.cpp: (WebCore::previousLinePosition): (WebCore::nextLinePosition): Updated for the above moves. * editing/Editor.cpp: (WebCore::Editor::advanceToNextMisspelling): Added a missing rangeCompliantEquivalent() call. * editing/TextIterator.cpp: (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Changed the condition to obviously match a maxCharacterOffset() call made after it; hopefully, this doesn't break any border cases. (WebCore::SimplifiedBackwardsTextIterator::advance): Updated for the above moves. * editing/htmlediting.h: * editing/htmlediting.cpp: (WebCore::canHaveChildrenForEditing): Removed a bogus comment: I don't thin BRs have a special ability to accept child nodes, other than via DOM manipulation, which is not specific to BRs. (WebCore::rangeCompliantEquivalent): Removed a check for BR, which is already covered by editingIgnoresContent(). (WebCore::maxDeepOffset): Ditto. (WebCore::caretMinOffset): Moved from Node. Changed some runtime checks that seemingly cannot fail into assertions. (WebCore::caretMaxOffset): Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEventSingleClick): Pass 0 to VisiblePosition constructor instead of caretMinOffset. I didn't want to include htmlediting.h here, and I think that VisiblePosition constructor will take care of adjusting the offset. * page/Frame.cpp: (WebCore::Frame::selectionLayoutChanged): Folded Document::updateSelection() here. * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]): Added missing rangeCompliantEquivalent() calls. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForRenderer): Changed to not round-trip via editing. Changed some runtime checks that seemingly cannot fail into assertions. 2007-11-11 Darin Adler Reviewed by Sam. - updated for JSRegExp function changes * platform/RegularExpression.cpp: (WebCore::RegularExpression::Private::compile): (WebCore::RegularExpression::match): 2007-11-10 Mark Rowe Qt Linux build fix. * platform/UnicodeRange.h: 2007-11-10 Mark Rowe Qt Windows build fix. * platform/UnicodeRange.h: 2007-11-10 Nikolas Zimmermann Reviewed by Eric. Fixes: http://bugs.webkit.org/show_bug.cgi?id=15937 (Add glyph-orientation-horizontal/vertical support) Fixes: http://bugs.webkit.org/show_bug.cgi?id=13971 (text-anchor support on vertical text seems slightly off) Add glyph-orientation-* support for text & textPath. (90/180/270 and 'auto') Also fix all vertical text handling - for text & textPath! (especially latin1 characters auto orientation in vertical writing modes) * WebCore.pro: Add platform/UnicodeRange.cpp to build * WebCore.xcodeproj/project.pbxproj: Dito. * rendering/SVGCharacterLayoutInfo.cpp: Respect orientationShiftX/Y & angle in characterTransform() (WebCore::SVGChar::characterTransform): * rendering/SVGCharacterLayoutInfo.h: New variables. (WebCore::SVGCharOnPath::SVGCharOnPath): (WebCore::SVGChar::SVGChar): * rendering/SVGRootInlineBox.cpp: Added glyph-orientation-* handling. (WebCore::glyphOrientationToAngle): (WebCore::glyphOrientationIsMultiplyOf180Degrees): (WebCore::calculateGlyphAdvanceAndShiftRespectingOrientation): (WebCore::cummulatedHeightOfInlineBoxCharacterRange): (WebCore::cummulatedWidthOrHeightOfTextChunk): (WebCore::SVGRootInlineBox::buildLayoutInformationForTextBox): 2007-11-10 Timothy Hatcher Reviewed by Sam Weinig. * page/inspector/StylesSidebarPane.js: Fix the wording of a comment and switch over to use getUniqueProperties in another place. 2007-11-10 John Sullivan Reviewed by Sam Weinig Rest of fix for 5394877 * bindings/js/kjs_window.cpp: (KJS::Window::isSafeScript): Don't log unsafe JavaScript attempts in the other version of isSafeScript() if in private browsing mode either. 2007-11-10 Nikolas Zimmermann Reviewed by Oliver. Fix function name difference - header said 'unicodeRangeForCharacter', actually implemented function is 'findCharUnicodeRange'. They are not compiled yet. * platform/UnicodeRange.h: 2007-11-10 Dan Bernstein Reviewed by Darin Adler. - fix Control-clicking text in a link can surprisingly select only part of the link, should select entire link No test because context menu events cannot be tested in DumpRenderTree. * page/EventHandler.cpp: (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Added. If the click occurred in an active link, selects the entire link element. Otherwise selects the closest word. (WebCore::EventHandler::sendContextMenuEvent): Call selectClosestWordOrLinkFromMouseEvent(). * page/EventHandler.h: 2007-11-10 John Sullivan Reviewed by Tim Hatcher - fixed Safari should not log unsafe JavaScript attempts when in private browsing mode (only an issue if Log JavaScript Exceptions is turned on) * bindings/js/kjs_window.cpp: (KJS::Window::isSafeScript): Don't log unsafe JavaScript attempts to console or chromeClient if in private browsing mode 2007-11-10 Alexey Proskuryakov Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=15922 Implement more of Mozilla Selection API Tests: editing/selection/containsNode.html editing/selection/deleteFromDocument.html editing/selection/extend.html editing/selection/selectAllChildren.html * editing/SelectionController.cpp: (WebCore::SelectionController::deleteFromDocument): (WebCore::SelectionController::containsNode): (WebCore::SelectionController::selectAllChildren): (WebCore::SelectionController::extend): * editing/SelectionController.h: Added deleteFromDocument(), containsNode(), and selectAllChildren(). Reimplemented extend(), which existed, but didn't match Firefox behavior and wasn't exposed via bindings. Removed a comment mentioning removeRange(), as this method makes no sense without multiple selection range support. * page/DOMSelection.cpp: (WebCore::DOMSelection::extend): (WebCore::DOMSelection::deleteFromDocument): (WebCore::DOMSelection::containsNode): (WebCore::DOMSelection::selectAllChildren): * page/DOMSelection.h: * page/DOMSelection.idl: Exposed the new methods. 2007-11-10 Alexey Proskuryakov Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=15892 DOM Range operations are not implemented for ProcessingInstruction nodes Test: fast/dom/Range/range-processing-instructions.html * dom/Range.cpp: (WebCore::Range::processContents): Implemented ProcessingInstruction cases. (WebCore::Range::checkNodeWOffset): Removed a FIXME - yes, I think that we are supposed to use ProcessingInstruction.data. 2007-11-09 Timothy Hatcher Reviewed by Mark Rowe. Bug 12054: Ability to serialize an element subtree (into clipboard?) from the DOM inspector http://bugs.webkit.org/show_bug.cgi?id=12054 - Add support code for routing copy events to the focused element. - Implement copying the currently selected DOM node. The node and it's subtree is copied to the clipboard. If the node has no outerHTML, the nodeValue is copied (text nodes, etc.) - Implement copy for the resource sidebar. The URL is copied for the currently selected resource. * page/inspector/DocumentPanel.js: * page/inspector/inspector.js: 2007-11-09 Antti Koivisto Reviewed by Adele. Fix occasional blank video with poster attribute. * ChangeLog: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::load): (WebCore::HTMLMediaElement::didRestoreFromCache): Just calling updateFromElement() does the right thing for both poster image and video. 2007-11-04 Sam Weinig Reviewed by Adam Roben. The COM bindings for the DOM should be autogenerated like the other DOM bindings Initial commit of the autogeneration of the COM DOM Bindings. No behavior change is being introduced in this patch and to insure that no conflicts arise, a temporary prefix of "GEN_" has been used for all the new classes. The build architecture for these bindings differs slightly from the other autogenerated bindings. Instead of building in WebCore and migrating the resuting code to WebKit (as is done for the Objective-C bindigs currently), the IDLs and generation scripts are migrated to WebKit and built there. This is done with a series of scripts and Makefiles. This commit includes: - Hand rolled root class/Interface GEN_DOMObject used to facilated object creation and ref-counting. - Generating all of the Core DOM and most of HTML and CSS - Generating Event, EventTarget, and EventListener * WebCore.vcproj/MigrateIDLAndScripts.make: Added. * WebCore.vcproj/WebCore.vcproj: * WebCore.vcproj/migrate-idls.sh: Added. * bindings/scripts/CodeGenerator.pm: * bindings/scripts/CodeGeneratorCOM.pm: Added. * dom/EventListener.h: Make the isWindowEvent parameter default to false to allow autogeneration based on the IDL. 2007-11-09 Tristan O'Tierney Reviewed by Timothy Hatcher. This patch is for the WebKit side of . We need a way to tell context menu navigations, such as "Open in New Window" to override any sort of browser preference for tab based navigation. * bridge/WindowFeatures.h: (WebCore::WindowFeatures::WindowFeatures): Added a new struct member var, preferredType and an accompanying enum type PreferredType to send a window type recommendation up to the Chrome. * page/ContextMenuController.cpp: (WebCore::openNewWindow): Set the window features to recommend a new Window for "Open in New Window" context menu action. 2007-11-08 Adam Roben Fix Pressing Enter on selected buttons should fire onclick We now match the behavior of Firefox and IE, which is to always just send a click event to the focused button when the Enter key is pressed (previously we were submitting forms directly in some cases). Reviewed by Adele. Test: fast/forms/enter-clicks-buttons.html * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler): Don't do anything fancy when Enter is pressed on a