=== WebCore-415.11 === 2005-06-13 Adele Peterson Merged new fix for from TOT to Safari-2-0-branch. 2005-06-13 Maciej Stachowiak Reviewed by Chris Blumenberg and Adele. - better fix for REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash http://bugzilla.opendarwin.org/show_bug.cgi?id=3445 With this change and the matching WebKit change we'll still stop loading the moment you click a download link, but the unload event and detaching of event handlers will not happen early any more. * khtml/khtml_part.cpp: (KHTMLPart::stopLoading): Factored out from closeURL, make firing of unload and detaching of event handlers optional. (KHTMLPart::closeURL): call stopLoading(true) * khtml/khtml_part.h: * kwq/WebCoreBridge.h: * kwq/WebCoreBridge.mm: (-[WebCoreBridge stopLoading]): Call stopLoading(false). === WebCore-415.10 === 2005-06-07 Adele Peterson Merged fix for from TOT to Safari-2-0-branch 2005-06-07 Adele Peterson Change by Darin, reviewed by Maciej and me. - fixed REGRESSION: Safari crashes at bebe.com There were cases where the DOMNode mark function would end up not even marking the node that it was called on. The old code tried to skip any subtrees that were already marked, but that code was wrong. * khtml/ecma/kjs_dom.cpp: (KJS::DOMNode::mark): Changed three things: 1) Instead of a boolean, keep a set of trees that we are marking, that prevents problems if we mark things that have references between separate trees of DOM nodes. 2) Don't do the "outermost node with a wrapper" check, just start marking at the root of the entire tree, because there's no way to have an unreachable node pointing to a reachable node. 3) Handle the unusual case where the document's wrapper dictionary is gone by marking just this node explicitly. This passes the layout tests, still fixes the Dashboard memory leak from bug 4125222, and makes bebe.com work again. === WebCore-415.9 === 2005-06-03 Adele Peterson Merged fix for from TOT for SUTiCambridge. Our fix for the Cingular bug ()relies on this. 2005-05-05 David Hyatt Fix for 4109667, sIFR flash replacement technique often malfunctions. This bug occurs when the plugin widget update causes the onload for the document to fire. Because you can be in the middle of a style recalc when doing an attach (in response to a stylesheet load), the onload fires in the middle of the attach process when the tree is in a bogus state. The fix is to add a bit to the document that tells style recalc that the implicitClose() method was invoked during the style recalc process and the code has been patched so that when this situation occurs, the close is deferred until after the style recalc has finished. Reviewed by John Sullivan * khtml/xml/dom_docimpl.cpp: (DocumentImpl::DocumentImpl): (DocumentImpl::recalcStyle): (DocumentImpl::implicitClose): * khtml/xml/dom_docimpl.h: === WebCore-415.8 === 2005-06-01 Adele Peterson Re-adding fix for , including fix for 2005-06-01 Adele Peterson fix for REGRESSION (412-TOT) crash in TV Tracker widget - KJS::XMLHttpRequest::removeFromRequestsByDocument() Reviewed by Darin. Synchronous loads don't get added to our requestsByDocument dictionary, so we should try to remove the request in this case. * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::removeFromRequestsByDocument): added checks to make sure request exists before trying to remove it. === WebCore-415.7 === 2005-06-01 Chris Petersen Backing out fix for because it caused REGRESSION (412-TOT) crash in TV Tracker widget - KJS::XMLHttpRequest::removeFromRequestsByDocument() 2005-05-31 Chris Petersen Change by Adele, Reviewed by Maciej. * khtml/ecma/kjs_binding.cpp: (ScriptInterpreter::mark): added nil check. * khtml/ecma/kjs_dom.cpp: (DOMNode::mark): added nil check. 2005-05-31 Chris Petersen Change by Adele, Reviewed by Maciej. * khtml/ecma/kjs_dom.cpp: (DOMNode::~DOMNode): Added nil check. On the branch, its possible to create a node with no impl. 2005-05-31 Chris Petersen Merged fix for 4125222 from TOT for SUTiCambridge 2005-05-30 Maciej Stachowiak Reviewed by Darin. - fixed Dashboard heap size grows over time (leak caused by JavaScript DOM node wrappers?) - changed per-document DOMObject caching to work with DOMNodes, since that is all it was used for anyway. * khtml/ecma/kjs_binding.cpp: (KJS::ScriptInterpreter::forgetDOMObjectForDocument): New function - allows nodes that get removed from the document to go away from the cache if not referenced. (KJS::ScriptInterpreter::mark): Don't mark nodes that aren't in the document, they can stay in the cache but only if they have another source of life. (KJS::ScriptInterpreter::domNodesPerDocument): Renamed and changed parameter types. (KJS::ScriptInterpreter::getDOMNodeForDocument): Renamed and changed parameter types. (KJS::ScriptInterpreter::forgetDOMNodeForDocument): Renamed and changed parameter types. (KJS::ScriptInterpreter::putDOMNodeForDocument): Renamed and changed parameter types. (KJS::ScriptInterpreter::forgetAllDOMNodesForDocument): Renamed and changed parameter types. (KJS::ScriptInterpreter::updateDOMNodeDocument): Renamed and changed parameter types. * khtml/ecma/kjs_binding.h: * khtml/ecma/kjs_dom.cpp: (KJS::DOMNode::~DOMNode): call forgetDOMObjectForDocument. (KJS::DOMNode::mark): If the node is not in the document, make sure to mark all wrappers in its detached piece of the tree. (KJS::getDOMNode): Updated for renames * khtml/ecma/kjs_dom.h: * khtml/xml/dom_docimpl.cpp: (DocumentImpl::~DocumentImpl): Updated for renames. * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Updated for renames. 2005-05-31 Chris Petersen Merged fix for from TOT to SUTiCambridge. 2005-05-27 Adele Peterson Change by Darin, reviewed by me. fix for 8A425: reload stock widget over and over and crash in XMLHttpRequest::changeState * khtml/khtml_part.cpp: (KHTMLPart::closeURL): now cancels XMLHttpRequests * khtml/ecma/xmlhttprequest.h: Added cancelRequests, addToRequestsByDocument, and RemoveFromRequestsByDocument methods. Added requestsByDocument dictionary. * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::send): calls addToRequestsByDocument (KJS::XMLHttpRequest::abort): calls removeFromRequestsByDocument (KJS::XMLHttpRequest::slotFinished): calls removeFromRequestsByDocument (KJS::XMLHttpRequest::requestsByDocument): creates dictionary to manage requests. (KJS::XMLHttpRequest::addToRequestsByDocument): adds this request to dict. (KJS::XMLHttpRequest::removeFromRequestsByDocument): removes this request from dict. (KJS::XMLHttpRequest::cancelRequests): goes and cancels requests in the doc 2005-05-31 Chris Petersen Merged fix for from TOT for SUTiCambridge. 2005-05-27 Adele Peterson Reviewed by Darin. fix for Cannot log into Cingular.com account page (load event delivered while still processing incoming data) * khtml/misc/loader.cpp: (DocLoader::DocLoader): Initialized m_loadInProgress to false. (DocLoader::setLoadInProgress): Added. (Loader::slotFinished): sets the m_loadInProgress flag to reflect the fact that we're not really done loading this request until we emit the signal with the request status. (Loader::numRequests): If there's a load in progress, we increment the number of requests so it doesn't seem like the load is done. * khtml/misc/loader.h: (khtml::DocLoader::loadInProgress): Added. === WebCore-415.6 === 2005-05-24 Adele Peterson Merged fix for from TOT for SUTiCambridge 2005-05-24 Maciej Stachowiak Reviewed by John. - fixed onunload handler doesn't fire when a window is closed * khtml/xml/dom_docimpl.cpp: (DocumentImpl::detach): Don't remove all event handlers from the document here... * khtml/khtml_part.cpp: (KHTMLPart::closeURL): ...instead do it here, after firing the unload event, but only if the document is not in the back/forward cache... * kwq/KWQPageState.mm: (-[KWQPageState finalize]): ...and take care of the back/forward cache case here. 2005-05-24 Chris Petersen Merged fix for from TOT to SUTiCambridge 2005-05-05 Maciej Stachowiak Reviewed by Darin. Unit Converter and Weather widgets crashed in KJS::Collector::markCurrentThreadConservatively Avoid possibly allocating new prototype objects as parameters to superclass constructors - there may be an allocated but uninitilized object so this is a bad time to allocate. Instead, set the prototype in the constructor body, since the object is happily allocated by then. * khtml/ecma/kjs_binding.h: * khtml/ecma/kjs_css.cpp: (DOMCSSStyleDeclaration::DOMCSSStyleDeclaration): (DOMMediaList::DOMMediaList): (DOMCSSStyleSheet::DOMCSSStyleSheet): (DOMCSSPrimitiveValue::DOMCSSPrimitiveValue): (DOMCSSValueList::DOMCSSValueList): * khtml/ecma/kjs_css.h: (KJS::DOMStyleSheet::DOMStyleSheet): (KJS::DOMCSSValue::DOMCSSValue): * khtml/ecma/kjs_dom.cpp: (DOMNode::DOMNode): (DOMDocument::DOMDocument): (DOMElement::DOMElement): (DOMDOMImplementation::DOMDOMImplementation): (DOMNamedNodeMap::DOMNamedNodeMap): (DOMNamedNodesCollection::DOMNamedNodesCollection): (DOMCharacterData::DOMCharacterData): (DOMText::DOMText): * khtml/ecma/kjs_dom.h: (KJS::NodeConstructor::NodeConstructor): (KJS::DOMExceptionConstructor::DOMExceptionConstructor): * khtml/ecma/kjs_events.cpp: (DOMEvent::DOMEvent): (Clipboard::Clipboard): * khtml/ecma/kjs_html.cpp: (HTMLCollection::HTMLCollection): * khtml/ecma/kjs_range.cpp: (DOMRange::DOMRange): * khtml/ecma/kjs_traversal.cpp: (DOMNodeIterator::DOMNodeIterator): (DOMNodeFilter::DOMNodeFilter): (DOMTreeWalker::DOMTreeWalker): * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::XMLHttpRequest): * khtml/ecma/xmlserializer.cpp: (KJS::XMLSerializer::XMLSerializer): 2005-05-23 Chris Petersen Merged fix for 4077106 from TOT to SUTiCambridge 2005-04-05 David Hyatt Fix for 4077106, make sure that mouse wheeling in overflow sections uses 40 rather than 10 as the base line step. Reviewed by darin * khtml/rendering/render_layer.cpp: (RenderLayer::positionScrollbars): * kwq/KWQScrollBar.mm: (QScrollBar::scroll): 2005-05-23 Chris Petersen Reviewed by Adele. * khtml/ecma/kjs_window.cpp: (Window::get): Merged final change for frameElement from TOT. 2005-05-23 Chris Petersen Merged fix for from TOT to SUTiCambridge 2005-04-25 Darin Adler Reviewed by John. - fixed JavaScript drop handlers don't receive more than one dropped item * kwq/KWQClipboard.mm: (cocoaTypeFromMIMEType): Remove some use of compare -- less efficient than a simpler "==" check. Fixed non-GC-safe code to use KWQCFAutorelease instead. (MIMETypeFromCocoaType): Use fromCFString instead of fromNSString to avoid a cast. (KWQClipboard::getData): Rearrange so that we'll use filenames if both filenames and a URL are present, since filenames can accomodate multiple items. Fix bug where we'd return multiple filenames when the type requested is "URL". Fixed loop that computed the count over and over again for the loop termination condition. Check that the data for NSFilenamesPboardType is an NSArray instead of assuming it is. (KWQClipboard::setData): Use isEqualToString: instead of == when comparing types. 2005-05-23 Chris Petersen Merged fix for from TOT for SUTiCambridge 2005-04-22 Darin Adler Reviewed by John. - fixed Google Suggest no longer works due to lack of "frameElement" * khtml/ecma/kjs_window.h: Added FrameElement. * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement". * khtml/ecma/kjs_window.lut.h: Regenerated. === WebCore-415.5 === 2005-05-07 Adele Peterson Merged fix for from TOT for SUTiAtlanta 2005-05-07 David Harrison Reviewed by John. Deleting text at the end of email moves insertion point to the top of the document * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::handleGeneralDelete): Update m_upstreamStart when deleting m_downstreamEnd.node() if the former is no longer in the document. Better to update here than trying to recover later in calculateEndingPosition(). === WebCore-415.3 === 2005-05-05 Adele Peterson Merging fix for from TOT for SUTiAtlanta. 2005-05-05 Darin Adler Reviewed by Dave Hyatt. - fixed REGRESSION (Atlanta): maps.google.com doesn't always center California correctly * khtml/ecma/kjs_events.cpp: (offsetFromTarget): Fix two places that said X where they should say Y. === WebCore-415.2 === 2005-05-02 Chris Petersen Reviewed by Adele. Merging changes for SUTiAtlanta. 2005-04-29 David Harrison Reviewed by Darin. When deleting link at end of sentence, entire sentence gets deleted * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::initializePositionData): Work around bug #4103339 (whose real fix is somewhat risky), so this fix can get into a software update. (khtml::DeleteSelectionCommand::handleGeneralDelete): Add isAncestor check when comparing m_downstreamEnd.node() and m_startNode. === WebCore-415.1 === 2005-04-27 Vicki Murley - merge this fix from HEAD This fix was included in WebCore-413, which shipped in Tiger GM (8A428). However, Safari-2-0-anchor was mistakenly placed at WebCore-412. Merging this fix to the branch so that this fix isn't lost in the SU. 2005-03-27 Darin Adler Reviewed by me, fix by Kida-san. - fixed 8A424: Safari immediately quit by Cmd+Ctrll+'D' * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]): Added nil check. 2005-04-27 Adele Peterson Merging John's fix for alt/shift bug in fix from TOT. 2005-04-27 John Sullivan Reviewed by Adele. - fixed problem with mouse wheel patch where alt and shift keys were switched * khtml/xml/dom2_eventsimpl.h: use the order cntl, alt, shift, meta in KeyboardEventImpl constructors to match superclass. This isn't necessary to fix the bug, but is better for clarity. * khtml/xml/dom2_eventsimpl.cpp: (KeyboardEventImpl::KeyboardEventImpl): switch parameter order to match superclass. Then pass the parameters to superclass's constructor in the right order. (KeyboardEventImpl::initKeyboardEvent): Pass parameters to superclass's constructor in the right order. 2005-04-27 chris petersen Removed fix for 4032346 and merged new fix as described in 4097842. 2005-04-18 David Hyatt Back out fix for 4032346, since it is causing garbled image content on many sites. The bug tracking the fix is 4069093. (khtml::RenderBlock::matchedEndLine): 2005-04-25 David Hyatt Fix for 4097842, changing 1st line of a url that wraps doesn't update the second line. Make sure to update line break info for the last dirty line so that when a clean line tries to figure out where it started, it will get an accurate position taking into account the updated string. By doing this, the code will be able to properly distinguish between the old and new positions and not accidentally assume they are the same. Reviewed by darin * khtml/rendering/render_text.cpp: (RenderText::setTextWithOffset): 2005-04-26 chris petersen Merged for 3655817 from TOT Reviewed by Adele. 2005-04-26 Darin Adler Reviewed by John. - fixed please add support for mouse wheel events and the onmousewheel handler Loose ends: - need to test behavior of Windows IE with horizontal scroll wheeling; we currently send a distinct event for that relatively obscure case, which means the event handlers won't fire at all; might be incorrect - overflow scrolling is done after all DOM event handling, but ideally should be done in the overflowing element's default event handler; not important in practice - frame scrolling is done after all DOM event handling, but probably should be done in a default event handler; not sure about this, but it's probably not important in practice and definitely not required - JavaScript * khtml/ecma/kjs_events.h: Added DOMWheelEvent. * khtml/ecma/kjs_events.cpp: (KJS::getDOMEvent): Added a case for wheel event. To be forward looking, I use the event's impl pointer instead of a C++ DOM wrapper. Eventually it will all work this way. (offsetFromTarget): Added. Factored out code to compute offsetX/Y for an event. (DOMMouseEvent::getValueProperty): Changed to call offsetFromTarget for offsetX/Y. (DOMWheelEvent::DOMWheelEvent): Added. (DOMWheelEvent::tryGet): Added. (DOMWheelEvent::getValueProperty): Added. (DOMWheelEventProtoFunc::tryCall): Added. Nothing at the moment, but might get contents later. * khtml/ecma/kjs_dom.h: Added OnMouseWheel to the enum with the list of properties. * khtml/ecma/kjs_dom.cpp: Added onmousewheel as a property of DOM nodes. (DOMNode::getValueProperty): Return the mouse wheel event handler. (DOMNode::putValue): Set the mouse wheel event handler. * khtml/ecma/kjs_window.cpp: Added onmousewheel as a property of the window. (Window::get): Return the mouse wheel event handler. (Window::put): Set the mouse wheel event handler. * khtml/ecma/kjs_window.h: Added OnWindowMouseWheel to the enum with the list of properties. (Other properties distinguish the window handler by lower-casing the initial letter, way too subtle, so I did this one a good way.) * khtml/dom/dom2_events.h: Made the constructors for Event and UIEvent public. There's no good reason for them to be private, and I had to use the UIEvent one in the JavaScript implementation. - DOM * khtml/xml/dom2_eventsimpl.h: Added events for mouse wheel and horizontal mouse wheel. Added isWheelEvent function to EventImpl. (DOM::UIEventWithKeyStateImpl): Added. Base class shared by mouse, wheel, and keyboard events. (DOM::MouseRelatedEventImpl): Added. Base class shared by mouse and wheel events. (DOM::WheelEventImpl): Added. * khtml/xml/dom2_eventsimpl.cpp: Added "mousewheel" to list of event names and a placeholder for the horizontal mouse wheel. (EventImpl::isWheelEvent): Added. Returns false. (MouseRelatedEventImpl::MouseRelatedEventImpl): Added. Factored out what's shared between mouse events and wheel events to avoid duplicated code. (MouseRelatedEventImpl::computeLayerPos): Moved to MouseRelatedWheelEventImpl. (MouseEventImpl::MouseEventImpl): Changed since MouseRelatedWheelEventImpl is now the base class so we can share more code with wheel events. (KeyboardEventImpl::KeyboardEventImpl): Changed since UIEventWithKeyStateImpl is now the base class so we can share more code with mouse and wheel events. (WheelEventImpl::WheelEventImpl): Added. (WheelEventImpl::isWheelEvent): Added. Returns true. * khtml/misc/htmlattrs.in: Added "onmousewheel" attribute name. * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Added parsing of the "onmousewheel" atribute, consistent with other event handler attributes. - event handling * kwq/WebCoreBridge.h: Renamed scrollOverflowWithScrollWheelEvent to sendScrollWheelEvent. * kwq/WebCoreBridge.mm: (-[WebCoreBridge sendScrollWheelEvent:]): Renamed. * kwq/KWQEvent.h: Added Wheel as an event type value. (QWheelEvent::QWheelEvent): Added. * kwq/KWQEvent.mm: (positionForEvent): Updated to know that wheel events have valid positions in them. (orientationForEvent): Added. (deltaForEvent): Added. (QWheelEvent::QWheelEvent): Added. * kwq/KWQKHTMLPart.h: Renamed scrollOverflowWithScrollWheelEvent to wheelEvent. * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::wheelEvent): Renamed and added code to construct a QWheelEvent and send it along to KHTMLView::viewportWheelEvent, consistent with how mouse events work. * khtml/khtmlview.cpp: (KHTMLView::viewportWheelEvent): Do a hit test to figure out which node to send the event to, and then call dispatchWheelEvent. * khtml/xml/dom_nodeimpl.h: Added dispatchWheelEvent. * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchWheelEvent): Added. - generated files * khtml/ecma/kjs_dom.lut.h: Regenerated. * khtml/ecma/kjs_events.lut.h: Regenerated. * khtml/ecma/kjs_window.lut.h: Regenerated. * khtml/misc/htmlattrs.c: Regenerated. * khtml/misc/htmlattrs.h: Regenerated. 2005-04-26 chris petersen Merging fix for from TOT Reviewed by Adele. 2005-04-26 David Harrison Reviewed by Darin, Maciej. Deleting text in new message borks content Fixed by removing the methods that attempted to preserve the position. The idea of preserving position is a very recent one, and turned out to not actually address the problem it was intended to fix (see below). Further, is unclear how the position could be preserved in a form that could be properly used later on. Therefore, removing the code to work like before is the preferred alternative for this software update. I've written to cover the bug that position preservation was supposed to fix (but did not). Added layout tests for both this bug and 4099839. Also, updated existing tests with correct expected results (delete-at-paragraph-boundaries-003 and 004). * khtml/editing/htmlediting.cpp: (khtml::CompositeEditCommand::removeFullySelectedNode): (khtml::CompositeEditCommand::removeChildrenInRange): (khtml::DeleteSelectionCommand::handleGeneralDelete): * khtml/editing/htmlediting.h: * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: 2005-04-26 chris petersen Merging fix for from TOT Reviewed by Adele. 2005-03-28 David Harrison Reviewed by Darin. REGRESSION (8A416-8A419): Safari crash bringing up context menu for non-HTML content in a frame * kwq/KWQAccObject.mm: (-[KWQAccObject rendererForView:]): Nil-check node variable instead of rechecking document variable. === Safari-412 === 2005-03-24 Richard Williamson Fixed After adding/removing stocks from Stocks Widget, stock areas went blank The request was being collected before firing it's load handler. We now gc protect the request while it's loading. Reviewed by Maciej. * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::send): (KJS::XMLHttpRequest::abort): (KJS::XMLHttpRequest::slotFinished): (KJS::XMLHttpRequestProtoFunc::tryCall): === Safari-411 === 2005-03-23 Darin Adler Further fix for 4053515. Covered cases where text position doesn't lie inside a text node. Reviewed by Richard. * khtml/editing/visible_text.cpp: (khtml::TextIterator::setRangeFromLocationAndLength): 2005-03-23 Richard Williamson Fixed REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews We now use actual document NSRanges to represent both marked text ranges and selection ranges. Reviewed by Ken. * khtml/editing/visible_text.cpp: (khtml::TextIterator::rangeLength): (khtml::TextIterator::setRangeFromLocationAndLength): * khtml/editing/visible_text.h: * kwq/WebCoreBridge.h: * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]): (-[WebCoreBridge DOM::convertToDOMRange:]): (-[WebCoreBridge selectNSRange:]): (-[WebCoreBridge markedTextDOMRange]): (-[WebCoreBridge markedTextNSRange]): 2005-03-22 Kevin Decker Reviewed by Vicki. Fixed REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back Rolled out the fix for REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken We clearly need a better solution to 4041374. We can't indiscriminately remove event listeners in closeURL() after-all. Since event listeners are registered in a case and allow the inline the tag's nested tags have been parsed, otherwise the list of parameters passed to the applet is incomplete. The regression was introduced (says Dave) when the parser's close-tag notifications were removed in the name of performance. * khtml/html/html_objectimpl.cpp: (HTMLAppletElementImpl::HTMLAppletElementImpl): (HTMLAppletElementImpl::getAppletInstance): (HTMLAppletElementImpl::setAllParamsAvailable): (HTMLAppletElementImpl::allParamsAvailable): * khtml/html/html_objectimpl.h: * khtml/html/htmlparser.cpp: (KHTMLParser::processCloseTag): * khtml/rendering/render_applet.cpp: (RenderApplet::createWidgetIfNecessary): 2005-02-18 Richard Williamson Fixed Tiger8A380: Widgets leak dashboard regions We were leaking the DashboardRegionImpls. Reviewed by Kevin. * khtml/css/css_valueimpl.cpp: (DOM::CSSPrimitiveValueImpl::cleanup): 2005-02-18 Chris Blumenberg Fixed: REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled Reviewed by kocienda. * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes() * khtml/editing/htmlediting.h: * kwq/WebCoreBridge.h: * kwq/WebCoreBridge.mm: (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle 2005-02-18 Ken Kocienda Reviewed by Chris Fix for these bugs: Copy/Paste of quoted word results in removal of any following Copy/Paste quoted text and then decrease quote level does not change text color For the most part, these bugs were caused by errors and lack of foresight on my part when I added the better paste code. Chalk these fixes up to the result of bake time. * khtml/editing/htmlediting.cpp: (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to. (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements! Terrible omission now fixed. (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now. Code has a more extensive comment in it now to explain the difficulty, and the need for more study and changes. (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the m_fragment.hasInterchangeNewline() case. This was just missed before. * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK. * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for

to

change in test content. * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change

to

to make this test go with the new design of using
tags for default paragraphs. 2005-02-18 David Hyatt Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their maxwidth when some cells have percentage values. Reviewed by kocienda * khtml/misc/arena.cpp: (ArenaAllocate): * khtml/rendering/table_layout.cpp: (FixedTableLayout::calcWidthArray): (FixedTableLayout::calcMinMaxWidth): (AutoTableLayout::layout): 2005-02-17 Darin Adler Reviewed by Kevin. - fixed WebKit crashes when deleting text in a modified div * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep the element alive until it's added to the DOM tree. * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto. 2005-02-17 Richard Williamson Fixed when Osaka-Mono is specified as fixed width font, Osaka used instead Fixed w/o introducing a performance regression. Add early check for Osaka-Mono to avoid expensive call into WebKit. Reviewed by Vicki. * kwq/KWQFont.mm: (QFont::isFixedPitch): 2005-02-17 Darin Adler Reviewed by Kevin. - fixed REGRESSION (180-181): Maxlength property for INPUT object not working * kwq/KWQTextField.mm: (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns YES, go on to call super, since super does the text formatter handling, which we need. (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto. (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto. === Safari-187 === 2005-02-17 Ken Kocienda Reviewed by Hyatt Fix for this bug: Copy from quoted text and paste results in blue text The relatively-new paste code tries hard to retain style of the content from the source location. However, in the case of quoted material in mail messages, we do not want to carry the quoting color along. This fixes the problem by factoring out such colors. * khtml/editing/htmlediting.cpp: (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded() to fix bug. (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are the result of text being quoted. (khtml::isNodeRendered): Function moved in file. No other change. (khtml::isProbablyBlock): Function moved in file. No other change. (khtml::closestMailBlockquote): New function. Helps fix bug. (khtml::isMailBlockquote): Function moved to be free-floating instead of being a member of CompositeEditCommand. No other change. * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded(). * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote. 2005-02-17 Richard Williamson Fixed dynamic support for -apple-dashboard-region is flakey Style operator== wasn't including regions. Reviewed by Darin. * khtml/rendering/render_style.cpp: (StyleCSS3NonInheritedData::operator==): 2005-02-17 Adele Amchan Reviewed by Chris. fix for 8A383: Safari v185 crash loading united.com multi city fare finder page. * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil 2005-02-17 Jens Alfke Reviewed by Hyatt. Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!" Force tokenizer to run synchronously while parsing document fragments, so it doesn't stop halfway through and cause truncated content. * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment): * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::reset): (khtml::HTMLTokenizer::begin): (khtml::HTMLTokenizer::setForceSynchronous): (khtml::HTMLTokenizer::continueProcessing): * khtml/html/htmltokenizer.h: 2005-02-17 Ken Kocienda Reviewed by Hyatt Fix for this bug: Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora * khtml/editing/htmlediting.cpp: (khtml::createDefaultParagraphElement): Change element we make from

to

. This fixes the problem, as these other mailers show
elements without margins. Some test files needed to change to preserve the ability to "eyeball" the results. Many others changed just because their

elements changed to

elements. * layout-tests/editing/deleting/delete-3928305-fix-expected.txt * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt * layout-tests/editing/inserting/insert-div-013-expected.txt * layout-tests/editing/inserting/insert-div-013.html * layout-tests/editing/inserting/insert-div-014-expected.txt * layout-tests/editing/inserting/insert-div-014.html * layout-tests/editing/inserting/insert-div-018-expected.txt * layout-tests/editing/inserting/insert-div-018.html * layout-tests/editing/inserting/insert-div-019-expected.txt * layout-tests/editing/inserting/insert-div-019.html * layout-tests/editing/inserting/insert-div-020-expected.txt * layout-tests/editing/inserting/insert-div-020.html * layout-tests/editing/inserting/insert-div-021-expected.txt * layout-tests/editing/inserting/insert-div-021.html * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt 2005-02-17 Ken Kocienda Reviewed by Hyatt Fix for this bug: REGRESSION (Mail): Copy/paste in Mail inserts returns The root cause of the problem is that a couple of pieces of code in AppKit and Mail insert newlines into markup as it is generated, and the paste code in WebCore was not smart about nodes that do not render (as is the case with these added newlines). So, the solution is to remove these unrendered nodes in the paste code in a pre-pass. Fortunately, my recent addition of such a pass to the paste code to handle styles gave me a convenient place to put this new logic. * khtml/editing/htmlediting.cpp: (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below. (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes(). Now does the additional work of removing unrendered nodes, as mentioned above. (khtml::isNodeRendered): New helper function. * khtml/editing/htmlediting.h: Updated as necessary. 2005-02-17 Ken Kocienda Reviewed by Hyatt Fix for this bug: REGRESSION (Mail): bolding a selection from end of line changes unselected text on starting line. The styling code did not move to the next node when the starting position was at the last offset of a node. Instead, it styled it. Clearly wrong. Solution is to borrow a check from the delete algorithm. Though I call caretMaxOffset(), which I consider deprecated, it is still the simplest and most strightforward way to ask the right question for this kind of problem. * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above. * layout-tests/editing/style/style-3998892-fix-expected.txt: Added. * layout-tests/editing/style/style-3998892-fix.html: Added. 2005-02-16 Chris Blumenberg Fixed: Forward/reply to an HTML email can result in nothing (in cases with tags for CSS) Reviewed by john. * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document. 2005-02-16 John Sullivan Written by Darin, reviewed by Maciej and me - change required to make previous checkin work with English language RSS pages * kwq/KWQKURL.h: new private method isHierarchical * kwq/KWQKURL.mm: (KURL::KURL): add hierarchical base URL check when determining whether the URL is absolute (KURL::isHierarchical): new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon 2005-02-16 John Sullivan Written by Darin, reviewed by me. - WebCore part of fix for FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter * kwq/DOM.mm: (-[DOMElement _getURLAttribute:]): new SPI method, uses parseURL and completeURL to get valid URL from attribute value * kwq/DOMPrivate.h: declare new SPI method 2005-02-15 Maciej Stachowiak Reviewed by Darin. reproducible crash loading cbs.sportsline.com This change reverts the fix for , and re-fixes it in a different (better) way. Instead of preventing programmatic open from setting the parsing flag, instead make sure that programmatic close resets it. * khtml/khtml_part.cpp: (KHTMLPart::openURL): (KHTMLPart::didExplicitOpen): (KHTMLPart::closeURL): (KHTMLPart::begin): (KHTMLPart::end): (KHTMLPart::endIfNotLoading): (KHTMLPart::slotFinishedParsing): (KHTMLPart::checkEmitLoadEvent): * khtml/khtml_part.h: * khtml/khtmlpart_p.h: (KHTMLPartPrivate::KHTMLPartPrivate): * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): (DocumentImpl::implicitOpen): (DocumentImpl::close): (DocumentImpl::implicitClose): * khtml/xml/dom_docimpl.h: 2005-02-15 David Harrison Reviewed by Maciej. smart delete seems to delete too much after expanding selection with arrow keys Fixed by updating the selection granularity. Only byWord granularity enables smart delete, but in this case the granularity changed from byWord to byCharacter. * khtml/khtml_part.cpp: (KHTMLPart::setSelectionGranularity): * khtml/khtml_part.h: * kwq/WebCoreBridge.mm: (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]): (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]): (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): 2005-02-15 David Harrison Reviewed by Darin. (continued) REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line This was supposed have been committed yesterday with the other part of the fix, but was not. * khtml/editing/visible_units.cpp: (khtml::endOfWord): 2005-02-15 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): blank line lost after pasting as quotation Problem was that the blank line after the selection was getting deleted incorrectly since the paste code thought this was an unneeded placeholder rather than a placeholder outside of the selection. * khtml/editing/htmlediting.cpp: (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder. (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in removeBlockPlaceholderIfNeeded to this new helper. (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step. * khtml/editing/htmlediting.h: Add new function. New layout test. * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added. * layout-tests/editing/pasteboard/paste-text-017.html: Added. Result changed for the better. * layout-tests/editing/pasteboard/paste-text-011-expected.txt 2005-02-14 David Harrison Reviewed by Darin. REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line Reviewed by Darin. REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line * khtml/editing/visible_text.cpp: (khtml::SimplifiedBackwardsTextIterator::advance): Add BR in for fix only if leaving a visible text node. * khtml/editing/visible_units.cpp: (khtml::endOfWord): Do not move left over a paragraph boundary. 2005-02-14 Darin Adler Reviewed by John. - fixed Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers) * khtml/html/html_formimpl.cpp: (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString. (DOM::FormDataList::end): Ditto. (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData when we encounter a path name rather than data. (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file in; the reading now happens inside WebKit. (DOM::FormDataList::appendString): Updated for FormDataListItem. (DOM::FormDataList::appendFile): Added. * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h. * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h. * kwq/KWQKFileItem.h: Removed. * kwq/KWQKFileItem.mm: Removed. * kwq/KWQKIONetAccess.h: Removed. * kwq/KWQKIONetAccess.mm: Removed. * WebCore.pbproj/project.pbxproj: Removed the 4 files above. - small unrelated fix (not reviewed by John) * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time. 2005-02-14 David Harrison Reviewed by Darin. REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line Fixed nextLinePosition to calculate affinity rather than take it as a parameter. Propagated the parameter change out to related methods. * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::initializePositionData): (khtml::InsertLineBreakCommand::doApply): (khtml::InsertParagraphSeparatorCommand::doApply): (khtml::InsertTextCommand::input): (khtml::ReplaceSelectionCommand::doApply): (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): * khtml/editing/selection.cpp: (khtml::Selection::modifyExtendingRightForward): (khtml::Selection::modifyMovingRightForward): (khtml::Selection::modifyExtendingLeftBackward): (khtml::Selection::modifyMovingLeftBackward): (khtml::Selection::modify): (khtml::Selection::validate): * khtml/editing/visible_position.cpp: (khtml::visiblePositionsOnDifferentLines): * khtml/editing/visible_units.cpp: (khtml::rootBoxForLine): (khtml::startOfLine): (khtml::endOfLine): (khtml::inSameLine): (khtml::isStartOfLine): (khtml::isEndOfLine): (khtml::previousLinePosition): (khtml::nextLinePosition): (khtml::previousSentencePosition): (khtml::nextSentencePosition): (khtml::previousParagraphPosition): (khtml::nextParagraphPosition): * khtml/editing/visible_units.h: * khtml/khtml_events.cpp: (khtml::MouseEvent::offset): * khtml/khtml_part.cpp: (KHTMLPart::isPointInsideSelection): (KHTMLPart::selectClosestWordFromMouseEvent): (KHTMLPart::handleMousePressEventTripleClick): (KHTMLPart::handleMousePressEventSingleClick): (KHTMLPart::handleMouseMoveEventSelection): (KHTMLPart::khtmlMouseReleaseEvent): * khtml/rendering/render_block.cpp: (khtml::RenderBlock::positionForCoordinates): * khtml/rendering/render_block.h: * khtml/rendering/render_br.cpp: (RenderBR::positionForCoordinates): * khtml/rendering/render_br.h: * khtml/rendering/render_container.cpp: (RenderContainer::positionForCoordinates): * khtml/rendering/render_container.h: * khtml/rendering/render_inline.cpp: (RenderInline::positionForCoordinates): * khtml/rendering/render_inline.h: * khtml/rendering/render_object.cpp: (RenderObject::caretRect): (RenderObject::positionForCoordinates): * khtml/rendering/render_object.h: * khtml/rendering/render_replaced.cpp: (RenderReplaced::positionForCoordinates): * khtml/rendering/render_replaced.h: * khtml/rendering/render_text.cpp: (RenderText::positionForCoordinates): * khtml/rendering/render_text.h: * khtml/xml/dom_position.cpp: (DOM::Position::previousCharacterPosition): (DOM::Position::nextCharacterPosition): (DOM::Position::leadingWhitespacePosition): (DOM::Position::trailingWhitespacePosition): * khtml/xml/dom_position.h: * kwq/KWQAccObject.mm: (-[KWQAccObject value]): (-[KWQAccObject accessibilityAttributeValue:]): (-[KWQAccObject doAXLineForTextMarker:]): (-[KWQAccObject doAXTextMarkerRangeForLine:]): (-[KWQAccObject doAXTextMarkerForPosition:]): (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]): * kwq/KWQKHTMLPart.mm: * kwq/WebCoreBridge.mm: (-[WebCoreBridge _visiblePositionForPoint:]): 05-02-07 Maciej Stachowiak Reviewed by Ken and John. Re-fixed a specific case of the following: REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type some text, worked fine. But hitting the second Cmd-B before the second Cmd-U still failed to remove underlining. The reason for this is that our code to compute the style of the current position did not work when you had a typing style and were positioned right at a
element. For various reasons, this did not show up for bold and italic, since those are handled through the font manager. The following change fixes this - for elements that can't have children, we add the dummy span after the element of interest, rather than as a child of it. * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): 2005-02-11 David Harrison Reviewed by Darin. Double Clicking on a line in Mail selected the entire body * khtml/editing/visible_units.cpp: (khtml::startOfWord): (khtml::endOfWord): Pay attention to being at the end of a paragraph. (khtml::previousLinePosition): (khtml::nextLinePosition): (khtml::endOfParagraph): Use DOWNSTREAM per recent affinity changes. 2005-02-11 Richard Williamson Fixed DOM objects not being marshaled on JS->native calls Re-factored how 'native' wrappers for JS objects are created. The interpreter now creates these wrappers. The WebCore subclass of the interpreter now overrides createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects. * WebCore.pbproj/project.pbxproj: * khtml/ecma/kjs_binding.cpp: (ScriptInterpreter::createLanguageInstanceForValue): * khtml/ecma/kjs_binding.h: * kwq/DOMUtility.mm: Added. (KJS::ScriptInterpreter::createObjcInstanceForValue): * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::getAppletInstanceForView): (getInstanceForView): (KWQKHTMLPart::getEmbedInstanceForView): (KWQKHTMLPart::getObjectInstanceForView): 2005-02-11 Chris Blumenberg Fixed: Quote level not maintained when copied and pasted within a Mail message Reviewed by harrison. * khtml/editing/markup.cpp: (khtml::isMailBlockquote): new (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes * khtml/rendering/render_block.cpp: (khtml::RenderBlock::positionForCoordinates): default to downstream for the affinity since the affinity is only upstream when the cursor is clicked to the right of a wrapped line * khtml/rendering/render_text.cpp: (RenderText::positionForCoordinates): ditto 2005-02-11 Adele Amchan Reviewed by Darin. fix for no need to add body element for xml documents In the fix for we decided to add a body element when closing a document to ensure that the onload handler would fire. This is unnecessary for xml documents, so now we also check to see if we're dealing with an html document before adding the body element. * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): 2005-02-11 Adele Amchan Reviewed by Darin. * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change. * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt: * layout-tests/apple-only/base/www.time.com/index-expected.txt: * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt: * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt: * layout-tests/fast/overflow/003-expected.txt: * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785) === Safari-186 === 2005-02-11 Darin Adler Reviewed by John. - fixed paths are relative to the old src URL after document.open, which is supposed to clear the document, including the URL * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart. * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a document, which is supposed to clear the document, including the URL. In the long run we might want to do even more document "resetting and clearing" in here, but this URL clearing is what's needed now to fix the most important problem. (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which is unnecessary and inappropriate in the one place we call this. * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open. 2005-02-10 Ken Kocienda Reviewed by Hyatt Fix for this bug: 8A374: Mail crash while pasting - RemoveNodeCommand * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in the document. We try to do a good job of detecting all these cases, and generally do. This one was missed. Fixed. 2005-02-10 Darin Adler Reviewed by Harrison. - added support needed to fix Format->Style->Underline menu item does not get checked when selected text is underlined * kwq/WebCoreBridge.h: Added selectionHasStyle: method. * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part. 2005-02-10 Darin Adler Reviewed by Harrison. - fixed cursor changes to I-beam when moving over text in widgets, even when selection off via CSS * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding whether to show an I-beam cursor. * khtml/rendering/render_object.h: Added canSelect. * khtml/rendering/render_object.cpp: (selectStartNode): Added. Helper function with the guts of shouldSelect. (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler. (RenderObject::shouldSelect): Refactored to use selectStartNode. * khtml/css/cssvalues.c: Regnerated with newer gperf. 2005-02-10 David Hyatt Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can set the .width and .height properties on the Image object. Reviewed by John Sullivan * khtml/ecma/kjs_html.cpp: (ImageConstructorImp::construct): (Image::getValueProperty): (Image::putValue): (Image::Image): * khtml/ecma/kjs_html.h: 2005-02-10 Ken Kocienda Reviewed by Chris Fix for this bug: Drag-n-drop within a rich text message sometimes changes the color of the dragged text This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging" or "smooshing" of styles during its operation. Since this new code is actively, rather than passively working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to preserve quote levels in Mail. * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::clear): New method. (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto. (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto. (DOM::operator==): Add operator for CSSProperty. * khtml/css/css_valueimpl.h: Declare new functions. * khtml/editing/htmlediting.cpp: (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself. (khtml::isStyleSpan): Check for ID_SPAN. (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before. (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style" check, but rather calls functions which do a similar check to that, and much more. (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles. (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node. (khtml::ReplacementFragment::removeNodePreservingChildren): New helper. (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for every node in the fragment. This information is used later after paste is done as a reference for testing what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the replacement code. (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are no longer needed after the call to computeStylesForNodes(), (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the command's ReplacementFragment. (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make styles come out right. (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It computes the styles that need to be added to each node inserted, comparing the style it gets from just being inserted into its correct destination with the computed "desired style" done in the ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles. * khtml/editing/htmlediting.h: Update declarations and member variables as needed. * khtml/editing/markup.cpp: (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it. (khtml::markup): Ditto. (khtml::createMarkup): Ditto. These test results are subtly better with this change. They no longer have an unneeded empty span. Visually the same as before. * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt * layout-tests/editing/style/remove-underline-expected.txt * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt New tests: * layout-tests/editing/style/smoosh-styles-001-expected.txt * layout-tests/editing/style/smoosh-styles-002-expected.txt * layout-tests/editing/style/smoosh-styles-001.html * layout-tests/editing/style/smoosh-styles-002.html 2005-02-10 Darin Adler Reviewed by Adele. - fixed WebHTMLView drops scroll wheel events when deltas are 0 * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only. For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the delta attributes return all 0 for newfangled scrolling events from the new trackpads. 2005-02-10 David Harrison Reviewed by Darin. REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't * khtml/css/cssvalues.c: (hash_val): (findValue): * khtml/editing/selection.cpp: (khtml::Selection::validate): Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH. 2005-02-10 David Harrison Reviewed by Darin. Double-click on first character selects wrong item * khtml/editing/selection.cpp: (khtml::Selection::validate): Honor the fact that clicking on a character positions the cursor on the left side of the character. 2005-02-10 David Hyatt Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging blocks we dirty them for layout up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild. Reviewed by mjs * khtml/rendering/render_block.cpp: (khtml::RenderBlock::removeChild): 2005-02-10 David Hyatt Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly. Reviewed by mjs * khtml/rendering/render_block.h: (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat): 2005-02-10 David Hyatt Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine an incorrect optimization I added to be less restrictive. Reviewed by mjs * khtml/rendering/render_block.cpp: (khtml::RenderBlock::layoutBlockChildren): 2005-02-08 Maciej Stachowiak Reviewed by Darin. pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow I fixed this by removing all event listeners for a document, it's children, and any disconnected nodes that used to be in the document at document detach time. Mozilla temporarily disables event listeners on such nodes, but re-enables them if you re-parant a node into a new document. However, in WebCore, you can't re-parent a node into another document, so there is no observable change in behavior. We have to do this to break the possible reference cycles between event listeners and the dom nodes they are attached to (e.g. via scope chain, as in this case). * khtml/xml/dom_docimpl.cpp: (DocumentImpl::detach): (DocumentImpl::removeAllEventListenersFromAllNodesx): (DocumentImpl::registerDisconnectedNodeWithEventListeners): (DocumentImpl::unregisterDisconnectedNodeWithEventListeners): (DocumentImpl::removeAllDisconnectedNodeEventListeners): * khtml/xml/dom_docimpl.h: * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::~NodeImpl): (NodeImpl::addEventListener): (NodeImpl::removeEventListener): (NodeImpl::removeAllEventListeners): (NodeImpl::removeHTMLEventListener): (NodeImpl::insertedIntoDocument): (NodeImpl::removedFromDocument): * khtml/xml/dom_nodeimpl.h: 2005-02-09 Chris Blumenberg Fixed: Sometimes 2 Windows Media Player plugin instances are loaded Reviewed by hyatt. * khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::attach): Set needWidgetUpdate to false before calling updateWidget because updateWidget may cause this method or another method (which also calls updateWidget) to be called. (HTMLObjectElementImpl::recalcStyle): ditto 2005-02-09 David Harrison Reviewed by Darin. Mail-689: Arrow key navigation in new message body stops working when a line ends with a bold word Added affinity to VisiblePosition. Changed Selection code to use affinity more. (Partial) editing/pasteboard/paste-text-007 is failing Changed ReplaceSelectionCommand to also pay attention to the top children of the incoming fragment, not just the very last node inserted, when deciding whether to insert a paragraph for the Apple interchange newline. * khtml/ecma/kjs_window.cpp: (SelectionFunc::tryCall): * khtml/editing/htmlediting.cpp: (khtml::EditCommandPtr::setStartingSelection): (khtml::EditCommandPtr::setEndingSelection): (khtml::EditCommand::setStartingSelection): (khtml::EditCommand::setEndingSelection): (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded): (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded): (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded): (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical): (khtml::ApplyStyleCommand::joinChildTextNodes): (khtml::DeleteSelectionCommand::initializePositionData): (khtml::DeleteSelectionCommand::handleGeneralDelete): (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): (khtml::DeleteSelectionCommand::doApply): (khtml::InsertLineBreakCommand::doApply): (khtml::InsertParagraphSeparatorCommand::doApply): (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): (khtml::InsertTextCommand::input): (khtml::MoveSelectionCommand::doApply): (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): (khtml::ReplaceSelectionCommand::doApply): (khtml::ReplaceSelectionCommand::completeHTMLReplacement): (khtml::ReplaceSelectionCommand::updateNodesInserted): (khtml::TypingCommand::deleteKeyPressed): (khtml::TypingCommand::forwardDeleteKeyPressed): (khtml::TypingCommand::markMisspellingsAfterTyping): * khtml/editing/htmlediting.h: * khtml/editing/selection.cpp: (khtml::Selection::Selection): (khtml::Selection::init): (khtml::Selection::moveTo): (khtml::Selection::modifyExtendingRightForward): (khtml::Selection::modifyMovingRightForward): (khtml::Selection::modifyExtendingLeftBackward): (khtml::Selection::modifyMovingLeftBackward): (khtml::Selection::modify): (khtml::Selection::xPosForVerticalArrowNavigation): (khtml::Selection::clear): (khtml::Selection::setBase): (khtml::Selection::setExtent): (khtml::Selection::setBaseAndExtent): (khtml::Selection::layout): (khtml::Selection::validate): * khtml/editing/selection.h: (khtml::Selection::startAffinity): (khtml::Selection::endAffinity): (khtml::Selection::baseAffinity): (khtml::Selection::extentAffinity): (khtml::operator==): * khtml/editing/text_affinity.h: (khtml::): * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition): (khtml::VisiblePosition::init): (khtml::VisiblePosition::initUpstream): (khtml::VisiblePosition::initDownstream): (khtml::VisiblePosition::next): (khtml::VisiblePosition::previous): (khtml::startVisiblePosition): (khtml::endVisiblePosition): * khtml/editing/visible_position.h: (khtml::VisiblePosition::): (khtml::VisiblePosition::VisiblePosition): (khtml::VisiblePosition::affinity): (khtml::VisiblePosition::setAffinity): (khtml::operator==): * khtml/editing/visible_units.cpp: (khtml::previousBoundary): (khtml::nextBoundary): (khtml::startOfLine): (khtml::endOfLine): (khtml::previousLinePosition): (khtml::nextLinePosition): (khtml::startOfParagraph): (khtml::endOfParagraph): (khtml::previousParagraphPosition): (khtml::nextParagraphPosition): (khtml::startOfBlock): (khtml::endOfBlock): (khtml::startOfDocument): (khtml::endOfDocument): * khtml/editing/visible_units.h: * khtml/khtml_part.cpp: (KHTMLPart::findTextNext): (KHTMLPart::selectClosestWordFromMouseEvent): (KHTMLPart::handleMousePressEventTripleClick): (KHTMLPart::handleMousePressEventSingleClick): (KHTMLPart::handleMouseMoveEventSelection): (KHTMLPart::khtmlMouseReleaseEvent): (KHTMLPart::selectAll): (KHTMLPart::computeAndSetTypingStyle): (KHTMLPart::selectionComputedStyle): * khtml/rendering/render_br.cpp: (RenderBR::positionForCoordinates): * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateSelection): * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::setFocus): * khtml/xml/dom_position.cpp: (DOM::Position::previousCharacterPosition): (DOM::Position::nextCharacterPosition): * khtml/xml/dom_position.h: * kwq/KWQAccObject.mm: (-[KWQAccObject value]): (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]): (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]): (-[KWQAccObject accessibilityAttributeValue:]): (-[KWQAccObject doAXLineForTextMarker:]): (-[KWQAccObject doAXTextMarkerRangeForLine:]): (-[KWQAccObject doAXTextMarkerForPosition:]): (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]): (-[KWQAccObject doSetAXSelectedTextMarkerRange:]): * kwq/KWQAccObjectCache.mm: (KWQAccObjectCache::textMarkerForVisiblePosition): (KWQAccObjectCache::visiblePositionForTextMarker): * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::findString): (KWQKHTMLPart::advanceToNextMisspelling): (KWQKHTMLPart::styleForSelectionStart): (KWQKHTMLPart::baseWritingDirectionForSelectionStart): (KWQKHTMLPart::setSelectionFromNone): (KWQKHTMLPart::respondToChangedSelection): * kwq/WebCoreBridge.mm: (-[WebCoreBridge setSelectedDOMRange:affinity:]): (-[WebCoreBridge selectionAffinity]): (-[WebCoreBridge setMarkDOMRange:]): (-[WebCoreBridge _visiblePositionForPoint:]): (-[WebCoreBridge moveDragCaretToPoint:]): (-[WebCoreBridge editableDOMRangeForPoint:]): (-[WebCoreBridge ensureSelectionVisible]): (-[WebCoreBridge rangeOfCharactersAroundCaret]): 2005-02-09 Chris Blumenberg Fixed: Seed: Mail: Drag-and-drop destination indicator / insertion point disappears Reviewed by kocienda. * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintCaret): new (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret * khtml/rendering/render_block.h: === Safari-185 === 2005-02-08 Ken Kocienda Reviewed by John Fix for this bug: Entire document content is deleted when only the first paragraph was supposed to be Problem stems from my attempt to fix this bug: Insertion point goes to beginning of doc after deleting. I added an "optimization" that proved to do more harm than good. So, basically, the fix is to remove code. * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::handleGeneralDelete) 2005-02-07 Darin Adler Reviewed by Kevin. - fixed REGRESSION (125-170, Panther-only): pasted textarea contents disappear (exception in NSText) * kwq/KWQTextArea.mm: (-[KWQTextArea tile]): Don't resize the text view immediately here. Use performWithDelay to defer it to avoid the re-entrancy that bothers the Panther version of NSTextView. On Tiger, leave the code alone. 2005-02-07 Adele Amchan Reviewed by Darin. Fix for REGRESSION (180-181): Logitelnet bank's website doesn't work This fixes an oversight in the fix for . We're now making sure there is a document before calling checkCompleted in slotLoaderRequestDone. That function is called even when other parts finish loads of their subresources, so we could end up calling checkCompleted before we had a document. We also looked over all the other calls to checkCompleted to convince ourselves no other call sites had a similar issue. * khtml/khtml_part.cpp: (KHTMLPart::slotLoaderRequestDone): Check if doc is nil before calling checkCompleted. 2005-02-07 Ken Kocienda Reviewed by Darin Fix for this bug: Replacing quoted text ends up with blue-colored text that is not quoted * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply): Removed special case delete code for select all. It was causing as many bugs as it fixed. What's more, the design concept is a bit shaky. By removing this special case, the bug goes away. * khtml/editing/htmlediting.h: Remove declaration. Test results using selectAll() updated to reflect changed behavior. * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: * layout-tests/editing/deleting/delete-select-all-001-expected.txt: * layout-tests/editing/deleting/delete-select-all-003-expected.txt: * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: * layout-tests/editing/inserting/insert-3775316-fix-expected.txt: * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: * layout-tests/editing/pasteboard/paste-text-015-expected.txt: 2005-02-06 Darin Adler Reviewed by Ken. - fixed setting a new style attribute with setAttribute("style") doesn't blow away the old style * khtml/css/css_valueimpl.h: Renamed parseProperty to parseDeclaration, since it's used to parse an entire style declaration, not a single property. * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::parseDeclaration): Renamed, and added code to clear m_values. * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Call function by its new name, and remove some unnecessary comments. 2005-02-06 Darin Adler Reviewed by Maciej. - fixed need oncut and onpaste handlers implemented for