=== WebCore-415.5 ===

2005-05-07  Adele Peterson  <adele@apple.com>

        Merged fix for <rdar://problem/4110366> from TOT for SUTiAtlanta

    2005-05-07  David Harrison  <harrison@apple.com>

        Reviewed by John.

        <rdar://problem/4110366> 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  <adele@apple.com>

    Merging fix for <rdar://problem/4109564> from TOT for SUTiAtlanta.

    2005-05-05  Darin Adler  <darin@apple.com>

        Reviewed by Dave Hyatt.

        - fixed <rdar://problem/4109564> 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  <cpetersen@apple.com>

        Reviewed by Adele. Merging changes for SUTiAtlanta.

    2005-04-29  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4083333> 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  <vicki@apple.com>

	- 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  <darin@apple.com>

        Reviewed by me, fix by Kida-san.

        - fixed <rdar://problem/4067474> 8A424: Safari immediately quit by Cmd+Ctrll+'D'

        * kwq/WebCoreBridge.mm: (-[WebCoreBridge convertToNSRange:DOM::]):
        Added nil check.

2005-04-27  Adele Peterson  <adele@apple.com>

        Merging John's fix for alt/shift bug in <rdar://problem/3655817> fix from TOT.

    2005-04-27  John Sullivan  <sullivan@apple.com>

        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  <cpetersen@apple.com>

        Removed fix for 4032346 and merged new fix as described in 4097842.

      2005-04-18  David Hyatt  <hyatt@apple.com>

        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  <hyatt@apple.com>

	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  <cpetersen@apple.com>

	Merged for 3655817 from TOT

	Reviewed by Adele.

   2005-04-26  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3655817> 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  <cpetersen@apple.com>
	
	Merging fix for <rdar://problem/4075576> from TOT 

	Reviewed by Adele.

    2005-04-26  David Harrison  <harrison@apple.com>

        Reviewed by Darin, Maciej.

        <rdar://problem/4075576> 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 <rdar://problem/4099839> 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  <cpetersen@apple.com>
	
	Merging fix for <rdar://problem/4069161> from TOT 

	Reviewed by Adele.

    2005-03-28  David Harrison  <harrison@apple.com>

        Reviewed by Darin.
        
        <rdar://problem/4069161> 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   <rjw@apple.com>

	Fixed <rdar://problem/4052683> 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   <darin@apple.com>

	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   <rjw@apple.com>

	Fixed <rdar://problem/4053515> 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  <kdecker@apple.com>

        Reviewed by Vicki.

	Fixed <rdar://problem/4062336> REGRESSION (406-407): HTML submenus not working at hrweb.apple.com after going back

	Rolled out the fix for <rdar://problem/4041374> 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 <script> tag, which is evaluated and executed at page load time, this becomes a problem since we don't reevaluate a page's <script> that is in the back/forward cache.  Thus once you leave the page, the listeners are gone for good.  This is the problem.

        * khtml/khtml_part.cpp:
        (KHTMLPart::closeURL):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::detach): 

=== Safari-410 ===

2005-03-22  Vicki Murley  <vicki@apple.com>

        - roll the fix for <rdar://problem/4060266> back in, since its 
	now approved by CCC

        * khtml/editing/visible_text.cpp:
        (khtml::TextIterator::handleTextBox):

2005-03-22  Vicki Murley  <vicki@apple.com>

	- roll out the fix for <rdar://problem/4060266> since it was denied by CCC

        * khtml/editing/visible_text.cpp:
        (khtml::TextIterator::handleTextBox):

2005-03-22  David Harrison  <harrison@apple.com>

        Reviewed by Darin.
        
        <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)

        * khtml/editing/visible_text.cpp:
        (khtml::TextIterator::handleTextBox):
        Complete the check of whether to emit space for collapsed space.

2005-03-22  David Harrison  <harrison@apple.com>

        Reviewed by John.
        
        <rdar://problem/4061443> REGRESSION (8A420-8A421): Pasting in the Stickies widget is broken again

        * khtml/editing/htmlediting.cpp:
        (khtml::positionBeforeContainingSpecialElement):
        (khtml::positionAfterContainingSpecialElement):
        Return unchanged Position rather than a null or non-editable one.

=== Safari-409 ===

2005-03-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        I made an error in this test earlier. It was not testing what I intended. Fixed.

        * layout-tests/editing/unsupported-content/list-delete-001-expected.txt
        * layout-tests/editing/unsupported-content/list-delete-001.html
        
        New tests:

        * layout-tests/editing/unsupported-content/table-delete-001-expected.txt: Added.
        * layout-tests/editing/unsupported-content/table-delete-001.html: Added.
        * layout-tests/editing/unsupported-content/table-delete-002-expected.txt: Added.
        * layout-tests/editing/unsupported-content/table-delete-002.html: Added.
        * layout-tests/editing/unsupported-content/table-delete-003-expected.txt: Added.
        * layout-tests/editing/unsupported-content/table-delete-003.html: Added.
        * layout-tests/editing/unsupported-content/table-type-after-expected.txt: Added.
        * layout-tests/editing/unsupported-content/table-type-after.html: Added.
        * layout-tests/editing/unsupported-content/table-type-before-expected.txt: Added.
        * layout-tests/editing/unsupported-content/table-type-before.html: Added.

2005-03-20  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3923903> REGRESSION (164-165): Repro Safari crash in khtml::RenderLayer::scrollToOffset

        * khtml/rendering/render_layer.cpp: (RenderLayer::scrollToOffset): Check canvas for nil.

2005-03-20  David Harrison  <harrison@apple.com>

        Reviewed by Darin.
        
        <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)

        SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
        when checking whether moving back across block boundaries

        VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition

        All editing tests pass.

        * khtml/editing/visible_text.cpp:
        (khtml::SimplifiedBackwardsTextIterator::advance):
        * khtml/editing/visible_units.cpp:
        (khtml::previousBoundary):

2005-03-20  Darin Adler  <darin@apple.com>

        Reviewed by Harrison.

        - fixed <rdar://problem/4059914> when you select all of a frame's content, need to select the frame in the parent document so it can be easily deleted

        * khtml/khtml_part.h: Added selectFrameElementInParentIfFullySelected.
        * khtml/khtml_part.cpp:
        (isFrame): Added.
        (KHTMLPart::setFocusNodeIfNeeded): Changed to not set focus to a frame; was not what this function was
        intended to do, and caused trouble when trying to select a frame element.
        (KHTMLPart::khtmlMouseReleaseEvent): Call selectFrameElementInParentIfFullySelected.
        (KHTMLPart::selectAll): Call selectFrameElementInParentIfFullySelected.
        (KHTMLPart::selectFrameElementInParentIfFullySelected): Added. Selects the frame element in the parent
        if a frame is entirely selected, which makes it easier to delete or replace the frame and is consistent
        with the changes Maciej made recently for other elements.

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Call selectFrameElementInParentIfFullySelected.
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Call selectFrameElementInParentIfFullySelected.

2005-03-20  Darin Adler  <darin@apple.com>

        Reviewed by me, code change by Ken.

        - fixed <rdar://problem/4059852> Deleting from first element of list makes content jump to wrong place

        * khtml/editing/htmlediting.cpp:
        (khtml::isListStructureNode): Added.
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Check for list nodes as well as table nodes.

2005-03-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me
        
        Added tests to cover new "unsupported content" editing code.

        * layout-tests/editing/unsupported-content/list-delete-001-expected.txt: Added.
        * layout-tests/editing/unsupported-content/list-delete-001.html: Added.
        * layout-tests/editing/unsupported-content/list-delete-002-expected.txt: Added.
        * layout-tests/editing/unsupported-content/list-delete-002.html: Added.
        * layout-tests/editing/unsupported-content/list-delete-003-expected.txt: Added.
        * layout-tests/editing/unsupported-content/list-delete-003.html: Added.
        * layout-tests/editing/unsupported-content/list-type-after-expected.txt: Added.
        * layout-tests/editing/unsupported-content/list-type-after.html: Added.
        * layout-tests/editing/unsupported-content/list-type-before-expected.txt: Added.
        * layout-tests/editing/unsupported-content/list-type-before.html: Added.

2005-03-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej
        
        Fix for this bug:
        
        <rdar://problem/4059578> Entire list deleted, and caret disappears, when delete key hit at end of list

        The problem is that a new case in the delete code did not consider when the
        downstream end node of the selection might be an ancestor of the upstream start
        node. That is the case in this bug. The downstream end is the body element, and
        this line of code would delete all the children of the downstream end:
            removeChildrenInRangePreservingPosition(m_downstreamEnd.node(), 0, 
                m_downstreamEnd.offset(), m_upstreamStart);

        The fix is to check for this "is ancestor" case, and do some tree logic to find
        the right offset of the downstream end node for the call to
        removeChildrenInRangePreservingPosition().

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleGeneralDelete): Fixed as described.

2005-03-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

        Fix for this bug:
       
        <rdar://problem/4059384> Cannot place insertion point correctly in editable text that avoids floating elements

        Note: I strongly suspect this bug blocks a complete solution to this other Tiger/P2:
        <rdar://problem/4055748> AX: Dictionary pop-up panel shows at wrong place on specific parts of particular pages

        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect): Change the y-coordinate used to calculate the available width for a line. Height is wrong.
        Top of the box containing the text where the click is done is correct. Also, add in the x-offset for the start
        of the text box when calculating the available width. If this text box is avoiding a float at the y-coordinate
        for the relevant box, failure to add in the amount of float-avoidance will make the text at the coordinates
        greater than end-of-line minus float-avoidance ineligible for caret placement.

2005-03-19  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/4057594> REGRESSION (125-406): Unrepro crash in HTMLTokenizer::allDataProcessed after hitting Back button

        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::allDataProcessed):
        To get the part safely after calling end, save a guarded pointer to the view.
        The old way could end trying to call a virtual function a part that was destroyed.

2005-03-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/4053506> Pasting Tables and Cells in Mail does not allow editing before or after
	<rdar://problem/4005954> REGRESSION (Mail): After copy/paste of content containing list element cannot go back to entering text at left side of page
	
        * khtml/editing/htmlediting.cpp:
        (khtml::maxDeepOffset):
        (khtml::CompositeEditCommand::removeFullySelectedNodePreservingPosition):
        (khtml::CompositeEditCommand::removeChildrenInRangePreservingPosition):
        (khtml::CompositeEditCommand::removeNodePreservingPosition):
        (khtml::CompositeEditCommand::insertBlockPlaceholder):
        (khtml::CompositeEditCommand::appendBlockPlaceholder):
        (khtml::CompositeEditCommand::forceBlockPlaceholder):
        (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
        (khtml::isSpecialElement):
        (khtml::isFirstVisiblePositionInSpecialElementInFragment):
        (khtml::positionBeforePossibleContainingSpecialElement):
        (khtml::positionAfterPossibleContainingSpecialElement):
        (khtml::ApplyStyleCommand::applyInlineStyle):
        (khtml::DeleteSelectionCommand::initializePositionData):
        (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
        (khtml::DeleteSelectionCommand::handleGeneralDelete):
        (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
        (khtml::DeleteSelectionCommand::doApply):
        (khtml::InsertParagraphSeparatorCommand::doApply):
        (khtml::ReplacementFragment::ReplacementFragment):
        (khtml::ReplaceSelectionCommand::doApply):
        * khtml/editing/htmlediting.h:
        * khtml/editing/visible_position.cpp:
        (khtml::isRenderedBR):
        (khtml::VisiblePosition::initDownstream):
        (khtml::isLastVisiblePositionInBlock):
        * khtml/rendering/render_line.cpp:
        (khtml::RootInlineBox::closestLeafChildForXPos):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::isBlockFlowOrTable):
        (NodeImpl::isEditableBlock):
        (NodeImpl::enclosingBlockFlowOrTableElement):
        * khtml/xml/dom_nodeimpl.h:
        * khtml/xml/dom_position.cpp:
        (DOM::Position::upstream):
        (DOM::Position::downstream):
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt:
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-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-3786362-fix-expected.txt:

2005-03-19  John Sullivan  <sullivan@apple.com>

        Reviewed by Darin.
        
        - fixed <rdar://problem/4058740> Crash (nil-deref) editing Mail reply 
        message in KWQKHTMLPart::fontForSelection (MailViewer-723)

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection):
        Add nil check to loop. It shouldn't be necessary, but this crash trace seems to be
        running into it. We're not completely certain, but the check is harmless at worst.

=== Safari-408 ===

2005-03-18  David Harrison  <harrison@apple.com>

        Reviewed by Darin.
        
        <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch
        
        Also changed WebKit.

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject rendererForView:]):
        New to cover both the WebCore and WebKit NSViews.
        
        (-[KWQAccObject _accessibilityParentForSubview:]):
        Use rendererForView.
        
        * kwq/WebCoreFrameView.h:
        Add WebCoreBridgeHolder protocol to get access to WebKit NSViews.

2005-03-18  David Harrison  <harrison@apple.com>

        Reviewed by Darin, Ken.

        <rdar://problem/3735625> AX: add AXPress action if an element has an onclick handler

        * khtml/dom/html_form.cpp:
        (HTMLInputElement::click):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::click):
        (HTMLElementImpl::accessKeyAction):
        * khtml/html/html_elementimpl.h:
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::submitClick):
        (DOM::HTMLButtonElementImpl::click):
        (DOM::HTMLButtonElementImpl::accessKeyAction):
        (DOM::HTMLInputElementImpl::click):
        (DOM::HTMLInputElementImpl::accessKeyAction):
        (DOM::HTMLInputElementImpl::defaultEventHandler):
        (DOM::HTMLLabelElementImpl::accessKeyAction):
        (DOM::HTMLSelectElementImpl::accessKeyAction):
        (DOM::HTMLTextAreaElementImpl::accessKeyAction):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::defaultEventHandler):
        (HTMLAnchorElementImpl::accessKeyAction):
        * khtml/html/html_inlineimpl.h:
        * khtml/rendering/render_form.cpp:
        (RenderFileButton::click):
        * khtml/rendering/render_form.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::defaultEventHandler):
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::accessKeyAction):
        * kwq/DOMHTML.mm:
        (-[DOMHTMLInputElement click]):
        * kwq/KWQButton.h:
        * kwq/KWQButton.mm:
        (QButton::click):
        * kwq/KWQFileButton.h:
        * kwq/KWQFileButton.mm:
        (KWQFileButton::click):
        
        Add accessKeyAction parameter about whether to limit to HTMLElementImpl subclasses that JavaScript wants, or to apply to others as well.
        
        Add click() parameter about whether to send the mousedown and mouseup events in addition to the click event.
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject mouseButtonListener]):
        Locate a mousedown, mouseup, or click handler in the current element and its ancestors.
        
        (-[KWQAccObject actionElement]):
        (-[KWQAccObject accessibilityIsIgnored]):
        (-[KWQAccObject accessibilityPerformAction:]):
        Consider mouseButtonListener.

2005-03-18  John Sullivan  <sullivan@apple.com>

        Reviewed by Darin.
        
        - fixed <rdar://problem/4002164> maps that include start and end 
        location don't print right from maps.google.com

	I thought I checked this in yesterday but a ChangeLog conflict aborted my checkin
	without me noticing.

        * khtml/rendering/render_style.cpp:
        (RenderStyle::diff):
        flag name changed from _should_correct_text_color to _force_backgrounds_to_white
        
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::InheritedFlags::operator==):
        flag name changed from _should_correct_text_color to _force_backgrounds_to_white
        (khtml::RenderStyle::setBitDefaults):
        ditto
        (khtml::RenderStyle::forceBackgroundsToWhite):
        ditto, and method name changed too
        (khtml::RenderStyle::setForceBackgroundsToWhite):
        ditto
        
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paint):
        updated for name change; also, compare text against white instead of current bg color
        because we no longer actually modify the bg color (previously we would always set
        the bg color to white, so the result is the same)
        
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::recalcStyle):
        updated for name change
        
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge styleSheetForPrinting]):
        removed this method
        (-[WebCoreBridge reapplyStylesForDeviceType:]):
        removed the code that called styleSheetForPrinting; we no longer use a stylesheet
        for this behavior.

        * khtml/rendering/render_box.cpp:
        (RenderBox::paintBackgroundExtended):
        If forceBackgroundsToWhite flag is set, convert background images and
        background colors to white background color with no background image.
        
2005-03-18  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4056718> Pasting quotes the entire message

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): After pasting, nodes are moved to the block containing
        the end of the pasted content in certain cases. This move logic used to stop once it moved all the
        siblings of the node following the last node of the pasted-in content. This means that block elements
        could get moved, and if the pasted-in content included a mail blockquote, this could result in
        one quote level getting added. The fix is to stop the move of nodes once a <br>, block element, or
        <table> is seen. This only affected one of the many test cases we have for such scenarios, and 
        the change to that result makes sense given the code change.
        * layout-tests/editing/pasteboard/paste-text-003-expected.txt: This test result changed in a way that
        adequately tests the behavior change, so I did not add a new test.

2005-03-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Fix for this bug:
        
        <rdar://problem/4051809> 8A413: Cursor-up in a mail message sometimes gets stuck (with specific reproducible case)

        * khtml/rendering/render_text.cpp:
        (RenderText::positionForCoordinates): Consider two lines: line-above and line-below. If the caret position in line-below
        was at an x coordinate between half way through the x coordinate of the last character on the line-above and the
        end of that same character, this bug would happen since the positioning code would assume that it could create a 
        VisiblePosition with a DOWNSTREAM affinity. Now, I check to see if the character position on the line-above is the 
        last character on that line, and if it is, I use UPSTREAM as the affinity.

=== Safari-407 ===

2005-03-17  David Harrison  <harrison@apple.com>

        Reviewed by Darin, Ken.

        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommandPtr::setEndingSelection):
        Fixed typo so that it calls setEndingSelection rather than setStartingSelection.
        Commented out this unused method, tho, since this is late in Tiger.  Proved unused by successful build after temporarily removing method declaration or implemenation.

2005-03-16  Kevin Decker  <kdecker@apple.com>

        Reviewed by mjs.

	Fixed <rdar://problem/4046665> REGRESSION (403-405): mypage.apple.com login does not work (hits assertion in Development build)

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Check always came back false when callers would send a nil NSURL to this method. Now we allow the empty url cases, eg., <frame src="">

2005-03-16  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/4045203> REGRESSION (125-188): Redundant JS imports crash Safari

        * khtml/html/htmltokenizer.h: Take inWRite bool out of NDEBUG ifdef.
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::HTMLTokenizer): Take inWrite bool management code out of NDEBUG ifdef.
        (khtml::HTMLTokenizer::write): Ditto. Don't call end if inWrite is true, since it will be called
        when you return to the body of the outer write() call.
        (khtml::HTMLTokenizer::allDataProcessed): Don't call end() if inWrite is true for the same reason.
        (khtml::HTMLTokenizer::finish): Ditto.

        * kwq/KWQWidget.mm: (QWidget::getOuterView): Removed bogus assertion that has been vexing us of late.

2005-03-16  David Harrison  <harrison@apple.com>

        Reviewed by me (written by Patti Yeh).

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
        Use LeftWordIfOnBoundary instead of RightWordIfOnBoundary.

        (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
        Use RightWordIfOnBoundary instead of LeftWordIfOnBoundary.

2005-03-16  David Harrison  <harrison@apple.com>

        Reviewed by Maciej.

        <rdar://problem/4054590> AX: Dictionary panel does not work when page is scrolled on Safari

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXTextMarkerForPosition:]):
        Add in the view's contentsX and contentsY to the point.

2005-03-16  David Harrison  <harrison@apple.com>

        Reviewed by Maciej.

        <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements
        
        Also changed WebKit.
        
        * khtml/editing/visible_units.h:
        * khtml/editing/visible_units.cpp:
        (khtml::startOfEditableContent):
        (khtml::endOfEditableContent):
        (khtml::inSameEditableContent):
        (khtml::isStartOfEditableContent):
        (khtml::isEndOfEditableContent):
        New.
        
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge canDeleteRange:]):
        New.

2005-03-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/4042935> undo doesn't work properly during inline input

        * kwq/WebCoreBridge.h: Declare new method below.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge replaceMarkedTextWithText:]): New method. Wraps calls to TypingCommand::deleteKeyPressed and
        TypingCommand::insertText to map the way that international text input works onto the typing undo system.

2005-03-16  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4044336> REGRESSION (8A398-8A409): Option-Delete also deletes space to left of deleted word

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData):
        - skip smart delete if the selection to delete already starts or ends with whitespace
        
        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventDoubleClick):
        - preserve selection on double-click when range is already selected
        
        * khtml/xml/dom_position.cpp:
        (DOM::Position::leadingWhitespacePosition):
        (DOM::Position::trailingWhitespacePosition):
        - fix considerNonCollapsibleWhitespace action (logic was reversed)
        - add non-breaking space to the non-collapsable ones
        
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
        (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
        - these methods do not set the selection, so remove calls to setSelectionGranularity
          
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:]):
        - set the granularity back to character
        - the one exception is that we need to keep word granularity
          to preserve smart delete behavior when extending by word

2005-03-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/4053266> Pressing return a few times right after a link makes the new blank lines part of the link
	
        * khtml/editing/htmlediting.cpp:
	(khtml::InsertLineBreakCommand::doApply): Use
	positionOutsideContainingSpecialElement in the right two places.
        (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.

	- move all these helper functions higher in the file
	
        * khtml/editing/htmlediting.cpp:
        (khtml::isSpecialElement):
        (khtml::isFirstVisiblePositionInSpecialElement):
        (khtml::positionBeforeNode):
        (khtml::positionBeforeContainingSpecialElement):
        (khtml::maxRangeOffset):
        (khtml::isLastVisiblePositionInSpecialElement):
        (khtml::positionAfterNode):
        (khtml::positionAfterContainingSpecialElement):
        (khtml::positionOutsideContainingSpecialElement):

2005-03-14  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/4049925> Pasting right after a link makes pasted content part of the link (without visible style change)
        
        * khtml/editing/htmlediting.cpp:
        (khtml::positionOutsideContainingSpecialElement): made a helper
	function that computes a position outside the outermost containing
	special element if the passed in position is right at the start or
	end of it
        (khtml::InsertTextCommand::prepareForTextInsertion): use new helper here
        (khtml::ReplaceSelectionCommand::doApply): use it here too: this is the fix
        (khtml::positionBeforeNode): made static
        (khtml::positionBeforeContainingSpecialElement): made static
        (khtml::positionAfterNode): made static
        (khtml::positionAfterContainingSpecialElement): made static

2005-03-15  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4053658> Crash getting direction at maps.google.com

	Add non nil style() check.

        Reviewed by Dave Harrison.

        * khtml/rendering/render_table.cpp:
        (RenderTableCell::collapsedRightBorder):

2005-03-15  Kevin Decker  <kdecker@apple.com>

        Reviewed by John
	
	Fixed: <rdar://problem/4041374> REGRESSION (185-186): unload handlers (at least those added with addEventListener) are broken

	The reason why UNLOAD_EVENT wouldn't dispatch was because the code would delete all event listeners at the detach() phase which is prior to closeURL(). 

	This fixes a recent regression from:

 <rdar://problem/3977973> pages on ebay leak referenced JavaScript objects -- over time browsing becomes super-slow

        * khtml/khtml_part.cpp:
        (KHTMLPart::closeURL): After dispatching event handlers, go ahead and remove them from the DOM. 
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::detach): Took out the call to removeAllEventListenersFromAllNodes(). If we remove all event listeners here then when KHTMLPart::closeURL() checks for even listeners, it will never have any because they'll already be gone. 

2005-03-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki

        Fox for this bug:
        
        <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing

        Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing
        keystrokes grouped together in a single undo operation. A change on 27 Jan in WebKit to change the way delete
        keystrokes are handled made this feature regress. Previous to that change, the backwards delete
        key went through separate code that is no longer in the tree that did not set the selection in the way
        it is done now.
        
        The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method:
        -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the 
        selection will act to close typing or not.

        * kwq/WebCoreBridge.h: Changed header accordingly to change method shown below.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Added closeTyping argument to this method.

2005-03-15  John Sullivan  <sullivan@apple.com>

        Reviewed by Vicki.
        
        - fixed <rdar://problem/4052246> crash in KWQKHTMLPart::createPart() trying to display local file in frame

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::createPart):
        Check part for nil before trying to ref. This was probably a longstanding code flaw revealed by
        the recent security fix.

2005-03-15  Kevin Decker  <kdecker@apple.com>

        Reviewed by Ken and Maciej.

	New fix for <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
	
	The tokenizer has buffers which mean parsing can continue even after loading is supposed to be stopped. If the loading process was aborted, the tokenizer should abort, too.

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::HTMLTokenizer): Initialize loadStopped to false.
        (khtml::HTMLTokenizer::write): Go ahead and bail out if loadStopped is true. 
        (khtml::HTMLTokenizer::processToken):
        * khtml/html/htmltokenizer.h: Added loadStopped flag. Changed the view pointer from a standard pointer to a QGuardedPtr.  This fixes the crash.  Now the tokenizer's handle to the view will now automatically nil-out and never dangle.
        * khtml/khtml_part.cpp:
        (KHTMLPart::closeURL): Notify the tokenizer to stop parsing. 
        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::XMLTokenizer): Initialize loadStopped to false.
        * khtml/xml/xml_tokenizer.h:
        (khtml::Tokenizer::stopParsing): Added. 

2005-03-14  David Harrison  <harrison@apple.com>

        Reviewed by Darin, Maciej.

        <rdar://problem/4046103> REGRESSION (Mail): clicking after style change sets insertion point incorrectly
        
        Also fixes crash by adding nil check.

        * khtml/editing/htmlediting.cpp:
        (khtml::MoveSelectionCommand::doApply):
        Check the node for nil.
        
        * khtml/khtml_part.cpp:
        (KHTMLPart::khtmlMouseReleaseEvent):
        Use the node from the event rather than from the selection.

2005-03-14  Darin Adler  <darin@apple.com>

        Reviewed by Harrison.

        - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl): Set markers list to be "auto-delete" so they don't all leak.
        (DocumentImpl::removeMarker): Remove markers list for a node when the last marker is removed
        for that node. Otherwise, we can have empty marker lists for each node forever until the
        document goes away.
        (DocumentImpl::removeAllMarkers): Added code to dirty the markers.
        (DocumentImpl::shiftMarkers): Remove unneeded empty check.

        * kwq/WebCoreBridge.h: Added unmarkAllMisspellings for WebKit.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge unmarkAllMisspellings]): Added. Calls removeAllMarkers.

2005-03-14  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4027928> Tiger_8A394:Acrobat crashes while tried to remove the subscription errors by clicking on "Would you like to remove the subscription" from Tracker details view pane

	A document may be deleted as a consequence of handling an event,
	as was the case with Acrobat.app.  Ensure that the document is still valid
	before passing the event on for further handling.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchUIEvent):

2005-03-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        Added a couple of comments about setChanged() to this code based on my experiences with 4047028.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties)
        (DOM::CSSMutableStyleDeclarationImpl::merge)

2005-03-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4047028> Changing quote levels on stylized text causes it to be sent as colored (Blue). Tiger8A410

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): This function now calls setChanged() at the 
        end of its loop if any properties were removed. This makes the style system update correctly in response
        to changes made by this function. The code to paste removes style from the pasted content in a 
        preliminary step, and the fact that the style system did not update properly left unwanted color
        declarations in the document.

2005-03-14  Vicki Murley  <vicki@apple.com>

	- roll out this change for now, since it was denied by CCC

    2005-03-11  David Harrison  <harrison@apple.com>
        
        Reviewed by Darin.
        
        <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::advanceToNextMisspelling):
        (KWQKHTMLPart::markMisspellings):
        Nil check checker.

2005-03-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4050403> Mail crashes after pasting and deleting the content of one Excel cell

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleGeneralDelete): Add some null checks to the code. This fixes the crash, although
        following the steps described in the bug by John Sullivan on 3/14/05 at 10:49 AM will leave us with a "blank line" in 
        the document that cannot be removed (this is actually an empty table). This is undesirable, however, work Maciej is
        doing to fix the general-case problem of trying to edit constructs we do not handle well in editing should fix this
        particular case, making the deletion of this "blank line" possible. Maciej is doing this work as part of this bug:
        <rdar://problem/4036051> Hard to select (and thus delete) an IFRAME in an editable WebView

2005-03-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/4029632> Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari
        
        The problem is that removeInlineStyle() can remove nodes, and if either the start or end node of the
        selection at the time of the call to removeInlineStyle() was in a node that got removed, bad things
        would happen. The fix is described below.

        * khtml/editing/htmlediting.cpp:
        (khtml::maxRangeOffset): Moved this static function to a different place in the file so the code below can use it.
        (khtml::ApplyStyleCommand::applyInlineStyle): Calling removeInlineStyle() now has the side effect of 
        setting the command's ending selection. Now resets start and end using the ending selection after the call to
        removeInlineStyle() as it is done elsewhere in this function.
        (khtml::ApplyStyleCommand::removeInlineStyle): Track the removal of the start or end node based on
        the positions passed in. If either the start or the end node is removed as part of style removal, 
        set an appropriate replacement start or end that is still in the document.

=== Safari-406 ===

2005-03-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        I need to roll out Kevin's change to fix 3667701. It breaks contextual fragments, and hence breaks
        paste in editing (among other things).

        * khtml/html/htmltokenizer.cpp: Roll out recent change.
        (khtml::HTMLTokenizer::write) 
        * khtml/html/htmltokenizer.h: Ditto.

2005-03-13  Darin Adler  <darin@apple.com>

        Reviewed by Ken and Maciej.

        - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)

        * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
        documents the same privileges to open local files that "file:" documents have.

2005-03-13  Kevin Decker  <kdecker@apple.com>

        Reviewed by mjs.
        
        Fixed: <rdar://problem/3667701> crash in KHTMLPart::jScriptEnabled()
        
        The problem here was that the tokenizer would continue to receive chunks of data from the loader already
        after the view and part had been destroyed.  Situations like this could arise when clicking on another link 
        while still loading the current view, or during self test where we rapidly open, load, and close browser
        windows very fast. 

        * khtml/html/htmltokenizer.cpp: 
        (khtml::HTMLTokenizer::write): Simple nil check against the view. 
        * khtml/html/htmltokenizer.h: Changed the view pointer from a standard pointer to a QGuardedPtr.  The tokenizer's
        handle to the view will now automatically nil-out and never dangle.

2005-03-13  Darin Adler  <darin@apple.com>

        Reviewed by John and Ken.

        - fixed <rdar://problem/4044347> REGRESSION (Mail): Control-K in particular message moves insertion point to previous line

        Tweaked the deleting code, and added three new deleting layout tests to confirm the new code works.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed special case with comment that said it was
        for the case where a "selection contains only a BR right after a block ended". This code was being triggered in
        more cases than just that one, and in all the cases I tested, the general delete code works fine.
        (khtml::DeleteSelectionCommand::handleGeneralDelete): Changed the code that decides whether to delete an entire
        block to understand the case where the end block is outside the start block, but contains the start block.
        In that case, we want to delete the entire block. Not deleting the block was causing us to delete just the <br>,
        and not the enclosing <div> in the case in the bug.

        * layout-tests/editing/deleting/delete-line-015-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-015.html: Added.
        * layout-tests/editing/deleting/delete-line-016-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-016.html: Added.
        * layout-tests/editing/deleting/delete-line-017-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-017.html: Added.
        * layout-tests/editing/style/smoosh-styles-002-expected.txt: Updated to improved results. With the code change, the deletion
        now deletes more than it used to. The old results had an empty text node and <h1> element that were both 0-sized, and now
        we delete both of those.

2005-03-13  Darin Adler  <darin@apple.com>

        - fixed <rdar://problem/4049172> REGRESSION (403-405): Gmail: text box in "Invite a friend" section overlaps other sections

        Rolled out fix for <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail

        * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth): Back to previous version of this file.

2005-03-12  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Adele.

	<rdar://problem/4046144> RSS pages leave a hole in local file security policy (need to revert feed: exemption)
        
	* kwq/WebCoreBridge.mm:
        (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Revert
	emergency workaround for Safari RSS, now that a new Syndication
	has been submitted.

2005-03-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/4026787> text typed after a link (pasted or Mail Link to this Page) is part of the link, underlined and colored blue
        
	The concept of this change is every time you type at the very
	start or very end of a link (even if nested in further inner
	elements), the typed text goes outside the link instead of inside.
	
	* khtml/editing/htmlediting.cpp:
        (khtml::InsertTextCommand::prepareForTextInsertion): Check whether
	we are at the first visible position or last visible position of a
	special element. For now this only includes HTML A elements that
	are links (i.e. they have an href).
	(khtml::isSpecialElement): Helper function that identifies special
	elements (for now only links).
        (khtml::isFirstVisiblePositionInSpecialElement): Checks if a given DOM
	position is equivalent to the first visible position in some containing 
	editable special element.
        (khtml::positionBeforeNode): Returns the DOM position immediately
	before a node.
        (khtml::positionBeforeContainingSpecialElement): Gives a DOM
	position immediately before the outermost editable containing
	special element where the passed-in position is equivalent to the
	first visible position.
        (khtml::maxRangeOffset): Helper to get the maximum allowed
	range/position offset for a node, does the right thing based on
	whether the node would use a character offset or child offset.
        (khtml::isLastVisiblePositionInSpecialElement): Similar to above,
	but for end of node instead of start.
        (khtml::positionAfterNode): Ditto.
        (khtml::positionAfterContainingSpecialElement): Ditto.

	Some layout tests changed - I looked over all the diffs and found
	that the only changes were "junk nodes" like empty spans and text
	nodes moving from one spot in the tree to another. These changes
	are all harmless and do not affect layout or future editing.

        * layout-tests/editing/inserting/typing-003-expected.txt:
        * 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:
        * layout-tests/editing/style/remove-underline-expected.txt:
        * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt:
        * layout-tests/editing/style/remove-underline-in-bold-expected.txt:
        * layout-tests/editing/style/typing-style-003-expected.txt:
        * layout-tests/editing/style/unbold-in-bold-expected.txt:
        * layout-tests/editing/style/underline-expected.txt:

2005-03-11  Adele Amchan  <adele@apple.com>

        backing out fix for <rdar://problem/4021711> REGRESSION (125-188): blank pages when browsing forum at cooperativeresearch.org - cached external script problem

        This caused the following regressions (that we know of): 
        <rdar://problem/4047445> REGRESSION (Safari-400-403?): Some or all page contents sometimes don't appear (macworld.com)
        <rdar://problem/4046153> 8a409: Problem loading Citibank page in Safari 2 (403)
        <rdar://problem/4047801> REGRESSION (402-403): .Mac homepage links don't work

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::scriptHandler):

2005-03-11  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4046602> WebCore invokes undefined behavior when the spell checker isn't running

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::advanceToNextMisspelling):
        (KWQKHTMLPart::markMisspellings):
        Nil check checker.

2005-03-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        * ForwardingHeaders/editing/visible_units.h: Added.

2005-03-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4045521> Hitting return key with full line selected does not add blank line as it should

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): Removed some "special-case" code from this 
        function that would look for a selection that started and ended in a different block, and would
        then bail right after the deletion of the selection without inserting a paragraph separator.
        This was just wrong. So, the code change is removal only. When the general-case code runs instead
        of the erroneous special-case code, the bug goes away.
        
        New tests:
        
        * layout-tests/editing/inserting/return-key-with-selection-001-expected.txt: Added.
        * layout-tests/editing/inserting/return-key-with-selection-001.html: Added.
        * layout-tests/editing/inserting/return-key-with-selection-002-expected.txt: Added.
        * layout-tests/editing/inserting/return-key-with-selection-002.html: Added.
        * layout-tests/editing/inserting/return-key-with-selection-003-expected.txt: Added.
        * layout-tests/editing/inserting/return-key-with-selection-003.html: Added.

2005-03-11  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4009446> AX: kAXTextMarkerForPositionParameterizedAttribute not working correctly (required for Dictionary pop-up)

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityAttributeValue:]):
        Comment changes.
        
        (-[KWQAccObject doAXTextMarkerForPosition:]):
        Dig into widgets.
        
        (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
        Use the selection's document instead of the top document, to accommodate frames, etc.
        
        (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
        Fixed parameter processing to look for NSValue instead of AXValue.

2005-03-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Fix for this bug:
        
        <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor
        
        This was fixed, then regressed with Harrison's fix for this bug:
        
        <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): My now addresses both problems in a way that they no longer
        clobber each other.

2005-03-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for these bugs:
        
        <rdar://problem/4045511> Copying and pasting end-of-paragraph selection puts insertion point in wrong place
        <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break

        The copy/paste code before this patch had no notion of a "logical newline" at the start of the selection. We have
        had a similar notion for "logical newline" at the end of the selection for quite some time. To fix these bugs, we
        need to introduce the same idea for selection starts.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Process the "logical newline" at start as we write it out
        in markup. Set the bit we added to this object to signify we have such a newline.
        (khtml::ReplaceSelectionCommand::doApply): Many, many changes to introduce the new "logical newline" at start concept.
        I also tried to simply the code that sets the start position for inserting content to be pasted. I also improved a
        weakness in the smart-paste code. Now, we check before and after the paste for whether we need to add a leading or
        trailing space. The code previous to this patch only did a "before" check, with the result that we sometimes added
        a second space. In other words, the code did not realize that DOM changes done by pasting could cause formerly
        unrendered whitespace to become rendered. Also moved line placeholder clean up code to its own function.
        (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): New helper that further refines the notion
        of when we can remove a line placeholder. The definition is now, "If a line placeholder is at the visible start
        and visible end of its line, keep it; otherwise remove it".
        * khtml/editing/htmlediting.h: Declare new functions. Rework inlines in ReplacementFragment class to account for
        addition of new "logical newline" at start concept.
        (khtml::ReplacementFragment::hasInterchangeNewlineAtStart): New accessor.
        (khtml::ReplacementFragment::hasInterchangeNewlineAtEnd): Renamed from hasInterchangeNewline(), since before we
        only had a bit for the end, hence we did not need to distinguish it from the start.
        * khtml/editing/markup.cpp:
        (khtml::createMarkup): Added code to detect and write out markup for cases where we have a "logical newline" at start.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::startPosition): New helper.
        (DOM::RangeImpl::endPosition): Ditto.
        * khtml/xml/dom2_rangeimpl.h: Declare new helpers.
        
        New tests:
        * layout-tests/editing/pasteboard/paste-line-endings-001-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-001.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-002-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-002.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-003-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-003.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-004-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-004.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-005-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-005.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-006-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-006.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-007-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-007.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-008-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-008.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-009-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-009.html: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-010-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-line-endings-010.html: Added.

=== Safari-405 ===

2005-03-10  Darin Adler  <darin@apple.com>

        Reviewed by Richard.

        - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk

        * khtml/rendering/render_text.cpp: (getCharacterBreakIterator): Set boolean "got iterator" to true.

2005-03-10  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/4042867> "Bigger" changes the font size of too much text when the selection is on a style-change boundary

        * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
        Advance out of the starting text node if we're at the end of it.

2005-03-10  Darin Adler  <darin@apple.com>

        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Fixed assertion for nested calls to write.

2005-03-10  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4032346> REGRESSION (Mail): changing 1st line of a URL that wraps to two lines doesn't always update 2nd line

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::matchedEndLine):
        Look at first clean line in case line wrap implicitly dirtied it.

2005-03-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Vicki.

	<rdar://problem/4046018> REGRESSION (TOT): RSS pages don't display anything
        
	* kwq/WebCoreBridge.mm:
        (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Exempt
	feed: and feeds: pages from the local file security check.

2005-03-10  Darin Adler  <darin@apple.com>

        Change written by Steve Peters, reviewed by me.

        - fixed <rdar://problem/4045924> improve compareBoundaryPoints to make style changes faster

        * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints):
        Do early outs in a couple of the loops to make things faster.

2005-03-10  Jens Alfke  <jens@apple.com>

        Reviewed by rjw.

	Fixes <rdar://problem/4040848> "REGR: Sun security-check demo applet does not load". My earlier fix for 3603191 deferred loading the applet until the </applet> tag is reached, so all <param>s will be available. Unfortunately that meant that if the </applet> tag was missing, the applet would never load at all. So instead, the loading needs to happen when the ID_APPLET tag is popped from the parser stack for any reason.

	I've restored the old NodeImpl::closeRenderer() method. Except it's now virtual, with a no-op base implementation, and is overridden by HTMLAppletElementImpl, replacing its setAllParamsAvailable method that I added a few weeks ago when fixing 3603191.

	This ensures that the applet will get loaded even if there is no explicit </applet> tag.

	The changes to htmlparser.cpp back out my earlier change and restore the lines that were deleted on 8/3/04 when the old closeRenderer was removed.

        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::closeRenderer):
        * khtml/html/html_objectimpl.h:
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):
        (KHTMLParser::processCloseTag):
        (KHTMLParser::popOneBlock):
        * khtml/xml/dom_nodeimpl.h:
        (DOM::NodeImpl::closeRenderer):

2005-03-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4024929> REGRESSION (Mail): Pasting text with multiple reply levels removes one level instead of all
        
        The code to figure out which node to use to merge into an existing line did not drill into the first inline element
        as needed to make the feature work as user expect. Instead, it looked at the first node, and if it was a block, it
        skipped that node. This worked for some cases (including the important "paste-as-quotation" case) but obviously 
        doesn't work for content quoted more than once.
        
        Now, mergeStartNode() will look for the first node in pasted content that is not a block. It will now also look
        for nodes specially marked by Mail as a node added to make "Paste As Quotation" work. It won't skip those. 
        
        NOTE: This change will break Mail's "Paste As Quotation" feature for TOT WebKit users, but this is only a temporary 
        problem that will exist until we sync up with Mail's pending change to mark nodes as needed in its pasteAsQuotation:
        method.
        
        * khtml/editing/html_interchange.h: Add ApplePasteAsQuotation constant used to check for "marked" blockquotes.
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::mergeStartNode): Look for first node that is either not a block or is marked as
        an ApplePasteAsQuotation node.
        (khtml::isMailPasteAsQuotationNode): New helper that looks for nodes marked with ApplePasteAsQuotation.
        * khtml/editing/htmlediting.h: Updated header for new function.
        
        This test result changed is an acceptable way.
        
        * layout-tests/editing/pasteboard/paste-text-013-expected.txt
        * layout-tests/editing/pasteboard/paste-text-013.html

        NOTE: This change causes a regression in this layout test:

        * layout-tests/editing/pasteboard/paste-text-013.html

        This problem will need to be fixed separately, and this bug has been filed to track this problem:
        <rdar://problem/4045513> Copying and pasting selection starting at end of paragraph can incorrectly remove line break

2005-03-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/4040776> Dashboard (Weather widget) is a memory hog
        
	Change things around so the event listeners for XMLHttpRequest
	mark their JS listener objects instead of holding a hard
	reference, to avoid an unbreakable reference cycle.

	* khtml/ecma/kjs_events.cpp:
        (JSAbstractEventListener::JSAbstractEventListener):
        (JSAbstractEventListener::~JSAbstractEventListener):
        (JSAbstractEventListener::handleEvent):
        (JSAbstractEventListener::eventListenerType):
        (JSUnprotectedEventListener::JSUnprotectedEventListener):
        (JSUnprotectedEventListener::~JSUnprotectedEventListener):
        (JSUnprotectedEventListener::listenerObj):
        (JSUnprotectedEventListener::windowObj):
        (JSUnprotectedEventListener::mark):
        (JSEventListener::JSEventListener):
        (JSEventListener::~JSEventListener):
        (JSEventListener::listenerObj):
        (JSEventListener::windowObj):
        (JSLazyEventListener::JSLazyEventListener):
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_html.h:
        * khtml/ecma/kjs_window.cpp:
        (Window::getJSEventListener):
        (Window::getJSUnprotectedEventListener):
        * khtml/ecma/kjs_window.h:
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::putValue):
        (KJS::XMLHttpRequest::mark):
        * khtml/ecma/xmlhttprequest.h:
        * khtml/khtml_part.h:

2005-03-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content
        
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::putValue):
        * khtml/ecma/kjs_window.cpp:
        (Window::put):
        (WindowFunc::tryCall):
        (Location::put):
        (LocationFunc::tryCall):
        * khtml/khtml_part.cpp:
        (KHTMLPart::begin):
        (KHTMLPart::scheduleLocationChange):
        (KHTMLPart::slotRedirect):
        (KHTMLPart::processObjectRequest):
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::openURLRequest):
        (KWQKHTMLPart::urlSelected):
        (KWQKHTMLPart::createPart):
        * kwq/KWQKHTMLPartBrowserExtension.mm:
        (KHTMLPartBrowserExtension::createNewWindow):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (hasCaseInsensitivePrefix):
        (-[WebCoreBridge didNotOpenURL:pageCache:]):
        (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]):

2005-03-09  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted

	Remove our hacked special case now we have our own cache of
	which fonts are fixed  pitch.

        Reviewed by Maciej.

        * kwq/KWQFont.mm:
        (QFont::isFixedPitch):

2005-03-09  David Harrison  <harrison@apple.com>

        Reviewed by Maciej.

        <rdar://problem/4037141> REGRESSION (Mail): Pasting deletes preceding blank lines with certain steps

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
        Add check for anonymous text after blocks.

2005-03-08  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for these bugs:
        
        <rdar://problem/4039661> crash in ApplyStyleCommand::applyBlockStyle pasting contents of webpage into Mail or Blot
        <rdar://problem/4039672> hang in moveParagraphContentsToNewBlockIfNecessary after pasting contents of webpage into Blot

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix for 4039672. Iteration needs to do
        a traverseNextSibling(), not a traverseNextNode(). The latter might iterate into a child that already got moved, and
        the code can infinite loop as a result.
        (khtml::ApplyStyleCommand::applyBlockStyle): Fix for 4039661. This function iterates over a set of nodes to apply
        block styles. Before, the iteration would go from the start to the end of the selection, and apply block styles
        as it went. However, the act of applying style could confuse the iteration. Now I iterate and store the relevant
        nodes in QPtrList before doing any style manipulation, and then iterate that set of nodes.

2005-03-08  Darin Adler  <darin@apple.com>

        Change written by Hyatt, reviewed by me.

        - fixed <rdar://problem/3952698> Function buttons do not display properly with Telia Webmail

        * khtml/rendering/render_replaced.cpp: (RenderReplaced::calcMinMaxWidth):
        Only use a minWidth of 0 for images with a percentage value. Other replaced elements aren't scalable
        so their minWidth should be their calculated width. This has been wrong all along, but it's a relatively
        safe change because it only affects replaced elements' min-width.

2005-03-08  David Harrison  <harrison@apple.com>

        Reviewed by Ken.

        <rdar://problem/4039006> REGRESSION (Mail): Command-left-arrow goes to the start of the wrong line in particular message

        * khtml/editing/visible_units.cpp:
        (khtml::startOfLine):
        Use firstLeafChild() instead of firstChild().

2005-03-08  Richard Williamson   <rjw@apple.com>

	Fixed by Tom Madden.

	Fixed <rdar://problem/4038586> 8A402: Osaka-Mono text overlaps when typing with input method

	We weren't clearing the "all ascii" flag when setting text on
	RenderText.

        Reviewed by Richard Williamson.

        * khtml/rendering/render_text.cpp:
        (RenderText::setText):

2005-03-08  Darin Adler  <darin@apple.com>

        Reviewed by Ken and Maciej.

        - fixed <rdar://problem/3988809> REGRESSION (Mail): wide space characters are turned into plain old spaces when typed or pasted

        Changed the few places where it matters to use a "collapsible whitespace" concept instead of
        the general whitespace concept. This means treating only ' ' and '\n' specially instead of
        including other space characters, which matches what the space-collapsing logic does in RenderText,
        although it really needs to behave differently based on whitespace mode.

        * khtml/editing/visible_text.h: (khtml::isCollapsibleWhitespace): Added. This returns true only for
        ' ' and '\n' since they are the only characters collapsed once text is in the DOM. But really it
        can't do the job ignoring white-space mode, so some day it must go.

        * khtml/editing/html_interchange.cpp: (convertHTMLTextToInterchangeFormat): Changed to use
        isCollapsibleWhitespace and removed unnecessary calls to latin1().

        * khtml/editing/htmlediting.cpp:
        (khtml::isNBSP): Removed unnecessary creation/destruction of QChar each time this is called.
        (khtml::nextCharacterIsCollapsibleWhitespace): Renamed from isWS and changed to use isCollapsibleWhitespace.
        (khtml::DeleteSelectionCommand::fixupWhitespace): Use isCollapsibleWhitespace instead of isWS,
        since we only want to do our NBSP tricks for collapsible whitespace.
        (khtml::InsertTextCommand::input): Changed use of isTab to instead say == "\t" since that does the
        same thing and is arguably just as clear. Changed use of isWS to == " " since the input text can't
        include any "\n" characters, and really a plain old space is the only collapsible thing that can
        be passed in. Use isCollapsibleWhitespace instead of isWS since we want to do NBSP tricks only for
        collapsible whitespace, not all whitespace.
        (khtml::InsertTextCommand::insertSpace): Use isCollapsibleWhitespace instead of isWS since we want
        to do NBSP tricks only for collapsible whitespace, not all whitespace.
        (khtml::RebalanceWhitespaceCommand::doApply): Ditto.

        * khtml/xml/dom_position.h: Changed treatNBSPAsWhiteSpace parameters to considerNonCollapsibleWhitespace
        parameters. The most common callers are only interested in collapsible whitespace, and the smart copy
        and paste callers want to include all whitespace, including non-breaking spaces and all the Unicode spaces.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::leadingWhitespacePosition): Rename the parameter, and use either QChar::isSpace or
        isCollapsibleWhitespace depending on the boolean passed in.
        (DOM::Position::trailingWhitespacePosition): Ditto.

2005-03-07  John Sullivan  <sullivan@apple.com>

        Reviewed by Darin.
        
        - <rdar://problem/4040868> REGRESSION (Mail, 403-403+): Drag and drop deletes text, 
        many other bad editing problems

        * khtml/rendering/render_text.cpp:
        (RenderText::caretMaxOffset):
        A "-" should have been a "+" in this method that was tweaked an hour ago. Editing
        was completely horked.

2005-03-07  Richard Williamson   <rjw@apple.com>

	Additional nil check from fix for 4040749.

        * khtml/rendering/render_box.cpp:
        (RenderBox::setStyle):

2005-03-07  Richard Williamson   <rjw@apple.com>

	Additional nil check from fix for 4040749.

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateLayerPosition):

2005-03-07  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4033202> REGRESSION (Mail): Can't arrow up at a particular spot in a particular Mail message

        Doublecheck that new position is really on a different line, because the VisiblePosition constructor does not.
        Filed <rdar://problem/4040763> for that problem.

        * khtml/editing/visible_units.cpp:
        (khtml::previousLinePosition):

2005-03-07  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4040749> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com

	When layers are dynamically created/removed as a result of changing opacity they weren't being correctly
	sized and positioned.  This happens whenever opacity goes from < 1 to 1.

        Reviewed by Darin.

        * khtml/rendering/render_box.cpp:
        (RenderBox::setStyle):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateLayerPosition):

2005-03-07  Christy Warren  <kali@apple.com>

        Reviewed by Darin

        * khtml/rendering/render_text.cpp:
        (RenderText::caretMinOffset): modified to handle BIDI case by checking all text boxes for min offset
        (RenderText::caretMaxOffset): modified to handle BIDI case by checking all text boxes for max offset

2005-03-07  David Harrison  <harrison@apple.com>

        Reviewed by Ken.

        <rdar://problem/4029225> REGRESSION (Mail): Crash if hit return after dragging in attachment - DeleteSelectionCommand::initializePositionData

        Work around the fact that the height() of a BR is 0 if there are no text elements on the line, even if there are replaced elements.
        Filed <rdar://problem/4040358> RenderBR height() is not accurate.
        
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply):
        When height is 0, double check that the placeholder is the first position on the line.

=== Safari-403 ===

2005-03-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki
    
        Fix for this bug:
        
        <rdar://problem/4040136> Expose SPI for WebCore's functions to create document fragments from plain text and markup strings

        * kwq/DOMHTML.mm: Add two new SPI functions.
        (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:])
        (-[DOMHTMLDocument _createDocumentFragmentWithText:])
        * kwq/DOMPrivate.h: Declare the new SPI here, a privately-exported header, so Mail can make use of it.

2005-03-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
        when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
        in the content needs to be preserved. A simple one-line change now sees to this.
        
        * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
        <br> at the end of a paragraph. This makes sense given the code change.

        New test:
        * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-018.html: Added.

2005-03-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4035648> REGRESSION (Mail): line feed in source HTML file causes bad copy/paste behavior

        The createMarkup() function in markup.cpp iterates over the nodes in a range,
        and does some bookkeeping to figure out when to add close tags to the markup.
        Some code added at the start of the loop to prevent markup from being written
        for unrendered nodes short-circuited the rest of the loop, and so prevented
        the close-tag-writing code from running when it should.

        This is why the "plain" text wound up inside of the bold tag in the example
        above. The addition of the unrendered return character caused an incorrect
        delay in the close tag for the bold element from being written out, with the
        result being that it wound up including additional content.

        The fix is to add checks for node renderers throughout the loop at the points
        where markup is written out for each node. This allows the additional close
        tag logic to run as needed.

        All layout tests pass with this change.

        * khtml/editing/markup.cpp:
        (khtml::createMarkup)

        New test:
        
        * layout-tests/editing/pasteboard/paste-4035648-fix-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-4035648-fix.html: Added.

2005-03-06  Christy Warren  <kali@appple.com>

        Reviewed by Ken

        * khtml/rendering/render_text.cpp:
        (lastRendererOnPrevLine): helper for RenderText::caretRect
        (RenderText::caretRect): added code to properly handle bidi ordered text boxes

2005-03-06  Christy Warren  <kali@apple.com>

        Reviewed by Darin.

        * khtml/editing/visible_position.cpp: Eliminated code that cuts off searching through the text boxes based on an assumption that breaks under bidi
        (khtml::VisiblePosition::isCandidate):
        * kwq/KWQFontMetrics.mm:
        (QFontMetrics::checkSelectionPoint): Made the initialization of the WebCoreStyle honor the reversed flag

2005-03-05  John Sullivan  <sullivan@apple.com>

        Reviewed by Maciej.
        
        - fixed <rdar://problem/4038417> Mail crashed in StyleChange::checkForLegacyHTMLStyleChange 
        when composing a reply

        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::checkForLegacyHTMLStyleChange):
        Added missing nil check.

2005-03-05  Darin Adler  <darin@apple.com>

        Reviewed by Don.

        - fixed <rdar://problem/4038478> Crash in renderer viewing RSS feed at feed://wvs.topleftpixel.com/index.rdf

        * khtml/xml/dom_docimpl.cpp: (widgetForNode): Check for nil before going from node to renderer.

2005-03-05  Darin Adler  <darin@apple.com>

        Reviewed by Richard.

        - fixed <rdar://problem/4037700> Every character typed causes stat call for /usr/share/icu/icudt32b_char.brk

        * khtml/rendering/render_text.cpp:
        (getCharacterBreakIterator): Added. Helper that sets up an iterator for the passed-in text.
        Shares a single global iterator (fast, albeit not thread-safe).
        (RenderText::previousOffset): Changed to call getCharacterBreakIterator.
        (RenderText::nextOffset): Ditto.

2005-03-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/4038267> REGRESSION (Mail): Crash copying and pasting end of paragraph

        Code to handle content that has a "logical" newline at the end of the pasted content, and the code
        to adjust the selection at the end of the paste operation made an assumption that at least one
        node had been inserted by the paste command. This is not necessarily true in the case where the sole content
        in the pasted content is one of these "logical" newlines. Adjust some code around so that we don't deref
        null, but still adjust the selection correctly for this case. In each of the two functions below, some
        null checks have been added, and some code has been rearranged a little bit to continue on through
        the end of completeHTMLReplacement, even if no nodes have been inserted. The patch looks bigger and more
        complicated than the conceptual change.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply)
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement)
        
        * layout-tests/editing/pasteboard/paste-4038267-fix-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-4038267-fix.html: Added.

2005-03-05  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4025918> images copied from Safari with relative src URLs aren't pasted into Mail messages (KURL resolves base URLs incorrectly)

        * kwq/KWQKURL.mm: (KURL::KURL): Add a slash at the start of the path if a relative part is adding
        a path onto a URL that has "pre-path" bits like host name, but no path yet. This doesn't come up
        for http because in that case we add a trailing "/" as part of canonicalization.

2005-03-04  John Sullivan  <sullivan@apple.com>

        Reviewed by Kevin.
        
        - fixed <rdar://problem/4033705> REGRESSION (Mail): Copy/Paste from Excel 
        crashes Mail in KWQKHTMLPart::fontForSelection(bool*) const + 232

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection):
        Check for nil startNode, not just nil renderer.

2005-03-04  David Harrison  <harrison@apple.com>

        Reviewed by Ken, Richard.

        <rdar://problem/3996383> REGRESSION (Mail): Deleting all of first line also deletes line ending

        Problem was the placeholder check was based on 0 height block, but the block in this
        case is the BODY, which has other content even though the paragraph is gone.
        
        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::insertBlockPlaceholder):
        Now does insert instead of append!
    
        (khtml::CompositeEditCommand::appendBlockPlaceholder):
        New.  Actually does append.
        
        (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded):
        Renamed from insertBlockPlaceholderIfNeeded because it can insert or append.  Also accepts "force insert" flag.
        
        (khtml::CompositeEditCommand::removeBlockPlaceholder):
        Renamed for succinctness from removeBlockPlaceholderIfNeeded.
        
        (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent):
        (khtml::DeleteSelectionCommand::moveNodesAfterNode):
        Use renamed methods.
        
        (khtml::DeleteSelectionCommand::doApply):
        Use addBlockPlaceholderIfNeeded "force insert" flag if deleting whole paragraphs did not leave an empty one.
        
        (khtml::InsertParagraphSeparatorCommand::doApply):
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
        (khtml::InsertTextCommand::input):
        Use renamed methods.
        
        * khtml/editing/htmlediting.h:
        Renamed and new methods per above.
        

2005-03-04  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message

        Reviewed by darin.

        * khtml/editing/visible_units.cpp:
        (khtml::endOfParagraph): don't consider text nodes that have no rendered characters

2005-03-04  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)

	The parse mode wasn't be restored to the document when going
	back.

        Reviewed by Hyatt.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::openURLFromPageCache):
        * kwq/KWQPageState.h:
        * kwq/KWQPageState.mm:
        (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):

2005-03-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        * layout-tests/editing/style/create-block-for-style-012-expected.txt: Shame on me!
        I landed my last fix without running layout tests. This one changes in a subtle, but
        acceptable way.

2005-03-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Fix for this bug:
        
        <rdar://problem/4032543> REGRESSION (Mail): Mail hangs when quoted text is pasted twice
        
        This code change fixes the bug in a non-obvious way. The root cause of the problem was
        that a VisiblePosition created using an affinity originating in Mail code caused 
        two VisiblePosition objects that should have been equal to differ only in their 
        affinities, which in turn caused us to run a code path that should not have run.

        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::VisiblePosition): Added copy constructor.
        (khtml::VisiblePosition::next): Factored out inline code that used to be here into new
        setAffinityUsingLinePosition() function.
        (khtml::isEqualIgnoringAffinity): New helper to handle cases when affinity in equality check does
        not matter. However, we want to know about such cases where a VisiblePosition differs only by affinity, 
        and the code will assert in development when this happens.
        (khtml::isNotEqualIgnoringAffinity): Ditto, but not. :)
        (khtml::setAffinityUsingLinePosition): New helper function mentioned above. This will "correct"
        upstream affinity to downstream if the affinity does not make a difference for the position.
        * khtml/editing/visible_position.h:
        * khtml/editing/visible_range.h: Wacky bug. The operator== for this class took VisiblePosition classes!
        * khtml/editing/visible_units.cpp:
        (khtml::isStartOfParagraph): Now performs equality check without regard to affinity.
        (khtml::isEndOfParagraph): Ditto.
        (khtml::isStartOfBlock): Ditto.
        (khtml::isEndOfBlock): Ditto.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectedDOMRange:affinity:]): Adjusts the affinity using setAffinityUsingLinePosition()
        if necessary.

2005-03-04  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut

        * khtml/editing/htmlediting.h: Added insertTextRunWithoutNewlines.
        * khtml/editing/htmlediting.cpp:
        (khtml::InsertTextCommand::input): Added assertion to make sure strings with newlines don't get
        down to this level.
        (khtml::TypingCommand::insertText): Added. Takes the name of the old function, but is a new
        level that breaks runs into lines and inserts each one separately.
        (khtml::TypingCommand::insertTextRunWithoutNewlines): Renamed old insertText to this. 

        * khtml/dom/dom_string.h: Made substring be a const member function.
        * khtml/dom/dom_string.cpp: (DOM::DOMString::substring): Made this const.

2005-03-04  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts)

        * khtml/css/css_valueimpl.cpp:
        (DOM::isLegalIdentifier): Added. Commented out and not used.
        (DOM::quoteStringIfNeeded): Quotes the string if needed. For now only if it starts with "#".
        (DOM::CSSPrimitiveValueImpl::cssText): Call quoteStringIfNeeded when asked for cssText for an arbitrary string, since we
        need text you can re-parse.
        (DOM::FontFamilyValueImpl::cssText): Ditto.

        * khtml/editing/markup.cpp:
        (khtml::startMarkup): Added comments about lack of quoting for attributes.
        (khtml::createMarkup): Ditto.

2005-03-04 Adele Amchan  <adele@apple.com>
 
       Reviewed by Maciej

	Fix for <rdar://problem/4021711> REGRESSION(125-188) blank pages when browsing forum at cooperativeresearch.org - cached external script problem

        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::scriptHandler): set flag needToRefCachedScript so we can make sure 
        notifyFinished is called after pendingSrc is set up with the right data from the cached script

2005-03-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4029632> Tiger 8A398:- Mail crashes in DOM::NodeImpl::isBlockFlow() after pasting text with alignment style and BR element from Safari

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): VisiblePosition constructor
        was failing to yield a position for a node just pasted into the document since a layout was needed
        for the calculation to come out right. Layout added. Crash gone.

=== Safari-402 ===

2005-03-03  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3992803> Cannot navigate through list items with the keyboard, you're stuck in the same <li> block unless you click out

        Reviewed by harrison.

        * khtml/rendering/render_line.cpp:
        (khtml::RootInlineBox::closestLeafChildForXPos): avoid returning list markers when possible. Also improved heuristic for returning the best InlineBox given the passed X position.


2005-03-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Fix for this bug:
        
        <rdar://problem/4035198> Pasting text with different styles does not get reproducible results

        I had a good idea yesterday to improve the way we "fixup" styles after
        pasting, but i chose a poor data structure to do it, a map of
        nodes-to-styles. In the fixup step, I iterated over the map elements and
        did the fixup. However, since the order in which the items would come
        out of the map is indeterminate, we got unpredictable results.

        So, the concept was good, but the implementation was flawed. I have
        fixed this mapping to be a list instead, so the order that nodes are
        evaluated in the fixup step is document order. This works nicely.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::~ReplacementFragment): No longer need to explicity deref nodes and
        styles saved away for later fixup. This is now handled by the new NodeDesiredStyle class.
        (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls computeAndStoreNodeDesiredStyle,
        function renamed from mapDesiredStyleForNode.
        Now accepts a QValueList<NodeDesiredStyle> in place of the old map.
        (khtml::NodeDesiredStyle::NodeDesiredStyle): New class that represents a node-to-style mapping.
        (khtml::NodeDesiredStyle::~NodeDesiredStyle): Ditto.
        (khtml::NodeDesiredStyle::operator=): Ditto.
        (khtml::ReplaceSelectionCommand::doApply): Now calls computeAndStoreNodeDesiredStyle,
        function renamed from mapDesiredStyleForNode.
        (khtml::ReplaceSelectionCommand::fixupNodeStyles): Now operates on a QValueList<NodeDesiredStyle> in 
        place of the old map.
        (khtml::computeAndStoreNodeDesiredStyle): Renamed from mapDesiredStyleForNode.  Now operates on a 
        QValueList<NodeDesiredStyle> in place of the old map.
        * khtml/editing/htmlediting.h:
        (khtml::NodeDesiredStyle): New class that represents a node-to-style mapping.
        (khtml::ReplacementFragment::desiredStyles): Now returns a QValueList<NodeDesiredStyle> in place of the old map.

        * layout-tests/editing/style/typing-style-003-expected.txt: Results changed in an acceptable way.

2005-03-02  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/4029741> REGRESSION (188-189): <input type=text> are cleared when you hide/show them

        * khtml/html/html_formimpl.h: Added detach functions for both input and text area elements, since
        both have m_valueMatchesRenderer flags.
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::detach): Set m_valueMatchesRenderer to false, since the renderer is going away.
        (DOM::HTMLTextAreaElementImpl::detach): Ditto.

2005-03-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/4006151> in reply, caret moves to next line after toggling bold style then typing

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::applyInlineStyle): Defer cleaning up empty style until the end of the
        function. In some situations, the render tree can get confused when we do this removal up front.
        I wish I understood the reasons more deeply, but this bit of code shuffling seems harmless, and 
        fixes the bug.

2005-03-02  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/4024966> crash happened twice in [KWQTextField setHasFocus:] + 0xe8

        Added more nil checks to the widget implementations. Anywhere a widget pointer is used, do a nil check,
        rather than relying on high level assumptions about which calls can and can't destroy the HTML element
        (and hence the widget). The case in the bug seems to be a case where scrolling destroyed the element.
        We can't be sure this fixes the bug, but we can be relatively sure we didn't introduce any new problems,
        because this just avoids nil-dereferencing.

        * kwq/KWQButton.mm:
        (-[KWQButton becomeFirstResponder]):
        (-[KWQButton nextKeyView]):
        (-[KWQButton previousKeyView]):
        * kwq/KWQListBox.mm:
        (-[KWQTableView mouseDown:]):
        (-[KWQTableView becomeFirstResponder]):
        (-[KWQTableView numberOfRowsInTableView:]):
        (-[KWQTableView tableViewSelectionDidChange:]):
        (-[KWQTableView tableView:shouldSelectRow:]):
        (-[KWQTableView selectionShouldChangeInTableView:]):
        * kwq/KWQScrollBar.mm:
        (-[KWQScrollBar scroll:]):
        * kwq/KWQSlider.mm:
        (-[KWQSlider mouseDown:]):
        (-[KWQSlider slide:]):
        (-[KWQSlider becomeFirstResponder]):
        (-[KWQSlider nextKeyView]):
        (-[KWQSlider previousKeyView]):
        * kwq/KWQTextArea.mm:
        (-[KWQTextAreaTextView becomeFirstResponder]):
        (-[KWQTextAreaTextView resignFirstResponder]):
        (-[KWQTextAreaTextView mouseDown:]):
        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController action:]):
        (-[KWQTextFieldController controlTextDidEndEditing:]):
        (-[KWQTextFieldController controlTextDidChange:]):
        (-[KWQTextFieldController textView:didHandleEvent:]):
        (-[KWQTextFieldController setHasFocus:]):

2005-03-02  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4031483> Leak (RenderObject::createInlineBox) reproducible with Stock widget

	We were leaking inline block line boxes.  Argh!

        Reviewed by Hyatt.

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLineBoxes):
        * khtml/rendering/render_line.cpp:
        (khtml::InlineBox::deleteLine):

2005-03-02  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3976872> REGRESSION (Mail): Pasted plain text doesn't get the proper style if pasted into newlines

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommand::styleAtPosition): new, factored out from calculateStyleBeforeInsertion
        (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): call styleAtPosition
        (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): clear new m_insertionStyle ivar
        (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): deref new m_insertionStyle  ivar
        (khtml::ReplaceSelectionCommand::doApply): store the style so it later be applied when matching style
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply style from m_insertionStyle when matching style
        * khtml/editing/htmlediting.h:

2005-03-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/4031718> REGRESSION (401-401+): Safari reproducible crash setting up scope in JSLazyEventListener::parseCode authenticating to bugweb
        
	* khtml/ecma/kjs_events.cpp:
	(JSLazyEventListener::parseCode): If originalNode is NULL, don't
	mess with the scope chain.
	
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::parseHTMLAttribute): For handlers that are
	delcared on body but set on the document, pass NULL to avoid
	swizzling the scope chain. It turns out that this is what browsers
	do, and it finesses the crash.

2005-03-02  David Harrison  <harrison@apple.com>

        Reviewed by Ken.

        <rdar://problem/3948453> Can't type accented chars as first character in Stickies widget

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply):

2005-03-02  Ken Kocienda  <kocienda@apple.com>
        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4020574> REGRESSION (Mail): copy/paste first part of reply-quoted text alters downstream style
        
        The problem was that the operation to move nodes following the newly-pasted nodes did not preserve the
        style of these moved nodes. I have generalized some of the functions that compute and preserve styles
        for nodes and then apply these styles after a DOM operation.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::~ReplacementFragment): Call new derefNodesAndStylesInMap() helper function
        in place of old code that had this deref'ing inline.
        (khtml::ReplacementFragment::computeStylesUsingTestRendering): Now calls new mapDesiredStyleForNode() helper
        function place of old code that had this style computation inline.
        (khtml::ReplacementFragment::removeStyleNodes): Updated comment for new helper name.
        (khtml::ReplaceSelectionCommand::doApply): Now calls new helpers in place of helpers whose names were changed,
        or in place of pre-refactored inline code.
        (khtml::ReplaceSelectionCommand::fixupNodeStyles): Renamed from applyStyleToInsertedNodes(). Now generalized
        to take the map of nodes to use for the fixup. This makes it possible to call this code with different maps,
        and that is needed to fix the bug.
        (khtml::mapDesiredStyleForNode): New helper function to compute the inheritable styles for a given node
        and map this style to the given node in the given map. This function now also includes the code that was
        in the removeBlockquoteColorsIfNeeded(). This latter helper has now been removed.
        (khtml::derefNodesAndStylesInMap): Simple helper to deref map members.
        * khtml/editing/htmlediting.h:
        (khtml::ReplacementFragment::desiredStyles): New helper to return map of nodes-to-desiredStyles.

2005-03-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/4011358> REGRESSION(Mail): after dragging text to mail message and deleting, typing or dragging new text doesn't work

        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::isCandidate): Insertion point disappearing was due to a failed
        check here after deleting all the content in the body element. The special "empty block"
        needs to add check for DOM children. A block may have straggling anonymous render children in
        some cases, and so the check needs to be (!DOM-kids || !render-kids).

        Also, I botched the last checkin trying to split these two patches in my tree. Wrong layout tests 
        got checked in, I checked in a conflict marker in the Changelog, etc. I fixed everything with this checkin.

2005-03-01  Ken Kocienda  <kocienda@apple.com>
 
        Reviewed by Maciej

        Improved fix for this bug:
        
        <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML

        Maciej and I discussed this situation at length, and we came up with a better fix than I did earlier.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): Simplify one special case so that it only handles the 
        "last in block" situation. Remove special case for "downstream node is in different block" and handle
        this case with a little bit of special code in the general insertion case.

        Results studied to make sure there were no problems.

        * layout-tests/editing/deleting/delete-3959464-fix-expected.txt
        * layout-tests/editing/inserting/insert-div-001-expected.txt
        * layout-tests/editing/inserting/insert-div-002-expected.txt
        * layout-tests/editing/inserting/insert-div-004-expected.txt
        * layout-tests/editing/inserting/insert-div-005-expected.txt
        * layout-tests/editing/inserting/insert-div-009-expected.txt
        * layout-tests/editing/inserting/insert-div-014-expected.txt
        * layout-tests/editing/inserting/insert-div-018-expected.txt
        * layout-tests/editing/inserting/insert-div-024-expected.txt
        * layout-tests/editing/pasteboard/paste-text-011-expected.txt
        * layout-tests/editing/pasteboard/paste-text-013-expected.txt
        * layout-tests/editing/pasteboard/paste-text-015-expected.txt
        * layout-tests/editing/style/block-style-004-expected.txt
        * layout-tests/editing/style/block-style-005-expected.txt
        * layout-tests/editing/style/block-style-006-expected.txt

        New test:
        
        * layout-tests/editing/inserting/insert-div-027.html
        * layout-tests/editing/inserting/insert-div-027-expected.txt

2005-03-01  David Hyatt  <hyatt@apple.com>

	Fix for 4030890, regression with <sup> on Google.  Fix some bogus != comparison checks in verticalPositionHint.
	
        Reviewed by John

        (RenderObject::getVerticalPosition):
        
2005-03-01  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content

        Reviewed by rjw.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
        * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
        * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
        * layout-tests/editing/deleting/smart-delete-001.html: Added.
        * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
        * layout-tests/editing/deleting/smart-delete-002.html: Added.

2005-03-01  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4029772> Weather widgets use a lot of memory (more that other widgets)

	The string objects created by KWQHeaderStringFromDictionary() leaked.

        Reviewed by John Louch.

        * kwq/KWQLoader.mm:
        (KWQHeaderStringFromDictionary):

2005-03-01  Jens Alfke  <jens@apple.com>

        Reviewed by Darin.

	<rdar://problem/4004531> Simple Sun Signed Applet throws exceptions; doesn't run
	Two fixes for the way we extract the parameter-y goodness from <object> tags.

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget):

2005-03-01  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari

	The problem was due to incorrect "object truncation" in  RenderFlow::paintLines.  
	We attempt to push objects down if they don't fit on a page at
	paint time.  If the attempt to push object down failed we just
	didn't paint at all.

        Reviewed by Hyatt.

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines):

2005-03-01  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content

        Reviewed by rjw.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
        * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
        * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
        * layout-tests/editing/deleting/smart-delete-001.html: Added.
        * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
        * layout-tests/editing/deleting/smart-delete-002.html: Added.

2005-03-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki

        Fix for this bug:
        
        <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.

2005-03-01  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Vicki.

	<rdar://problem/4003774> REGRESSION(125-181): JavaScript problems @ Yankee/Dixie quiz
        
	Reworked how scopes are set up for event handlers to match other
	browser. This includes the following changes:

	- Special scope entries are set up at the time the event handler
	is created, not at the time it fires.

	- Special scope is only set up for event handlers set in the html
	source through an html attribute, not for handlers set using
	addEventHandler or setting JS properties like onclick through
	JavaScript.

	- Special scope is based on the DOM node on which the handler is
	an attribute, not the event target.

	This fixes the regression while allowing the fix to
	<rdar://problem/3798453> (DIG: getting variable with same name as
	DOM element attribute gets attribute value instead) to keep
	working correctly.
	
	* khtml/ecma/kjs_events.cpp:
        (JSEventListener::handleEvent):
        (JSLazyEventListener::JSLazyEventListener):
        (JSLazyEventListener::parseCode):
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::createHTMLEventHandler):
        * khtml/ecma/kjs_proxy.h:
        * khtml/ecma/kjs_window.cpp:
        (Window::getJSLazyEventListener):
        * khtml/ecma/kjs_window.h:
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::parseHTMLAttribute):
        (HTMLFrameElementImpl::parseHTMLAttribute):
        (HTMLFrameSetElementImpl::parseHTMLAttribute):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseHTMLAttribute):
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::parseHTMLAttribute):
        (DOM::HTMLButtonElementImpl::parseHTMLAttribute):
        (DOM::HTMLInputElementImpl::parseHTMLAttribute):
        (DOM::HTMLLabelElementImpl::parseHTMLAttribute):
        (DOM::HTMLSelectElementImpl::parseHTMLAttribute):
        (DOM::HTMLTextAreaElementImpl::parseHTMLAttribute):
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::parseHTMLAttribute):
        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::parseHTMLAttribute):
        * khtml/khtml_part.cpp:
        (KHTMLPart::createHTMLEventListener):
        * khtml/khtml_part.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLEventListener):
        * khtml/xml/dom_docimpl.h:

=== Safari-401 ===

2005-03-01  Chris Blumenberg  <cblu@apple.com>

	Backed out my patch since the tree was closed.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData):
        * khtml/editing/jsediting.cpp:

2005-03-01  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4030669> smart delete does not delete spaces from pasted content

        Reviewed by rjw.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData): pass true for treatNBSPAsWhiteSpace to leadingWhitespacePosition and trailingWhitespacePosition when testing whether or not we have to delete those characters as well.
        * khtml/editing/jsediting.cpp: pass true for smartDelete when the selection granularity is WORD. This allows us to write smart delete layout tests.
        * layout-tests/editing/deleting/smart-delete-001-expected.txt: Added.
        * layout-tests/editing/deleting/smart-delete-001.html: Added.
        * layout-tests/editing/deleting/smart-delete-002-expected.txt: Added.
        * layout-tests/editing/deleting/smart-delete-002.html: Added.

2005-03-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki

        Fix for this bug:
        
        <rdar://problem/4030068> Trailing <return> gets eaten when pasted at the end of a document

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Add code to handle formerly-unhandled end-of-document case.

2005-03-01  David Harrison  <harrison@apple.com>

        Reviewed by Chris.

        <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
        (-[WebCoreBridge smartInsertForString:replacingRange:beforeString:afterString:]):
        New.

2005-03-01  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4030404> selection granularity should be set when extending selection via JS

        Reviewed by kocienda.

        * khtml/ecma/kjs_window.cpp:
        (SelectionFunc::tryCall): set the granularity on the part. This will allow us to write smart paste layout tests.
        * layout-tests/editing/pasteboard/smart-paste-001-expected.txt: Added.
        * layout-tests/editing/pasteboard/smart-paste-001.html: Added.
        * layout-tests/editing/pasteboard/smart-paste-002-expected.txt: Added.
        * layout-tests/editing/pasteboard/smart-paste-002.html: Added.
        * layout-tests/editing/pasteboard/smart-paste-003-expected.txt: Added.
        * layout-tests/editing/pasteboard/smart-paste-003.html: Added.
        * layout-tests/editing/pasteboard/smart-paste-004-expected.txt: Added.
        * layout-tests/editing/pasteboard/smart-paste-004.html: Added.
        * layout-tests/editing/pasteboard/smart-paste-005-expected.txt: Added.
        * layout-tests/editing/pasteboard/smart-paste-005.html: Added.
        * layout-tests/editing/pasteboard/smart-paste-006-expected.txt: Added.
        * layout-tests/editing/pasteboard/smart-paste-006.html: Added.
        * layout-tests/editing/pasteboard/smart-paste-007-expected.txt: Added.
        * layout-tests/editing/pasteboard/smart-paste-007.html: Added.

2005-03-01  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4029934> smart paste with plain text can add too many spaces

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): pass true for treatNBSPAsWhitespace to leadingWhitespacePosition and trailingWhitespacePosition
        * khtml/xml/dom_position.cpp:
        (DOM::isWS): take treatNBSPAsWhitespace param
        (DOM::Position::leadingWhitespacePosition): ditto
        (DOM::Position::trailingWhitespacePosition): ditto
        * khtml/xml/dom_position.h:

2005-03-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3996605> Insert paragraph command puts new block in wrong place, creating difficult-to-handle HTML

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): Look for the upstream-most block to insert after
        when at the visible end of a block. This helps to avoid some undesirable sequences of markup which
        Dave says will be vary hard to render. Changing the command in this way avoids the "limitations"
        of the render tree by not asking it to render markup we do not want to make anyway.
        
        All these tests change, but either in insignificant ways, or for the better.
        
        * layout-tests/editing/deleting/delete-3959464-fix-expected.txt:
        * layout-tests/editing/inserting/insert-div-001-expected.txt:
        * layout-tests/editing/inserting/insert-div-002-expected.txt:
        * layout-tests/editing/inserting/insert-div-004-expected.txt:
        * layout-tests/editing/inserting/insert-div-005-expected.txt:
        * layout-tests/editing/inserting/insert-div-009-expected.txt:
        * layout-tests/editing/inserting/insert-div-024-expected.txt:
        * layout-tests/editing/pasteboard/paste-text-011-expected.txt:
        * layout-tests/editing/pasteboard/paste-text-013-expected.txt:
        * layout-tests/editing/pasteboard/paste-text-015-expected.txt:
        * layout-tests/editing/style/block-style-004-expected.txt:
        * layout-tests/editing/style/block-style-005-expected.txt:
        * layout-tests/editing/style/block-style-006-expected.txt:
        * 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:

        New test to check specific problem mentioned in the bug.

        * layout-tests/editing/inserting/insert-div-026-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-026.html: Added.

2005-02-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/4002864> REGRESSION(125-146) getElementById in onload fails in a test case involving external resources
        
	Moved management of elementById hashtable from attach/detach to
	insertedIntoDocument/removedFromDocument, to avoid being thrown
	off by temporary detaches due to style recalcs.
	
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::insertedIntoDocument):
        (ElementImpl::removedFromDocument):
        (ElementImpl::attach):
        (ElementImpl::updateId):
        * khtml/xml/dom_elementimpl.h:

	Make sure that insertedIntoDocument is called before firing any
	DOM events.
	
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeBaseImpl::dispatchChildInsertedEvents): 

2005-02-28  David Hyatt  <hyatt@apple.com>

	Fix for 4028999, safari crashes when resetting if mallocsribble is on.  Clip rects were being cleared using dead
	render objects.  Change the ordering.
	
        Reviewed by rjw

        * khtml/rendering/render_box.cpp:
        (RenderBox::detach):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::~RenderLayer):

2005-02-28  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Call updateLayout so caretMinOffset and caretMaxOffset return correct values.

2005-02-28  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - WebCore part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links 
        on frameset page gets stuck at end (tivofaq.com)

        * kwq/WebCoreBridge.h:
        add nextValidKeyViewOutsideWebFrameViews (code is in WebKit)

2005-02-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3972665> 8A360: HTML message partially truncated on left hand side, text-indent from Script Editor

        * khtml/css/css_computedstyle.cpp: inheritableProperties array now defined in css_valueimpl.cpp.
        * khtml/css/css_valueimpl.cpp: Define inheritableProperties array here.
        (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Use new name for blockProperties, and use the new
        constant for the number of items in the array.
        (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
        (DOM::CSSMutableStyleDeclarationImpl::removeInheritableProperties): New function.
        * khtml/css/css_valueimpl.h: Declare inheritableProperties array and numInheritableProperties extern so they
        can be defined in css_valueimpl.cpp and used in css_computedstyle.cpp.
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::removeStyleNodes): This code was misguided, and removed too much style from HTML
        elements. Now, it removes from HTML elements only the styles that we replace later with a call to applyStyle().
        Also, add ID_B to list of inline "style" nodes we are willing to remove. Leaving it off was an oversight.

        * layout-tests/editing/pasteboard/paste-text-011-expected.txt: ID_B fix made this result change, without any
        visible change in the test.
        
        New test:
        
        * layout-tests/editing/style/smoosh-styles-003.html
        * layout-tests/editing/style/smoosh-styles-003-expected.txt

2005-02-28  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4026985> CrashTracer: ...14 crashes at com.apple.WebCore: -[KWQPageState invalidate] + 32

	Added more nil checking and ASSERTS.
	Without a reproducible case this is hard to definitively resolve.

        Reviewed by John Sullivan.

        * kwq/KWQPageState.mm:
        (-[KWQPageState invalidate]):

2005-02-28  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4027702> 3.5% performance regression btwn Safari-188 and Safari-400

	I inadvertently checked in some debugging code that disabled
	style sharing.  Backed out that change.

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::styleForElement):

2005-02-28  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari

        Reviewed by john.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::tryGet): when frameset.<name of frame child> is called, return the window object of the frame child

2005-02-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/4026906> Paste of HTML table content can break table structure

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::pruneEmptyNodes): Call new isProbablyTableStructureNode() function to prevent
        removal of empty table structure nodes.
        (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
        (khtml::isProbablyTableStructureNode): New helper function.
        * khtml/editing/htmlediting.h: Declare new helper.

2005-02-28  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): ref and deref the element while it is "floating"
        (khtml::ReplacementFragment::insertFragmentForTestRendering): ditto
        (khtml::floatRefdElement): new, keeps an element alive while its ref count is 0
        (khtml::createDefaultParagraphElement): removed commented out code
        (khtml::createBlockPlaceholderElement): ref the element and return it as "floating"
        (khtml::createFontElement): ditto
        (khtml::createStyleSpanElement): ditto
        * khtml/editing/htmlediting.h:

2005-02-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Vicki.

	<rdar://problem/3993557> REGRESSION (125-180-ish): getElementsByTagName no longer works with namespace designations
        
	* khtml/xml/dom_nodeimpl.cpp:
        (NodeBaseImpl::getElementsByTagNameNS): When no namespace is specified, find elements
	of the specified name in any namespace to match Mozilla and earlier Safari behavior.

2005-02-25  Darin Adler  <darin@apple.com>

        Reviewed by Adele.

        - fixed <rdar://problem/4025618> Crash while searching at hollywoodvideo.com

        * khtml/html/html_formimpl.h: Added valueWithDefault.
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::appendFormData): Call valueWithDefault instead of going at the render object
        to try to get the default value; there may be no render object if this is display:none.
        (DOM::HTMLInputElementImpl::valueWithDefault): Added. Knows about the defaults for "submit" and "reset"
        buttons; otherwise just returns the value as-is.

        * khtml/rendering/render_form.h: Removed the defaultLabel member functions.
        * khtml/rendering/render_form.cpp:
        (RenderSubmitButton::rawText): Call valueWithDefault instead of using defaultLabel function here on
        the render side. The DOM needs to know how to deal with the default anyway for form submission.
        (RenderSubmitButton::defaultLabel): Removed.
        (RenderResetButton::defaultLabel): Removed.
        (RenderPushButton::defaultLabel): Removed.

2005-02-25  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus

        * kwq/KWQKHTMLPart.h: Added setWindowHasFocus function and m_windowHasFocus data member.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setDisplaysWithFocusAttributes): Took out the code that sends the focus and blur events.
        (KWQKHTMLPart::setWindowHasFocus): Put that code here instead.

        * kwq/WebCoreBridge.h: Added setWindowHasFocus: method to the bridge.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge setWindowHasFocus:]): Added. Calls method on the part.

2005-02-25  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - re-fixed <rdar://problem/3665430> horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode

        * kwq/KWQTextArea.mm: (-[KWQTextArea _updateTextViewWidth]): Don't change the text view width
        to match the text area's width in the "wrap" case.

2005-02-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/4021518> 8A394 Mail crashes during paste: khtml::RootInlineBox::closestLeafChildForXPos

        * khtml/editing/visible_units.cpp:
        (khtml::previousLinePosition): Adding an updateLayout call at the start of the function fixes the crash, since
        we caught line boxes in a not-completely-updated state.
        (khtml::nextLinePosition): Ditto.

2005-02-25  David Hyatt  <hyatt@apple.com>

	Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
	DOM subtrees are inserted into documents via one insert/append call.
	
        Reviewed by kocienda

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::nextRenderer):

2005-02-25  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.

	Second pass at fixing 3382926 w/o causing layout regressions.  Same concept:
	if directionality of text's element is RTL and first character has neutral directionality
	then set the initial directionality to RTL.

        Reviewed by Hyatt.

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::bidiReorderLine):
        (khtml::RenderBlock::determineStartPosition):

=== Safari-400 ===

2005-02-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        Roll out Chris' change to fix this bug:
        
        <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste
        
        That code change is responsible for all these new crashers:
        
        <rdar://problem/4025177> crash copying safari.apple.com into Blot document
        <rdar://problem/4025184> crash in DOM::NodeImpl::parentNode copying "New!" from google.com to Blot
        <rdar://problem/4025214> crash in DOM::NodeImpl::getRect loading paste-match-style-001.html

        Since we wish to close the tree for a build right now, I am rolling out rather than investigating.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded)
        (khtml::ReplacementFragment::insertFragmentForTestRendering)
        (khtml::createDefaultParagraphElement)
        (khtml::createBlockPlaceholderElement)
        (khtml::createFontElement)
        (khtml::createStyleSpanElement)
        * khtml/editing/htmlediting.h

2005-02-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4020108> Pasting text into message makes Mail crash reproducibly

        Note that, even with this fix, development build will crash until this bug is fixed:
        <rdar://problem/4024996> Applying block styles can cause assertion failure in inline style removal
        
        This will not crash deployment builds, so I am going to land.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::applyBlockStyle): Applying block styles can make the loop to reach beyondEnd
        fail since the structure of the document can change. Cache the next node first before operating on it,
        as we do elsewhere.

2005-02-25  Vicki Murley <vicki@apple.com>

	- recommit this change, since rolling it out did NOT fix the performance regression!

    2005-02-23  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves

        The key was to change things around so that we don't push text from the DOM to the widget
        unless the DOM has actually been changed. This prevents the code path that wipes out inline input
        during the blur process.

        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
        (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
        new value is set here.
        (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
        is set here.
        (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
        to true, and also sends out the input event. It's better to have this here than in the renderer code.
        (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
        m_dirtyvalue) and m_valueMatchesRenderer as false.
        (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
        the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
        where the value came from.
        (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
        (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
        (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.

        * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
        and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
        by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.

        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
        is true.
        (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
        directly.
        (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
        (RenderTextArea::handleFocusOut): Ditto.
        (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
        DOM if valueMatchesRenderer is true.
        (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.

2005-02-25  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4023566> Stickies: Crash in ReplacementFragment::insertFragmentForTestRendering on paste

        Reviewed by darin.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
        (khtml::ReplacementFragment::insertFragmentForTestRendering):
        (khtml::floatRefdElement):
        (khtml::createDefaultParagraphElement):
        (khtml::createBlockPlaceholderElement):
        (khtml::createFontElement):
        (khtml::createStyleSpanElement):
        * khtml/editing/htmlediting.h:

2005-02-25  Darin Adler  <darin@apple.com>

        * kwq/character-sets.txt: Checked in updated file. This new file has no effect, because none of the
        changes affect character sets that we support, but it's good to have the latest file in here, and
        completely safe because I checked that the generated files have not changed.

2005-02-25  Vicki Murley <vicki@apple.com>

        Reviewed by Darin.
 
	- back out this change, since it causes a 3.5% performance regression

    2005-02-23  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves

        The key was to change things around so that we don't push text from the DOM to the widget
        unless the DOM has actually been changed. This prevents the code path that wipes out inline input
        during the blur process.

        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
        (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
        new value is set here.
        (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
        is set here.
        (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
        to true, and also sends out the input event. It's better to have this here than in the renderer code.
        (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
        m_dirtyvalue) and m_valueMatchesRenderer as false.
        (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
        the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
        where the value came from.
        (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
        (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
        (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.

        * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
        and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
        by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.

        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
        is true.
        (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
        directly.
        (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
        (RenderTextArea::handleFocusOut): Ditto.
        (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
        DOM if valueMatchesRenderer is true.
        (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.

2005-02-25  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced

        * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
        Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
        functions to add the leading and trailing spaces for smart paste.

2005-02-25  David Hyatt  <hyatt@apple.com>

	Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
	
        Reviewed by john

        * khtml/rendering/bidi.cpp:
        (khtml::BidiIterator::direction):

2005-02-25  David Hyatt  <hyatt@apple.com>

	Fix for 3975039, scrolling is slow in huge RSS views.  Optimize the calculation of clip rects for overflow:hidden
	layers.  Also optimize layer movement when scrolling overflow sections.
	
        Reviewed by darin

        * khtml/rendering/render_layer.cpp:
        (throw):
        (ClipRects::operator delete):
        (ClipRects::detach):
        (RenderLayer::RenderLayer):
        (RenderLayer::~RenderLayer):
        (RenderLayer::updateLayerPosition):
        (RenderLayer::removeOnlyThisLayer):
        (RenderLayer::insertOnlyThisLayer):
        (RenderLayer::scrollToOffset):
        (RenderLayer::hitTest):
        (RenderLayer::calculateClipRects):
        (RenderLayer::calculateRects):
        (RenderLayer::containsPoint):
        (RenderLayer::clearClipRects):
        (RenderLayer::clearClipRect):
        * khtml/rendering/render_layer.h:
        (khtml::ClipRects::m_refCnt):
        (khtml::ClipRects::overflowClipRect):
        (khtml::ClipRects::fixedClipRect):
        (khtml::ClipRects::posClipRect):
        (khtml::ClipRects::ref):
        (khtml::ClipRects::deref):
        (khtml::RenderLayer::clipRects):
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):

2005-02-24  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin and Dave a while ago.

	<rdar://problem/3996685> REGRESSION: Crash in KWQVectorImpl::at loading http://maps.google.com/mapfiles/homepanel.xsl
        
	* kwq/WebCoreBridge.mm:
        (formElementFromDOMElement): Check for isHTMLElement() as well as
	id() == ID_FORM. This seems like an impossible situation, but
	papering over it seems more expedient for the time being.

2005-02-24  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.

	Use mirror characters correctly when rendering with RTL directionality.

        Reviewed by Hyatt.

        * khtml/rendering/bidi.cpp:
        (khtml::BidiIterator::direction):

2005-02-24  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame
	
        Reviewed by Hyatt.

        * WebCore.pbproj/project.pbxproj:
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageLoader::updateFromElement):
        * khtml/rendering/render_image.cpp:
        (RenderImage::resetAnimation):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_list.cpp:
        (RenderListMarker::setStyle):
        (RenderListMarker::paint):
        * khtml/rendering/render_list.h:
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (QPixmap::QPixmap):
        (QPixmap::resetAnimation):
        * kwq/WebCoreImageRenderer.h:

2005-02-24  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/4020110> Safari crashes in setAllData while taking a www.zoomerang.com survey

        Reviewed by rjw.

        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader finishJobAndHandle:]): clear the job after we've deleted to avoid reentrancy

2005-02-24  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        - fixed <rdar://problem/4023360> REGRESSION (186-187): image file upload is broken at pep.apple.com

        * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::appendFormData): Return true after
        setting up the form data for an uploaded file. The old code would fall through to the ISINDEX
        case and send double form data (the filename instead of the file contents the second time).

2005-02-24  David Harrison  <harrison@apple.com>

        Reviewed by Ken.
        
        <rdar://problem/3990849> AX: textMarkerRange for an AXUIElement within an AXWebArea

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject textMarkerRange]):
        (-[KWQAccObject accessibilityParameterizedAttributeNames]):
        (-[KWQAccObject doAXTextMarkerRangeForUIElement:]):
        (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
        Added AXTextMarkerRangeForUIElement, or you can send textMarkerRange to the UIElement itself.

2005-02-24  David Harrison  <harrison@apple.com>

        Reviewed by Vicki.

        <rdar://problem/4004279> 3 AXSelectedTextChanged notifications are firing each time I type a character

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection):
        Send notification only if the selection is not null.  This safely ignores transitory selections set during editing.

2005-02-24  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3987619> in some cases, text doesn't resize with Format->Style->Bigger/Smaller

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): Only call nodeFullySelected for non-text nodes.
        Text nodes are already split so they're either in the range and full selected or out of the range.
        And nodeFullySelected doesn't work for text nodes.
        (khtml::ApplyStyleCommand::nodeFullySelected): Add an assertion, since this function only works for elements,
        not text nodes.
        (khtml::ApplyStyleCommand::nodeFullyUnselected): Ditto.

        - make big improvement in <rdar://problem/3953636> Mail hung for ~10sec changing font of 84328 characters: khtml::ApplyStyleCommand::nodeFullySelected

        * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::compareBoundaryPoints): Improve algorithm based on suggestion
        from Nate Begeman.

        - fixed <rdar://problem/4020305> REGRESSION (185-186): loading image in new window using document.write fails

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::open): If there is no parent document, don't blow away the base URL.

        - fixed <rdar://problem/4021701> REGRESSION (188-188+): form not submitted after pressing <return> at http://hrweb.apple.com
        
        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchMouseEvent): Send activate event in the case where the event
        sent is a KHTML_CLICK_EVENT, not CLICK_EVENT.

2005-02-23  Kevin Decker  <kdecker@apple.com>

        Reviewed by mjs  
        
        Fixed <rdar://problem/4020747> REGRESSION: stray </applet> tags crash Safari

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::processCloseTag):  Made a typesafe check that prevents crashes
        whenever there is a closing applet tag without an actual <applet> in the first place. 
        Now verifies the current token is ID_APPLET before casting it to an HTMLAppletElementImpl.
         

2005-02-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
        that we were doing work in cases where we should not, and content whose style would have
        been correct if we had done nothing was getting clobbered. It turns out that extra work
        to apply style to the new paragraph added in this command only needs to be done if we're 
        at the boundaries of a paragraph. Otherwise, content that is moved as part of the work 
        of the command will lend their styles to the new paragraph without any extra work needed.
        So, make this position check and return unless at a paragraph boundary.

        New test:

        * layout-tests/editing/style/block-styles-007-expected.txt
        * layout-tests/editing/style/block-styles-007.html

2005-02-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a selection starting from end of line once

        Problem is with the way we figure out whether to add or remove a style based on
        the current selection. In this case, the code is looking at the end of the
        previous line, which is not bold, and deduces incorrectly that the operation is
        a "make bold". Then the style code runs to make bold, but there is nothing on
        the end of the previous line to embolden, so we get into a cycle where the same
        thing happens each time cmd-b is hit.

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectionComputedStyle):  Call editingStartPosition() to get the right position for the font determination.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::editingStartPosition): New helper function that "does the right thing" based on whether the
        selection is a caret or a range, moving upstream for the former, and downstream for the latter.
        * khtml/xml/dom2_rangeimpl.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection): Call editingStartPosition() to get the right position for the font determination.

        New tests:

        * layout-tests/editing/style/style-boundary-001-expected.txt
        * layout-tests/editing/style/style-boundary-001.html
        * layout-tests/editing/style/style-boundary-002-expected.txt
        * layout-tests/editing/style/style-boundary-002.html
        * layout-tests/editing/style/style-boundary-003-expected.txt
        * layout-tests/editing/style/style-boundary-003.html
        * layout-tests/editing/style/style-boundary-004-expected.txt
        * layout-tests/editing/style/style-boundary-004.html

2005-02-23  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3985579> 8A367: Dashboard: Stock widget not visible when click remove to remove single char ticker symbol

	Explicitly remove scroll bar views when removing them from 
	the overflow.

	Don't paint synchronously when the scroll position changes,
	this caused funky clip problems.

        Reviewed by Hyatt.

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::scrollToOffset):
        (RenderLayer::setHasHorizontalScrollbar):
        (RenderLayer::setHasVerticalScrollbar):
        (RenderLayer::updateScrollInfoAfterLayout):

2005-02-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3959996> REGRESSION (Mail): cursor moves to beginning of document when click is past end

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates): Skip blocks that are invisible or have no height when 
        looking for a child to pass off to. And save away the last visible block with a height to pass off
        to if there is no child at the right y-coordinate.

2005-02-23  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4010059> BoundsForTextMarkerRange does not update with scrolled web area

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
        Adjust for scrolling.

2005-02-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3949790> hitting return after pasted styled line results in extra content getting the style
	
        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): In the case
	where the start block is the root, insert the newly created DIV at
	the end of the root block instead of after the last sibling in the
	start node, since the start node could be inside other
	style-affecting nodes and we don't want to reparent its cousins
	into that.

2005-02-23  David Harrison  <harrison@apple.com>

        Reviewed by Vicki.

        <rdar://problem/4014691> switch to correctly spelled NSAccessibilityForegroundColorTextAttribute constant
        
        Also removed two older, now unneeded, wrappers.

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
        (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
        Removed these older, now unneeded, wrappers.
        
        (NSAccessibilityForegroundColorTextAttributeWrapper):
        New wrapper for NSAccessibilityForegroundColorTextAttribute.
        
        (AXAttributeStringSetStyle):
        Use NSAccessibilityForegroundColorTextAttributeWrapper.
        
        (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
        Remove uses of visiblePositionForStartOfTextMarkerRange and visiblePositionForEndOfTextMarkerRange.

2005-02-23  David Harrison  <harrison@apple.com>

        Reviewed by Vicki.

        <rdar://problem/3524784> AX hit test doesn't return info when done in empty space of content area

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityHitTest:]):
        Return unignored object.

2005-02-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/4006509> REGRESSION (171-172): Setting CSS -khtml-user-modify property triggers crash

        * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyProperty):
        Removed the code that changes the style of the element. This was never needed, and caused the
        style to be modified while we were iterating it.

2005-02-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
        insertion so that it come before the move. The logic stays exactly the same, however, with the old
        ordering, the new block could want to become a child of itself come insertion time. I considered
        making a more complicated code change to fix this problem, but the simple reordering works just
        as well, and seems less risky.
        
        These all changed in an insignificant way. It seems that with the new code, some empty text nodes
        got reordered in the document. This has no effect on anything visible to the user.
        
        * layout-tests/editing/style/create-block-for-style-003-expected.txt
        * layout-tests/editing/style/create-block-for-style-004-expected.txt
        * layout-tests/editing/style/create-block-for-style-009-expected.txt
        * layout-tests/editing/style/create-block-for-style-011-expected.txt
        * layout-tests/editing/style/create-block-for-style-013-expected.txt

2005-02-23  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4013986> REGRESSION (173-174): onclick event not sent when mouse click on checkbox is double-click

        We need to send an onclick event *and* an ondblclick event when we process a double click.

        * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): In the case where we're sending a CLICK_EVENT,
        follow it by a KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT when handling a double click, and a DOMACTIVATE_EVENT.
        We no longer do the DOMACTIVATE_EVENT in dispatchGenericEvent.
        * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked): send only CLICK_EVENT here, and
        lets dispatchMouseEvent deal with the other subsequent events.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchGenericEvent): Remove the code that sends a DOMACTIVATE_EVENT, since there's no longer
        a good way to figure out if this is the last event that should be sent before it is.
        (NodeImpl::dispatchMouseEvent): Set the meta key modifier here (as it already is set elsewhere), and
        follow up a CLICK_EVENT with KHTML_CLICK_EVENT, a KHTML_DBLCLICK_EVENT, and DOMACTIVATE_EVENT as above.

2005-02-23  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4011405> REGRESSION (180-181): Unconfirmed text disappears when text focus moves

        The key was to change things around so that we don't push text from the DOM to the widget
        unless the DOM has actually been changed. This prevents the code path that wipes out inline input
        during the blur process.

        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::HTMLInputElementImpl): Start m_valueMatchesRenderer as false.
        (DOM::HTMLInputElementImpl::parseHTMLAttribute): Set m_valueMatchesRenderer to false when a
        new value is set here.
        (DOM::HTMLInputElementImpl::setValue): Set m_valueMatchesRenderer to false when a new value
        is set here.
        (DOM::HTMLInputElementImpl::setValueFromRenderer): Added. Sets m_value, sets m_valueMatchesRenderer
        to true, and also sends out the input event. It's better to have this here than in the renderer code.
        (DOM::HTMLTextAreaElementImpl::HTMLTextAreaElementImpl): Start m_valueIsValid as false (replaces
        m_dirtyvalue) and m_valueMatchesRenderer as false.
        (DOM::HTMLTextAreaElementImpl::updateValue): Added. Factored this out from the value function. Uses
        the new booleans and keeps them up to date, specifically setting m_valueMatchesRenderer based on
        where the value came from.
        (DOM::HTMLTextAreaElementImpl::value): Updated to call updateValue to do most of the work.
        (DOM::HTMLTextAreaElementImpl::setValue): Set both m_valueIsValid and m_valueMatchesRenderer.
        (DOM::HTMLTextAreaElementImpl::setDefaultValue): Take parameter by reference.

        * khtml/html/html_formimpl.h: Added setValueFromRenderer, valueMatchesRenderer, setValueMatchesRenderer,
        and m_valueMatchesRenderer to input element. For textarea element, made some parameters pass DOMString
        by reference, and added invalidateValue, updateValue, valueMatchesRenderer, and setValueMatchesRenderer.

        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::updateFromElement): Don't re-get the value from the DOM if valueMatchesRenderer
        is true.
        (RenderLineEdit::slotTextChanged): Call setValueFromRenderer instead of manipulating the DOM
        directly.
        (RenderTextArea::detach): Call updateValue instead of calling value for its side effect.
        (RenderTextArea::handleFocusOut): Ditto.
        (RenderTextArea::updateFromElement): Call updateValue and then not re-get the value from the
        DOM if valueMatchesRenderer is true.
        (RenderTextArea::slotTextChanged): Call invalidateValue instead of directly setting m_dirtyvalue to true.

2005-02-22  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions

	Just set dashboard dirty bit when overflow scrolling changes.

	Don't do comparison of regions in before scroll regions are
	added, instead do it in WebKit after automatic scroll regions
	are added.

        Reviewed by Maciej.

        * khtml/css/cssparser.cpp:
        (CSSParser::parseDashboardRegions):  Cleaned up comments
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::styleForElement): Cleaned up comments

        * khtml/khtmlview.cpp:
        (KHTMLView::updateDashboardRegions):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateScrollInfoAfterLayout):
        * kwq/WebDashboardRegion.m:
        (-[WebDashboardRegion isEqual:]):

2005-02-22  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines

        Reviewed by mjs.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
        * khtml/editing/jsediting.cpp:
        * khtml/khtml_part.cpp:
        (KHTMLPart::pasteAndMatchStyle): new
        * khtml/khtml_part.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
        * kwq/WebCoreBridge.h:
        * layout-tests/editing/editing.js:

2005-02-22  Darin Adler  <darin@apple.com>

        Reviewed by Adele.

        - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)

        * khtml/xml/dom_docimpl.cpp:
        (widgetForNode): Added helper.
        (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
        The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.

2005-02-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora

        * khtml/editing/htmlediting.cpp:
        (khtml::isEmptyFontTag): Helper for removing <font> tags.
        (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
        legacy-html-styles value.
        (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
        (khtml::ApplyStyleCommand::isHTMLStyleNode):
        (khtml::ApplyStyleCommand::removeHTMLFontStyle):
        (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
        whether to use legacy html styles or not.
        (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
        (khtml::createFontElement): Helper for applying <font> elements.
        * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
        (khtml::StyleChange::applyFontColor)
        (khtml::StyleChange::applyFontFace)
        (khtml::StyleChange::applyFontSize)
        (khtml::StyleChange::fontColor)
        (khtml::StyleChange::fontFace)
        (khtml::StyleChange::fontSize)

        Test results updated now that we will write out <font> tags for quirks mode documents.        
        
        * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
        * layout-tests/editing/style/block-style-004-expected.txt
        * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
        * layout-tests/editing/style/block-style-005-expected.txt
        * layout-tests/editing/style/block-style-006-expected.txt
        * layout-tests/editing/style/smoosh-styles-001-expected.txt
        * layout-tests/editing/style/smoosh-styles-002-expected.txt

2005-02-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles

	When creating option elements, use lowercase "option" instead of
	uppercase "OPTION" to create option elements, because only
	lowercase works for XHTML.
	
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLSelectCollection::tryPut):
        (OptionConstructorImp::construct):

2005-02-22  Chris Blumenberg  <cblu@apple.com>

	WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies
	
	Mail must 4018993 to fully address the problem.

        Reviewed by kocienda.

        * khtml/editing/markup.cpp:
        (khtml::startMarkup): don't compute style for text in PRE tags
        (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range

2005-02-21  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com

	There was a long standing bug in cssText().  Double value were always cast int!  So,
	opacity values values were incorrectly converted to text, i.e. 0.75 became 0.
	
	The problem was newly triggered because we parse the css for opacity *TWICE*.  This is a result of 
	incorrectly "invalidating" the style attribute (from fix for 3790449).  The second parse was from
	the cssText() of the style.

        Reviewed by Hyatt.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSPrimitiveValueImpl::cssText):

2005-02-21  David Hyatt  <hyatt@apple.com>

	Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
	Skip elements with layers and inline flows.  Demoted <form>s can end up causing trouble otherwise.
	
        Reviewed by Richard Williamson

        * khtml/rendering/render_box.cpp:
        (RenderBox::nodeAtPoint):

2005-02-21  David Hyatt  <hyatt@apple.com>

	Fix for 4017033, CSS is being parsed twice.  Make sure to always validate the style attribute when it is
	initially parsed.  Add code to clean up decls when the style attribute is completely removed.  Add a new
	synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
	being synced up to the declaration.

        Reviewed by John

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSMutableStyleDeclarationImpl::setChanged):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::invalidateStyleAttribute):
        (HTMLElementImpl::updateStyleAttributeIfNeeded):
        (HTMLElementImpl::HTMLElementImpl):
        (HTMLElementImpl::~HTMLElementImpl):
        (HTMLElementImpl::destroyInlineStyleDecl):
        (HTMLElementImpl::mapToEntry):
        (HTMLElementImpl::parseHTMLAttribute):
        * khtml/html/html_elementimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::ElementImpl):
        (ElementImpl::setAttribute):
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::updateStyleAttributeIfNeeded):

=== Safari-188 ===

2005-02-21  Darin Adler  <darin@apple.com>

        - fixed Panther deployment build

        * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.

2005-02-21  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps

        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintMarker):
        Make sure underline is placed within the text bounds.
        
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::misspellingLineThickness):
        * kwq/WebCoreTextRenderer.h:
        Add misspellingLineThickness for use by InlineTextBox::paintMarker.

2005-02-21  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space

        * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
        nil check.

2005-02-21  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)

        * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.

2005-02-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted

        * khtml/editing/markup.cpp:
        (khtml::markup): Changed over to ASSERT instead of assert.
        (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
        block did not check for blocks whose markup had already been added, and could result in adding markup for
        nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
        only add markup for those nodes before the start of the selection range. This fixes the bug.
        (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
        (khtml::createFragmentFromText): Ditto.

2005-02-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/4015494> REGRESSION (186-187) <cr> removed if quoted word is copy/pasted on line immediately above quoted text

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Relatively new check designed to remove a <br> element when
        that element was on a line by itself did not do an adequate check for this condition, causing the
        failure described in the bug. Fixed.

2005-02-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

        * khtml/editing/htmlediting.cpp:
        (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
        for this pseudo-color.
        (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
        psuedo-color here, rather than removing colors as was done before.
        (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
        style, and determine the real color based on the nearest blockquote (or none) to the node.
        (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.

        All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
        case, -khtml-match-nearest-mail-blockquote-color.

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty)
        * khtml/css/cssvalues.c:
        (findValue)
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::matchNearestMailBlockquoteColor)
        (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
        (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)

2005-02-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for these bugs:
        
        <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
        <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
        the fragment is inserted into the document, rendered, and then tested for certain
        important pieces of information that are required for pasting.
        (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
        the fragment nodes into the document.
        (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
        document, and restores them to the fragment.
        (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
        did this before into its own function.
        (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
        (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
        eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
        counted are real, rendered blocks.
        (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
        CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
        in the short term while there are still versions of Mail out there that use <p> elements
        instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
        with other mail clients that use <p> elements for their paragraphs but render them themselves
        with no margins as the result of quirks.
        (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
        of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This, 
        coupled with the refactoring, fixes 4014393.
        * khtml/editing/htmlediting.h: Updated for new functions.
        * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
        * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.

2005-02-19  Kevin Decker  <kdecker@apple.com>

        Reviewed by Chris.

	Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission
	
	Our window.open() policy is to refuse the <script>window.open(...)</script> case and allow the inline the <a href="javascript:window.open('foo')> case.  Clever advertisers at some point realized that by executing their Javascript through the Flash plugin, Safari would always treat their code as the inline case, and thus, they were able to work around our popup blocker.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
        (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Let the WebKit make the determination if this was a user originated gesture or not; we must no longer assume this is always the case.

2005-02-18  Chris Blumenberg  <cblu@apple.com>
	
	Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
	- If we find a new start node, update topBlockquote so we don't use too many block quotes for the contents following the new line.
	- Build up the list of ancestors after we've determined the actual topBlockquote.
	- Don't insert an extra new line if there is a new start node.

2005-02-19  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3978461> smart paste is broken

        Reviewed by kevin.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): properly check for leading and trailing whitespace. These checks were incorrectly reversed. Also check if we're pasting at the beginning or end of a line. We should not insert spaces in either case.

2005-02-18  Adele Amchan  <adele@apple.com>

        Reviewed by Darin.

        Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem

        This patch fixes two problems caused by our added support for custom tags.  First, the layout problem at the sites mentioned in the bug
        was caused by custom tags within tables.  In checkChild, we needed to treat these tags as spans so they get placed correctly in the DOM tree.
        Also, we were indexing the tagPriority and endTag arrays with id values from the custom tags that were greater than the size of the array.  So now 
        we have functions to check for the custom tags, and again, treat them as spans.  To avoid confusion, we changed the names of the arrays to
        endTagArray and tagPriorityArray.

        * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
        (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
        (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
        * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
        (DOM::checkChild): treat custom tags as spans during this check
        * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
        (HTMLElementImpl::createContextualFragment):
        (HTMLElementImpl::setInnerText):
        (HTMLElementImpl::setOuterText):
        (HTMLElementImpl::toString):
        * khtml/html/htmlparser.cpp: changed all uses of the endTag array to the endTagRequirement function and all uses of the tagPriority array to the tagPriority function.
        (KHTMLParser::parseToken):
        (KHTMLParser::insertNode):
        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
       * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
        (khtml::endMarkup): 
        (khtml::markup):

2005-02-18  Jens Alfke  <jens@apple.com>

        Reviewed by Hyatt.

	Fixed build: Whoops, setNeedsLayout's parameter is NOT optional.

        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::setAllParamsAvailable):

2005-02-18  Jens Alfke  <jens@apple.com>

        Reviewed by cblu, hyatt.

	Fixes <rdar://problem/3603191> "REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2"
	Defer instantiation of Java applet plugin until after all of the <applet> tag's nested <param> 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   <rjw@apple.com>

	Fixed <rdar://problem/4006161> 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  <cblu@apple.com>

	Fixed: <rdar://problem/3945271> 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  <kocienda@apple.com>

        Reviewed by Chris

        Fix for these bugs:
        
        <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
        <rdar://problem/4013100> 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 <p> to <div> change in test content.
        * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to 
        make this test go with the new design of using <div> tags for default paragraphs.

2005-02-18  David Hyatt  <hyatt@apple.com>

	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  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3998627> 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   <rjw@apple.com>

        Fixed <rdar://problem/3999467> 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  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/4011210> 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  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/4012058> 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   <rjw@apple.com>

	Fixed <rdar://problem/4008163> 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  <adele@apple.com>

        Reviewed by Chris.

        fix for <rdar://problem/4010028> 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  <jens@apple.com>

        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  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora

        * khtml/editing/htmlediting.cpp:
        (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
        This fixes the problem, as these other mailers show <div> elements without margins.
        
        Some test files needed to change to preserve the ability to "eyeball" the results.
        Many others changed just because their <p> elements changed to <div> 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  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3996737> 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  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3998892> 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  <cblu@apple.com>
	
	Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> 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  <sullivan@apple.com>

        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  <sullivan@apple.com>

        Written by Darin, reviewed by me.
        
        - WebCore part of fix for <rdar://problem/4007384> 
        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  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3942428> reproducible crash loading cbs.sportsline.com
	
	This change reverts the fix for <rdar://problem/3805311>, 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  <harrison@apple.com>

        Reviewed by Maciej.

        <rdar://problem/3933665> 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  <harrison@apple.com>

        Reviewed by Darin.

        (continued) <rdar://problem/4004305> 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  <kocienda@apple.com>

        Reviewed by John
        
        Fix for this bug:
        
        <rdar://problem/3951178> 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  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line

        Reviewed by Darin.

        <rdar://problem/4004305> 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 <rdar://problem/3917929> 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  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3686434> 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  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/4004305> 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  <mjs@apple.com>

        Reviewed by Ken and John.

	Re-fixed a specific case of the following:

	<rdar://problem/3790449> 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 <br> 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  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3978980> 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   <rjw@apple.com>

	Fixed <rdar://problem/3985118> 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  <cblu@apple.com>

	Fixed: <rdar://problem/3937352> 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  <adele@apple.com>

        Reviewed by Darin.

        fix for <rdar://problem/4004004> no need to add body element for xml documents

        In the fix for <rdar://problem/3758785> 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  <adele@apple.com>

        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  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3915449> 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  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3992092> 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  <darin@apple.com>

        Reviewed by Harrison.

        - added support needed to fix <rdar://problem/3991225> 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  <darin@apple.com>

        Reviewed by Harrison.

        - fixed <rdar://problem/3990484> 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  <hyatt@apple.com>

	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  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3965158> 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  <darin@apple.com>

        Reviewed by Adele.

        - fixed <rdar://problem/3974988> 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  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3991532> 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  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3991848> 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  <hyatt@apple.com>

	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  <hyatt@apple.com>

	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  <hyatt@apple.com>

	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  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3977973> 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  <cblu@apple.com>

	Fixed: <rdar://problem/3999213> 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  <harrison@apple.com>

        Reviewed by Darin.
        
        <rdar://problem/3937447> 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) <rdar://problem/3982096> 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  <cblu@apple.com>

	Fixed: <rdar://problem/3985211> 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  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3996344> Entire document content is deleted when only the first paragraph was supposed to be

        Problem stems from my attempt to fix this bug: <rdar://problem/3986155> 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  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3890352> 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  <adele@apple.com>

        Reviewed by Darin.

        Fix for <rdar://problem/3993628> REGRESSION (180-181): Logitelnet bank's website doesn't work

        This fixes an oversight in the fix for <rdar://problem/3964286>.  
        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  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3953302> 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  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3994164> 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  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3993722> need oncut and onpaste handlers implemented for <textarea> (needed for widgets)

        * kwq/KWQTextArea.mm:
        (-[KWQTextAreaTextView dispatchHTMLEvent:]): Added.
        (-[KWQTextAreaTextView cut:]): Dispatch "before cut" and "cut" events.
        (-[KWQTextAreaTextView copy:]): Dispatch "before copy" and "copy" events.
        (-[KWQTextAreaTextView paste:]): Dispatch "before paste" and "paste" events.
        (-[KWQTextAreaTextView pasteAsPlainText:]): Ditto.
        (-[KWQTextAreaTextView pasteAsRichText:]): Ditto.

2005-02-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3943038> <input type=search> that is focused in onload handler doesn't have a visible editor

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setFocusNode): Always update layout before giving focus to a widget.
        This prevents the bad case where we give a widget focus before it has been positioned or sized, causing us to
        exercise edge cases AppKit doesn't handle well.

        * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Remove workaround code I added
        to fix bug 3943049. Updating the layout fixes the same problem in a cleaner, safer way, and solves another problem,
        with the way the clip view is set up.

2005-02-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3425232> textarea won't trigger onchange action when clicking to new field

        * khtml/rendering/render_form.h: Added new m_dirty data member.
        * khtml/rendering/render_form.cpp:
        (RenderTextArea::RenderTextArea): Initialize m_dirty to false.
        (RenderTextArea::detach): Call value() on the DOM element to cause it to fetch the value from this object.
        (RenderTextArea::handleFocusOut): Ditto. Also send the onchange event based only on the m_dirty flag.
        (RenderTextArea::updateFromElement): Clear the m_dirty flag if the edited value is blown away by a value
        that comes from the DOM element. Remove code to clear the element's m_dirtyvalue flag; that's an unnecessary
        optimization, and ideally we'll stop having code in the render object that knows about that flag later.
        (RenderTextArea::slotTextChanged): Set the m_dirty flag.

2005-02-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - re-fixed <rdar://problem/3760910> please add support for custom tag names in HTML

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::tagId): Use ID_LAST_TAG + 1 for the ID of the first assigned tag ID. Before we'd use ID_LAST_TAG,
        which resulted in the same number being used for ID_COMMENT and the first custom tag.
        (DocumentImpl::tagName): Use ID_LAST_TAG + 1, as above.
        (DocumentImpl::namespaceURI): Change a < ID_LAST_TAG to <= ID_LAST_TAG in the same spirit as above.

2005-02-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3986639> Crash occurs after choosing Undo Typing from the Edit menu

        * kwq/KWQTextArea.mm: (-[KWQTextArea viewWillMoveToWindow:]): Remove actions from undo manager when the view is
        removed from the window. Unfortunately, to do this the code has to know that the target of NSTextView actions
        will be the text storage object, but given the NSText architecture, that's pretty clear.

2005-02-05  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work

        Reviewed by hyatt.

        * kwq/KWQKJavaAppletWidget.mm:
        (KJavaAppletWidget::KJavaAppletWidget): fallback to the document's base URL if there is no baseURL attribute
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge baseURL]): new

2005-02-04  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        Rolled out Ken's accidental checkin when committing <rdar://problem/3986155> fix yesterday.
        
        * khtml/editing/selection.cpp:
        (khtml::Selection::validate):

2005-02-04  Adele Amchan  <adele@apple.com>

        Reviewed by Darin.

        Fix for <rdar://problem/3758785> Safari no longer works at BankOfAmerica online banking for military users
  
        When closing the document, if a body doesn't exist we now create one.  This bug was preventing the onload handler from
        firing in cases where there wasn't a body.  In the BankOfAmerica case, the page was just a bit of script where the onload
        handler redirected to the correct page.

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):

2005-02-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3986155> Insertion point goes to beginning of doc after deleting

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::setStartNode): New convenience to handle reference counting when setting.
        (khtml::DeleteSelectionCommand::handleGeneralDelete): This contains the crux of the bug fix. Improve tests
        that detect when a selected node needs to be retained, rather than deleted, to preserve the intent of the user.
        This has the side effect of causing the insertion point placement code to succeed rather than fail. Before
        this fix, the failure of the insertion point placement code caused the insertion point to jump to the start
        of the document, which is the symptom that can be perceived by users when editing.
        * khtml/editing/htmlediting.h: Add setStartNode declaration.
        * khtml/editing/visible_units.cpp:
        (khtml::startOfBlock): This function had a stubbed-in non-tested implementation. Implement and 
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-001.html: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002.html: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-003.html: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-004.html: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005-expected.txt: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-005.html: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006-expected.txt: Added.
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-006.html: Added.

=== Safari-183 ===

2005-02-03  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3987419> Stocks and Weather leak what appears to XMLHTTPRequest results

	XMLHTTPRequests were causing massive leaks.  _webcore_initWithHeaderString: did funky things with
	self replacement.  Re-wrote to use more traditional factory constructor avoiding self replacement.
	
        Reviewed by David Harrison.

        * kwq/KWQLoader.mm:
        (+[NSDictionary _webcore_dictionaryWithHeaderString:]):
        (KWQServeRequest):
        (KWQServeSynchronousRequest):

2005-02-03  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3938763> Cannot view Windows Media Player videos (soundtrack is played twice with delay)

        Reviewed by hyatt.

        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::attach): set needWidgetUpdate to false right after calling updateWidget because dispatchHTMLEvent can end up calling this method again
        (HTMLObjectElementImpl::recalcStyle): ditto

2005-02-02  John Sullivan  <sullivan@apple.com>

        Reviewed by Chris.

        - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page, 
        iFrame involved
        
        This also fixes the problems with printing from GMail, yay!

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines):
        If the current line is taller than the entire page height (e.g. tall iFrame), don't try
        to avoid splitting it across pages.
        
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
        Handle error cases in a more obvious manner; this will cause future problems like this
        to print a blank page and complain to the console on debug builds, rather than print a 
        zillionty mostly-blank pages.

2005-02-02  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded

        Reviewed by hyatt.

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget): when getting the MIME type from the PARAM tag, make sure the MIME type is the text from the left of the semi-colon if there is one. We do this elsewhere as well.

2005-02-02  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)

        Reviewed by rjw.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
        * kwq/WebCoreBridge.h:

2005-02-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        * khtml/editing/markup.cpp:
        (khtml::createMarkup): Removed debug spam I committed earlier in error.

2005-02-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support)

        Since base writing direction is a paragraph-level property in AppKit, and we use the CSS direction
        property in WebCore, which can be applied to inline elements as well as blocks, a new notion has
        been added to the WebCore apply style logic. It is now possible to force all properties in a 
        style declaration to be applied as though they were block properties.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::ApplyStyleCommand): Add an enum and a flag to this command that controls whether to force all
        properties in the style to be applied as block styles. Default is "no", retaining previous behavior.
        (khtml::ApplyStyleCommand::doApply): Switch on new flag to apply styles as before, or force all preoperties to be applied
        as block styles.
        * khtml/editing/htmlediting.h:
        (khtml::ApplyStyleCommand::): Add an enum and a flag, as above.
        * khtml/khtml_part.cpp:
        (KHTMLPart::applyParagraphStyle): New method to force application of all style properties as block styles.
        * khtml/khtml_part.h: Update header declarations.
        * kwq/KWQKHTMLPart.h: Update header declarations.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::baseWritingDirectionForSelectionStart): Accessor to help WebKit do a toggle operation on 
        writing direction.
        * kwq/WebCoreBridge.h: Update header declarations.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge applyParagraphStyle:withUndoAction:]): New method to force application of all style properties as block styles.
        (-[WebCoreBridge baseWritingDirectionForSelectionStart]): Accessor to help WebKit do a toggle operation on 
        writing direction.

        Fix for this bug:
        
        <rdar://problem/3985035> REGRESSION (Mail): Text copied from wrapped line contains extra character when pasted

        * khtml/editing/markup.cpp:
        (khtml::renderedText): Add an enum and a flag to this command that controls whether to force all
        This is the result of an error in the code that computes the rendered text that is selected 
        when copying. Since spaces collapse at the end of lines, and these spaces need to be copied 
        when the selection spans line endings, code runs to compute this text. However, this code 
        was also running incorrectly in cases where lines wrapped. I have now added the missing 
        test to check that the selection does indeed extend to the end of the line.


2005-02-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for these bugs:
        
        <rdar://problem/3984894> REGRESSION (Mail): Command-right-arrow in reply does the wrong thing (two ways)
        <rdar://problem/3985130> REGRESSION (Mail): command-right-arrow in pasted RTF selects only up to tab

        * khtml/editing/visible_units.cpp:
        (khtml::endOfLine): Two separate problems in this new function recently added to take the place of
        selectionForLine. In the first, endOfLine did not stop at BR elements, and returned the position
        beyond them. In the second, the VisiblePosition constructor gives the wrong answer in certain cases.
        Darin is going to work on a solution for that problem. In the meantime, I can fix the symptom of this
        bug by going down to the last leaf child of the root line box; a one line change we will roll out when
        Darin's fix is in.

2005-02-01  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3985535> QT Plug-in JavaScript support now fails in <embed> tag only case

        Reviewed by Maciej.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):

2005-02-01  John Sullivan  <sullivan@apple.com>

        Written by Darin, reviewed and tested by me
        
        - fixed <rdar://problem/3969684> Panther-only: extra blank lines between 
        pasted content from Blot

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::attributedString):
        don't emit paragraph breaks if the margins are tiny; matches what
        we do for plain-text conversion

=== Safari-182 ===

2005-02-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3985160> Deficiencies in pasting architecture blocking progress on other bugs

        * khtml/editing/html_interchange.h: Move style span text used to mark element added to 
        add style to this header.
        * khtml/editing/htmlediting.cpp:
        (khtml::styleSpanClassString): Change to use constant moved to html_interchange.h.
        (khtml::isStyleSpan): New helper function. Checks if this is a span we added to apply style.
        (khtml::CompositeEditCommand::insertNodeBefore): Added an assert to check that the node
        we are inserting before is not the body.
        (khtml::CompositeEditCommand::insertNodeAfter): Ditto, but check is for after.
        (khtml::ReplacementFragment::ReplacementFragment): Added code to process the "default style"
        that is added by the copy code.
        (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): first and last nodes inserted are
        now member variables instead of function locals. Initialize them here.
        (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand): Deref first and last nodes inserted
        if necessary.
        (khtml::ReplaceSelectionCommand::doApply): Change design to fix the bug. Major change is to
        separate out the code that inserts nodes into the tree so additional styling checks can
        be done in a centralized way. Also got rid of the notion of "merging into the end block." That
        concept was just wrong.
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Tweak interface now that first and 
        last nodes inserted are member variables.
        (khtml::ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted): New helper used
        by replace code to do the stated DOM operation and update state internal to the command.
        This will also be a catch point to handle the kinds of additional style checks needed to
        make paste work right.
        (khtml::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted): Ditto.
        (khtml::ReplaceSelectionCommand::insertNodeBeforeAndUpdateNodesInserted): Ditto.
        (khtml::ReplaceSelectionCommand::updateNodesInserted): Ditto.
        * khtml/editing/htmlediting.h: Update declarations as needed.
        * khtml/editing/markup.cpp:
        (khtml::createMarkup): Adds a "default style" span to the content written to the pasteboard.
        This will help us to fix some of the bugs blocked by the bug above.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::lastDescendent): New helper.
        * khtml/xml/dom_nodeimpl.h: Ditto.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::upstream): Fixed a bug which would allow the upstream position returned to be
        in unrendered content.
        (DOM::Position::downstream): Ditto.

        * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Ending positions tweaked due to 
        changes in upstream() and downstream() functions.
        * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Ditto
        * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Ditto
        * layout-tests/editing/selection/extend-by-character-006-expected.txt: Ditto

        * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Changed what we expect, given
        new behavior of paste code.

2005-01-31  John Sullivan  <sullivan@apple.com>

        Reviewed by Dave Hyatt.
        
        - fixed <rdar://problem/3983097> Tabbing on RSS pages gets stuck in search field 
        with "full keyboard navigation" off

        * kwq/KWQSlider.h:
        * kwq/KWQSlider.mm:
        (QSlider::focusPolicy):
        Implemented this method for KWQSlider. It is needed for our widget subclasses that
        can become focused in some situations. I missed this when fixing 3949203 because
        it only comes into play when tab-to-controls is on, and because the other relevant
        methods are objective-C methods.

2005-01-31  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3964164> AXWebArea needs to unregister on going invisible

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::detach):
        Detach the AX UIElement for the AXWebArea.

2005-01-31  David Harrison  <harrison@apple.com>

        Reviewed by Darin

        <rdar://problem/3850876> AX: button exposed as only an AXImage at http://appleseed.apple.com/ site (<input type=image>)

        * khtml/rendering/render_form.h:
        (khtml::RenderImageButton::isImageButton):
        New.
        * khtml/rendering/render_image.h:
        (khtml::RenderImage::isImageButton):
        New.
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject isImageButton]):
        (-[KWQAccObject actionElement]):
        (-[KWQAccObject role]):
        (-[KWQAccObject accessibilityActionNames]):
        (-[KWQAccObject accessibilityPerformAction:]):
        Represent RenderImageButton elements as buttons instead of images.

2005-01-31  David Harrison  <harrison@apple.com>

        Prevent nil dereference in debug code.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::displayTree):
        Stop when parent is 0, too.

2005-01-31  John Sullivan  <sullivan@apple.com>

        Reviewed by Dave Hyatt.
        
        - fixed <rdar://problem/3949203> cannot tab to, within, or out of the RSS sidebar

        * kwq/KWQSlider.mm:
        (-[KWQSlider becomeFirstResponder]):
        (-[KWQSlider resignFirstResponder]):
        (-[KWQSlider nextKeyView]):
        (-[KWQSlider previousKeyView]):
        (-[KWQSlider canBecomeKeyView]):
        (-[KWQSlider nextValidKeyView]):
        (-[KWQSlider previousValidKeyView]):
        Copied these methods from KWQButton. The lack of special handling for first-responder-ness
        here was causing the focus to get "stuck" on the RSS page's slider widget. Added FIXME
        about how it would be nice to share more of this code rather than replicating it in each
        KWQ widget subclass.

2005-01-31  Darin Adler  <darin@apple.com>

        Reviewed by Harrison.

        - fixed <rdar://problem/3980066> Double-click on single character moves insertion point to previous line

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectClosestWordFromMouseEvent): Set affinity too.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::handleMouseMoveEventSelection): Ditto.
        (KHTMLPart::khtmlMouseReleaseEvent): Ditto.

        * khtml/editing/selection.cpp:
        (khtml::Selection::modifyExtendingRightForward): Use endOfLine and endOfDocument.
        (khtml::Selection::modifyMovingRightForward): Ditto.
        (khtml::Selection::modifyExtendingLeftBackward): Use startOfLine and startOfDocument.
        (khtml::Selection::modifyMovingLeftBackward): Ditto.
        (khtml::Selection::validate): Rewrote the section that handles double-click. Two main fixes: 1) use isStartOfLine to
        check for another case where we want to select the word to the right, and 2) use isEndOfParagraph, which seems
        to work correctly in cases where isLastVisiblePositionInParagraph is giving the wrong answer. Also changed the line
        code to use startOfLine/endOfLine and the document code to use startOfDocument/endOfDocument.

2005-01-31  Darin Adler  <darin@apple.com>

        Reviewed by Harrison.

        - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)

        * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
        The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.

2005-01-31  Darin Adler  <darin@apple.com>

        Reviewed by Ken and Harrison.

        - fixed <rdar://problem/3947901> REGRESSION (Mail): Pasting paragraph of rich text leaves insertion point before pasted text
        - fixed <rdar://problem/3949790> hitting return after underlined line results in too much or too little underlined
        - fixed <rdar://problem/3981759> nil-deref and crash when pasting just a paragraph break
        - fixed a couple problems I discovered while working with bug 3949790

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::applyInlineStyle): Pass StayInBlock to upstream. Without this, we end up going too far
        upstream in the test case in bug 3949790.
        (khtml::ApplyStyleCommand::removeInlineStyle): Pass StayInBlock to upstream and downstream. Same reason as above.
        (khtml::ReplaceSelectionCommand::doApply): Update endPos if inserting a new node and endPos is using that node's
        parent and an offset past the node being inserted. That change fixes a problem with the position of the insertion point
        after pasting into the top level of a document (from test cases in 3947901 and 3949790). When setting insertionPos, use
        code that works when lastNodeInserted is a block rather than a text node. That change fixes a problem where a newline is
        not added when pasting an entire paragraph into the end of a document (from test case in 3949790). Added nil check before
        checking if lastNodeInserted is a <br> element, which fixes the crash when pasting just a paragraph break.

        * khtml/editing/visible_units.h: Filled out the set of calls to add some boolean checks for lines (needed for the
        bug fix), and calls for blocks (not yet implemented), and documents. The document checks may need refinement to
        properly handle documents with a mix of editable and non-editable content, but for now they just refactor code
        and make things a little clearer. Also removed the "include line break" parameter from endOfSentence.
        * khtml/editing/visible_units.cpp:
        (khtml::rootBoxForLine): Added.
        (khtml::startOfLine): Added. Algorithm taken from selectionForLine in selection.cpp.
        (khtml::endOfLine): Ditto.
        (khtml::inSameLine): Added.
        (khtml::isStartOfLine): Added.
        (khtml::isEndOfLine): Added.
        (khtml::endOfSentence): Removed "include line break" parameter.
        (khtml::inSameParagraph): Added a null check.
        (khtml::isStartOfParagraph): Ditto.
        (khtml::isEndOfParagraph): Ditto.
        (khtml::startOfBlock): Added.
        (khtml::endOfBlock): Added.
        (khtml::inSameBlock): Added.
        (khtml::isStartOfBlock): Added.
        (khtml::isEndOfBlock): Added.
        (khtml::startOfDocument): Added.
        (khtml::endOfDocument): Added.
        (khtml::inSameDocument): Added.
        (khtml::isStartOfDocument): Added.
        (khtml::isEndOfDocument): Added.

2005-01-30  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3977000> form data set posted for <input type="image" ...> omits name/value pair

        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::appendFormData): Append a name/value pair for type IMAGE in addition to the X/Y
        coordinates.

2005-01-30  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3974246> REGRESSION (125-180): popup menus are missing item text on Harmony Remote web site

        * khtml/html/html_formimpl.cpp: (DOM::HTMLOptionElementImpl::text): Change this function to traverse the entire tree
        and gather all the text rather than just looking at immediate children.

        * khtml/xml/dom_nodeimpl.h: Added const.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::traverseNextNode): Added const.
        (NodeImpl::traverseNextSibling): Ditto.
        (NodeImpl::traversePreviousNodePostOrder): Ditto.
        (NodeImpl::detach): Add a missing nil check.

2005-01-30  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard

        * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Added missing ref/deref of newly created element.

2005-01-28  Darin Adler  <darin@apple.com>

        * khtml/css/cssproperties.c: Regenerated with newer gperf.

2005-01-28  David Harrison  <harrison@apple.com>

        Reviewed by John Sullivan.

        <rdar://problem/3968144> AX need to be able to focus an AXLink by setting AXFocused to true
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityPerformAction:]):
        (-[KWQAccObject accessibilityIsAttributeSettable:]):
        Add AXFocused for AXLinks.

2005-01-28  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch

        Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object.
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject _accessibilityParentForSubview:]):
        New.

2005-01-27  Adele Amchan  <adele@apple.com>

        fixed by Darin, reviewed by me.

        <rdar://problem/3976314> REGRESSION (180-TOT): submitting password fields fail on Panther

        * kwq/KWQTextField.mm: (-[KWQTextFieldController string]): on panther, the secure text field's editor 
        does not contain the real string, so now we just call stringValue on the field in that case.

2005-01-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin, Hyatt and Ken.

	<rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration
	
        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support
	for -khtml-text-decorations-in-effect property. This works like text-docration
	but follows proper inline semantics, that is, if a parent is causing text
	decoration then -khtml-text-decorations-in-effect on this element will reflect that.
        * khtml/css/cssproperties.in: Add -khtml-text-decorations-in-effect property.
        * khtml/css/cssproperties.h: regenerated
        * khtml/css/cssvalues.c: regenerated
        * khtml/css/cssparser.cpp: regenerated
        * khtml/css/cssproperties.c: regenerated

        * khtml/css/css_valueimpl.h: Made copyPropertiesInSet public.

        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::init): Handle -khtml-text-decorations-in-effect
	specially, translate to text-decoration
        (khtml::ApplyStyleCommand::applyInlineStyle): Fix a comment.
        (khtml::ApplyStyleCommand::removeInlineStyle): Add new way of pushing down
	text-decoration styles around the edges of the selected range.
        (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Helper for this.
        (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): ditto
        (khtml::ApplyStyleCommand::nodeFullyUnselected): ditto
        (khtml::hasTextDecorationProperty): ditto
        (khtml::highestAncestorWithTextDecoration): ditto
        (khtml::ApplyStyleCommand::extractTextDecorationStyle): ditto
        (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle): ditto
        (khtml::ApplyStyleCommand::applyTextDecorationStyle): ditto
        * khtml/editing/htmlediting.h: Prototype new methods.
        * khtml/editing/jsediting.cpp: Make underline execCommand use the new CSS property.

	- as a necessary part of the fix, fixed the longstanding problem
	that mutating an element's inlineStyleDecl would not property
	update its style attribute. now it does.
	
        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSMutableStyleDeclarationImpl::setChanged): If this is an inline style
	declaration, tell the element it's style attribute needs updating.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::invalidateStyleAttribute): New method, just calls down
	to the dom element.
        (HTMLElementImpl::updateStyleAttribute): Regenerate style attribute from
	inline style declaration.
        * khtml/html/html_elementimpl.h: Prototype new stuff.
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::ElementImpl): Initialize new attribute.
        (ElementImpl::updateStyleAttributeIfNeeded): New method to check if the style
	is dirty and this is an html element, and if so call the html element to
	regenerate the style attribute.
        (ElementImpl::attributes): update style if needed
        (ElementImpl::getAttribute): ditto
        (ElementImpl::hasAttributes): ditto
        (ElementImpl::dump): ditto
        (XMLElementImpl::cloneNode): ditto
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::isStyleAttributeValid): new method to manage style attr
	dirty bit
        (DOM::ElementImpl::setStyleAttributeValid): ditto

	- added new layout tests for underlining:
	
        * layout-tests/editing/editing.js:
        * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-across-paragraph-in-bold.html: Added.
        * layout-tests/editing/style/remove-underline-across-paragraph.html: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph-in-bold.html: Added.
        * layout-tests/editing/style/remove-underline-after-paragraph.html: Added.
        * layout-tests/editing/style/remove-underline-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-from-stylesheet.html: Added.
        * layout-tests/editing/style/remove-underline-in-bold-expected.txt: Added.
        * layout-tests/editing/style/remove-underline-in-bold.html: Added.
        * layout-tests/editing/style/remove-underline.html: Added.
        * layout-tests/editing/style/underline-expected.txt: Added.
        * layout-tests/editing/style/underline.html: Added.

2005-01-27  David Hyatt  <hyatt@apple.com>

	Fix for 3875199, search field needs to be able to  show a magnifying  glass without a dropdown menu.
	
        Reviewed by kocienda

        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::HTMLInputElementImpl):
        (DOM::HTMLInputElementImpl::parseHTMLAttribute):
        * kwq/KWQLineEdit.mm:
        (QLineEdit::setMaxResults):

2005-01-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

        Fix for this bug:
        
        <rdar://problem/3973254> Deletions of ranges does not coalesce correctly with subsequent typing

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertTextCommand::deleteCharacter): Remove this dead code.
        (khtml::ReplaceSelectionCommand::editingAction): Moved this code to a better place in the file. 
        It was in with unrelated functions.
        (khtml::TypingCommand::TypingCommand): Reorganize initialization list so it is easier to read.
        (khtml::TypingCommand::issueCommandForDeleteKey): Remove dead code. Roll in remaining code into deleteKeyPressed.
        (khtml::TypingCommand::deleteKeyPressed): Add in support for carrying along smart delete flag.
        (khtml::TypingCommand::forwardDeleteKeyPressed): New function. Makes forward delete work like
        "regular" delete in terms of coalescing typing.
        (khtml::TypingCommand::doApply): Add case for ForwardDeleteKey.
        (khtml::TypingCommand::preservesTypingStyle): Ditto.
        * khtml/editing/htmlediting.h:
        (khtml::TypingCommand::): Add ForwardDeleteKey constant. Remove a couple declarations for now-dead code.
        (khtml::TypingCommand::smartDelete): New accessor.
        (khtml::TypingCommand::setSmartDelete): Ditto.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge deleteKeyPressedWithSmartDelete:]): Add smart delete flag.
        (-[WebCoreBridge forwardDeleteKeyPressedWithSmartDelete:]): New method.
        * khtml/editing/jsediting.cpp: Add supprt for ForwardDelete command
        * layout-tests/editing/editing.js: Ditto.
        * layout-tests/editing/deleting/delete-and-undo-expected.txt: Added.
        * layout-tests/editing/deleting/delete-and-undo.html: Added.
        * layout-tests/editing/deleting/forward-delete-expected.txt: Added.
        * layout-tests/editing/deleting/forward-delete.html: Added.

=== Safari-181 ===

2005-01-27  David Harrison  <harrison@apple.com>

        Reviewed by Ken.

        <rdar://problem/3962214> AX: AXLeftLineTextMarkerRangeForTextMarker returns incorrect range

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
        Allowed for selection to end of line including the linebreak.
        
2005-01-27  David Harrison  <harrison@apple.com>

        Reviewed by Darin, Ken.

        <rdar://problem/3964470> AX: Include attachments in AXAttributedStringForTextMarkerRange

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject isAttachment]):
        (-[KWQAccObject attachmentView]):
        (-[KWQAccObject role]):
        (-[KWQAccObject subrole]):
        (-[KWQAccObject roleDescription]):
        (-[KWQAccObject value]):
        (-[KWQAccObject title]):
        (-[KWQAccObject accessibilityDescription]):
        (-[KWQAccObject accessibilityIsIgnored]):
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        Make attachments accessible.
        
        (CreateCGColorIfDifferent):
        (AXAttributeStringSetColor):
        (AXAttributeStringSetNumber):
        (AXAttributeStringSetFont):
        (AXAttributeStringSetStyle):
        (AXAttributeStringSetElement):
        (AXLinkElementForNode):
        (AXAttributedStringAppendText):
        (AXAttributedStringAppendReplaced):
        (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
        Add attachments and more text attributes to AXAttributedStringForTextMarkerRange.

2005-01-27  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways

        * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        Use specified size rather than computed size when dealing with a percentage for line height.

2005-01-27  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3971372> SWB: template function DOM_cast() won't compile with gcc 4.0
        - fixed other gcc 4.0 compiling problems Patrick Beard pointed out on the phone

        * kwq/DOMInternal.h: (DOM_cast): Change the "failToCompile()" trick to use a dependent name.
        Nowadays, if a name is not dependent, it is checked at template definition time. But we want
        a failure only at template instantiation time.

        * ForwardingHeaders/editing/text_granularity.h: Added. Needed but a bug in the 3.3 compiler made
        it compile anyway without this.

        - other changes

        * khtml/html/html_miscimpl.h: For clarity, mark these functions virtual too. They are automatically
        virtual because the base class ones are virtual, but it's ugly to leave it this way.

2005-01-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3971609> REGRESSION (Mail): up/down arrow navigation broken after rewrapping text by resizing window
        <rdar://problem/3975661> REGRESSION (Mail): left/right arrow navigation can place insertion point after last character on line

        * khtml/editing/selection.cpp:
        (khtml::Selection::modifyAffinity): PARAGRAPH and LINE movements should not alter affinity. This was
        just a mistake before when it reset to upstream in some cases.
        * khtml/rendering/render_line.cpp:
        (khtml::RootInlineBox::closestLeafChildForXPos): Move this function down from InlineBox, and 
        rework the implementation. This fixes 3971609.
        * khtml/rendering/render_line.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect): Rework the algorithm to fix 3975661. This regressed when we began placing
        the spaces on the end of lines in text boxes when lines wrap.

2005-01-26  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test

	I added a member variable to ObjectImp.  This changed it's size and consequently
	hampered the optimizations built into the garbage collector.  Objects no longer
	fit within the allocators cell size, and thus allocation fell back to a slower
	allocator.

	As a result of this fix I also dramatically cleaned up how runtime objects are
	accessed.  The path mostly *removes* code.
	
        Reviewed by Chris.

        * khtml/ecma/kjs_dom.cpp:
        (DOMDocumentProtoFunc::tryCall):
        (DOMElementProtoFunc::tryCall):
        (KJS::getRuntimeObject):
        * khtml/ecma/kjs_dom.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):
        (KJS::HTMLElement::tryGet):
        (KJS::HTMLElement::implementsCall):
        (KJS::HTMLElement::call):
        (KJS::HTMLElement::tryPut):
        (KJS::HTMLCollection::tryGet):
        (KJS::HTMLCollection::getNamedItems):
        * khtml/ecma/kjs_html.h:
        * khtml/ecma/kjs_window.cpp:
        (Window::get):

2005-01-26  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input

	For now we are using ICU UBreakIterator to determine grapheme boundaries for
	cursor and deletion.  This does not match what Cocoa does exactly, but does match
	what Carbon does.  The areas are difference are obscure, but, according to
	Deborah Goldsmith, using the UBreakIterator is the reasonable approach.

        Reviewed by Ken.

        * khtml/rendering/render_text.cpp:
        (RenderText::previousOffset):
        (RenderText::nextOffset):

2005-01-25  David Harrison  <harrison@apple.com>

        Reviewed by Maciej and Richard.

        <rdar://problem/3963731> AX VO: Changing window sizes causes a crash using with Voice Over - KWQPtrDictImpl::clear

        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::HTMLCollectionImpl):
        Ensure that isHTMLDocument before calling HTMLDocument-only method.

2005-01-25  Richard Williamson   <rjw@apple.com>

	Part one of fix for <rdar://problem/3757712> REGRESSION (Mail): WebCore does not allow Devanagari ligature input

	This patch changes the semantics of next() and previous() on
	VisiblePosition to move a grapheme (character cluster) at a
	time.  This means that cursor navigation with correctly move
	over an entire cluster.

	However, the expected behavior for deleting a grapheme is to
	delete individual code points, thus decomposing the grapheme
	into it constituent parts.  That will be addressed in the next
	part of the fix.

        Reviewed by Ken.

        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::previousPosition):
        (khtml::VisiblePosition::nextPosition):
        * khtml/editing/visible_position.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::previousOffset):
        (RenderObject::nextOffset):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::previousOffset):
        (RenderText::nextOffset):
        (RenderText::findNextInlineTextBox):
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::previousOffset):
        (NodeImpl::nextOffset):
        * khtml/xml/dom_nodeimpl.h:

2005-01-25  David Harrison  <harrison@apple.com>

        Reviewed by Maciej.

        <rdar://problem/3973067> AXWebArea for http://apple.netscape.com/ has an empty AXLinkUIElements

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityAttributeValue:]):
        Omit ignored AXLinks from AXLinkUIElements result

2005-01-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3972851> REGRESSION (179-180+): Repro crash in ApplyStyleCommand::cleanUpEmptyStyleSpans

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): Added two null checks.

2005-01-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow

        The fix is more general than for this one bug, and may work to fix many crashers. The problem
        is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
        it is, then we need to bail before doing the work of the command, which we need to deref the
        start and end points of the selection in order to do its work. I think you can see the crash
        potential.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
        * kwq/WebCoreBridge.mm:
        (partHasSelection): New helper function to test that bridge has a part with a selection.
        
        Use new helper function to test part and selection; return from these function if this test fails.
        
        (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
        (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
        (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
        (-[WebCoreBridge documentFragmentWithText:])
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
        (-[WebCoreBridge insertLineBreak])
        (-[WebCoreBridge insertParagraphSeparator])
        (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
        (-[WebCoreBridge insertText:selectInsertedText:])
        (-[WebCoreBridge deleteSelectionWithSmartDelete:])
        (-[WebCoreBridge ensureSelectionVisible])

2005-01-24  Kevin Decker  <kdecker@apple.com>

        Reviewed by Darin.

	Fixed <rdar://problem/3932374> REGRESSION: 'ReferenceError - Can't find variable' JavaScript error at webxpress.fidelity.com

        * khtml/html/html_miscimpl.h: Missing virtual identifiers for namedItem() and nextNamedItem() exposed a flaw that prevented finding variables in form [HTMLFormCollectionImpl] scopes.
	

2005-01-24  Vicki Murley <vicki@apple.com>

        Reviewed by kocienda.

	- fix <rdar://problem/3810661> computed style not handled for Apple extensions
 
        * khtml/css/css_computedstyle.cpp: (DOM::):
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): add -apple-line-clamp and -apple-text-size-adjust

2005-01-24  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3969884> REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused

        * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]):
        Sizing up the form editor, which fixes things for normal fields and search fields,
        screws things up for password fields. Eventually, I'll need to figure out why this is
        and file a bug so that the AppKit team fixes it. In the mean time, just check for the
        case of the secure text field, and don't size up in that case.

2005-01-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3963560> 8A354: Inserting Japanese text to the line head causes line break

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the
        existing line. This covers the situation see using the steps to reproduce this bug.

2005-01-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3967572> Editing should split elements before removing style
	
        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::splitElement):
        (khtml::CompositeEditCommand::mergeIdenticalElements):
        (khtml::CompositeEditCommand::wrapContentsInDummySpan):
        (khtml::CompositeEditCommand::splitTextNodeContainingElement):
        (khtml::ApplyStyleCommand::applyInlineStyle):
        (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
        (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
        (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
        (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
        (khtml::areIdenticalElements):
        (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
        (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
        (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans):
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
        (khtml::InsertParagraphSeparatorCommand::doApply):
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
        (khtml::InsertTextCommand::prepareForTextInsertion):
        (khtml::SplitTextNodeCommand::doUnapply):
        (khtml::SplitElementCommand::SplitElementCommand):
        (khtml::SplitElementCommand::~SplitElementCommand):
        (khtml::SplitElementCommand::doApply):
        (khtml::SplitElementCommand::doUnapply):
        (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
        (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
        (khtml::MergeIdenticalElementsCommand::doApply):
        (khtml::MergeIdenticalElementsCommand::doUnapply):
        (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
        (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
        (khtml::WrapContentsInDummySpanCommand::doApply):
        (khtml::WrapContentsInDummySpanCommand::doUnapply):
        (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
        (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
        (khtml::SplitTextNodeContainingElementCommand::doApply):
        * khtml/editing/htmlediting.h:

	New layout test that shows the side benefit of this.
        
	* layout-tests/editing/style/unbold-in-bold-expected.txt: Added.
        * layout-tests/editing/style/unbold-in-bold.html: Added.

2005-01-24  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3933435> -[DOMRange cloneContents] sometimes alters the original DOMRange

        * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing
        the range after processing the contents. That's right for extract and delete, but not clone.

        - fixed <rdar://problem/3714184> inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr
        - fixed <rdar://problem/3193848> Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler)
        - fixed <rdar://problem/3874683> REGRESSION (161-162): Crash after typing command-Z to undo after pasting text with newline in it into a text field <input type=text>

        * kwq/KWQLineEdit.mm:
        (QLineEdit::text): Changed to call a new string method on the controller instead of calling
        stringValue, since stringValue has a bad side effect of ending inline input.
        (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected.
        When you are giving the field focus, it automatically gets all selected, and this change
        is required in the case where we defer the focus change.

        * kwq/KWQTextField.h: Added a new string method to the controller.
        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue.
        (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF.
        That's now handled in the shouldChangeTextInRange method instead.
        (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until
        after the event is handled. This makes sure the key gets into the field that's already handling it at
        rather than ending up in the newly-focused field if the key press handler focuses a different element.
        (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press
        has been handled.
        (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is
        an editor, calls string on that instead.
        (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by
        the three field subclasses. Truncates incoming strings at the first CR or LF character. This works
        properly with Undo, and the old technique did not.
        (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods
        so they all truncate at the first CR or LF as well as truncating to the appropriate length.
        (-[KWQTextField setStringValue:]): Changed to call the controller.
        (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller.
        (-[KWQSecureTextField setStringValue:]): More of the same.
        (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
        (-[KWQSearchField setStringValue:]): Ditto.
        (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.

        * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function.
        * kwq/KWQWidget.mm:
        (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed
        while we "have the ball".
        (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused.
        (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be
        the first responder.
        (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then
        get the deferred first responder and call setFocus on it again, which will do the work we didn't
        want to do earlier.

2005-01-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3964350> Deleting all content and typing in a message gets one letter, then beeps

        This is a problem with the way we turn key events, when a user starts typing, into editing commands. 
        Right now, that initial delete key in an empty window is turned into an editing command, and much 
        editing code runs that need not run. What's more, this is confusing the selection machinery. The
        solution is to detect the "delete in an empty window" case and don't turn this into an editing
        command at all.

        * khtml/editing/htmlediting.cpp:
        (khtml::TypingCommand::deleteKeyPressed)

2005-01-23  Adele Amchan  <adele@apple.com>

        Fixed <rdar://problem/3964286> REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work

        Removed check for document from checkCompleted.  In this case, WebCore never knew that a WebImageView was complete because 
        it fell into this document check case in checkCompleted.  
        Added check for document to tokenizerProcessedData (see <rdar://problem/3807144>)

        Reviewed by Darin.

        * khtml/khtml_part.cpp:
        (KHTMLPart::stop):
        (KHTMLPart::checkCompleted):
        * khtml/khtml_part.h:
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData):

2005-01-21  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3759399> Javascript / Liveconnect problems ((event handler):Undefined value)

	Java applets specified with <object> or <embed> weren't scriptable.  Now they are.

        Reviewed by Chris.

        * khtml/html/html_objectimpl.cpp:
        (HTMLEmbedElementImpl::getEmbedInstance):
        (HTMLObjectElementImpl::getObjectInstance):

2005-01-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3959464> REGRESSION (Mail): Insertion point goes back to beginning of document after deleting

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block.
        This fixes the bug.
        * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3959464-fix.html: Added.

2005-01-21  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3966998> REGRESSION(179-TOT) clicking on gmail message brings me to blank screen

	getElementById() sometimes returns Undefined() instead of Null().

        Reviewed by Hyatt.

        * khtml/ecma/kjs_dom.cpp:
        (DOMDocumentProtoFunc::tryCall):

2005-01-21  David Hyatt  <hyatt@apple.com>

	Fix for 3773809, make sure that overflow regions never end up at an invalid scroll offset because of a layout change.
	
        Reviewed by kocienda

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateScrollInfoAfterLayout):

2005-01-21  David Hyatt  <hyatt@apple.com>

	Fix for 3966349, hang loading page.  Make sure that loops using popOneBlock properly check for a null
	blockStack to avoid an infinite loop.
	
        Reviewed by kocienda

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::parseToken):
        (KHTMLParser::insertNode):
        (KHTMLParser::popInlineBlocks):

2005-01-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3957204> Mail crashed when sending a message in ~InsertParagraphSeparatorInQuotedContentCommand

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
        InsertParagraphSeparatorInQuotedContentCommand has this member variable: DOM::ElementImpl *m_breakNode;
        I failed to initialize this variable to null in the constructor, and there is an uncommonly-traveled 
        code path which does not set this variable to something good. In the destructor, we check for null, 
        and deref if non-null. Obvious "BOOM" potential. Fixed.

2005-01-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3966311> REGRESSION (Mail): Hitting return makes space character disappear

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): When writing the code to insert a block
        in response to the return key, I did not write code to cover the case described in the bug.
        Now I have.
        * layout-tests/editing/inserting/insert-div-025-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-025.html: Added.

2005-01-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3965196> security fix for javascript: exploit missed one case (already fixed in updates)
        
	* khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall): correct mistake in earlier fix for the following bug, caught by Adele:

2005-01-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3965466> editing needs to insert text before applying typing style
	
        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Remove a FIXME comment.
        (khtml::InsertLineBreakCommand::doApply): Apply style to the BR
	node after inserting it.
        (khtml::InsertTextCommand::prepareForTextInsertion): Don't try to
	apply style to any new nodes created before inserting.
        (khtml::InsertTextCommand::input): Apply style to the inserted range
	after doing the text insert.
        * khtml/editing/htmlediting.h:

	This change leads to improved results on one of the layout tests:
        
	* layout-tests/editing/inserting/insert-div-024-expected.txt:

=== Safari-180 ===

2005-01-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3964646> REGRESSION (179-180): Typing space at end of line makes following paragraph disappear

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code 
        caused this regression. The code became too aggressive in removing block placeholders, and would remove them
        from blocks other than the block containing the selection.
        * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spurious BR element in it that
        I did not notice earlier.
        * layout-tests/editing/inserting/insert-div-024-expected.txt: Ditto.

2005-01-20  David Hyatt  <hyatt@apple.com>

	Fix for oddness on albertsons.com.  Make sure not to crash when setting/removing style properties on a node
	with no document.  The bug # is 3813900.
	
        Reviewed by john

2005-01-20  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        PARTIAL fix for following bug.  Create attributed string with fonts and links.  Still need to add attachments.
        <rdar://problem/3942606> AX: Support kAXAttributedStringForTextMarkerRangeParameterizedAttribute
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject textUnderElement]):
        Touched up previous checkin to match code review comments.
        
        (-[KWQAccObject value]):
        Use plainText for this one instead of obsolete attributedString.
        
        (-[KWQAccObject accessibilityParameterizedAttributeNames]):
        Advertise AXAttributedStringForTextMarkerRange.
        
        (AXAttributeStringAddFont):
        (AXAttributeStringAddElement):
        (-[KWQAccObject linkUIElementForNode:]):
        (-[KWQAccObject _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
        (-[KWQAccObject accessibilityAttributedStringForRange:]):
        New routines to support AXAttributedStringForTextMarkerRange.
        
        (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
        Use new routines instead of obsolete attributedString.

2005-01-20  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3960196> AX Crash in DOM::Range::setStartBefore

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::getAccObjectCache):
        Adjust when detecting cache in non-top level WebArea.
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject textUnderElement]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        Make sure the elements document is the current one for the part.

2005-01-20  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3922980> Mail not crashing, just quitting itself suddenly in -[WebHTMLView(MailExtras) findString:options:]

        * khtml/dom/dom2_range.cpp: (DOM::operator==): Handle null and detached ranges without raising exceptions.
        The uncaught exception would make the entire program terminate.

        - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception

        * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration setProperty:::]): Uncommented this code which I had to disable
        back in November because Mail was stumbling over it.

        - fixed <rdar://problem/3943049> focus() called during onload handler results in square text field on <input type=search>        

        * kwq/KWQLineEdit.mm: (QLineEdit::baselinePosition): Change computation so it will work even for fields
        that position their text in a way that depends on vertical size. In the case of a search field, the text
        is centered, so the old logic was broken.
        * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Set the frame size to
        something large enough to accomodate the field editor. If we start the frame at size 0,0 we run into
        AppKit trouble when it insets the frame to figure out the frame for the field editor. In the case of this
        bug this happens because we become first responder before being sized and positioned by the HTML layout code.

        - improved debugging output when using "po" from gdb with Objective-C DOM

        * kwq/DOM.mm:
        (-[DOMNode description]): Added. Includes node name ("<tr>") and node value (e.g., string for text node).
        (-[DOMRange description]): Tweaked format.

2005-01-19  Richard Williamson   <rjw@apple.com>

	After further discussion with Real we have decided to NOT include the
	additional CLSID for the real plugin.  See 3958601.

        Reviewed by Darin.

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget):

2005-01-19  David Harrison  <harrison@apple.com>

        Reviewed by Maciej.

        <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line

        Previous checkin for this bug was missing some of the patch.  Editing snafu with multiple changes in tree.
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):

2005-01-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Small, cosmetic change John and I decided
        to do on my last checkin, but I forgot to do before landing.

2005-01-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3959727> REGRESSION (Mail): Style not preserved on blank lines

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::applyStyle):
        (khtml::CompositeEditCommand::insertBlockPlaceholder): New function that unconditionally adds a block placeholder.
        (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Now returns bool based on whether
        placeholder was added or not.
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now searches all the descendents of a block
        looking for a placeholder. The old code, which just looked at the last child of a node, started missing
        once block placeholders became styled (which started happening with this patch).
        (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Now handles applying typing style
        to a block placeholder at call time, rather than setting the typing style as a latent style that
        might be applied later. This is an important part of the bug fix.
        (khtml::DeleteSelectionCommand::doApply): Now uses bool return value from insertBlockPlaceholderIfNeeded()
        and passes it along to calculateStyleBeforeInsertion, so the case where a block placeholder needs to
        be styled can be detected.
        (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Changed the way this class
        managed style. Before it would calculate and set typing style for the block added. This is not
        sufficient. Added blocks need to styled immediately. Some name changes to instance variables in 
        this class due to the change to accommodate this change.
        (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Name changes, as above.
        (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
        (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
        (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
        (khtml::ReplaceSelectionCommand::doApply): Improve check for testing when a placeholder
        block can be removed in its entirety after the insertion.
        * khtml/editing/htmlediting.h: Update header accordingly.
        * khtml/khtml_part.cpp:
        (KHTMLPart::selectionComputedStyle): Move position for computed style check downstream before
        doing check when the position is in an empty block (this makes sure any style on any block
        placeholder is accounted for).

        New layout tests to check bug fix.

        * layout-tests/editing/style/block-style-004-expected.txt: Added.
        * layout-tests/editing/style/block-style-004.html: Added.
        * layout-tests/editing/style/block-style-005-expected.txt: Added.
        * layout-tests/editing/style/block-style-005.html: Added.
        * layout-tests/editing/style/block-style-006-expected.txt: Added.
        * layout-tests/editing/style/block-style-006.html: Added.

        Results updated to reflect new block placeholder code.

        * layout-tests/editing/inserting/insert-div-004-expected.txt 
        * layout-tests/editing/inserting/insert-div-005-expected.txt
        * layout-tests/editing/inserting/insert-div-006-expected.txt
        * layout-tests/editing/inserting/insert-div-008-expected.txt
        * layout-tests/editing/inserting/insert-div-011-expected.txt
        * layout-tests/editing/inserting/insert-div-012-expected.txt
        * layout-tests/editing/inserting/insert-div-013-expected.txt
        * layout-tests/editing/inserting/insert-div-014-expected.txt
        * layout-tests/editing/inserting/insert-div-015-expected.txt
        * layout-tests/editing/inserting/insert-div-016-expected.txt
        * layout-tests/editing/inserting/insert-div-017-expected.txt
        * layout-tests/editing/inserting/insert-div-018-expected.txt
        * layout-tests/editing/inserting/insert-div-019-expected.txt
        * layout-tests/editing/inserting/insert-div-021-expected.txt
        * layout-tests/editing/inserting/insert-div-022-expected.txt
        * layout-tests/editing/inserting/insert-div-023-expected.txt
        * layout-tests/editing/inserting/insert-div-024-expected.txt

2005-01-19  David Hyatt  <hyatt@apple.com>

	Dont null-check the renderer before submitting, since a script can set it to display:none and still expect the
	submission to occur.  Fixes bug #3477282.
	
        Reviewed by kdecker

        (DOM::HTMLInputElementImpl::defaultEventHandler):

2005-01-18  Richard Williamson   <rjw@apple.com>
	
	Fixed several issues all arising from analysis of plugin detection code at ifilm.com:

	Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
	Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
	Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
	Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in

	We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
	tags.  Also, if any of these elements are named they can be accessed from the document or window objects.
	Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.

        Reviewed by Chris.

        * khtml/dom/html_document.cpp:
        (HTMLDocument::objects):
        * khtml/dom/html_document.h:
        * khtml/ecma/kjs_dom.cpp:
        (DOMDocumentProtoFunc::tryCall):
        (DOMElementProtoFunc::tryCall):
        (KJS::getRuntimeObject):
        * khtml/ecma/kjs_dom.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):
        (KJS::HTMLElement::tryGet):
        (KJS::HTMLCollection::tryGet):
        (KJS::HTMLCollection::getNamedItems):
        * khtml/ecma/kjs_window.cpp:
        (Window::get):
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::traverseNextItem):
        * khtml/html/html_miscimpl.h:
        (DOM::HTMLCollectionImpl::):
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::getAppletInstance):
        (HTMLObjectElementImpl::HTMLObjectElementImpl):
        (HTMLObjectElementImpl::getObjectInstance):
        * khtml/html/html_objectimpl.h:
        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getObjectInstanceForView):

2005-01-18  David Hyatt  <hyatt@apple.com>

	Fix for 3948123, rolling over link erases nearby text.  The repaint rect check for lines was wrong whenever
	two lines overlapped.
	
        Reviewed by kocienda

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines):

2005-01-18  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bug:
        
        <rdar://problem/3960116> Focus rings paint incorrectly for contenteditable blocks in web pages

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::addFocusRingRects): Fix painting of focus rings so that ring only paints around
        outermost contenteditable elements.

2005-01-18  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3959668> accessibilityFocusedUIElement sometimes returns an ignored element; it must not

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityFocusedUIElement]):
        Return parentObjectUnignored if focused object is ignored.

2005-01-18  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3952877> REGRESSION (Mail): Command-left/right-arrows don't work with file attachment

        * khtml/editing/selection.cpp:
        (khtml::nodeForInlineBox): New helper function used in reimplementation of function below.
        (khtml::selectionForLine): Reimplemented using line box smarts. I originally wrote this code when
        I had a less than full understanding of line layout. I can do better now, and my new version no
        longer fails to notice attachments when doing the kind of navigation mentioned in the bug.

2005-01-17  David Harrison  <harrison@apple.com>

        Reviewed by John Sullivan.

        <rdar://problem/3949429> AX: word marker routines returns incorrect data for empty line
        <rdar://problem/3949848> AX: paragraph marker routines do not work when given a paragraph end marker

        Also fixed sentence support in the same way.
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
        Move one position in desired direction before calling visible_units.cpp code.

2005-01-17  David Harrison  <harrison@apple.com>

        Updated expected test results.
        
        <rdar://problem/3945880> line-ending space seems not to be present

        * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt:
        * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt:
        * layout-tests/editing/inserting/insert-div-020-expected.txt:
        * layout-tests/editing/inserting/insert-div-021-expected.txt:
        * layout-tests/editing/inserting/insert-div-022-expected.txt:
        * layout-tests/editing/inserting/insert-div-023-expected.txt:
        * layout-tests/editing/inserting/insert-div-024-expected.txt:

2005-01-17  David Harrison  <harrison@apple.com>

        Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).

        <rdar://problem/3945880> line-ending space seems not to be present

        * khtml/editing/selection.cpp:
        (khtml::Selection::validate):
        Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end.
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::findNextLineBreak):
        Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break).

2005-01-17  Darin Adler  <darin@apple.com>

        Reviewed by John Louch.

        - fixed <rdar://problem/3958503> need screenX and screenY to use WebKit windowFrame delegate

        * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead
        of using mapToGlobal and screen in a complicated way.
        * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function.
        * kwq/KWQWindowWidget.h: Ditto.
        * kwq/KWQWindowWidget.mm: Ditto.

2005-01-17  David Hyatt  <hyatt@apple.com>

	Fix a screwup in rightmost/lowets position computation.  3955207.  Make sure floats with layers are still checked.

        Reviewed by kocienda
	
	* khtml/rendering/render_block.cpp

2005-01-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        <rdar://problem/3953366> Problems with typing attributes in HTML compose

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization"
        that tried to sense when typing style could be cleared without actually doing a style diff between
        before-delete and after-delete positions. Removing this extra check and running the 
        general-purpose code fixes the bug.

2005-01-17  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)

	Keep track of originating execution context and target execution
	context for native JS object wrappers, and perform appropriate
	security checks.

        Reviewed by David Harrison.

        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::isGlobalObject):
        (ScriptInterpreter::isSafeScript):
        (ScriptInterpreter::interpreterForGlobalObject):
        * khtml/ecma/kjs_binding.h:
        * khtml/ecma/kjs_window.cpp:
        (Window::interpreter):
        (Window::isSafeScript):
        * khtml/ecma/kjs_window.h:
        * kwq/DOMInternal.mm:
        (-[WebScriptObject _initializeScriptDOMNodeImp]):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::windowScriptObject):
        (KWQKHTMLPart::windowScriptNPObject):
        * kwq/WebCoreBridge.mm:
        (rootForView):
        (-[WebCoreBridge init]):

2005-01-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with 
        "size up" and "size down" NSFontManager changes

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): Add support for parsing new font size delta property.
        * khtml/css/cssproperties.c: Generated file.
        * khtml/css/cssproperties.h: Ditto.
        * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
        * khtml/editing/htmlediting.cpp:
        (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
        (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
        and running command to do the removal.
        (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
        (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle 
        relative font size changes.
        (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
        before or equal to the end. Swap them if not true. I ran into this problem in some similar code in 
        applyRelativeFontStyleChange(). Moving that goodness here too.
        (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
        Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
        I use the bool return value now (I obviously did not need it before).
        (khtml::ApplyStyleCommand::computedFontSize): New helper function.
        (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
        (khtml::createStyleSpanElement): Ditto.
        * khtml/editing/htmlediting.h: Update header accordingly.
        * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
        (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
        * kwq/DOMPrivate.h: Declare new conveniences.
        * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
        * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-001.html: Added.
        * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-002.html: Added.
        * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-003.html: Added.
        * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
        * layout-tests/editing/style/relative-font-size-change-004.html: Added.

2005-01-14  Darin Adler  <darin@apple.com>

        * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1.
        * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1.
        * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1.
        * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1.

2005-01-14  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3886415> arrow keys don't work when the user hits Back to return to RSS page

        Reviewed by hyatt.

        (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode
        (KWQKHTMLPart::mousePressNode): new
        * kwq/KWQPageState.h:
        * kwq/KWQPageState.mm:
        (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode
        (-[KWQPageState clear]): clear the mousePressNode
        (-[KWQPageState dealloc]): deref the mousePressNode
        (-[KWQPageState mousePressNode]): new

=== Safari-179 ===

2005-01-13  Vicki Murley <vicki@apple.com>

        Reviewed by Adele.

        - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005

        * WebCore.pbproj/project.pbxproj: bump "2004" to "2005"

2005-01-13  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.
        
        Better fix for 3905066.
        
        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply):

2005-01-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
        
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paint): Support painting custom underline markers for
	marked text in place of generic yellow.
        (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
        * khtml/rendering/render_text.h:
        * kwq/KWQKHTMLPart.h: Declare new methods and structs.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::clear): Clear marked test underlines.
        (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
        (convertAttributesToUnderlines): Converts NSAttributedString attributes
	to simplified and C++-friendly form.
        (KWQKHTMLPart::markedTextUsesUnderlines): New method.
        (KWQKHTMLPart::markedTextUnderlines): New method.
        * kwq/KWQPainter.mm:
        (QPainter::drawLineForText): Handle pen width.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
	and ranges.
        * kwq/WebCoreTextRenderer.h:

2005-01-12  David Harrison  <harrison@apple.com>

        Reviewed by Dave Hyatt.

        <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject addChildrenToArray:]):
        Use the widget's outer view.

2005-01-12  David Harrison  <harrison@apple.com>

        Reviewed by Darin Adler.

        <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
        
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::displayNode):
        Add quotes around text node content.
        (NodeBaseImpl::childNode):
        Add nil check to return nil rather than crash when child node not found.
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject doAXStringForTextMarkerRange:]):
        Pass range compliant positions to TextIterator.

2005-01-12  David Hyatt  <hyatt@apple.com>

	Fix for 3951203, CSS border style incorrectly clipped on inline elements.  Make sure the repaint rect set during
	line layout is smarter about including the overflow for both old states and new states.
	
        Reviewed by john

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):

2005-01-12  David Hyatt  <hyatt@apple.com>

	Fix for bug 3937608, versiontracker.com flashes and displays the right column below content.  Make sure to move
	tables/overflows that dont fit within a block only in strict mode.

	Fix for bug 3931049, characters dont show up when typing.  Make sure to dirty the right lines when this specific
	case in editing is hit.
	
        Reviewed by darin (first one), kocienda (second one)

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::getClearDelta):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):
        * khtml/rendering/render_line.cpp:
        (khtml::InlineFlowBox::verticallyAlignBoxes):

2005-01-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
        merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
        added to visible_position files.
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
        tests to determine when to stop moving nodes more complete and correct. Also improved comments.
        * khtml/editing/visible_position.cpp:
        (khtml::isFirstVisiblePositionInParagraph): New function.
        (khtml::isLastVisiblePositionInParagraph): New function.
        * khtml/editing/visible_position.h: Update header accordingly.
        * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
        results but still correct.
        * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
        * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
        * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.

2005-01-11  Richard Williamson   <rjw@apple.com>

	Fixed 3922875.  Fall back to DOM object is EMBED element
	has no associated runtime object.

        Reviewed by Chris.

        * khtml/ecma/kjs_dom.cpp:
        (KJS::getRuntimeObject):
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):
        (KJS::HTMLElement::tryGet):
        (KJS::HTMLCollection::tryGet):
        (KJS::HTMLCollection::getNamedItems):

2005-01-11  David Hyatt  <hyatt@apple.com>

        Fix for 3882299, missing content on gibson.com.  Change our handling of " and ' in certain states of the parser to match
	other browsers.
	
        Reviewed by Maciej

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::parseTag):

2005-01-11  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3930733> Mail prints second page of email blank

        Reviewed by dave.

        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines): removed null check since the print rect should never be null
        * khtml/rendering/render_list.cpp:
        (RenderListMarker::paint): ditto
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page

2005-01-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a 
        simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the 
        result calculated in that deeper scope was not available when tested.

2005-01-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3946852> Option-e goes to next line

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
        into the start line is done. We plan to change pretty substantially soon to better handle
        the problem described in <rdar://problem/3937352> Quote level not maintained when copied 
        and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.

2005-01-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
        to their own blocks if needed so that a block style can be applied.
        (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
        (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
        This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
        paragraph is styled.
        (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
        Should remove attributue instead.
        * khtml/editing/htmlediting.h: Touch function declarations accordingly.
        * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-001.html: Added.
        * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-002.html: Added.
        * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-003.html: Added.
        * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-004.html: Added.
        * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-005.html: Added.
        * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-006.html: Added.
        * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-007.html: Added.
        * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-008.html: Added.
        * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-009.html: Added.
        * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-010.html: Added.
        * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-011.html: Added.
        * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-012.html: Added.
        * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-013.html: Added.

        Unrelated updates to these expected results.
        * layout-tests/editing/inserting/insert-div-007-expected.txt
        * layout-tests/editing/pasteboard/paste-text-013-expected.txt

2005-01-10  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print

        Reviewed by john.

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines): don't do pagination work if printRect is not set
        * khtml/rendering/render_list.cpp:
        (RenderListMarker::paint): ditto

2005-01-10  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        * kwq/KWQTextUtilities.mm:
        (currentTextBreakLocaleID):
        Return empty string (AKA root locale) if locale pref can not be canonicalized.

2005-01-10  John Sullivan  <sullivan@apple.com>

        Fixed broken Panther build.

        * kwq/KWQTextUtilities.mm:
        (currentTextBreakLocaleID):
        This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
        That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
        To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
        function. However, the Tiger-only code was wrong; the string generated using 
        CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
        as well.

2005-01-09  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

        <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
        
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply):
        Tune check for need for insertParagraphSeparator when hasInterchangeNewline.

2005-01-09  Darin Adler  <darin@apple.com>

        Reviewed by Harrison.

        - fixed <rdar://problem/3939176> select() method does not work on <input type=search>

        * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
        to a switch statement. Added SEARCH to the set of types that treat the renderer as a
        RenderLineEdit.

2005-01-09  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

        <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)

        Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
        whitespace to a single non-breaking space when splitting a text node.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply):

2005-01-08  Kevin Decker  <kdecker@apple.com>

        Reviewed by Ken.

	Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.

2005-01-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
	
	<rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)

        * Khtml/khtml_part.cpp:
        (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
	not started loading yet so it could not possibly be finishing here...
        (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
	no document, in this case we must have hit an error or been loading a non-HTML
	frame.
        * khtml/khtml_part.h:

2005-01-08  David Harrison  <harrison@apple.com>

        Reviewed by Maciej.

        <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
        
        * khtml/editing/selection.cpp:
        (khtml::Selection::validate):
        Tune word selections left/right choice to use right if on empty last line.

2005-01-07  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

        <rdar://problem/3942619> AX: Support sentence ax attributes

        Needed to use the unicode utilities properly.  Twas lame before.

        * khtml/editing/visible_units.cpp:
        (khtml::previousBoundary):
        (khtml::nextBoundary):
        (khtml::startOfWord):
        (khtml::endOfWord):
        (khtml::previousWordPosition):
        (khtml::nextWordPosition):
        (khtml::startOfSentence):
        (khtml::endOfSentence):
        (khtml::previousSentencePosition):
        (khtml::nextSentencePosition):
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        (-[KWQAccObject accessibilityParameterizedAttributeNames]):
        (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
        * kwq/KWQTextUtilities.mm:
        (currentTextBreakLocaleID):
        (KWQFindSentenceBoundary):
        (KWQFindNextSentenceFromIndex):

2005-01-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Kevin

        Fix for these bugs:
        
        <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
        <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
        Merge the typing style with the computed style for the current position. Fixes both bugs.
        * khtml/editing/htmlediting.h:
        * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-023.html: Added.
        * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-024.html: Added.

2005-01-07  David Hyatt  <hyatt@apple.com>

	Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again.  Fixes the odd scrolling
	behavior on worldofwarcraft.com.
	
        Reviewed by kevin

        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):

2005-01-06  David Hyatt  <hyatt@apple.com>

	Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables.  Bulletproof the hit testing to
	ignore inline flows in this case.
	
        Reviewed by kevin

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::nodeAtPoint):

2005-01-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
        in the document, or if it is not a descendent of the document element. In the case of the bug,
        since the selection has not yet been set up, the focus node passed here is the HTML element, and
        that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.

2005-01-06  Kevin Decker  <kdecker@apple.com>

        Reviewed by mjs.

	Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari

        * khtml/khtml_part.cpp:
        (KHTMLPart::processObjectRequest): m_bComplete was never true for frames generated by Javascript due to our synchronous loading and as a result, scheduled redirects wouldn't fire in KHTMLPart::scheduleLocationChange().  By virtue of being an empty document, a document is complete.  In this special case it's safe at this point to call checkCompleted() which sets m_bComplete true. 

=== Safari-178 ===

2005-01-06  David Harrison  <harrison@apple.com>

        Reviewed by Chris.

        (addendum to previous checkin for this bug) 
        <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText

        Fix line navigation.  Add AXUIElementForTextMarker.

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityParameterizedAttributeNames]):
        (-[KWQAccObject doAXUIElementForTextMarker:]):
        (-[KWQAccObject doAXLineForTextMarker:]):
        (-[KWQAccObject doAXTextMarkerRangeForLine:]):
        (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
        (-[KWQAccObject accessibilityAttributeValue:forParameter:]):

2005-01-06  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)

        (turns out the PLT regression was a false alarm)

        * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
        the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
        much larger number.
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
        sense to just have the array be a member so we don't have to use new and delete on it. Also needed
        to eliminate code that used ID_CLOSE_TAG for an array size.
        (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
        that manages isindex to use deref instead of delete.
        (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
        mistake of using ID_CLOSE_TAG for the array size too.
        (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
        there and it would prevent custom tags from working. Added range check before using the forbidden
        tag array with the token ID since custom tags will use index values past the end of the array.
        (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
        inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
        createElement call is still here. Last time I left out a few form element types from this switch;
        fixed now.
        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
        document if getTagID fails; this creates a unique per-document ID.

        * khtml/misc/htmltags.c: Regenerated.
        * khtml/misc/htmltags.h: Regenerated.

        * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
        Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
        Also rewrote getTagName to work with the new scheme.

2005-01-06  David Harrison  <harrison@apple.com>
        
        Fixed Panther build.  Also, do not advertize sentence support since it is incomplete.
        
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
        (-[KWQAccObject accessibilityParameterizedAttributeNames]):
        (-[KWQAccObject accessibilityIsAttributeSettable:]):

2005-01-06  David Harrison  <harrison@apple.com>

        Reviewed by Dave Hyatt.

        <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
        <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
        
        Many more AX attributes supported.  Numerous fixes to previous AX work.
        
        * khtml/editing/visible_units.cpp:
        (khtml::startSentenceBoundary):
        (khtml::startOfSentence):
        (khtml::endSentenceBoundary):
        (khtml::endOfSentence):
        (khtml::previousSentencePositionBoundary):
        (khtml::previousSentencePosition):
        (khtml::nextSentencePositionBoundary):
        (khtml::nextSentencePosition):
        * khtml/editing/visible_units.h:
        * khtml/khtmlview.cpp:
        (KHTMLView::layout):
        * khtml/misc/helper.cpp:
        (khtml::findSentenceBoundary):
        (khtml::nextSentenceFromIndex):
        * khtml/misc/helper.h:
        * khtml/misc/htmltags.c:
        (hash_tag):
        (findTag):
        * khtml/rendering/render_container.cpp:
        (RenderContainer::removeChildNode):
        (RenderContainer::appendChildNode):
        (RenderContainer::insertChildNode):
        * khtml/rendering/render_object.cpp:
        (RenderObject::remove):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::getAccObjectCache):
        (DocumentImpl::updateSelection):
        (DocumentImpl::close):
        (DocumentImpl::setFocusNode):
        (DocumentImpl::parentDocument):
        (DocumentImpl::topDocument):
        * khtml/xml/dom_docimpl.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityShouldUseUniqueId]):
        (-[KWQAccObject detach]):
        (-[KWQAccObject anchorElement]):
        (-[KWQAccObject firstChild]):
        (-[KWQAccObject lastChild]):
        (-[KWQAccObject previousSibling]):
        (-[KWQAccObject nextSibling]):
        (-[KWQAccObject parentObject]):
        (-[KWQAccObject value]):
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityPerformAction:]):
        (-[KWQAccObject textMarkerForVisiblePosition:]):
        (-[KWQAccObject visiblePositionForTextMarker:]):
        (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
        (-[KWQAccObject topDocument]):
        (-[KWQAccObject topRenderer]):
        (-[KWQAccObject topView]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        (-[KWQAccObject accessibilityParameterizedAttributeNames]):
        (-[KWQAccObject doAXLineForTextMarker:]):
        (-[KWQAccObject doAXTextMarkerRangeForLine:]):
        (-[KWQAccObject doAXStringForTextMarkerRange:]):
        (-[KWQAccObject doAXTextMarkerForPosition:]):
        (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
        (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
        (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
        (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXLengthForTextMarkerRange:]):
        (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
        (-[KWQAccObject accessibilityHitTest:]):
        (-[KWQAccObject accessibilityFocusedUIElement]):
        (-[KWQAccObject accessibilityIsAttributeSettable:]):
        (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
        (-[KWQAccObject setAccObjectID:]):
        (-[KWQAccObject removeAccObjectID]):
        * kwq/KWQAccObjectCache.h:
        * kwq/KWQAccObjectCache.mm:
        (KWQAccObjectCache::setAccObject):
        (KWQAccObjectCache::removeAccObject):
        (KWQAccObjectCache::visiblePositionForTextMarker):
        (KWQAccObjectCache::postNotificationToTopWebArea):
        (KWQAccObjectCache::postNotification):
        (KWQAccObjectCache::handleFocusedUIElementChanged):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::respondToChangedContents):
        * kwq/KWQTextUtilities.h:
        * kwq/KWQTextUtilities.mm:
        (KWQFindNextWordFromIndex):
        (KWQFindSentenceBoundary):
        (KWQFindNextSentenceFromIndex):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge accessibilityTree]):

2005-01-05  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - re-landing a subset of my custom tag change that does not fix the bug, but also does
          not introduce a performance regression

        * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
        some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.

        * khtml/editing/htmlediting.cpp:
        (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
        per-document tags and is just better all around for things like the document.
        (khtml::debugNode): Ditto.
        * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
        * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
        * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.

        * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
        non-HTML elements to be nested as desired.

        * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
        * khtml/misc/htmlhashes.cpp:
        (khtml::getTagID): Changed return type to unsigned short.
        (khtml::getAttrID): Ditto.

        * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
        Also updated for a few tags that the parser handled but this did not.

        * kwq/KWQRenderTreeDebug.cpp:
        (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
        the tag ID directly, which only works for standard nodes.
        (operator<<): Update to call getTagName.
        (nodePositionRelativeToRoot): Ditto.
        (writeSelection): Ditto.

2005-01-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
        this operation work correctly, particularly in the logic to figure out whether to merge content, and
        also performing merges.
        * khtml/editing/visible_position.cpp:
        (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
        * khtml/editing/visible_units.cpp:
        (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
        (khtml::isEndOfParagraph): Ditto.
        * khtml/editing/visible_units.h: Declare new functions.

2005-01-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
        for the block we are adding was being done at the wrong time, which led to the placeholder remaining
        in the document when it was not needed. This resulted in the extra space reported in the bug.

2005-01-04  Kevin Decker  <kdecker@apple.com>

        Reviewed by Hyatt.

	Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::fillInlineSelectionGaps): Added a nil check. If there is no selection, don't try to get the selection's containing block. If we do, we'll crash. 

2005-01-04  David Hyatt  <hyatt@apple.com>

	Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
	
        Reviewed by kevin

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateScrollInfoAfterLayout):

2005-01-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for these two bugs:
        
        <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
        <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
        neither start nor end. For 3939148, improve the code which adjusts the insertion point during 
        the process of pasting. It formerly handled only one of the possible cases.
        * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-015.html: Added.

2005-01-04  David Hyatt  <hyatt@apple.com>

	Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
	
        Reviewed by john

        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::updateFromElement):
        * kwq/KWQLineEdit.mm:
        (QLineEdit::setPlaceholderString):

2005-01-04  David Hyatt  <hyatt@apple.com>

	Fix for 3830936, hang on changeforamerica.com.  Make sure to ignore the style not yet available option when
	returning pseudo-styles.
	
        Reviewed by john

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::matchRulesForList):
        (khtml::CSSStyleSelector::pseudoStyleForElement):
        * khtml/rendering/render_style.cpp:
        (RenderStyle::addPseudoStyle):

2005-01-04  Darin Adler  <darin@apple.com>

        - rolled out my custom tag name change again -- it caused a 1 ms PLT regression

        * khtml/css/cssstyleselector.cpp:
        * khtml/editing/htmlediting.cpp:
        * khtml/editing/selection.cpp:
        * khtml/editing/visible_position.cpp:
        * khtml/html/dtd.cpp:
        * khtml/html/htmlparser.cpp:
        * khtml/html/htmlparser.h:
        * khtml/html/htmltokenizer.cpp:
        * khtml/misc/htmlhashes.cpp:
        * khtml/misc/htmlhashes.h:
        * khtml/misc/htmltags.c:
        * khtml/misc/htmltags.h:
        * khtml/misc/maketags:
        * khtml/xml/dom_docimpl.cpp:
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_position.cpp:
        * kwq/KWQRenderTreeDebug.cpp:

2005-01-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
        a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
        to be applied. Now the code will detect when at the end of a style run and will not move and apply 
        that ending style to the new paragraph, though it will place that style into the typing style. This
        seems to match NSText behavior.
        * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed 
        here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
        not have any visible effect on the document.
        * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-022.html: Added.

2005-01-04  David Hyatt  <hyatt@apple.com>

	Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
	all over the place.
	
        Reviewed by john

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines):

2005-01-03  David Hyatt  <hyatt@apple.com>

	Fix for float painting regressions 3932524, 3931664, and 3933068.  Make the noPaint flag setting more
	robust and make it work regardless of which objects get a layout or not.
	
        Reviewed by mjs

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::insertFloatingObject):
        (khtml::RenderBlock::addOverhangingFloats):
        (khtml::RenderBlock::addIntrudingFloats):
        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::FloatingObject::FloatingObject):

2005-01-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
        
	* khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
	it should not ever be (now).
        (HTMLCollectionImpl::item): When traversing items stop when we hit
	nil, meaning the end to avoid triggering above assert (formerly crash).

2005-01-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John and Kevin.

	<rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
        
	* khtml/ecma/kjs_window.cpp:
        (Window::get): Look up frame names before buitin window properties
	to match other browsers. This regressed because we added a builtin
	"toolbar" property but this site had a frame with that name.

2004-12-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
        
	Added opener bridge method to help WebKit implement security check
	for named frame visibility.
	
	* khtml/khtml_part.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge opener]):

2005-01-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.

2005-01-03  David Hyatt  <hyatt@apple.com>

	Fix for 3936881, make sure positioned objects prooperly update y-position.
	
        Reviewed by john

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutPositionedObjects):

2005-01-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison
        
        Fix for this bug:
        
        <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
        (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
        (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
        (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
        (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
        (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
        insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
        of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
        (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
        (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
         * khtml/editing/htmlediting.h: Declare new functions.

2004-12-25  Kevin Decker  <kdecker@apple.com>

        Reviewed by Hyatt.

	Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
	
        * khtml/html/dtd.cpp: <label> needed a much higher priority such that it will close block elements.  Malformed HTML (ugh) is the only reason why we need to do this. 

2004-12-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)

        * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
        some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.

        * khtml/editing/htmlediting.cpp:
        (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
        per-document tags and is just better all around for things like the document.
        (khtml::debugNode): Ditto.
        * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
        * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
        * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.

        * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
        non-HTML elements to be nested as desired.

        * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
        the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
        much larger number.
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
        sense to just have the array be a member so we don't have to use new and delete on it. Also needed
        to eliminate code that used ID_CLOSE_TAG for an array size.
        (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
        that manages isindex to use deref instead of delete.
        (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
        mistake of using ID_CLOSE_TAG for the array size too.
        (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
        there and it would prevent custom tags from working. Added range check before using the forbidden
        tag array with the token ID since custom tags will use index values past the end of the array.
        (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
        inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
        createElement call is still here. Last time I left out a few form element types from this switch;
        fixed now.
        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
        document if getTagID fails; this creates a unique per-document ID.

        * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
        * khtml/misc/htmlhashes.cpp:
        (khtml::getTagID): Changed return type to unsigned short.
        (khtml::getAttrID): Ditto.

        * khtml/misc/htmltags.c: Regenerated.
        * khtml/misc/htmltags.h: Regenerated.

        * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
        Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
        Also rewrote getTagName to work with the new scheme.

        * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
        Also updated for a few tags that the parser handled but this did not.

        * kwq/KWQRenderTreeDebug.cpp:
        (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
        the tag ID directly, which only works for standard nodes.
        (operator<<): Update to call getTagName.
        (nodePositionRelativeToRoot): Ditto.
        (writeSelection): Ditto.

=== Safari-177 ===

2004-12-22  Darin Adler  <darin@apple.com>

        - rolled out my custom tag name change -- it broke amazon.com

        * khtml/css/cssstyleselector.cpp:
        * khtml/editing/htmlediting.cpp:
        * khtml/editing/selection.cpp:
        * khtml/editing/visible_position.cpp:
        * khtml/html/dtd.cpp:
        * khtml/html/htmlparser.cpp:
        * khtml/html/htmlparser.h:
        * khtml/html/htmltokenizer.cpp:
        * khtml/misc/htmlhashes.cpp:
        * khtml/misc/htmlhashes.h:
        * khtml/misc/htmltags.c:
        * khtml/misc/htmltags.h:
        * khtml/misc/maketags:
        * khtml/xml/dom_docimpl.cpp:
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_position.cpp:
        * kwq/KWQRenderTreeDebug.cpp:

2004-12-22  David Harrison  <harrison@apple.com>

        Reviewed by Darin Adler.

        * khtml/editing/selection.cpp:
        (khtml::Selection::validate):
        The selecting/deselecting bad behavior is because the Selection code that expands by words
        had an inaccurate test for being at the end of the document (where double-clicking needs
        to select the last word).  Fixed that check.

2004-12-22  Adele Amchan  <adele@apple.com>

        Reviewed by Chris.

        Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection 
          so that we match Firefox and WinIE behavior.

2004-12-22  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)

        * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
        some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.

        * khtml/editing/htmlediting.cpp:
        (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
        per-document tags and is just better all around for things like the document.
        (khtml::debugNode): Ditto.
        * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
        * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
        * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.

        * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
        non-HTML elements to be nested as desired.

        * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
        the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
        much larger number.
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
        sense to just have the array be a member so we don't have to use new and delete on it. Also needed
        to eliminate code that used ID_CLOSE_TAG for an array size.
        (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
        that manages isindex to use deref instead of delete.
        (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
        mistake of using ID_CLOSE_TAG for the array size too.
        (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
        there and it would prevent custom tags from working. Added range check before using the forbidden
        tag array with the token ID since custom tags will use index values past the end of the array.
        (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
        inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
        createElement call is still here.
        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
        document if getTagID fails; this creates a unique per-document ID.

        * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
        * khtml/misc/htmlhashes.cpp:
        (khtml::getTagID): Changed return type to unsigned short.
        (khtml::getAttrID): Ditto.

        * khtml/misc/htmltags.c: Regenerated.
        * khtml/misc/htmltags.h: Regenerated.

        * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
        Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
        Also rewrote getTagName to work with the new scheme.

        * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
        Also updated for a few tags that the parser handled but this did not.

        * kwq/KWQRenderTreeDebug.cpp:
        (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
        the tag ID directly, which only works for standard nodes.
        (operator<<): Update to call getTagName.
        (nodePositionRelativeToRoot): Ditto.
        (writeSelection): Ditto.

2004-12-21  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

        <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line

        Problem was the TextIterator was not handling exitNode() from a P block properly.
        
        * khtml/editing/visible_text.cpp:
        (khtml::TextIterator::TextIterator):
        Add new param that specifies whether the iterator is for content or for searching.
        Search iterators do not prevent newlines at the beginning.
        (khtml::TextIterator::advance):
        Added some comments.
        (khtml::TextIterator::handleTextNode):
        Added some comments.
        (khtml::TextIterator::exitNode):
        Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
        (khtml::TextIterator::emitCharacter):
        Added some comments.
        (khtml::TextIterator::range):
        Added some comments.
        (khtml::CharacterIterator::CharacterIterator):
        Specify search type TextIterator.
        (khtml::CharacterIterator::advance):
        * khtml/editing/visible_text.h:
        (khtml::):
        Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
        * khtml/editing/visible_units.cpp:
        (khtml::nextWordBoundary):
        Specify search type TextIterator.

2004-12-21  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

        <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
        
        Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
        Fixed by pretending the start == end-1 in that situation, as long as end > 0.
        
        * khtml/rendering/render_text.cpp:
        (RenderText::setSelectionState)

2004-12-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
        
	* khtml/ecma/kjs_window.cpp:
        (Window::get): Change most window functions to be restricted by
	XSS domain check.

2004-12-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
        formerly undetected and unhandled. This is the crux of the bug fix.
        (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
        execution of command.
        * khtml/editing/htmlediting.h: Declare new function.
        * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3928305-fix.html: Added.

2004-12-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
        checking in (aka must return false from function returning bool).

2004-12-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Fix for this bug:
        
        <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.

2004-12-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
        further experiements.
        (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
        be done if the insertion point is in an empty block.
        * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-012.html: Added.
        * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-013.html: Added.
        * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-014.html: Added.

2004-12-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)

        * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
        add a field to track it. Must make a few things mutable so we can update them in the range accessor.
        * khtml/editing/visible_text.cpp:
        (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
        using the node's index. We only compute the node index if actually asked for the range.
        (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
        up the offsets.
        (khtml::TextIterator::handleTextBox): Ditto.
        (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
        nodeIndex.
        (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
        (khtml::TextIterator::exitNode): More of the same.
        (khtml::TextIterator::emitCharacter): Ditto.
        (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
        add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.

        - another small fix

        * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.

=== Safari-176 ===

2004-12-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
        regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
        Rolling out until I can develop a real fix.

2004-12-20  David Harrison  <harrison@apple.com>

        Reviewed by Dave Hyatt.
        
        Initial checkin of AXTextMarkerRef support.

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection):
        (DocumentImpl::setFocusNode):
        * kwq/KWQAccObject.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject detach]):
        (-[KWQAccObject anchorElement]):
        (-[KWQAccObject addChildrenToArray:]):
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityActionDescription:]):
        (-[KWQAccObject accessibilityPerformAction:]):
        (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
        (-[KWQAccObject textMarkerForVisiblePosition:]):
        (-[KWQAccObject visiblePositionForTextMarker:]):
        (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
        (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
        (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
        (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        (-[KWQAccObject accessibilityParameterizedAttributeNames]):
        (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
        (-[KWQAccObject getSelectedTextMarkerRange]):
        (-[KWQAccObject doAXLineForTextMarker:]):
        (-[KWQAccObject doAXTextMarkerRangeForLine:]):
        (-[KWQAccObject doAXStringForTextMarkerRange:]):
        (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
        (-[KWQAccObject accessibilityFocusedUIElement]):
        (-[KWQAccObject clearChildren]):
        (-[KWQAccObject accObjectID]):
        (-[KWQAccObject setAccObjectID:]):
        (-[KWQAccObject removeAccObjectID]):
        * kwq/KWQAccObjectCache.h:
        * kwq/KWQAccObjectCache.mm:
        (KWQAccObjectCache::KWQAccObjectCache):
        (KWQAccObjectCache::~KWQAccObjectCache):
        (KWQAccObjectCache::getAccObjectID):
        (KWQAccObjectCache::removeAccObjectID):
        (KWQAccObjectCache::textMarkerForVisiblePosition):
        (KWQAccObjectCache::visiblePositionForTextMarker):

2004-12-19  Darin Adler  <darin@apple.com>

        * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.

2004-12-19  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - a garbage collection fix

        * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
        #ifndef to use #if (in practice, either is OK).
        * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.

2004-12-17  David Hyatt  <hyatt@apple.com>

	Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
	
        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcPercentageHeight):
        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):

2004-12-17  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

        <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
        
        * khtml/editing/visible_units.cpp:
        (khtml::endOfParagraph):
        When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.

2004-12-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
        codes when I added the createBreakElement() function.

2004-12-17  Richard Williamson   <rjw@apple.com>

	Set the floor of max cacheable object size to 40K.  This restores
	the long standing floor.  Lower floor deleteriously impacts the PLT.
        Reviewed by Hyatt.

        * khtml/khtml_part.cpp:
        (KHTMLPart::checkCompleted):
        * khtml/misc/loader.cpp:
        (Cache::setSize):

2004-12-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
        Formerly checked only for block boundary.

2004-12-17  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

		Add KWQCFAutorelease for autoreleasing CF objects.
        * kwq/KWQFoundationExtras.h:
        (KWQCFAutorelease):
        New.

2004-12-17  David Harrison  <harrison@apple.com>

        Reviewed by Darin.

		Fix GC compatibility in getNSString.

        * kwq/KWQString.mm:
        (QString::getNSString):
		Use NSString allocator instead of CFString, so that autorelease works under GC.

2004-12-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
        move it after the <body> element.

2004-12-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me
        
        Added new layout tests covering cases from recent bug fixes.

        * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-018.html: Added.
        * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-019.html: Added.
        * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-020.html: Added.
        * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-021.html: Added.

2004-12-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.

        * layout-tests/editing/inserting/insert-div-013-expected.txt
        * layout-tests/editing/inserting/insert-div-014-expected.txt

2004-12-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply):
        * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
        block as the reference node for the insertion of the new block.
        (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
        I worked this all out on the whiteboard this time. This should be the last tweak.

2004-12-17  Kevin Decker  <kdecker@apple.com>

        Reviewed by Ken.

	Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs

        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.

2004-12-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
        it checks the downstream node for the starting position.

2004-12-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Added new createBreakElement() function that makes creating a <br> element a one-liner.
        Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
        over to this new helper.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
        (khtml::InsertLineBreakCommand::doApply): Ditto.
        (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
        (khtml::ReplaceSelectionCommand::doApply): Ditto.
        (khtml::createBreakElement): New helper.
        * khtml/editing/htmlediting.h: Ditto.

2004-12-16  David Hyatt  <hyatt@apple.com>

	Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
	vertical-align top or bottom.  The bug is 3771007, bankofamerica's ebills page.
	
        Reviewed by kocienda

        * khtml/rendering/render_object.cpp:
        (RenderObject::getVerticalPosition):

2004-12-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for these bugs:
        
        <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
        <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
        make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
        a check which may move the node used as the reference node for the insertion. Also change this code to
        insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
        to want to shift into the new <p>.

2004-12-16  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
          after talking this over with Dave and Ken

        * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
        helper so this can share code with the plain-text conversion code.
        (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
        helper so this can share code with the plain-text conversion code.
        (khtml::createDefaultParagraphElement): Added.
        (khtml::createBlockPlaceholderElement): Added.

        * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
        <br> elements for pasting plain text.

        - regenerated these files with the newer gperf

        * khtml/css/cssproperties.c: Regenerated.
        * khtml/css/cssvalues.c: Regenerated.
        * khtml/misc/htmlattrs.c: Regenerated.
        * khtml/misc/htmltags.c: Regenerated.

2004-12-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
        parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
        it stops looking in this situation. This problem eventually caused the delete code to try to 
        merge a node under a descendent.

2004-12-16  Adele Amchan  <adele@apple.com>

        Change by Richard, reviewed by me.

	Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load

        * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.

2004-12-16  Adele Amchan  <adele@apple.com>

        Reviewed by Chris.

        Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk

        Added a call to ObjectImp::get before Window::get just returns Undefined.  
        This was preventing us from getting the toString function from a Window object.

        * khtml/ecma/kjs_window.cpp: (Window::get):

2004-12-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Fix for this bug:
        
        <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
        
        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
        to do a better job than it was doing before. Added several test cases to prove I am on a 
        better track.
        * khtml/editing/visible_position.cpp:
        (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
        leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
        This function was returning true for the first position in "bar". Wrong. Also tightened up other 
        rule: Should not report true when relationship between blocks cannot be determined.
        (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true 
        when relationship between blocks cannot be determined.
        * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-010.html: Added.
        * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-011.html: Added.
        * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-012.html: Added.
        * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-013.html: Added.
        * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-014.html: Added.
        * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-015.html: Added.
        * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-016.html: Added.
        * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-017.html: Added.
            
2004-12-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me
        
        Added a layout test based on my last checkin.

        * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
        * layout-tests/editing/selection/move-by-word-001.html: Added.

2004-12-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps

        * khtml/editing/visible_text.cpp:
        (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
        backwards into a different block that is an descendent of the block containing the text node (as in leaving 
        the "bar" node in this example: <p>foo</p>bar).
        (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
        (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
        it is called from there, and now also from advance().

2004-12-15  Darin Adler  <darin@apple.com>

        Reviewed by Ken.
        
        - fixed problem where plain-text would put a blank line between each <p> even when they have no margins

        * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
        "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
        type altogether and use the render tree instead.

2004-12-14  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo" 
        in the menu, no specific action names

        * khtml/editing/edit_actions.h: new header, contains EditAction enum
        (renamed from HTMLEditAction, formerly in htmlediting.h)

        * ForwardingHeaders/editing/edit_actions.h: new forwarding header
        
        * khtml/editing/htmlediting.h:
        removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
        namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand

        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommandPtr::editingAction):
        update for enum name change
        (khtml::EditCommand::editingAction):
        ditto
        (khtml::ApplyStyleCommand::ApplyStyleCommand):
        added editingAction parameter to this constructor
        (khtml::ApplyStyleCommand::editingAction):
        return new ivar
        (khtml::DeleteSelectionCommand::editingAction):
        update for enum name change
        (khtml::MoveSelectionCommand::editingAction):
        ditto
        (khtml::TypingCommand::editingAction):
        ditto
        (khtml::ReplaceSelectionCommand::editingAction):
        ditto
        
        * khtml/khtml_part.h:
        added EditAction parameter to applyStyle and computeAndSetTypingStyle
        * khtml/khtml_part.cpp:
        (KHTMLPart::computeAndSetTypingStyle):
        added EditAction parameter
        (KHTMLPart::applyStyle):
        ditto

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::registerCommandForUndoOrRedo):
        do the cast from EditAction to WebUndoAction a different way to match other code
        
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setTypingStyle:withUndoAction:]):
        added WebUndoAction parameter, passed into ApplyStyleCommand constructor
        (-[WebCoreBridge applyStyle:withUndoAction:]):
        ditto

        * WebCore.pbproj/project.pbxproj:
        updated for new files

2004-12-14  David Hyatt  <hyatt@apple.com>

	Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them.  Remove
	the ridiculous 1024 limit on the span values.

        * khtml/html/html_tableimpl.cpp:
        (HTMLTableCellElementImpl::parseHTMLAttribute):
        * khtml/rendering/render_table.cpp:
        (RenderTableCell::collapsedBottomBorder):
        * khtml/rendering/render_table.h:
        (khtml::RenderTableCell::colSpan):
        (khtml::RenderTableCell::setColSpan):
        (khtml::RenderTableCell::rowSpan):
        (khtml::RenderTableCell::setRowSpan):
        (khtml::RenderTableCol::span):
        (khtml::RenderTableCol::setSpan):

2004-12-14  David Hyatt  <hyatt@apple.com>

	Make sure <col> and <colgroup> can have spans updated dynamically as well.
	
        Reviewed by rjw

        * khtml/html/html_tableimpl.cpp:
        (HTMLTableColElementImpl::parseHTMLAttribute):
        * khtml/rendering/render_table.cpp:
        (RenderTableCell::updateFromElement):
        (RenderTableCol::updateFromElement):

2004-12-14  David Hyatt  <hyatt@apple.com>

	Fix for 3833123, setting a cell's colspan does not update rendering like it should.
	
        Reviewed by rjw

        * khtml/html/html_tableimpl.cpp:
        (HTMLTableCellElementImpl::parseHTMLAttribute):
        * khtml/rendering/render_table.cpp:
        (RenderTableCell::RenderTableCell):
        (RenderTableCell::updateFromElement):

2004-12-14  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard

        Reviewed by hyatt.

        * khtml/editing/markup.cpp:
        (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it

2004-12-14  David Hyatt  <hyatt@apple.com>

	Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
	This is actually a regression from my positioned object DHTML optimization.
	
        Reviewed by kocienda

        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):

2004-12-14  David Hyatt  <hyatt@apple.com>

	Make sure the class attribute works when newlines are present in the attribute.

        Reviewed by kocienda

        * khtml/html/html_elementimpl.cpp:
        (HTMLNamedAttrMapImpl::parseClassAttribute):

2004-12-14  David Hyatt  <hyatt@apple.com>

	Fix for 3724938, float element is duplicated and paints twice.  The logic for when to paint floats was
	actually fairly screwed up.  This patch simplifies the logic and makes addOverhangingFloats easier to
	read by splitting it into two separate functions.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::clearFloats):
        (khtml::RenderBlock::addOverhangingFloats):
        (khtml::RenderBlock::addIntrudingFloats):
        * khtml/rendering/render_block.h:

2004-12-14  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - added Undo action names for Cut, Paste, and Drag

        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::editingAction):
        overridden to return HTMLEditActionCut
        (khtml::MoveSelectionCommand::editingAction):
        overridden to return HTMLEditActionDrag
        (khtml::ReplaceSelectionCommand::editingAction):
        overridden to return HTMLEditActionPaste

2004-12-14  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu, 
        no specific action names
          
        The remaining step is to make each EditCommand subclass override editingAction() to return an
        appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
        is not completely straightforward, so this next step isn't trivial.)

        * khtml/editing/htmlediting.h:
        new enum for HTMLEditAction

        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommandPtr::editingAction):
        new method, calls through to EditCommand
        (khtml::EditCommand::editingAction):
        new method for subclasses to override, returns HTMLEditActionUnspecified at this level
        (khtml::TypingCommand::editingAction):
        proof of concept override, returns HTMLEditActionTyping
                
        * kwq/KWQKHTMLPart.h:
        declare new private bottleneck method registerCommandForUndoOrRedo
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::registerCommandForUndoOrRedo):
        new bottleneck method to reduce code duplication; now calls over the bridge
        to get the localized string to use for the Undo action name
        (KWQKHTMLPart::registerCommandForUndo):
        now calls new bottleneck method
        (KWQKHTMLPart::registerCommandForRedo):
        now calls new bottleneck method
        
        * kwq/WebCoreBridge.h:
        new enum for WebUndoAction, maps directly to HTMLEditAction.
        Declaration of nameForUndoAction:

2004-12-14  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)

        * khtml/rendering/render_frames.cpp:
        (RenderPart::~RenderPart): Check widget for nil.
        (RenderPart::setWidget): Ditto.
        (RenderFrame::slotViewCleared): Ditto.
        (RenderPartObject::slotViewCleared): Ditto.

2004-12-13  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - moved markup-related functions into new sources files in the editing directory
        - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster

        * ForwardingHeaders/editing/markup.h: Added.
        * khtml/editing/markup.h: Added.
        * khtml/editing/markup.cpp: Added.

        * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.

        * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::innerHTML): Changed to call createMarkup.
        (HTMLElementImpl::outerHTML): Ditto.

        * khtml/ecma/kjs_window.cpp:
        (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
        (Window::retrieveActive): Ditto.

        * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
        * khtml/xml/dom_docimpl.h: Ditto.

        * khtml/khtml_part.cpp:
        (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
        (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.

        * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
        still works even with the additional replace overloads added to QString.
        * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.

        * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
        base pointer, because it used dynamic_cast in its implementation. Made the other version public.
        * khtml/rendering/render_object.cpp: Ditto.
        * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.

        * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
        * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
        the support code into markup.cpp.

        * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
        * khtml/xml/dom_nodeimpl.cpp: Ditto.

        * khtml/xml/dom_position.cpp:
        (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
        so these return null positions rather than raising exceptions.
        (DOM::endPosition): Ditto.

        * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
        * kwq/KWQFrame.h: Ditto.
        * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
        * kwq/KWQKPartsPart.h: Ditto.
        * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
        * kwq/KWQScrollView.h: Ditto.
        * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
        * kwq/KWQKHTMLPart.h: Ditto.
        * kwq/KWQKHTMLPart.mm:
        (KHTMLView::isKHTMLView): Ditto.
        (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
        replace overloads added to QString.
        (KWQKHTMLPart::setStatusBarText): Ditto.
        (KWQKHTMLPart::runJavaScriptAlert): Ditto.
        (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
        (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
        (KWQKHTMLPart::attributedString): Ditto.
        (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
        (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).

        * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
        * kwq/KWQObject.mm:
        (QObject::inherits): Changed to not use dynamic cast.
        (QObject::isKHTMLPart): Added. Returns false.
        (QObject::isKHTMLView): Ditto.
        (QObject::isKPartsReadOnlyPart): Ditto.
        (QObject::isQFrame): Ditto.
        (QObject::isQScrollView): Ditto.

        * kwq/KWQRenderTreeDebug.cpp:
        (write): Changed to use inherits rather than dynamic_cast.
        (writeSelection): Ditto.

        * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
        than going straight on to the "no parameters at all" version.

        * kwq/KWQString.h:
        * kwq/KWQString.mm: (QString::replace): Added overloads.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
        (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
        (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
        the additional replace overloads added to QString.
        (-[WebCoreBridge stringForRange:]): Ditto.
        (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
        (-[WebCoreBridge elementAtPoint:]): QChar conversion.
        (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
        (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.

2004-12-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on 
        leading and trailing whitespace positions was reversed! I must have introduced this error recently
        when changing around this code.

2004-12-13  David Hyatt  <hyatt@apple.com>

	Fix for 3915787, macobserver doesn't paint.  floatRect() needed to be const in the base class.  Also hit-testing
	and painting was using the wrong rect when setting up the x/y of the rect.
	
        Reviewed by mjs

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paint):
        (khtml::RenderBlock::nodeAtPoint):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::floatRect):

2004-12-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles

        Code to figuire out the end node to merge was missing the font tag in the second paragraph
        written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
        looking for the node that is the last inline in the last block of the fragment. The old algorithm was 
        insufficiently powerful.
        (khtml::ReplacementFragment::enclosingBlock): New helper function.
        * khtml/editing/htmlediting.h: Add declaration for new helper function.
        * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-011.html: Added.

2004-12-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        WebCore side of fix for this bug:
        
        <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace

        Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
        bug. This change involves our half of the needed changes.
        
        Note that a lot of this change has to do with changing code to use a <br> element instead of
        a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
        other places, code to handle comments in markup can be removed since we do not use comments for
        such annotations after this change.

        * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
        (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
        (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
        (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
        convertedSpaceSpanClassString to match other uses of the idiom used here.
        (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
        * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
        (khtml::ReplacementFragment::hasInterchangeNewline):  Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
        annotate fragments with comments any longer.
        * khtml/html/html_elementimpl.h: Ditto.
        * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
        (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
        (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
        spurious semi-colon.
        * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
        in DOM when calling createContextualFragment().

2004-12-10  John Sullivan  <sullivan@apple.com>

        fixed deployment build bustage that John Louch ran into

        * kwq/KWQTextEdit.mm:
        (QTextEdit::setScrollBarModes):
        move bool declaration inside exception-handling block to avoid obscure
        compiler error

2004-12-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
	
        * kwq/KWQWidget.mm:
        (QWidget::setFocus): Handle the case where setting focus removed
	us from the superview - this can happen due to style changes on
	focus change.

2004-12-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns

        There are a number of interesting things we could do to fix this bug, including SPI and involving
        the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
        will fix the bug in the general case until such time as we can come up with more specific
        solutions. 
        
        So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
        to 0.1em.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
        paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
        (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
        * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.

2004-12-10  Darin Adler  <darin@apple.com>

        Reviewed by Hyatt.

        - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars

        * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
        * khtml/rendering/render_form.cpp:
        (RenderSubmitButton::rawText): Convert to QChar explicitly.
        (RenderLineEdit::updateFromElement): Ditto.
        (RenderLineEdit::slotTextChanged): Ditto.
        (RenderSelect::updateFromElement): Ditto.
        (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
        that requires a derived class. Now we don't use this class at all for WebCore, but they still
        have it for KDE.
        (TextAreaWidget::event): Moved out the ifdefs.
        (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
        we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
        now done in setStyle.
        (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
        that's needed and WebCore no longer has TextAreaWidget.
        (RenderTextArea::calcMinMaxWidth): Ditto.
        (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
        overflow style.
        (RenderTextArea::updateFromElement): Use type QTextEdit.
        (RenderTextArea::text): Ditto.
        (RenderTextArea::select): Ditto.

        * kwq/KWQTextArea.mm:
        (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
        since it's now handled by QTextEdit.
        (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.

        * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
        the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
        * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.

2004-12-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3915047> HItting return in empty document inserts <p> but 
        insertion point does not move

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
        code to insert the <p> element for the return is not detecting the fact
        that the document is empty. Inserting a <p> into an empty body will not
        "add a new line" as the user expects. With this change, we'll add a second 
        <p> when the root editable element has no rendered kids.

2004-12-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)

        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
	the initial one step, otherwise we might inadvertantly step
	outside the collection base, thereby causing assertion failures or
	other badness later.

2004-12-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to 
        act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
        search could escape this node. Also, one other piece to code to move nodes to the new <p> element
        should do nothing if the starting point for the selection is itself the starting block.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
        function, though the names and concepts are slightly different.

2004-12-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
        
	* khtml/dom/html_document.cpp:
        (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
        * khtml/dom/html_document.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
	the items that can be accessed directly as a document propery, in particular forms, images,
	objects, applets and embeds.
        (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
        (HTMLFormCollectionImpl::updateNameCache): Ditto.
        * khtml/html/html_miscimpl.h:
        (DOM::HTMLCollectionImpl::): Added new type.

2004-12-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line

        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.

2004-12-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:

        <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
        that was removed from the document when pasting. This caused the disappearance. Now this
        is detected, and the selection is shifted to a node that is in the document.

2004-12-09  Richard Williamson   <rjw@apple.com>

	Check to disable threaded decoding during
	layout tests wasn't invoking function, just checking address of 
	function, which would always return true.
	
        * kwq/WebCoreImageRendererFactory.m:
        (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):

2004-12-09  David Hyatt  <hyatt@apple.com>

	Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
	error.

	Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
	all inlines when repainting.
	
        Reviewed by rjw

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::getAbsoluteRepaintRect):

2004-12-09  David Hyatt  <hyatt@apple.com>

	Fix for 3867545, finance.yahoo.com lays out incorrectly.  Add a quirk that will prevent tables from moving
	down below floats when there is insufficient space.  Instead we will match Gecko and just spill out of the
	containing block to the right.  This appears to be the more common desired behavior, despite being wrong.
	WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
	
        Reviewed by john

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::getClearDelta):
        * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
        * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
        * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
        * layout-tests/fast/block/margin-collapse/102-expected.txt:
        * layout-tests/fast/block/margin-collapse/102.html:

2004-12-09  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3914078> worldclock crashing gc related

	Use ProtectedValue for Context2D instance members.

        Reviewed by Maciej.

        * khtml/ecma/kjs_html.h:

2004-12-09  John Sullivan  <sullivan@apple.com>

        Reviewed by Dave.
        
        - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject title]): moved image alt tag code out of here
        (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
        (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
        that ordinary elements return; this means that ordinary elements that aren't images will return
        a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
        work here.
        (-[KWQAccObject accessibilityAttributeValue:]):
        call accessibilityDescription when asked for AXDescription

2004-12-09  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Fix for this bug:
        
        <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref

        * khtml/editing/htmlediting.cpp:
        (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
        been deleted. If this is the case, set the destination to the node the delete command provides in
        its ending selection.

=== Safari-175 ===

2004-12-09  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Fix for this bug:
        
        <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures

        The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
        callback may not be delivered before the program asks for the dimensions of an image in order to
        wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
        layout tests, so I have added a flag to the render tree debug code that we can set when debugging.

        * kwq/KWQRenderTreeDebug.cpp:
        (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
        (externalRepresentation): Sets debuggingRenderTree flag to true;
        * kwq/KWQRenderTreeDebug.h:
        * kwq/WebCoreImageRendererFactory.m:
        (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
        do threaded decoding in any case if the flag is set.

2004-12-09  Chris Blumenberg  <cblu@apple.com>

	Fix for busting XMLHTTPRequest.

        Reviewed by kocienda.

        * khtml/misc/loader.cpp:
        (Loader::servePendingRequests): pass true for deliverAllData
        * kwq/KWQKJob.h:
        (KIO::get): take deliverAllData param
        (KIO::http_post): ditto
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
        (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param

2004-12-09  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.

2004-12-07  Richard Williamson   <rjw@apple.com>

	Support threaded image decoding on machines w/ > 2 CPUs.

        Reviewed by Maciej and Chris.

        * khtml/misc/loader.cpp:
        (CachedImageCallback::notifyUpdate):
        (CachedImageCallback::notifyFinished):
        (CachedImageCallback::notifyDecodingError):
        (CachedImageCallback::handleError):
        (CachedImageCallback::clear):
        (CachedImage::CachedImage):
        (CachedImage::clear):
        (CachedImage::data):
        (CachedImage::checkNotify):
        (Loader::servePendingRequests):
        (Loader::slotFinished):
        (Loader::numRequests):
        (Loader::cancelRequests):
        (Loader::removeBackgroundDecodingRequest):
        * khtml/misc/loader.h:
        (khtml::CachedImageCallback::CachedImageCallback):
        (khtml::CachedImageCallback::ref):
        (khtml::CachedImageCallback::deref):
        (khtml::CachedImage::decoderCallback):
        * khtml/rendering/render_object.cpp:
        (RenderObject::setPixmap):
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (-[WebImageCallback initWithCallback:khtml::]):
        (-[WebImageCallback _commonTermination]):
        (-[WebImageCallback dealloc]):
        (-[WebImageCallback finalize]):
        (-[WebImageCallback notify]):
        (-[WebImageCallback setImageSourceStatus:]):
        (-[WebImageCallback status]):
        (QPixmap::shouldUseThreadedDecoding):
        (QPixmap::receivedData):
        * kwq/WebCoreImageRenderer.h:
        * kwq/WebCoreImageRendererFactory.h:
        * kwq/WebCoreImageRendererFactory.m:
        (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
        (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):

2004-12-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
        change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
        after new block has been inserted, otherwise a crash can result. Shuffle down call 
        to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted), 
        and all is good.

2004-12-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
        for determining the location for inserting content. Do not allow an insert before or after if the
        reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
        * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3907422-fix.html: Added.

2004-12-07  Darin Adler  <darin@apple.com>

        Reviewed by Don.

        - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links

        * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.

2004-12-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
        I discussed this with Hyatt and he agreed that going with "Apple" names was OK.

        * khtml/editing/html_interchange.h: Name change, as described above.
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): Ditto.

2004-12-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me
        
        Added a couple more layout tests.

        * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-013.html: Added.
        * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-014.html: Added.

2004-12-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Hyatt.

	- fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
        
	* kwq/KWQListBox.mm:
        (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
        (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
        (-[KWQListBoxScrollView widget]): See above.
        (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
	afterMouseDown, to avoid triggering an assertion failure.

2004-12-06  David Hyatt  <hyatt@apple.com>

	Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
	made by me, kocienda and harrison to just remove it.
	
        Reviewed by mjs

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_block.cpp:
        (khtml:::RenderFlow):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):

2004-12-06  David Hyatt  <hyatt@apple.com>

	Fix for 3787133, some web pages print with many blank pages.  Make sure to use the real page print rect and
	not a damage rect that can be changed when intersected with the clip regions of the web page.
	
        Reviewed by john

        * khtml/rendering/render_canvas.h:
        (khtml::RenderCanvas::printRect):
        (khtml::RenderCanvas::setPrintRect):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines):
        * khtml/rendering/render_list.cpp:
        (RenderListMarker::paint):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::adjustPageHeight):

2004-12-06  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).

		<rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
		
		
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):
		Dirty the line above because new child can inval the cached line break position of previous line.

2004-12-06  David Hyatt  <hyatt@apple.com>

	Fix for 3254464, radio buttons do not work for quiz on netscape.com.  Left/top overflow needed to be implemented.
	This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
	3126929, handle top/left overflow.

	This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.

	Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
	regions and web pages) has been fixed.
	
        Reviewed by mjs

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::computeHorizontalPositionsForLine):
        (khtml::RenderBlock::checkLinesForOverflow):
        * khtml/rendering/render_block.cpp:
        (khtml:::RenderFlow):
        (khtml::RenderBlock::overflowHeight):
        (khtml::RenderBlock::overflowWidth):
        (khtml::RenderBlock::overflowLeft):
        (khtml::RenderBlock::overflowTop):
        (khtml::RenderBlock::overflowRect):
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::paint):
        (khtml::RenderBlock::floatRect):
        (khtml::RenderBlock::lowestPosition):
        (khtml::RenderBlock::rightmostPosition):
        (khtml::RenderBlock::leftmostPosition):
        (khtml::RenderBlock::nodeAtPoint):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.h:
        (khtml::RenderBox::borderBox):
        (khtml::RenderBox::borderTopExtra):
        (khtml::RenderBox::borderBottomExtra):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::paintScrollbars):
        (mustExamineRenderer):
        (RenderLayer::intersectsDamageRect):
        (RenderLayer::containsPoint):
        * khtml/rendering/render_line.cpp:
        (khtml::InlineFlowBox::placeBoxesHorizontally):
        (khtml::InlineFlowBox::verticallyAlignBoxes):
        * khtml/rendering/render_line.h:
        (khtml::InlineBox::leftOverflow):
        (khtml::InlineBox::rightOverflow):
        (khtml::InlineFlowBox::setVerticalOverflowPositions):
        (khtml::RootInlineBox::RootInlineBox):
        (khtml::RootInlineBox::leftOverflow):
        (khtml::RootInlineBox::rightOverflow):
        (khtml::RootInlineBox::setVerticalOverflowPositions):
        (khtml::RootInlineBox::setHorizontalOverflowPositions):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::borderBox):
        (khtml::RenderObject::overflowLeft):
        (khtml::RenderObject::overflowTop):
        (khtml::RenderObject::overflowRect):
        (khtml::RenderObject::floatRect):
        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):
        (RenderTable::paint):
        (RenderTable::paintBoxDecorations):
        (RenderTable::calcMinMaxWidth):
        * khtml/rendering/render_table.h:
        (khtml::RenderTableCell::borderTopExtra):
        (khtml::RenderTableCell::borderBottomExtra):
        * kwq/KWQRect.h:
        * kwq/KWQRect.mm:
        (QRect::inflate):

2004-12-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
        
	I changed all unprotected places that can navigate a different
	window or frame from script to check for a javascript: URL, and if
	found, to check for safety using cross-site-script rules. 

	I considered a few other possible exploits and made no change:

	- document.location is already protected because the document
	object itself is protected

	- frame.src, frame.location, iframe.src and targetted links are
	all safe because setting the URL of a frame to a javascript: URL
	executes the script in the context of the parent

	* khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall):
        (Location::put):
        (LocationFunc::tryCall):

2004-12-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

        Fix for this bug:
        
        <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
        check for one of the special cases being checked for in this function. The specific case 
        intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
        sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
        case where a selection ended in a <br> after a block and would not delete any part of the
        selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
        selected.

        Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
        new use of the function exposed this bug:
        
        <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop

        * khtml/xml/dom_position.cpp:
        (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does 
        not have this fatal flaw. It is a much better design as well.
        
        * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
        have what I consider to be a better result. Going with it.

2004-12-06  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold

        Reviewed by hyatt.

        * kwq/DOM.mm:
        (-[DOMElement _font]): new SPI for AppKit
        * kwq/DOMPrivate.h:

2004-12-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)

        * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
        to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).

2004-12-06  John Sullivan  <sullivan@apple.com>

        Darin found what appears to be the real leak that we were falsely blaming
        on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
        sure nothing barfed.

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        call clearProperties() instead of just setting numParsedProperties to 0
        (CSSParser::parseDeclaration):
        ditto
        (CSSParser::createStyleDeclaration):
        ditto

2004-12-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me
        
        New layout tests.

        * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-001.html: Added.
        * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-002.html: Added.
        * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-003.html: Added.
        * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-004.html: Added.
        * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-005.html: Added.
        * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-006.html: Added.
        * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-007.html: Added.
        * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-008.html: Added.
        * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
        * layout-tests/editing/inserting/insert-div-009.html: Added.

2004-12-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Fix for this bug:
        
        <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
        being added to this function. This ensures that the added block has a height.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.

2004-12-06  Ken Kocienda  <kocienda@apple.com>
 
        Reviewed by John
        
        * khtml/dom/dom_string.cpp:
        (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
        * khtml/dom/dom_string.h: Ditto.
        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
        RebalanceWhitespaceCommand instance.
        (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
        (khtml::InsertLineBreakCommand::doApply): Ditto.
        (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
        (khtml::InsertTextCommand::input): Ditto.
        (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
        (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
        (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
        (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
        (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
        * khtml/editing/htmlediting.h: Ditto.
        (khtml::RebalanceWhitespaceCommand::): Ditto.

2004-12-05  Darin Adler  <darin@apple.com>

        - fixed small problem in my check-in from yesterday

        * kwq/KWQEvent.mm:
        (positionForEvent): Get location from event without raising exception if it's the wrong type.
        (clickCountForEvent): Same, for clickCount.
        (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
        the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
        to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.

2004-12-04  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes

        * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
        attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
        Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.

        - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set

        * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
        * khtml/rendering/render_form.cpp:
        (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
        (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
        creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.

        * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
        Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
        Added a fixState helper method so the constructors can save code.
        * kwq/KWQEvent.mm:
        (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
        and added a third constructor that uses the "current event" from AppKit (used above).
        (QMouseEvent::fixState): Compute state and click count based on event type.

        - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com

        * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
        the family name is a null string. This prevents the crash, but there are still other problems that may have the same
        underlying cause in CSS.

        - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result

        * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
        Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.

2004-12-03  Chris Blumenberg  <cblu@apple.com>

	New fixes for:
	<rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
	<rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
	<rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
	<rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear

        Reviewed by darin, rjw, kocienda.

        * khtml/misc/loader.cpp:
        (CachedObject::~CachedObject):
        (CachedCSSStyleSheet::checkNotify):
        (Loader::servePendingRequests):
        (Loader::slotFinished):
        (Loader::slotReceivedResponse):
        (Cache::requestImage):
        (Cache::requestScript):
        * khtml/misc/loader.h:
        (khtml::CachedObject::CachedObject):
        (khtml::CachedObject::response):
        (khtml::CachedObject::allData):
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate):
        (KIO::TransferJobPrivate::~TransferJobPrivate):
        (KIO::TransferJob::TransferJob):
        (KIO::TransferJob::assembleResponseHeaders):
        (KIO::TransferJob::retrieveCharset):
        (KIO::TransferJob::emitResult):
        (KIO::TransferJob::emitReceivedResponse):
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (KWQHeaderStringFromDictionary):
        (KWQCheckCacheObjectStatus):
        (KWQIsResponseURLEqualToURL):
        (KWQResponseURL):
        (KWQResponseMIMEType):
        (KWQCacheObjectExpiresTime):
        (khtml::CachedObject::setResponse):
        (khtml::CachedObject::setAllData):
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (QPixmap::QPixmap):
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader finishJobAndHandle:]):
        (-[KWQResourceLoader cancel]):
        (-[KWQResourceLoader reportError]):
        (-[KWQResourceLoader finishWithData:]):
        * kwq/KWQSignal.h:
        * kwq/KWQSignal.mm:
        (KWQSignal::call):
        * kwq/KWQSlot.h:
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot):
        (KWQSlot::call):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreResourceLoader.h:

2004-12-04  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)

        * khtml/rendering/render_form.cpp:
        (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
        modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
        the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
        (RenderSlider::slotSliderValueChanged): Ditto.

2004-12-03  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in 
        khtml::BackgroundLayer::cullEmptyLayers

        * khtml/rendering/render_style.cpp:
        (BackgroundLayer::cullEmptyLayers):
        added missing nil check

=== Safari-173 ===

2004-12-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        Roll out some recent changes by Chris that caused a performance regression.
        Fix is in hand, but it is a little risky this close to a submission. So,
        we have decided to roll back the change with the regression and roll in
        the new code after we submit.

        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/misc/htmlattrs.c:
        (hash_attr):
        (findAttr):
        * khtml/misc/htmltags.c:
        (hash_tag):
        (findTag):
        * khtml/misc/loader.cpp:
        (CachedObject::~CachedObject):
        (CachedObject::setResponse):
        (CachedCSSStyleSheet::checkNotify):
        (Loader::servePendingRequests):
        (Loader::slotFinished):
        (Loader::slotReceivedResponse):
        (Cache::requestImage):
        (Cache::requestScript):
        * khtml/misc/loader.h:
        (khtml::CachedObject::CachedObject):
        (khtml::CachedObject::response):
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate):
        (KIO::TransferJobPrivate::~TransferJobPrivate):
        (KIO::TransferJob::TransferJob):
        (KIO::TransferJob::assembleResponseHeaders):
        (KIO::TransferJob::retrieveCharset):
        (KIO::TransferJob::emitResult):
        (KIO::TransferJob::emitReceivedResponse):
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (KWQHeaderStringFromDictionary):
        (KWQCheckCacheObjectStatus):
        (KWQRetainResponse):
        (KWQReleaseResponse):
        (KWQIsResponseURLEqualToURL):
        (KWQResponseURL):
        (KWQResponseMIMEType):
        (KWQResponseTextEncodingName):
        (KWQResponseHeaderString):
        (KWQCacheObjectExpiresTime):
        (KWQLoader::KWQLoader):
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (QPixmap::QPixmap):
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader finishJobAndHandle]):
        (-[KWQResourceLoader cancel]):
        (-[KWQResourceLoader reportError]):
        (-[KWQResourceLoader finish]):
        * kwq/KWQSignal.h:
        * kwq/KWQSignal.mm:
        (KWQSignal::call):
        * kwq/KWQSlot.h:
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot):
        (KWQSlot::call):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreResourceLoader.h:

2004-12-03  John Sullivan  <sullivan@apple.com>

        Reviewed by Chris.
        
        - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
        when checking whether we moved the focus to another view, make sure we didn't "move" it to
        our documentView, because that's no move at all.

2004-12-03  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com

        * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
        Added missing initialization for base class and node pointer.

        - fixed a few places that could leave dangling node pointers

        * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
        Clear out the node pointer when the node is destroyed.
        * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.

2004-12-03  Chris Blumenberg  <cblu@apple.com>

	Fix for performance regression. My original patch added a signal for passing the data of a resource to its WebCore cache object. This patch passes the data with the preexisting "finished" symbol so we make less calls. 
	Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account

        Reviewed by rjw.

        * khtml/misc/loader.cpp:
        (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
        (Loader::slotFinished): take data param
        * khtml/misc/loader.h:
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
        (KIO::TransferJob::emitResult): take data param and pass it
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
        (-[KWQResourceLoader cancel]): pass nil for data
        (-[KWQResourceLoader reportError]): ditto
        (-[KWQResourceLoader finishWithData:]): pass data
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot): pass data param to slotFinished
        (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData

2004-12-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Did some clean up in the Position class as a result of trying to write some new layout
        tests and discovering a bug along the way.

        I removed these three functions from the Position class:
        
        1. bool isFirstRenderedPositionOnLine() const;
        2. bool isLastRenderedPositionOnLine() const;
        3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
        4. bool inFirstEditableInRootEditableElement() const;

        The first two have replacements in the VisiblePosition class, and some code has been
        moved to use these new variants. The third function was a helper used only by these
        first two function, and can be removed as well. The fourth function was not used by anyone.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
        * khtml/editing/visible_position.cpp:
        (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
        Incorrect results were being returned when asking about positions at the starts of blocks.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
        (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
        (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
        * khtml/xml/dom_position.h: Update header for deletions.

2004-12-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Terminology change in execCommand command identifiers. Specifically, the name of 
        "InsertNewline" command has been changed to "InsertLineBreak". This matches the 
        terminology used by AppKit. It is also more accurate, since the insertion of a
        "br" element is what the command does. The inspiration for this change is so the 
        -insertNewline AppKit method can be mapped to insert a new "div" element in 
        a document and avoid ambiguity with what the javascript editing command does.
        
        * khtml/editing/jsediting.cpp
        * layout-tests/editing/deleting/delete-tab-004.html
        * layout-tests/editing/editing.js
        * layout-tests/editing/inserting/insert-3654864-fix.html
        * layout-tests/editing/inserting/insert-3659587-fix.html
        * layout-tests/editing/inserting/insert-3775316-fix.html
        * layout-tests/editing/inserting/insert-3800346-fix.html
        * layout-tests/editing/inserting/insert-br-001.html
        * layout-tests/editing/inserting/insert-br-002.html
        * layout-tests/editing/inserting/insert-br-003.html
        * layout-tests/editing/inserting/insert-br-004.html
        * layout-tests/editing/inserting/insert-br-005.html
        * layout-tests/editing/inserting/insert-br-006.html
        * layout-tests/editing/inserting/insert-br-007.html
        * layout-tests/editing/inserting/insert-br-008.html
        * layout-tests/editing/inserting/insert-tab-004.html
        * layout-tests/editing/inserting/insert-text-with-newlines.html
        * layout-tests/editing/pasteboard/paste-text-010.html

2004-12-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
        at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
        (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
        in a block and the document is in quirks mode, add an additional br to make the one in the 
        replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
        * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3786362-fix.html: Added.

2004-12-02  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images

	Ensure that the document is cleared when leaving a non-HTML page.  This ensures that
	the b/f cache won't incorrectly trash the previous state when restoring.

        Reviewed by John.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
        (-[WebCoreBridge canCachePage]):
        (-[WebCoreBridge clear]):

2004-12-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        Fix for this bug:
        
        <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
        was found. This can happen in cases where the DOM was built from malformed markup (as in the case
        of this bug where there is content after the body tag). Did a little code clean up as well.
        (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.

2004-12-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left

        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
        to figure out which end of the selection to extend.

2004-12-02  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

		<rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
		Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.

        * khtml/editing/visible_text.cpp:
        (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
        (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
        (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
        (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
        (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
        Distinguish BR from whitespace.
        * khtml/editing/visible_text.h:
        Distinguish BR from whitespace.
        * khtml/editing/visible_units.cpp:
        (khtml::previousWordBoundary):
        Use UPSTREAM visible position now that SimplifiedBackwardsTextIterator distinguishes BR from whitespace.  Otherwise, double-clicking at end of line would result in caret selection at start of next line. 

2004-12-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24

        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
        of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
        exception trying to use a Position returned from this function to set the boundary point of a Range (which
        eventually led to the crash). Since this crash happened, it seems like this function was failing in its
        contract to return a range-compliant position, hence the need for this fix.

2004-12-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        Moving code only.

        * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
        regard to other editing commands. The class had a name change ages ago, and it was never
        moved.
        * khtml/editing/htmlediting.h: Ditto.

2004-12-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Some improvements for paste, including some new code to annotate
        whitespace when writing to the pasteboard to ensure that the meaning
        of the markup on the pasteboard is unambiguous.
        
        There is also new code for reading this annotated markup from the pasteboard,
        removing the nodes that were added only to prevent ambiguity.

        * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
        The header should have been added earlier, but I did not do so.
        * khtml/editing/html_interchange.cpp: Added.
        (convertHTMLTextToInterchangeFormat):
        * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
        Also fixed a bug in the code that counts blocks in a fragment.
        (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
        (khtml::ReplacementFragment::insertNodeBefore): New helper.
        (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
        for the replacement after deleting. This was causing a bug when pasting at the end of a block.
        * khtml/editing/htmlediting.h: Add some new declarations.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::stringValueForRange): New helper.
        (NodeImpl::renderedText): New helper to return only the rendered text in a node.
        (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
        should be added. Called by the paste code.
        * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.

        New test to check the khtml::ReplaceSelectionCommand::doApply fix.
        * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-010.html: Added.

2004-11-30  Chris Blumenberg  <cblu@apple.com>

        * ChangeLog: removed conflict marker

2004-11-30  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
	<rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)

        Reviewed by darin.

        * khtml/misc/loader.cpp:
        (CachedObject::~CachedObject): release m_allData
        (CachedObject::setAllData): new
        (Loader::servePendingRequests): connect slotAllData
        (Loader::slotAllData): new
        (Cache::requestImage): tweak
        * khtml/misc/loader.h:
        (khtml::CachedObject::CachedObject): set allData to 0
        (khtml::CachedObject::allData): new
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJob::TransferJob): set m_allData
        (KIO::TransferJob::emitAllData): new
        * kwq/KWQLoader.mm:
        (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot): support for slotAllData
        (KWQSlot::call):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreResourceLoader.h:

2004-11-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

2004-11-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)

        * khtml/khtml_part.cpp:
	(KHTMLPart::begin): call setParsing on document here after opening
	- from now on we'll only set parsing to true for a document open
	caused by page loading, not a programmatic one.
	* khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::open): don't setParsing to true here any more.

2004-11-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fix recent regression from collection perf fixes.
	
        * khtml/html/html_miscimpl.cpp:
        (HTMLFormCollectionImpl::updateNameCache): Look up the name
	attribute in the name cache, not the id cache (d'oh!)

2004-11-30  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - rolled in a KDE fix for a problem that may underlie a number of crashes

        * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
        the KDE guys to fix a subtle problem. Code said "n = n =".

        - rolled in a KDE fix for a containingBlock crash

        * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
        elements that can not be a containingBlock. They said this fixes a crash, although I did not look
        into that further.

        - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)

        * kwq/KWQButton.mm:
        (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
        (-[KWQButton detachQButton]): Added.
        (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
        (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
        (-[KWQButton widget]): Added.
        (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
        (-[KWQButton resignFirstResponder]): Ditto.
        (-[KWQButton canBecomeKeyView]): Ditto.
        (QButton::QButton): Remove target and action setup; handled in KWQButton now.
        (QButton::~QButton): Call detachQButton instead of setTarget:nil.

        * kwq/KWQComboBox.mm:
        (QComboBox::~QComboBox): Call detachQComboBox.
        (-[KWQPopUpButtonCell detachQComboBox]): Added.
        (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
        (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
        (-[KWQPopUpButton action:]): Ditto.
        (-[KWQPopUpButton widget]): Tweaked.
        (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
        (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
        (-[KWQPopUpButton resignFirstResponder]): Ditto.
        (-[KWQPopUpButton canBecomeKeyView]): Ditto.

        * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.

        * kwq/KWQListBox.mm:
        (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.

        * kwq/KWQScrollBar.h: Removed m_scroller field.
        * kwq/KWQScrollBar.mm:
        (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
        (-[KWQScrollBar detachQScrollBar]): Added.
        (-[KWQScrollBar widget]): Added.
        (-[KWQScrollBar mouseDown:]): Added.  Calls QWidget::beforeMouseDown and afterMouseDown.
        (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
        (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
        (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
        (QScrollBar::setKnobProportion): Ditto.
        (QScrollBar::scrollbarHit): Ditto.

        * kwq/KWQScrollView.mm:
        (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
        hack where we don't remove right away when doing mouse tracking.
        (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
        the hack where we don't add right away when doing mouse tracking.

        * kwq/KWQSlider.h: Added destructor.
        * kwq/KWQSlider.mm:
        (-[KWQSlider initWithQSlider:]): Tweaked a little.
        (-[KWQSlider detachQSlider]): Added.
        (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
        (-[KWQSlider widget]): Added.
        (QSlider::~QSlider): Added. Calls detachQSlider.

        * kwq/KWQTextArea.h: Added detachQTextEdit method.
        * kwq/KWQTextArea.mm:
        (-[KWQTextArea detachQTextEdit]): Added.
        (-[KWQTextArea textDidChange:]): Added check for widget of 0.
        (-[KWQTextArea becomeFirstResponder]): Ditto.
        (-[KWQTextArea nextKeyView]): Ditto.
        (-[KWQTextArea previousKeyView]): Ditto.
        (-[KWQTextArea drawRect:]): Ditto.
        (-[KWQTextAreaTextView insertTab:]): Ditto.
        (-[KWQTextAreaTextView insertBacktab:]): Ditto.
        (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
        (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
        (-[KWQTextAreaTextView mouseDown:]): Ditto.
        (-[KWQTextAreaTextView keyDown:]): Ditto.
        (-[KWQTextAreaTextView keyUp:]): Ditto.

        * kwq/KWQTextEdit.h: Added ~QTextEdit.
        * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.

        * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
        * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.

        * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
        Added beforeMouseDown and afterMouseDown for use in widget implementations.
        Removed unused hasMouseTracking function.
        * kwq/KWQWidget.mm:
        (QWidget::QWidget): Initialize two new fields.
        (QWidget::~QWidget): Added code to remove view when widget is destroyed.
        (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
        (QWidget::addToSuperview): Added.
        (QWidget::removeFromSuperview): Added.
        (QWidget::beforeMouseDown): Added.
        (QWidget::afterMouseDown): Added.

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
        (RenderLayer::setHasVerticalScrollbar): Ditto.

2004-11-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down

        * khtml/khtml_part.cpp:
        (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
        with no blink if it is.

2004-11-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control

        * khtml/khtml_part.cpp:
        (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
        or <input type=image> was checked for focus since these elements are keyboard-focusable,
        but not mouse focusable. Also, this function did not work hard enough to set the focused
        node, and was content to clear it if the first element checked failed the test, rather
        than looking more at parents. This would have the effect of clearing, then resetting the
        focus on a DIV containing a button or image with content on either side of it in the
        process of arrowing over such content.

2004-11-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
        Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
        * khtml/khtml_part.cpp:
        (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
        ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
        * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
        * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make 
        isCharacterSmartReplaceExempt virtual.

2004-11-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
        Seemed simple enough to land without review.

2004-11-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris
    
        Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
        are handled correctly now, including selections that span multiple blocks, and cases
        where content on the pasteboard ends in newlines (or what appear to be newlines to a
        user, really block ends or BRs). I also made one small, but important change in the 
        copy code to annotate the markup written to the pasteboard to support these selections 
        ending in newlines.

        New header that defines a couple of constants used in copying and pasting.

        * ForwardingHeaders/editing/html_interchange.h: Added.
        * khtml/editing/html_interchange.h: Added.
        
        Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
        as a new helper class, ReplacementFragment, which encapsulates information and functions
        pertaining to a document fragment that is being inserted into a document.
        
        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment):
        (khtml::ReplacementFragment::~ReplacementFragment):
        (khtml::ReplacementFragment::firstChild): Simple accessor.
        (khtml::ReplacementFragment::lastChild): Ditto.
        (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
        the starting node to use for merging into the block containing the start of the selection.
        (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
        (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
        (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
        special annotation comment added in by the copy code.
        (khtml::ReplacementFragment::removeNode): Simple helper.
        (khtml::isComment): Simple helper.
        (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
        I would like to do better than this some day, but this check will hold us until I can do better.
        (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
        (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
        (khtml::ReplaceSelectionCommand::doApply):
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
        * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
        (khtml::ReplacementFragment::root):
        (khtml::ReplacementFragment::type):
        (khtml::ReplacementFragment::isEmpty):
        (khtml::ReplacementFragment::isSingleTextNode):
        (khtml::ReplacementFragment::isTreeFragment):
        (khtml::ReplacementFragment::hasMoreThanOneBlock):
        (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
        
        This smaller set of changes markup generation to add the newline annotation described in the
        comment at the start of this entry.
        
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
        (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
        comment annotations are added to the markup generated.
        * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to 
        DOM::RangeImpl::toHTML uses annotations when generating.
        
        New tests.        

        * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-001.html: Added.
        * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-002.html: Added.
        * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-003.html: Added.
        * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-004.html: Added.
        * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-005.html: Added.
        * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-006.html: Added.
        * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-007.html: Added.
        * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-008.html: Added.
        * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-009.html: Added.

2004-11-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Made two small changes that make it possible for comments to have DOM nodes made for them
        when pasting. This relies on some earlier work I did some days ago.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::startMarkup): Get the string from the comment.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
        rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
        be included in the DOM.

2004-11-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
        my improved paste code.

        * khtml/editing/visible_position.cpp:
        (khtml::blockRelationship)
        (khtml::visiblePositionsInDifferentBlocks)
        (khtml::isFirstVisiblePositionInBlock)
        (khtml::isFirstVisiblePositionInNode)
        (khtml::isLastVisiblePositionInBlock)
        * khtml/editing/visible_position.h

2004-11-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        * khtml/xml/dom_position.cpp:
        (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
        specified from obeying that directive. The old code would stop at an outer block boundary in
        the case where that block had a block as its first child. The correct behavior is to drill into
        that inner block (and continue on drilling down, if possible), to find the correct position.

2004-11-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Small improvements to the node-display debugging helpers.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
        * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.

2004-11-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function 
        may need to be adjusted when deleting text off the front part of a text node. This fixes a problem 
        I discovered while improving the paste command, where the insertion poitn wound up in the wrong
        place after the delete. 

2004-11-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Add a new helper function to insert a paragraph separator. Will be used in my
        upcoming paste improvments.

        * khtml/editing/htmlediting.cpp: Added function
        (khtml::CompositeEditCommand::insertParagraphSeparator)
        * khtml/editing/htmlediting.h: Ditto.

2004-11-23  David Harrison  <harrison@apple.com>

        Added various comments.

        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::init):
        (khtml::ApplyStyleCommand::doApply):
        (khtml::ApplyStyleCommand::applyBlockStyle):
        (khtml::ApplyStyleCommand::applyInlineStyle):

2004-11-23  David Hyatt  <hyatt@apple.com>

	Hit testing in table cells with top/bottom space from vertical alignment didn't work.  I forgot about the
	super-secret yPos() lie that table cells do.  Use m_y instead of yPos().

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::nodeAtPoint):

2004-11-22  David Hyatt  <hyatt@apple.com>

	Make sure you can use document.createElement to make a <canvas> element.

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLElement):

2004-11-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	<rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
	<rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
	<rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
	<rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
        
	* khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
        (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::HTMLCollectionImpl):
        (HTMLCollectionImpl::~HTMLCollectionImpl):
        (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
        (HTMLCollectionImpl::CollectionInfo::reset):
        (HTMLCollectionImpl::resetCollectionInfo):
        (HTMLCollectionImpl::checkForNameMatch):
        (appendToVector):
        (HTMLCollectionImpl::updateNameCache):
        (HTMLCollectionImpl::namedItems):
        (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
        (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
        (HTMLFormCollectionImpl::item):
        (HTMLFormCollectionImpl::updateNameCache):
        * khtml/html/html_miscimpl.h:

2004-11-22  David Hyatt  <hyatt@apple.com>

	Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
	size.
	
        Reviewed by mjs

        * khtml/misc/loader.cpp:
        (CachedObject::finish):
        (Cache::flush):
        (Cache::setSize):
        * khtml/misc/loader.h:
        (khtml::Cache::maxCacheableObjectSize):

2004-11-22  David Hyatt  <hyatt@apple.com>

	Fix for 3673381, huge directory listing so slow it seems like a hang.  Rework painting and hit testing so that
	it crawls the line box tree instead of the render tree.  This allows more precise intersection/containment testing
	that lets us short circuit earlier when painting and hit testing.
	
        Reviewed by mjs

        * khtml/khtml_part.cpp:
        (KHTMLPart::isPointInsideSelection):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paint):
        (khtml::RenderBlock::paintChildren):
        (khtml::RenderBlock::paintObject):
        (khtml::RenderBlock::paintFloats):
        (khtml::RenderBlock::nodeAtPoint):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::nodeAtPoint):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::paint):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLines):
        (RenderFlow::hitTestLines):
        (RenderFlow::caretRect):
        (RenderFlow::addFocusRingRects):
        (RenderFlow::paintFocusRing):
        (RenderFlow::paintOutlines):
        (RenderFlow::paintOutlineForLine):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_frames.cpp:
        (RenderFrameSet::nodeAtPoint):
        * khtml/rendering/render_frames.h:
        * khtml/rendering/render_image.cpp:
        (RenderImage::nodeAtPoint):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::paint):
        (RenderInline::nodeAtPoint):
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::paintLayer):
        (RenderLayer::hitTest):
        (RenderLayer::hitTestLayer):
        * khtml/rendering/render_layer.h:
        * khtml/rendering/render_line.cpp:
        (khtml::InlineBox::paint):
        (khtml::InlineBox::nodeAtPoint):
        (khtml::InlineFlowBox::flowObject):
        (khtml::InlineFlowBox::nodeAtPoint):
        (khtml::InlineFlowBox::paint):
        (khtml::InlineFlowBox::paintBackgrounds):
        (khtml::InlineFlowBox::paintBackground):
        (khtml::InlineFlowBox::paintBackgroundAndBorder):
        (khtml::InlineFlowBox::paintDecorations):
        (khtml::EllipsisBox::paint):
        (khtml::EllipsisBox::nodeAtPoint):
        (khtml::RootInlineBox::paintEllipsisBox):
        (khtml::RootInlineBox::paint):
        (khtml::RootInlineBox::nodeAtPoint):
        * khtml/rendering/render_line.h:
        (khtml::InlineRunBox::paintBackgroundAndBorder):
        * khtml/rendering/render_object.cpp:
        (RenderObject::hitTest):
        (RenderObject::setInnerNode):
        (RenderObject::nodeAtPoint):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::PaintInfo::PaintInfo):
        (khtml::RenderObject::PaintInfo::~PaintInfo):
        (khtml::RenderObject::paintingRootForChildren):
        (khtml::RenderObject::shouldPaintWithinRoot):
        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):
        (RenderTable::paint):
        * khtml/rendering/render_text.cpp:
        (simpleDifferenceBetweenColors):
        (correctedTextColor):
        (InlineTextBox::nodeAtPoint):
        (InlineTextBox::paint):
        (InlineTextBox::selectionStartEnd):
        (InlineTextBox::paintSelection):
        (InlineTextBox::paintMarkedTextBackground):
        (InlineTextBox::paintDecoration):
        (RenderText::posOfChar):
        * khtml/rendering/render_text.h:
        (khtml::RenderText::paint):
        (khtml::RenderText::layout):
        (khtml::RenderText::nodeAtPoint):
        * khtml/xml/dom2_eventsimpl.cpp:
        (MouseEventImpl::computeLayerPos):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::prepareMouseEvent):
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityHitTest:]):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
        (KWQKHTMLPart::eventMayStartDrag):
        (KWQKHTMLPart::khtmlMouseMoveEvent):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]):
        (-[WebCoreBridge _positionForPoint:]):

2004-11-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	<rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
	<rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)

	This avoids the O(N^2) penalty for named item traversal for form collections.

	It also combines the item traversal logic for all non-form
	collection operations into a single traverseNextItem
	function. This avoids having 5 copies of the big switch statement
	for this.

	Also fixed a bug that prevented the last form element from being removed properly.
        
        * khtml/html/html_formimpl.cpp:
        (DOM::removeFromVector):
	* khtml/dom/html_misc.cpp:
        (HTMLCollection::namedItems):
        * khtml/dom/html_misc.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLCollection::getNamedItems):
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::traverseNextItem):
        (HTMLCollectionImpl::calcLength):
        (HTMLCollectionImpl::length):
        (HTMLCollectionImpl::item):
        (HTMLCollectionImpl::nextItem):
        (HTMLCollectionImpl::checkForNameMatch):
        (HTMLCollectionImpl::namedItem):
        (HTMLCollectionImpl::namedItems):
        (HTMLCollectionImpl::nextNamedItem):
        (HTMLFormCollectionImpl::calcLength):
        (HTMLFormCollectionImpl::namedItem):
        (HTMLFormCollectionImpl::nextNamedItem):
        (HTMLFormCollectionImpl::namedItems):
        * khtml/html/html_miscimpl.h:

2004-11-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Change around the way we block the Javascript "Paste" command identifier from
        being available. Formerly, this was done with an ifdef we never compiled in.
        Now, this is done with a couple of cheap runtime checks. The advantage is that
        we can now compile this command into development builds, and still yet switch
        on the command in deployment builds through the use of WebCore SPI so we can
        write and run layout tests with all of our builds.

        * khtml/editing/jsediting.cpp:
        (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
        command being queried is the paste command. 
        (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
        * khtml/editing/jsediting.h: Ditto.
        * khtml/khtml_part.cpp:
        (KHTMLPart::pasteFromPasteboard): Added.
        (KHTMLPart::canPaste): Added.
        * kwq/KWQKHTMLPart.mm:
        (KHTMLPart::canPaste): Added.
        * kwq/KWQRenderTreeDebug.cpp:
        (externalRepresentation): Turn on paste command.
        * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.

2004-11-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
        
	* khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::calcLength):
        (HTMLCollectionImpl::getItem):
        (HTMLCollectionImpl::item):
        (HTMLCollectionImpl::nextItem):
        (HTMLCollectionImpl::getNamedItem):
        (HTMLCollectionImpl::namedItem):
        (HTMLCollectionImpl::nextNamedItemInternal):
        (HTMLFormCollectionImpl::nextNamedItemInternal):

2004-11-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
	<rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
	<rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)

	Many optimizations to HTMLFormCollection. Iterating it should not
	be N^2 any more, though finding items by name could still be.
	
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
        (DOM::HTMLFormElementImpl::length):
        (DOM::HTMLFormElementImpl::submitClick):
        (DOM::HTMLFormElementImpl::formData):
        (DOM::HTMLFormElementImpl::submit):
        (DOM::HTMLFormElementImpl::reset):
        (DOM::HTMLFormElementImpl::radioClicked):
        (DOM::appendToVector):
        (DOM::removeFromVector):
        (DOM::HTMLFormElementImpl::registerFormElement):
        (DOM::HTMLFormElementImpl::removeFormElement):
        (DOM::HTMLFormElementImpl::makeFormElementDormant):
        (DOM::HTMLFormElementImpl::registerImgElement):
        (DOM::HTMLFormElementImpl::removeImgElement):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_miscimpl.cpp:
        (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
        (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
        (HTMLFormCollectionImpl::resetCollectionInfo):
        (HTMLFormCollectionImpl::calcLength):
        (HTMLFormCollectionImpl::item):
        (HTMLFormCollectionImpl::getNamedItem):
        (HTMLFormCollectionImpl::getNamedFormItem):
        (HTMLFormCollectionImpl::firstItem):
        (HTMLFormCollectionImpl::nextItem):
        * khtml/html/html_miscimpl.h:
        (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::setAttribute):
        (ElementImpl::setAttributeMap):
        * kwq/KWQPtrVector.h:
        (QPtrVector::findRef):
        * kwq/KWQVectorImpl.h:
        * kwq/KWQVectorImpl.mm:
        (KWQVectorImpl::findRef):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementWithName:inForm:]):
        (-[WebCoreBridge controlsInForm:]):

2004-11-19  David Harrison  <harrison@apple.com>

        Reviewed by Ken and Darin.

        <rdar://problem/3856215> Cannot remove bold from the beginning of a message

        Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
        for the existing style, but in this case (hitting cmd-B with caret at top of
        file) there is nothing upstream.  Changed this to use the VisiblePosition
        deepEquivalent instead.
        
        * khtml/khtml_part.cpp:
        (KHTMLPart::computeAndSetTypingStyle):

=== Safari-172 ===

2004-11-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
	
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::close): Don't fire the onload handler if there is a
	redirect pending. This is a very long-standing bug that was masked
	by our previously incorrect redirect logic. It used to be that an
	older redirect would always win. Recently we changed things so
	that a newer redirect would win, but a script that causes a
	redirect would stop parsing once complete (so if there are two
	redirects in the same script, the latter wins). However, we should
	have also prevented onload in this case. Testing with other
	browsers shows that onload handlers do not run at all when there
	is a pending redirect.

2004-11-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Fix some object lifetime issues in these two commands. This fixes some crashes
        I am seeing in some new code I am working on, but have not yet reproduced otherwise.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
        in the ancestor list. They are not ref'ed when put on list. D'uh.
        (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
        before putting them on the cloned nodes list. This are still deref'ed in the destructor.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
        destructor comment.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.

2004-11-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Fix for this bug:
        
        <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it

        * khtml/khtml_part.cpp:
        (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
        declaration given the current selection, and then sets the minimum necessary style as the typing
        style on the part.
        (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
        to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
        as well.
        * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
        * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
        * kwq/WebCoreBridge.mm: 
        (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
        (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.

2004-11-18  David Harrison  <harrison@apple.com>

        Reviewed by Darin.
        
        Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
        by Mail.app. Filed <rdar://problem/3886832> against Mail.app.

        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration setProperty:::]):

2004-11-18  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably

        Reviewed by john.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form

2004-11-18  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Chris.

	- fix recursive item traversal, use traverseNextNode() instead of
	the buggy hand-rolled traversal.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeListImpl::recursiveItem):

2004-11-17  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)

        * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
        Rolled in fix from KDE; make sure to set job to 0 before calling changeState.

        - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
        - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
        - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
        - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
          an entire category of leaks we have been fixing one by one recently
        - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
          stale RenderObject pointer, although I never saw it do that in practice
        - implemented the length and item methods for computed styles
        - implemented querying additional properties in computed styles (29 more)

        * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
        now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
        take a mutable style.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
        (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
        a computed style; also change some types to mutable style.
        (updateState): Update iteration of CSSProperty objects in a style declaration to use
        the new valuesIterator interface.
        (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
        (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
        (editingStyle): Change type to mutable style, and simplify the style-creation calls,
        including accomodating the exception code that setCssText has now.
        (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
        (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
        the style attributes really was a change, although it's not an important optimization it's
        good to do it right.

        * khtml/css/css_base.h: Remove unneeded setParsedValue method.
        * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
        calling it were already removing the old property explicitly, so the code in here to remove
        the property again was redundant.

        * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
        Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
        the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
        Before we had no guarantee the object would outlast us.
        (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
        exception to NO_MODIFICATION_ALLOWED_ERR.
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
        than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
        box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
        list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
        marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
        page-break-inside, position, unicode-bidi, widows, z-index.
        (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
        exception to NO_MODIFICATION_ALLOWED_ERR.
        (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
        (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
        (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
        CSSMutableStyleDeclarationImpl.
        (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
        (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.

        * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
        now a separate class rather than a typedef.
        * khtml/css/cssparser.h: Ditto.

        * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
        CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
        Removed a bunch of redundant stuff from other classes in this file too.
        (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
        (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
        (DOM::CSSProperty::operator=): Added.
        (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
        (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
        (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
        (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
        (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
        (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
        (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
        (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
        (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
        (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
        (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
        (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
        (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
        no styles in the list. Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
        parameter and set it.
        (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
        (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
        (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
        (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
        (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
        (DOM::CSSMutableStyleDeclarationImpl::copy): Added.

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): Changed to use addParsedProperties.
        (CSSParser::parseDeclaration): Ditto.
        (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.

        * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
        * khtml/css/cssproperties.c: Regenerated.
        * khtml/css/cssproperties.h: Regenerated.

        * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
        Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.

        * khtml/dom/css_value.cpp:
        (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
        (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
        first doing getPropertyCSSValue and then doing cssText.
        (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling. 
        (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
        (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
        (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
        (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).

        * khtml/dom/dom_node.h: Made isNull and handle functions inline.
        * khtml/dom/dom_node.cpp: Ditto.

        * khtml/editing/htmlediting.h: Change some types to mutable style.
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
        (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
        (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
        (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
        (khtml::EditCommand::setTypingStyle): Ditto.
        (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
        (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
        (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
        (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
        (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
        (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
        (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
        (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
        (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
        (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
        (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.

        * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
        * khtml/html/html_baseimpl.h: Change type to mutable style.
        * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.

        * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
        class as a base class, and change types to mutable style as needed.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
        (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
        (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
        (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
        (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
        (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
        to appendChild.
        (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
        to replaceChild.

        * khtml/html/html_tableimpl.h: Change types to mutable style.
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
        (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
        (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
        than using an explicit delete to make the node go away, and is required for compatibility with the
        changes to the NodeImpl functions.
        (KHTMLParser::insertNode): Ditto.
        (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
        the NodeImpl functions.

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
        now that there's no need to make the property list explictly.

        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
        (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
        (-[DOMCSSStyleDeclaration setProperty:::]): Dito.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
        function succeeded or not for ownership purposes.
        (NodeImpl::replaceChild): Ditto.
        (NodeImpl::appendChild): Ditto.
        (NodeBaseImpl::insertBefore): Ditto.
        (NodeBaseImpl::replaceChild): Ditto.
        (NodeBaseImpl::appendChild): Ditto.
        (NodeBaseImpl::addChild): Ditto.

        * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
        * WebCore-combined.exp: Regenerated.

2004-11-18  Maciej Stachowiak  <mjs@apple.com>

        still even more build fixing

        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::resetCollectionInfo):

2004-11-18  Maciej Stachowiak  <mjs@apple.com>

        more build fixing

        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::resetCollectionInfo):

2004-11-18  Maciej Stachowiak  <mjs@apple.com>

        Fixed build problem.

        * khtml/html/html_miscimpl.h:
        (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.

2004-11-18  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	- merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror

	<rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
	<rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)

	This is also a start on fixing 5 other bugs, but those need additional work to make
	HTMLFormCollection fast.

        * khtml/html/html_documentimpl.h:
        (DOM::HTMLDocumentImpl::collectionInfo):
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
        (DOM::HTMLFormElementImpl::isURLAttribute):
        (DOM::HTMLFormElementImpl::registerImgElement):
        (DOM::HTMLFormElementImpl::removeImgElement):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::HTMLImageElementImpl):
        (HTMLImageElementImpl::~HTMLImageElementImpl):
        * khtml/html/html_imageimpl.h:
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::HTMLCollectionImpl):
        (HTMLCollectionImpl::~HTMLCollectionImpl):
        (HTMLCollectionImpl::updateCollectionInfo):
        (HTMLCollectionImpl::length):
        (HTMLCollectionImpl::item):
        (HTMLCollectionImpl::firstItem):
        (HTMLCollectionImpl::nextItem):
        (HTMLCollectionImpl::namedItem):
        (HTMLCollectionImpl::nextNamedItemInternal):
        (HTMLFormCollectionImpl::getNamedFormItem):
        * khtml/html/html_miscimpl.h:
        (DOM::HTMLCollectionImpl::):
        (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::getElement):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::incDOMTreeVersion):
        (DOM::DocumentImpl::domTreeVersion):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::attach):
        (NodeImpl::detach):

2004-11-18  Kevin Decker  <kdecker@apple.com>

        Reviewed by Chris.

	fixed: <rdar://problem/3841842> getPropertyID expensive

        * kwq/DOM-CSS.mm:
        (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.

2004-11-17  David Hyatt  <hyatt@apple.com>

	Improve responsiveness by being willing to break out of the tokenizer.  (This patch was landed already
	and subsequently backed out).
	
        Reviewed by kocienda

        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::insertedIntoDocument):
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::reset):
        (khtml::HTMLTokenizer::scriptHandler):
        (khtml::HTMLTokenizer::scriptExecution):
        (khtml::HTMLTokenizer::write):
        (khtml::HTMLTokenizer::continueProcessing):
        (khtml::HTMLTokenizer::timerEvent):
        (khtml::HTMLTokenizer::notifyFinished):
        * khtml/html/htmltokenizer.h:
        * khtml/khtmlview.cpp:
        (KHTMLViewPrivate::KHTMLViewPrivate):
        (KHTMLViewPrivate::reset):
        (KHTMLView::clear):
        (KHTMLView::layout):
        (KHTMLView::timerEvent):
        (KHTMLView::scheduleRelayout):
        (KHTMLView::layoutPending):
        (KHTMLView::haveDelayedLayoutScheduled):
        (KHTMLView::unscheduleRelayout):
        * khtml/khtmlview.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::close):
        (DocumentImpl::setParsing):
        (DocumentImpl::shouldScheduleLayout):
        (DocumentImpl::minimumLayoutDelay):
        (DocumentImpl::write):
        (DocumentImpl::finishParsing):
        (DocumentImpl::stylesheetLoaded):
        (DocumentImpl::updateStyleSelector):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::parsing):
        * kwq/KWQDateTime.mm:
        (KWQUIEventTime::uiEventPending):

2004-11-17  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.
        
        Make sure previousLineStart is non-null before calling compareBoundaryPoints.
        Treat null case as meaning no post-move merge is needed.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData):

2004-11-17  David Harrison  <harrison@apple.com>
        
        Added displayNode and displayTree methods for debugging.  Fixed comment typo in dispatchChildRemovalEvents.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::displayNode):
        (NodeImpl::displayTree):
        (NodeBaseImpl::dispatchChildRemovalEvents):
        * khtml/xml/dom_nodeimpl.h:

2004-11-16  John Sullivan  <sullivan@apple.com>

        Reviewed by Richard.
        
        - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)

        * khtml/khtml_part.cpp:
        (editingStyle):
        delete the list we created when we're done with it

2004-11-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
        Instead, I replaced this with a helper function that derefs DOM nodes stored in a 
        QPtrList when the list goes out of scope.

        * khtml/editing/htmlediting.cpp:
        (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
        (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
        (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):  
        No longer set lists to autodelete.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
         Call new derefNodesInList helper.
        * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
        of one before, but now it does.

2004-11-15  David Harrison  <harrison@apple.com>

        Reviewed by Chris and Darin.
        
        <rdar://problem/3880304> Non-linear performance hit for style changes

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::traverseNextNode):
        (NodeImpl::traverseNextSibling):
        (NodeImpl::traversePreviousNodePostOrder):
        Return 0 rather than traversing beyond stayWithin when this == stayWithin.
        Add asserts that stayWithin is an ancestor of the returned node.

2004-11-15  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
        since there's no guarantee it's already ref'd.
        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
        (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
        (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
        (CSSStyleDeclarationImpl::merge): Ditto.
        (CSSStyleDeclarationImpl::diff): Ditto.
        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::currentlyHasStyle): Ditto.
        (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
        * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
        * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.

2004-11-15  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        Use separate mutable style and computed style types as appropriate.
        For now this should have no effect, but it prepares us for refactoring later.
        Also remove some unnecessary "DOM::" prefixes and in one case factor out
        some shared code.

        * khtml/khtml_part.cpp:
        (KHTMLPart::typingStyle):
        (KHTMLPart::setTypingStyle):
        (updateState):
        (KHTMLPart::selectionHasStyle):
        (KHTMLPart::selectionStartHasStyle):
        (KHTMLPart::selectionComputedStyle):
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:

        * khtml/css/css_base.h:
        * khtml/css/css_ruleimpl.cpp:
        (CSSStyleRuleImpl::setDeclaration):
        * khtml/css/css_ruleimpl.h:
        (DOM::CSSFontFaceRuleImpl::style):
        (DOM::CSSPageRuleImpl::style):
        (DOM::CSSStyleRuleImpl::style):
        (DOM::CSSStyleRuleImpl::declaration):
        * khtml/css/css_valueimpl.h:
        (DOM::CSSPrimitiveValueImpl::):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::parseColor):
        (CSSParser::parseDeclaration):
        (CSSParser::createStyleDeclaration):
        * khtml/css/cssparser.h:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::addMatchedDeclaration):
        (khtml::CSSStyleSelector::matchRulesForList):
        (khtml::CSSStyleSelector::styleForElement):
        (khtml::CSSStyleSelector::applyDeclarations):
        * khtml/css/cssstyleselector.h:
        * khtml/css/parser.cpp:
        * khtml/css/parser.y:
        * khtml/dom/css_rule.h:
        * khtml/dom/css_stylesheet.h:
        * khtml/dom/css_value.h:
        * khtml/dom/dom2_views.cpp:
        * khtml/xml/dom2_viewsimpl.cpp:
        (DOM::AbstractViewImpl::getComputedStyle):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::importNode):
        (DocumentImpl::setStyleSheet):
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_xmlimpl.cpp:
        (DOM::ProcessingInstructionImpl::setStyleSheet):
        * khtml/xml/dom_xmlimpl.h:

        * khtml/dom/css_value.cpp:
        (DOM::throwException): Added.
        (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
        The real thing is coming with the next change to refactor.
        (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
        (DOM::CSSPrimitiveValue::setStringValue): Ditto.

2004-11-15  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)

        * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
        dispatchSubtreeModifiedEvent, so it can be called in cases where only the
        node's attributes changed without sending a misleading childrenChanged call,
        but the childrenChanged call can happen at the exact right moment.
        * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
        (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
        the boolean true is passed in.

        * khtml/xml/dom_elementimpl.cpp:
        (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
        (NamedAttrMapImpl::removeAttribute): Ditto.

2004-11-15  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet, 
        seen often in Mail and Blot

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::copyPropertiesInSet):
        delete temporary list after we're done using it

2004-11-15  Richard Williamson   <rjw@apple.com>

	Fixed leak (3879883) that John found.  Early return leaked
	allocated instance.

        Reviewed by John.

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):

2004-11-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail

        Fixed a couple of object lifetime issues. The EditCommand class used to hold an
        EditCommandPtr to its parent, but this caused a a reference cycle in composite 
        commands as the children held a ref to their parent. Now, the parent variable
        is a non-retained reference to an EditCommand *. It would be nice to have a 
        weak reference to the parent or even override deref in composite commands (but I
        can't since deref() is not virtual). However, this should be OK since any
        dangling parent pointer is a sign of a bigger object lifetime problem that
        would need to be addressed anyway.

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a 
        QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
        just assigning the list variable passed in to the local list variable, or the list will be 
        double-deleted.
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
        (khtml::EditCommand::setEndingSelection): Ditto.
        (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
        Unrelated to the change, but saves some ref's and deref's.
        (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
        * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
        EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
        (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.

2004-11-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
	
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
	isLengthCacheValid.
        (NodeListImpl::recursiveLength): Adjusted for rename.
        (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
	If the same offset is looked up again, just return it, otherwise, if looking up
	a later offset, start at the last item and proceed from there.
        (NodeListImpl::itemById): Apply the special document optimization to all
	nodes that are either a document or in a document - just walk up to make
	sure the node found by ID has the root node as an ancestor.
        (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
        * khtml/xml/dom_nodeimpl.h: Prototype new stuff.

2004-11-15  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::documentFragmentWithText):
        release mutable copy of string after we're done using it

2004-11-14  Kevin Decker  <kdecker@apple.com>

        Reviewed by mjs.

	fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
        (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.

2004-11-13  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists

        * khtml/dom/dom_node.cpp:
        (NodeList::itemById): New method, just forward to impl.
        * khtml/dom/dom_node.h: Prototype it.
        * khtml/ecma/kjs_dom.cpp:
        (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
	let the NodeList do it. The NodeList might be able to do it more efficiently.
        * khtml/xml/dom_nodeimpl.cpp:
	(NodeListImpl::itemById): Optimize for the case where the NodeList
	covers the whole document. In this case, just use getElementById,
	then check that the element satisfies the list criteria.
        (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
        (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
        * khtml/xml/dom_nodeimpl.h:

2004-11-12  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Gramps.

	- fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
	sometimes using a huge bogus length value.
	
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeListImpl::NodeListImpl): Initialize isCacheValid.

2004-11-12  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed an infinite loop in that last check-in

        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
        Added a ++i to the loop so it won't get stuck on the first element in the list.

2004-11-12  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	- fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
        
	I fixed this by changing NodeLists to cache their length, but
	invalidate it whenever there is a change in the DOM subtree at
	which they are rooted. This makes NodeListImpl::recursiveLength()
	drop completely off the profile, since we were repeatedly getting
	a length for the same NodeList over and over.
	
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::NodeImpl):
        (NodeImpl::~NodeImpl):
        (NodeImpl::registerNodeList):
        (NodeImpl::unregisterNodeList):
        (NodeImpl::notifyLocalNodeListsSubtreeModified):
        (NodeImpl::notifyNodeListsSubtreeModified):
        (NodeImpl::dispatchSubtreeModifiedEvent):
        (NodeListImpl::NodeListImpl):
        (NodeListImpl::~NodeListImpl):
        (NodeListImpl::recursiveLength):
        (NodeListImpl::recursiveItem):
        (NodeListImpl::rootNodeSubtreeModified):
        (ChildNodeListImpl::ChildNodeListImpl):
        (ChildNodeListImpl::length):
        (ChildNodeListImpl::item):
        (TagNodeListImpl::TagNodeListImpl):
        (TagNodeListImpl::length):
        (TagNodeListImpl::item):
        (NameNodeListImpl::NameNodeListImpl):
        (NameNodeListImpl::length):
        (NameNodeListImpl::item):
        * khtml/xml/dom_nodeimpl.h:

2004-11-12  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - various small cleanups

        * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
        * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.

        * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
        * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
        * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
        (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.

        * khtml/khtml_part.h: Removed docImpl function.
        * khtml/khtml_part.cpp: Ditto.

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
        the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.

        * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
        * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
        part of the change last time, which is why the build broke).
        (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
        (KWQKHTMLPart::setPolicyBaseURL): Ditto.
        (KWQKHTMLPart::keyEvent): Ditto.
        (KWQKHTMLPart::dispatchCPPEvent): Ditto.
        (KWQKHTMLPart::bodyBackgroundColor): Ditto.

2004-11-12  Chris Blumenberg  <cblu@apple.com>

	<rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was

        Reviewed by rjw.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused

=== Safari-171 ===

2004-11-12  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed a couple places that would not work for XML documents

        * khtml/ecma/kjs_window.cpp:
        (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
        is present on the base class.
        (WindowFunc::tryCall): More of the same.

2004-11-12  Darin Adler  <darin@apple.com>

        - land versions of these files generated by the newer gperf

        People building on Panther will continue to see these files modified.
        A workaround would be to install the newer gperf on our Tiger build machines.

        * khtml/css/cssproperties.c: Regenerated.
        * khtml/css/cssvalues.c: Regenerated.
        * khtml/html/doctypes.cpp: Regenerated.
        * khtml/html/kentities.c: Regenerated.
        * khtml/misc/htmlattrs.c: Regenerated.
        * khtml/misc/htmltags.c: Regenerated.
        * kwq/KWQColorData.c: Regenerated.

2004-11-11  Richard Williamson   <rjw@apple.com>
	
        Fix build horkage from previous checkin.
		
        * kwq/KWQKHTMLPart.h:

2004-11-11  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields

        * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.

        * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
        method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
        we started with the NSTextField as first responder, and then took focus away and gave it back, which
        makes dragging text work again.
        (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.

2004-11-11  David Hyatt  <hyatt@apple.com>

	Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
	
        Reviewed by vicki

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::continueProcessing):

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
        of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
        with the prevailing style for the VisiblePosition class.
        * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files. 
        * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
        (khtml::visiblePositionsInDifferentBlocks): New helper method.
        (khtml::isLastVisiblePositionInBlock): Ditto.
        (khtml::isLastVisiblePositionInNode): Ditto.
        * khtml/editing/visible_position.h: Add declarations for new functions.

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
        (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
        (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
        (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
        (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
        * khtml/xml/dom2_rangeimpl.h: Ditto.

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Some improvements to deleting when complete lines are selected.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
        the end of a selection is fully selected. Turn off block merging in this case.
        (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
        whether a BR immediately followed a block. The old code could erroneously skip nodes.
        (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
        start block is selected. This new code will now delete this block in one call, rather
        than iterating over each child.
        * khtml/editing/visible_position.cpp:
        (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
        to do the work mentioned above in the comment for that function.
        (khtml::isFirstVisiblePositionOnLine): Ditto.
        (khtml::isLastVisiblePositionOnLine): Ditto.
        * khtml/editing/visible_position.h: Add new functions.
        * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-001.html: Added.
        * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-002.html: Added.
        * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-003.html: Added.
        * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-004.html: Added.
        * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-005.html: Added.
        * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-006.html: Added.
        * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-007.html: Added.
        * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-008.html: Added.
        * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-009.html: Added.
        * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-010.html: Added.
        * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-011.html: Added.
        * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-012.html: Added.

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Adele

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for these bugs:

        <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
        <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)

        * khtml/editing/selection.cpp:
        (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
        the next line position when necessary.
        * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
        * layout-tests/editing/selection/move-3875618-fix.html: Added.
        * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
        * layout-tests/editing/selection/move-3875641-fix.html: Added.

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Improved some function names, at John's urging. No changes to the
        functions themselves.
        
        canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
        canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
        performGeneralDelete() --> handleGeneralDelete()

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
        (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
        (khtml::DeleteSelectionCommand::handleGeneralDelete)
        (khtml::DeleteSelectionCommand::doApply)
        * khtml/editing/htmlediting.h

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Updated some layout test results that changed as a result of my last checking.
        Added a new test that has been in my tree for a few days.

        * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
        * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
        * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3851164-fix.html: Added.

2004-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/editing/htmlediting.cpp:
        (khtml::debugNode): New debugging helper.
        (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
        startPositionForDelete() and endPositionForDelete() functions. Just use the 
        m_selectionToDelete object to determine start and end positions for the delete.
        (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
        function that creates a special case for deleting all the content in a root
        editable element.
        (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
        function before BR special case and the general case delete functions.
        * khtml/editing/htmlediting.h: Updated for changed functions.

2004-11-10  Kevin Decker  <kdecker@apple.com>

        Reviewed by mjs.
	
        Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.  

        * khtml/ecma/kjs_dom.cpp:
        (DOMNodeList::tryGet): Got rid of an unnecessary node traversal. 

2004-11-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
        smart delete from the two functions below to here. There was an unnecessary double 
        calculation of the leading and trailing whitespace positions. Also refined the trailing
        case so it only acts when the leading position is null (which seems to match TextEdit in
        my tests). Also removed some unnecessary copying of Position objects.
        (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
        from here.
        (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.

2004-11-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
        make things more clear.
        * khtml/editing/selection.cpp:
        (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the 
        resulting positions do not cross block boundaries. This was a bug and caused some
        delete problems when whole blocks were selected. I will be addressing that issue
        more fully in upcoming changes.

2004-11-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Some cleanups and fixes in upstream and downstream functions. 
        
        Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement(). 
        Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the 
        block's enclosing block will be returned. 
        
        Remove code from upstream that confined the serach to block boundaries outside of
        the code which runs in the StayInBlock case. This code was redundant, and caused
        incorrect results to be returned in the DoNotStayInBlock case.
        
        In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
        node, not the the this pointer's node.

        * khtml/xml/dom_position.cpp:
        (DOM::Position::upstream)
        (DOM::Position::downstream)

2004-11-09  David Hyatt  <hyatt@apple.com>

	Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
        loading large local files.
	
        Reviewed by mjs

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::HTMLTokenizer):
        (khtml::HTMLTokenizer::reset):
        (khtml::HTMLTokenizer::write):
        (khtml::HTMLTokenizer::stopped):
        (khtml::HTMLTokenizer::processingData):
        (khtml::HTMLTokenizer::continueProcessing):
        (khtml::HTMLTokenizer::timerEvent):
        (khtml::HTMLTokenizer::allDataProcessed):
        (khtml::HTMLTokenizer::end):
        (khtml::HTMLTokenizer::finish):
        (khtml::HTMLTokenizer::notifyFinished):
        * khtml/html/htmltokenizer.h:
        * khtml/khtml_part.cpp:
        (KHTMLPart::slotFinished):
        (KHTMLPart::end):
        (KHTMLPart::stop):
        * khtml/khtml_part.h:
        (KHTMLPart::tokenizerProcessedData):
        * khtml/khtmlview.cpp:
        * khtml/xml/dom_docimpl.cpp:
        * khtml/xml/xml_tokenizer.h:
        (khtml::Tokenizer::stopped):
        (khtml::Tokenizer::processingData):
        * kwq/KWQDateTime.h:
        * kwq/KWQDateTime.mm:
        (QDateTime::secsTo):
        (KWQUIEventTime::uiEventPending):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::tokenizerProcessedData):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge stop]):
        (-[WebCoreBridge numPendingOrLoadingRequests]):
        (-[WebCoreBridge doneProcessingData]):

2004-11-09  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

		<rdar://problem/3865837> Wrong text style after delete to start of document
		
        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::saveTypingStyleState):
        Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.

2004-11-09  Richard Williamson   <rjw@apple.com>

        Fixed <rdar://problem/3872440> NSTimer prematurely released.

        Reviewed by Darin.

        * kwq/KWQTimer.mm:
        (QTimer::fire):
        * kwq/KWQWidget.mm:
        (QWidget::paint):

2004-11-09  Chris Blumenberg  <cblu@apple.com>

        Reviewed by vicki.

        * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped

2004-11-08  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

		<rdar://problem/3865854> Deleting first line deletes all lines
		
        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::performGeneralDelete):
        Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
        of its ancestors, failed to end the loop that deletes all fully selected nodes.  Also,
        fixed this code to clear m_trailingWhitespaceValid.  Also removed dead m_endingPosition
        update because it is handled in calculateEndingPosition now.
        * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3865854-fix.html: Added.

2004-11-08  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
        are added to the DOM.
        * khtml/html/html_elementimpl.h: Ditto.
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::KHTMLParser): Ditto.
        (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
        * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
        (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
        There were a couple of indexing errors that resulted in the comment text containing part of the 
        comment markers.
        (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
        * khtml/html/htmltokenizer.h:  Add flag to constructor so callers can request comment nodes.

2004-11-08  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security

        Reviewed by darin.

        * WebCore.pbproj/project.pbxproj: stop unnecessary linking
        * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
        * kwq/KWQKHTMLPart.h: ditto

2004-11-08  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled

        * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
        that possibly deletes the QTimer.

2004-11-08  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus

        Reviewed by john.

        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
        * kwq/WebCoreBridge.h:

2004-11-08  David Harrison  <harrison@apple.com>

        Reviewed by Darin.
        
        Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::moveNodesAfterNode):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::enclosingInlineElement):
        * khtml/xml/dom_nodeimpl.h:

2004-11-05  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters

        Reviewed by rjw.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::character): new, returns the character for the position
        * khtml/editing/visible_position.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
        * kwq/WebCoreBridge.h:

=== Safari-170 ===

2004-11-05  Adele Amchan  <adele@apple.com>

        Reviewed by Darin

	Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
	and a workaround for displaying transparent backgrounds for textareas.

        * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
        * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
        * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class, 
          on the contentView, and on the textView.

2004-11-04  David Hyatt  <hyatt@apple.com>

	Fix for relpositioned inlines.  This was reviewed a long time ago, but I can't recall who reviewed it (either
	darin or ken).
	
        Reviewed by darin or ken

        * khtml/rendering/bidi.cpp:
        (khtml::appendRunsForObject):
        (khtml::RenderBlock::skipWhitespace):
        (khtml::RenderBlock::findNextLineBreak):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::lowestPosition):
        (khtml::RenderBlock::rightmostPosition):
        (khtml::RenderBlock::leftmostPosition):
        * khtml/rendering/render_box.cpp:
        (RenderBox::position):
        * khtml/rendering/render_box.h:
        (khtml::RenderBox::staticX):
        (khtml::RenderBox::staticY):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateLayerPosition):
        (RenderLayer::convertToLayerCoords):
        * khtml/rendering/render_line.cpp:
        (khtml::InlineFlowBox::placeBoxesHorizontally):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::staticX):
        (khtml::RenderObject::staticY):

	Finish turning on XSLT.  Make sure child stylesheets can load.
	
        * khtml/xsl/xslt_processorimpl.cpp:
        (DOM::stylesheetLoadFunc):
        (DOM::XSLTProcessorImpl::transformDocument):

2004-11-04  David Hyatt  <hyatt@apple.com>

	Implement CSS3 support for multiple backgrounds.  Also fix a bug with background propagation so that it only
	happens (from the <body> to the root) for HTML documents.  Fixed background-position to handle a mixture of
	keyword and length values.

        Reviewed by darin

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::addBackgroundValue):
        (CSSParser::parseBackgroundShorthand):
        (CSSParser::parseBackgroundColor):
        (CSSParser::parseBackgroundImage):
        (CSSParser::parseBackgroundPositionXY):
        (CSSParser::parseBackgroundPosition):
        (CSSParser::parseBackgroundProperty):
        (CSSParser::parseColorFromValue):
        * khtml/css/cssparser.h:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::adjustRenderStyle):
        (khtml::CSSStyleSelector::applyProperty):
        (khtml::CSSStyleSelector::mapBackgroundAttachment):
        (khtml::CSSStyleSelector::mapBackgroundImage):
        (khtml::CSSStyleSelector::mapBackgroundRepeat):
        (khtml::CSSStyleSelector::mapBackgroundXPosition):
        (khtml::CSSStyleSelector::mapBackgroundYPosition):
        * khtml/css/cssstyleselector.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::paintRootBoxDecorations):
        (RenderBox::paintBoxDecorations):
        (RenderBox::paintBackgrounds):
        (RenderBox::paintBackground):
        (RenderBox::paintBackgroundExtended):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_form.cpp:
        (RenderFieldset::paintBoxDecorations):
        * khtml/rendering/render_line.cpp:
        (khtml::InlineFlowBox::paintBackgrounds):
        (khtml::InlineFlowBox::paintBackground):
        (khtml::InlineFlowBox::paintBackgroundAndBorder):
        * khtml/rendering/render_line.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):
        (RenderObject::updateBackgroundImages):
        (RenderObject::getVerticalPosition):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::paintBackgroundExtended):
        * khtml/rendering/render_style.cpp:
        (m_next):
        (BackgroundLayer::BackgroundLayer):
        (BackgroundLayer::~BackgroundLayer):
        (BackgroundLayer::operator=):
        (BackgroundLayer::operator==):
        (BackgroundLayer::fillUnsetProperties):
        (BackgroundLayer::cullEmptyLayers):
        (StyleBackgroundData::StyleBackgroundData):
        (StyleBackgroundData::operator==):
        (RenderStyle::diff):
        (RenderStyle::adjustBackgroundLayers):
        * khtml/rendering/render_style.h:
        (khtml::OutlineValue::operator==):
        (khtml::OutlineValue::operator!=):
        (khtml::BackgroundLayer::backgroundImage):
        (khtml::BackgroundLayer::backgroundXPosition):
        (khtml::BackgroundLayer::backgroundYPosition):
        (khtml::BackgroundLayer::backgroundAttachment):
        (khtml::BackgroundLayer::backgroundRepeat):
        (khtml::BackgroundLayer::next):
        (khtml::BackgroundLayer::isBackgroundImageSet):
        (khtml::BackgroundLayer::isBackgroundXPositionSet):
        (khtml::BackgroundLayer::isBackgroundYPositionSet):
        (khtml::BackgroundLayer::isBackgroundAttachmentSet):
        (khtml::BackgroundLayer::isBackgroundRepeatSet):
        (khtml::BackgroundLayer::setBackgroundImage):
        (khtml::BackgroundLayer::setBackgroundXPosition):
        (khtml::BackgroundLayer::setBackgroundYPosition):
        (khtml::BackgroundLayer::setBackgroundAttachment):
        (khtml::BackgroundLayer::setBackgroundRepeat):
        (khtml::BackgroundLayer::clearBackgroundImage):
        (khtml::BackgroundLayer::clearBackgroundXPosition):
        (khtml::BackgroundLayer::clearBackgroundYPosition):
        (khtml::BackgroundLayer::clearBackgroundAttachment):
        (khtml::BackgroundLayer::clearBackgroundRepeat):
        (khtml::BackgroundLayer::setNext):
        (khtml::BackgroundLayer::operator!=):
        (khtml::BackgroundLayer::containsImage):
        (khtml::BackgroundLayer::hasImage):
        (khtml::BackgroundLayer::hasFixedImage):
        (khtml::RenderStyle::setBitDefaults):
        (khtml::RenderStyle::hasBackground):
        (khtml::RenderStyle::hasFixedBackgroundImage):
        (khtml::RenderStyle::outlineWidth):
        (khtml::RenderStyle::outlineStyle):
        (khtml::RenderStyle::outlineStyleIsAuto):
        (khtml::RenderStyle::outlineColor):
        (khtml::RenderStyle::backgroundColor):
        (khtml::RenderStyle::backgroundImage):
        (khtml::RenderStyle::backgroundRepeat):
        (khtml::RenderStyle::backgroundAttachment):
        (khtml::RenderStyle::backgroundXPosition):
        (khtml::RenderStyle::backgroundYPosition):
        (khtml::RenderStyle::accessBackgroundLayers):
        (khtml::RenderStyle::backgroundLayers):
        (khtml::RenderStyle::outlineOffset):
        (khtml::RenderStyle::resetOutline):
        (khtml::RenderStyle::setBackgroundColor):
        (khtml::RenderStyle::setOutlineWidth):
        (khtml::RenderStyle::setOutlineStyle):
        (khtml::RenderStyle::setOutlineColor):
        (khtml::RenderStyle::clearBackgroundLayers):
        (khtml::RenderStyle::inheritBackgroundLayers):
        (khtml::RenderStyle::setOutlineOffset):
        * khtml/rendering/render_table.cpp:
        (RenderTable::paintBoxDecorations):
        (RenderTableCell::paintBoxDecorations):

2004-11-04  David Hyatt  <hyatt@apple.com>

	Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
	Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).

        Reviewed by darin

        * kwq/KWQTextCodec.mm:
        (KWQTextDecoder::convertLatin1):
        (KWQTextDecoder::convertUTF16):
        (KWQTextDecoder::convertUsingTEC):
        (KWQTextDecoder::toUnicode):

2004-11-04  David Hyatt  <hyatt@apple.com>

	Make sure line-height returns the correct value for normal.
	
        Reviewed by darin

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):

2004-11-04  David Harrison  <harrison@apple.com>

        Reviewed by Ken Kocienda.

		<rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
		
        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
        to, but not including, the enclosingBlockFlowElement) rather than just the source element.
        Fixed to insert after the destination subtree, rather than the destination element.  Handles
        edge case of deleting back to the top of the tree, where there is nothing left to insert after.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
        * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
        * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3857753-fix.html: Added.

2004-11-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me
        
        More layout tests.

        * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-008.html: Added.
        * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-009.html: Added.
        * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-010.html: Added.

2004-11-03  Maciej Stachowiak  <mjs@apple.com>

        Fix by Yasuo Kida, reviewed by me.

	<rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
        
	* kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
	same as a nil range - setting an empty marked range should clear
	the marked range entirely.

2004-11-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave Hyatt (when I originally coded it).

	WebCore part of fix for:

	<rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
	
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
	DOMRange, or if the range is split into multiple lines, the rect for the part on
	the first line only.
	
        * khtml/rendering/render_object.cpp:
        (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
	for the overrides below.
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::caretRect):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::caretRect):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::caretRect):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect):

2004-11-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Implemented command to insert a block in response to typing a return key (even though
        I am not turning that on by default with this patch....that will come later). 
        
        This new command is called InsertParagraphSeparatorCommand.
        
        Reworked the command and function names associated with inserting content into a 
        document. Before this patch, there were inputXXX and insertXXX variants, with the
        former used for more high-level actions and the latter used for lower-level stuff.
        However, this was confusing as the AppKit uses insertXXX for everything. This resulted
        in an insertXXX command going through an inputXXX WebCore step and then finally to an
        insertXXX WebCore step. To make this less confusing, I have changes all the names to
        be insertXXX, and modified the lower-level operations so that it is clear what they do.
        
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommandPtr::isInsertTextCommand): Name change.
        (khtml::EditCommand::isInsertTextCommand): Ditto.
        (khtml::CompositeEditCommand::inputText): Ditto.
        (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
        (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
        (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
        (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
        (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
        (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
        (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
        (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
        (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
        (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
        (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
        (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
        (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
        (khtml::InsertIntoTextNode::doApply): Ditto.
        (khtml::InsertIntoTextNode::doUnapply): Ditto.
        (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
        (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
        (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
        (khtml::InsertLineBreakCommand::doApply):
        (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
        (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
        (khtml::InsertNodeBeforeCommand::doApply): Ditto.
        (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
        (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
        (khtml::InsertParagraphSeparatorCommand::doApply):
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
        Class name change, was InsertNewlineCommandInQuotedContentCommand.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
        (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
        (khtml::InsertTextCommand::doApply): Ditto.
        (khtml::InsertTextCommand::deleteCharacter): Ditto.
        (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
        (khtml::InsertTextCommand::input): Ditto.
        (khtml::InsertTextCommand::insertSpace): Ditto.
        (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
        (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
        (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
        (khtml::TypingCommand::insertParagraphSeparator): New function.
        (khtml::TypingCommand::doApply): Name changes, as above.
        (khtml::TypingCommand::insertText): Ditto.
        (khtml::TypingCommand::deleteKeyPressed): Ditto.
        (khtml::TypingCommand::preservesTypingStyle): Ditto.
        * khtml/editing/htmlediting.h:
        (khtml::DeleteFromTextNodeCommand::node): Name change.
        (khtml::DeleteFromTextNodeCommand::offset): Ditto.
        (khtml::DeleteFromTextNodeCommand::count): Ditto.
        (khtml::InsertIntoTextNode::text): Ditto.
        (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
        (khtml::InsertNodeBeforeCommand::refChild): Ditto.
        (khtml::TypingCommand::): Ditto.
        * khtml/editing/jsediting.cpp: Name changes, as above.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
        (-[WebCoreBridge insertParagraphSeparator]): New function.
        (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.

2004-11-01  Kevin Decker  <kdecker@apple.com>

        Reviewed by rjw.

	fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
	once and for all. 

        * khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().

2004-11-01  Darin Adler  <darin@apple.com>

        Reviewed by Hyatt.

        - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color

        * khtml/css/html4.css: Use color: initial for textarea and related ones.

2004-11-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the 
        implementation here into new copyPropertiesInSet helper. This now calls the
        generalized copyPropertiesInSet function with the arguments needed to make copying
        inheritable work.
        * khtml/css/css_computedstyle.h:
        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
        In order to do apply block properties, "regular" style declarations need to do style
        diffs as well.
        (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
        except that it uses a different set of properties that apply only to blocks.
        (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
        and copies out those properties listed in a pre-defined set.
        * khtml/css/css_valueimpl.h:
        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
        block, factoring out some of the special case code that should now only run in the inline case.
        (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
        (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
        special handling for "legacy" HTML styles like <B> and <I>.
        (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
        style changes into different kinds. CSS specifies certain properties only apply to certain
        element types. This set of changes now recognizes two such separate cases: styles that apply
        to blocks, and styles that apply to inlines.
        (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
        (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
        (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
        with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
        done so that the function can be passed a portion of the styles being applied so that block styles
        and inline styles can be handled separately.
        (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
        (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
        (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
        * khtml/editing/htmlediting.h:
        (khtml::StyleChange::): Changed as described above.
        (khtml::StyleChange::usesLegacyStyles):
        (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
        it needs to layout, even though it has not changed position in the DOM. For instance, this is needed 
        when text align changes.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
        the passed-in argument.
        (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
        is a caret. Formerly, this just set typing style and made no visible changes to the document.

        New tests.

        * layout-tests/editing/editing.js: Added some glue to change text align.
        * layout-tests/editing/style/block-style-001-expected.txt: Added.
        * layout-tests/editing/style/block-style-001.html: Added.
        * layout-tests/editing/style/block-style-002-expected.txt: Added.
        * layout-tests/editing/style/block-style-002.html: Added.
        * layout-tests/editing/style/block-style-003-expected.txt: Added.
        * layout-tests/editing/style/block-style-003.html: Added.

=== Safari-169 ===

2004-10-29  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)

        * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
        before advancing one character; before it did it backwards.

2004-10-29  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading

        Reviewed by kocienda, adele.

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes

2004-10-29  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)

        * khtml/khtmlview.cpp:
        (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
        deleted before this function finishes running.
        (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
        (KHTMLView::viewportMouseReleaseEvent): Ditto.
        (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
        is guaranteed to do ref/deref as needed.

        * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.

2004-10-28  Chris Blumenberg  <cblu@apple.com>

	Enabled XSLT on Panther. See intrigue mail for compiling instructions.

        Reviewed by darin.

        * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
        * WebCorePrefix.h: always use XSLT

2004-10-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for these bugs:
        
        <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
        <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
        
        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members 
        to initialization list, zeroing them out.
        (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
        handle a delete of content in special cases where the only thing selected is a BR. This
        code path is much simpler than the newly-named performGeneralDelete, and detects when no
        content merging should be done between blocks. This aspect of the change fixes 3854848.
        One of the special cases added fixes 3803832.
        (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
        like the other helpers in this class.
        (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
        (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
        * khtml/editing/htmlediting.h: Added new helper and changed an old one.

2004-10-28  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com

        Reviewed by darin.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it

2004-10-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Harrison

        Reorganization of delete command functionality so that doApply is not
        several hundred lines long. This is not a squeaky-clean cleanup, but
        it is a step in the right direction. No functionality changes.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
        (khtml::DeleteSelectionCommand::initializePositionData): New helper.
        (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
        (khtml::DeleteSelectionCommand::performDelete): Ditto.
        (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
        (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
        (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
        (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
        (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
        * khtml/editing/htmlediting.h:

2004-10-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
        new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.

2004-10-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
        whether content not in the block containing the start of the selection is moved to that block
        after the selection is deleted.
        (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
        (khtml::DeleteSelectionCommand::doApply): Ditto.
        (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
        to handle the case of inserting a newline when in quoted content in Mail.
        (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
        (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
        (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
        (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
        (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
        (khtml::TypingCommand::doApply): Ditto.
        (khtml::TypingCommand::preservesTypingStyle): Ditto.
        * khtml/editing/htmlediting.h: Add new delclarations.
        (khtml::TypingCommand::): Ditto.
        * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.

2004-10-26  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content

        Reviewed by dave.

        * khtml/ecma/kjs_dom.cpp:
        (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMElement::):
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::):

2004-10-26  David Hyatt  <hyatt@apple.com>

	Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
	the previous line.
	
        Reviewed by kocienda

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):

2004-10-26  David Hyatt  <hyatt@apple.com>

	Convert selectionRect() from using a list to a dict and patch it to be like setSelection.  It was still trying
	to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
	
        Reviewed by kocienda

        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::selectionRect):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::hasSelectedChildren):

2004-10-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bug::
        
        <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
        let the caller know if a placeholder was removed.
        (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
        removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
        some cases, the selection was still set on the removed BR, and this was the cause of the
        crash.
        * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.

2004-10-26  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued

        * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.

2004-10-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
        with a zero-length string. That triggers an assert. Call deleteText instead, 
        using the same indices that are passed to replaceText.
        
        Cleaned up the asserts in these three functions below, making them
        more consistent. This is not needed for the fix, but I tripped over
        these in the course of debugging.
        
        (khtml::InsertTextCommand::InsertTextCommand):
        (khtml::InsertTextCommand::doApply):
        (khtml::InsertTextCommand::doUnapply):

2004-10-25  Adele Amchan <adele@apple.com>

        Reviewed by Darin.

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
        * khtml/xml/dom_docimpl.h:

2004-10-25  Adele Amchan  <adele@apple.com>

        Reviewed by me, code change by Darin.

        * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.

2004-10-25  Ken Kocienda  <kocienda@apple.com>

        Oops. These two test results changed with my last checkin, for the better.

        * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
        * layout-tests/editing/inserting/insert-3775316-fix-expected.txt

2004-10-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
        expand the selection outwards when the selection is on the visible boundary of a root
        editable element. This fixes the bug. Note that this function also contains a little code
        I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
        (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
        (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
        * khtml/editing/htmlediting.h: Declare new helpers.
        * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-select-all-001.html: Added.
        * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-select-all-002.html: Added.
        * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-select-all-003.html: Added.

2004-10-25  Ken Kocienda  <kocienda@apple.com>

        Added some more editing layout tests.

        * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
        * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
        * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
        * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
        * layout-tests/editing/inserting/typing-003-expected.txt: Added.
        * layout-tests/editing/inserting/typing-003.html: Added.

2004-10-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
        yesterday quite right: words that should have been placed on the next line were instead
        appearing on the line before, beyond the right margin. This was a one-word only error
        based on moving the line break object when it should have stayed put. Here is the rule:
        The line break object only moves to after the whitespace on the end of a line if that 
        whitespace caused line overflow when its width is added in.

2004-10-25  Adele Amchan  <adele@apple.com>

        Reviewed by Darin.
 
        Fix for <rdar://problem/3619890> Feature request: designMode        

        This change implements the designMode property of a document.  This is an IE property that is also supported by Mozilla.  
        This will enable more JS editing compatibility.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet): added case for designMode
        (KJS::HTMLDocument::putValue): added case for designMode
        * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
        * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl): initialize m_designMode member variable
        (DocumentImpl::setDesignMode): added function to assign m_designMode value
        (DocumentImpl::getDesignMode): return m_designMode value
        (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value. 
            Otherwise, it will just return the m_designMode value.
        (DocumentImpl::parentDocument):
        * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart

2004-10-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
        everything that could be affected.
        (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
        braces, making it act as a comma operator, with a zero value as the right value!!! This made
        an important check always fail!!! It turns out that we do not want the constant at all, since
        that constant is only needed when checking a computed style, not an inline style as is being
        done here.
        (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
        (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
        RangeImpl::compareBoundaryPoints to perform the required check.
        * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.

2004-10-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bugs:
        
        <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
        <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
    
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
        it is when we are editing, add in the space of the current character when calculating the width
        of committed plus uncommitted characters. If this value exceeds the width of the line, move up
        the line break object and call skipWhitespace to move past the end of the whitespace.

=== Safari-168 ===

2004-10-22  Ken Kocienda  <kocienda@apple.com>

        * WebCore.pbproj/project.pbxproj:
         Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.

2004-10-21  David Hyatt  <hyatt@apple.com>

        Reviewed by darin
	
	Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
	
	<rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
	<rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
	
        * khtml/rendering/render_block.cpp:
        (khtml::getInlineRun):
        (khtml::RenderBlock::makeChildrenNonInline):

2004-10-21  David Hyatt  <hyatt@apple.com>

	Fix for 3810389, crash because of continuation() craziness.  Revert back to the old behavior of
	making sure that all line boxes get deleted and recreated when inlines are split because of a block.
	
        Reviewed darin

        * khtml/rendering/render_inline.cpp:
        (RenderInline::splitFlow):

2004-10-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin
        
        Significant improvement to the way that whitespace is handled during editing.

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
        two being added with this name) that delete "insignificant" unrendered text.
        (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
        calculates the downstream position to use as the endpoint for the deletion, and
        then calls deleteInsignificantText with this start and end.
        (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
        (khtml::InputNewlineCommand::doApply): Ditto.
        (khtml::InputTextCommand::input): Ditto.
        * khtml/editing/htmlediting.h: Add new declarations.
        
        Modified layout test results:
        * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
        * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
        * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
        * layout-tests/editing/deleting/delete-selection-001-expected.txt:
        * layout-tests/editing/deleting/delete-tab-001-expected.txt:
        * layout-tests/editing/deleting/delete-tab-004-expected.txt:
        * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
        * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
        * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
        * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
        * layout-tests/editing/inserting/insert-br-001-expected.txt:
        * layout-tests/editing/inserting/insert-br-004-expected.txt:
        * layout-tests/editing/inserting/insert-br-005-expected.txt:
        * layout-tests/editing/inserting/insert-br-006-expected.txt:
        * layout-tests/editing/inserting/insert-tab-001-expected.txt:
        * layout-tests/editing/inserting/insert-tab-002-expected.txt:
        * layout-tests/editing/inserting/insert-tab-004-expected.txt:
        * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
        * layout-tests/editing/inserting/typing-001-expected.txt:
        * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
        * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
        * layout-tests/editing/style/typing-style-003-expected.txt:
        * layout-tests/editing/undo/redo-typing-001-expected.txt:
        * layout-tests/editing/undo/undo-typing-001-expected.txt:

2004-10-21  David Hyatt  <hyatt@apple.com>

	Fix for 3847054, assertion failure in RenderText::layout() on news.com page.  Fix getInlineRun so that
	it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::getInlineRun):

2004-10-20  David Hyatt  <hyatt@apple.com>

	Add better dumping of overflow information for scrolling regions.

	Fix for 3726524, crash in updateLayerPosition.  Make sure anonymous elements properly remove themselves
	from the render tree so that layers and so forth are cleaned up.
	
        Reviewed by darin

        * khtml/rendering/render_container.cpp:
        (RenderContainer::detach):
        * khtml/rendering/render_layer.h:
        (khtml::RenderLayer::scrollXOffset):
        (khtml::RenderLayer::scrollYOffset):
        * kwq/KWQRenderTreeDebug.cpp:
        (write):

2004-10-20  David Hyatt  <hyatt@apple.com>

	Fix for 3791146, make sure all lines are checked when computing overflow.
	
        Reviewed by kocienda

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::computeHorizontalPositionsForLine):
        (khtml::RenderBlock::layoutInlineChildren):
        (khtml::RenderBlock::findNextLineBreak):
        (khtml::RenderBlock::checkLinesForOverflow):
        * khtml/rendering/render_block.h:

2004-10-20  David Hyatt  <hyatt@apple.com>

	Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
	
        Reviewed by kocienda

        * khtml/rendering/break_lines.cpp:
        (khtml::isBreakable):

2004-10-20  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties

        * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
        Create a palette with the background and foreground colors in it and set it on the widget.

        * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
        with APPLE_CHANGES. Removed palette and palette-related function members.
        * khtml/rendering/render_style.cpp:
        (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
        (RenderStyle::diff): No palette to compare.

        * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
        * kwq/KWQLineEdit.mm:
        (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
        (QLineEdit::text): Made const.

        * kwq/KWQTextEdit.h: Added setPalette override.
        * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
        based on palette.

        * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
        per color group, and only a single color group per palette.
        * kwq/KWQColorGroup.mm: Removed.
        * kwq/KWQPalette.mm: Removed.
        * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.

        * kwq/KWQApplication.h: Removed unused palette function.
        * kwq/KWQApplication.mm: Ditto.

        * kwq/KWQWidget.h: Removed unsetPalette.
        * kwq/KWQWidget.mm: Ditto.

        - fixed storage leak

        * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
        Roll in storage leak fix from KDE guys.

2004-10-19  David Hyatt  <hyatt@apple.com>

        Reviewed by kocienda

	More cleanup of block layout.  Eliminates the separate step for tables that dont fit on a line with a float
	and consolidates it with clearing.

	Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
	
        * khtml/rendering/render_block.cpp:
        (khtml::getInlineRun):
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::adjustFloatingBlock):
        (khtml::RenderBlock::collapseMargins):
        (khtml::RenderBlock::clearFloatsIfNeeded):
        (khtml::RenderBlock::estimateVerticalPosition):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
        (khtml::RenderBlock::getClearDelta):
        (khtml::RenderBlock::calcBlockMinMaxWidth):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_frames.cpp:
        (RenderFrameSet::layout):
        * khtml/xml/dom_textimpl.cpp:
        (TextImpl::rendererIsNeeded):

        Fix for 3841060, regression with * in frames.  Reviewed by kocienda.
	
	* layout-tests/fast/frames/002-expected.txt: Added.
        * layout-tests/fast/frames/002.html: Added.

 2004-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done

        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
        scripts being loaded here. If the current code being run is the external script itself, then we don't want
        to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
        assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
        wrong since there can be a script loading in that case too. Layout tests check for both problems.

        * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
        * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
        * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.

        * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).

2004-10-18  Darin Adler  <darin@apple.com>

        Reviewed by Dave Hyatt.

        - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
        (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
        we only want to look at loadingExtScript if m_executingScript is 0.

2004-10-18  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents

        * khtml/css/css_valueimpl.cpp:
        (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
        Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the 
        lifecycle issues associated with creating a string to be returned in the ident case.
        * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.

2004-10-18  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)

        Reviewed by kocienda.

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion

2004-10-15  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS

        Reviewed by john.

        * kwq/DOM-CSS.mm:
        (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
        * kwq/DOMPrivate.h:

2004-10-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
        skipping after a clean line break, in addition to the cases already 
        checked for.
        * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-007.html: Added.
        * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-008.html: Added.

=== Safari-167 ===

2004-10-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment

        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
        position code to new-style VisiblePosition code. In retrospect, this code was misguided.
        Since we do a good job of insulating external code from the internal workings of 
        VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
        in the case of this bug, was doing harm. Simply removing this code makes the bug
        go away and does not cause any editing layout test regresssions.

2004-10-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/rendering/bidi.cpp:
        (khtml::skipNonBreakingSpace): New helper.
        (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
        at the start of a block. This was preventing users from typing spaces in empty
        documents.
        * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
        * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.

2004-10-14  Adele Amchan  <adele@apple.com>

        Reviewed by Darin and Ken.

	fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()

        This change shifts some code around so that the code that determines what typing style
        is in effect is called before deleteUnrenderedText is called.  Two asserts are also added
        to ensure that start and end nodes of the selection are in the document.

        * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):

2004-10-14  Adele Amchan  <adele@apple.com>

        Reviewed by Ken
	
	This change makes these three functions virtual so that the work is being done in KWQHTMLPart 
        instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.

        * khtml/khtml_part.cpp:
        (KHTMLPart::shouldBeginEditing):
        (KHTMLPart::shouldEndEditing):
        (KHTMLPart::isContentEditable):
        * khtml/khtml_part.h:
        * kwq/KWQKHTMLPart.h:

2004-10-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Final fix for these bugs:
        
        <rdar://problem/3806306> HTML editing puts spaces at start of line
        <rdar://problem/3814252> HTML editing groups space with word causing wrapping

        This change sets some new CSS properties that have been added to WebCore to 
        enable whitespace-handling and line-breaking features that make WebView work
        more like a text editor.

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties 
        based on property value.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties 
        based on attribute value.
        * khtml/khtml_part.cpp:
        (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
        body element.
        (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
        body element.
        (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
        (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
        * khtml/khtml_part.h: Add new declarations.
        * kwq/WebCoreBridge.h: Ditto.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
        (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
        (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
        (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.

2004-10-14  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
        needed a nil check to handle empty document case

2004-10-13  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
        
	- I fixed this by turning off all colormatching for WebKit
	content. We might turn it back on later. For now, it's possible to
	turn it on temporarily by defining COLORMATCH_EVERYTHING.
	
	* WebCorePrefix.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        (Context2D::colorRefFromValue):
        (Gradient::getShading):
        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::createDrawingContext):
        * kwq/KWQColor.mm:
        (QColor::getNSColor):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (CGColorFromNSColor):
        (QPainter::selectedTextBackgroundColor):
        (QPainter::rgbColorSpace):
        (QPainter::grayColorSpace):
        (QPainter::cmykColorSpace):
        * kwq/WebCoreGraphicsBridge.h:
        * kwq/WebCoreGraphicsBridge.m:
        (-[WebCoreGraphicsBridge createRGBColorSpace]):
        (-[WebCoreGraphicsBridge createGrayColorSpace]):
        (-[WebCoreGraphicsBridge createCMYKColorSpace]):

2004-10-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
        is non-null before appending.

2004-10-13  Ken Kocienda  <kocienda@apple.com>

        Update expected results for improved behavior as a result of fix to 3816768.
    
        * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
        * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
        * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt

2004-10-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
        for getting -khtml-line-break and -khml-nbsp-mode.

2004-10-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly 
        moves caret out of block.

        The issue here is that an empty block with no explicit height set by style collapses
        to zero height, and does so immediately after the last bit of content is removed from
        it (as a result of deleting text with the delete key for instance). Since zero-height
        blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
        
        The fix is to detect when a block has not been removed itself, but has had all its 
        contents removed. In this case, a BR element is placed in the block, one that is
        specially marked as a placeholder. Later, if the block ever receives content, this
        placeholder is removed.

        * khtml/editing/htmlediting.cpp:
        (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
        (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
        Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong 
        (it's very clear that we needs to be able to move more than just text nodes). This may expose
        bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
        made the test case in the bug work.
        (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
        removeBlockPlaceholderIfNeeded.
        (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
        (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
        * khtml/editing/htmlediting.h: Declare new functions.

2004-10-13  Richard Williamson   <rjw@apple.com>

        Added support for -apple-dashboard-region:none.  And fixed
	a few computed style problems.

        Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
        Reviewed by Hyatt.

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        * khtml/css/css_valueimpl.cpp:
        (CSSPrimitiveValueImpl::cssText):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::parseDashboardRegions):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/rendering/render_style.cpp:
        (RenderStyle::noneDashboardRegions):
        * khtml/rendering/render_style.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dashboardRegionsDictionary):

2004-10-13  David Hyatt  <hyatt@apple.com>

	Rework block layout to clean it up and simplify it (r=kocienda).  

	Also fixing the style sharing bug (r=mjs).
	
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::MarginInfo::MarginInfo):
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::adjustPositionedBlock):
        (khtml::RenderBlock::adjustFloatingBlock):
        (khtml::RenderBlock::handleSpecialChild):
        (khtml::RenderBlock::handleFloatingOrPositionedChild):
        (khtml::RenderBlock::handleCompactChild):
        (khtml::RenderBlock::insertCompactIfNeeded):
        (khtml::RenderBlock::handleRunInChild):
        (khtml::RenderBlock::collapseMargins):
        (khtml::RenderBlock::clearFloatsIfNeeded):
        (khtml::RenderBlock::estimateVerticalPosition):
        (khtml::RenderBlock::determineHorizontalPosition):
        (khtml::RenderBlock::setCollapsedBottomMargin):
        (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
        (khtml::RenderBlock::handleBottomOfBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
        (khtml::RenderBlock::addOverHangingFloats):
        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::maxTopMargin):
        (khtml::RenderBlock::maxBottomMargin):
        (khtml::RenderBlock::CompactInfo::compact):
        (khtml::RenderBlock::CompactInfo::block):
        (khtml::RenderBlock::CompactInfo::matches):
        (khtml::RenderBlock::CompactInfo::clear):
        (khtml::RenderBlock::CompactInfo::set):
        (khtml::RenderBlock::CompactInfo::CompactInfo):
        (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
        (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
        (khtml::RenderBlock::MarginInfo::clearMargin):
        (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
        (khtml::RenderBlock::MarginInfo::setTopQuirk):
        (khtml::RenderBlock::MarginInfo::setBottomQuirk):
        (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
        (khtml::RenderBlock::MarginInfo::setPosMargin):
        (khtml::RenderBlock::MarginInfo::setNegMargin):
        (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
        (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
        (khtml::RenderBlock::MarginInfo::setMargin):
        (khtml::RenderBlock::MarginInfo::atTopOfBlock):
        (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
        (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
        (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
        (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
        (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
        (khtml::RenderBlock::MarginInfo::quirkContainer):
        (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
        (khtml::RenderBlock::MarginInfo::topQuirk):
        (khtml::RenderBlock::MarginInfo::bottomQuirk):
        (khtml::RenderBlock::MarginInfo::posMargin):
        (khtml::RenderBlock::MarginInfo::negMargin):
        (khtml::RenderBlock::MarginInfo::margin):
        * khtml/rendering/render_box.cpp:
        (RenderBox::calcAbsoluteVertical):
        * khtml/rendering/render_box.h:
        (khtml::RenderBox::marginTop):
        (khtml::RenderBox::marginBottom):
        (khtml::RenderBox::marginLeft):
        (khtml::RenderBox::marginRight):
        * khtml/rendering/render_image.cpp:
        (RenderImage::setImage):
        * khtml/rendering/render_object.cpp:
        (RenderObject::sizesToMaxWidth):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::collapsedMarginTop):
        (khtml::RenderObject::collapsedMarginBottom):
        (khtml::RenderObject::maxTopMargin):
        (khtml::RenderObject::maxBottomMargin):
        (khtml::RenderObject::marginTop):
        (khtml::RenderObject::marginBottom):
        (khtml::RenderObject::marginLeft):
        (khtml::RenderObject::marginRight):
        * khtml/rendering/render_text.h:
        (khtml::RenderText::marginLeft):
        (khtml::RenderText::marginRight):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::recalcStyle):

2004-10-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line

        * khtml/editing/selection.cpp:
        (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
        This will make it seem like the run ends on the next line.

2004-10-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages

        * khtml/editing/htmlediting.cpp:
        (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
        row, section, or column.
        (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
        of table structure when doing deletes, rather than deleting the structure elements themselves.
        (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
        of table structure. We may want to revisit this some day, but this seems like the best behavior
        to me now.
        (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
        where needed.
        * khtml/editing/htmlediting.h: Add declarations for new functions.

2004-10-12  Richard Williamson   <rjw@apple.com>

        Fixed access to DOM object via WebScriptObject API.
        The execution context for DOM objects wasn't being found.	
        <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
        Reviewed by Chris

        Fixed <rdar://problem/3831063> regions use left offset instead of top offset
	Reviewed by John

        * khtml/khtml_part.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::addDashboardRegions):
        * kwq/DOM.mm:
        (-[DOMNode isContentEditable]):
        (-[DOMNode KJS::Bindings::]):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::executionContextForDOM):

2004-10-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
    
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
        insert our style-checking node is done with an appendChild rather than an insertBefore. Note 
        that this table-related problem was exposed by fixing Selection::layout(), which I did
        yesterday. This change simply improves things even more so that we do not crash in the
        scenario described in the bug.

2004-10-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        This is a partial fix to this bug:
        
        <rdar://problem/3832886> increase quote level on new mail document leads to immediate 
        crash in caret painting code
        
        To eliminate the bad behavior for good, I have done some investigations in Mail code,
        and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
        blocks (like blockquote elements used for quoting) to documents without giving those 
        blocks some content (so they have a height).

        I added some other crash protections below.

        * khtml/editing/selection.cpp:
        (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
        the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
        a couple position-has-renderer assertion checks.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
        may not yield a position. This assertion is a holdover from before we had VisiblePosition.
        (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
        calls to helpers.

2004-10-11  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3834230> empty table can result in division by 0

        * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
        Added 0 check; rolled in from KDE.

2004-10-11  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3818712> form checkbox value property is read only

        The underlying problem was that we were storing two separate values for all
        form elements; one for the value property (JavaScript) and the other for the
        value attribute (DOM). This is a good idea for text input, but not for other types.

        * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
        Added private storesValueSeparateFromAttribute function.
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
        if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
        (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
        switch so that we will get a warning if a type is left out.
        (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
        (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
        separately from the attribute. Otherwise, we just want to lave it alone
        (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
        on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
        (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
        supposed to be stored separate from the attribute.
        (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
        input elements, and false for the others.

2004-10-11  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange

        * khtml/rendering/render_form.cpp:
        (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
        (RenderCheckBox::slotStateChanged): Added call to onChange.

2004-10-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Finish selection affinity implementation. This includes code to set the
        affinity correctly when clicking with the mouse, and clearing the
        affinity when altering the selection using any of the Selection object
        mutation functions.

        Each instance of the positionForCoordinates, inlineBox and caretRect 
        functions have been changed to include an EAffinity argument to give results
        which take this bit into account.

        * khtml/editing/selection.cpp:
        (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
        (khtml::Selection::modifyAffinity): New function to compute affinity based on
        modification constants.
        (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
        (khtml::Selection::modifyExtendingRightForward): Ditto.
        (khtml::Selection::modifyMovingRightForward): Ditto.
        (khtml::Selection::modifyExtendingLeftBackward): Ditto.
        (khtml::Selection::modifyMovingLeftBackward): Ditto.
        (khtml::Selection::modify): Support saving, restoring, and then calculating new
        affinity value as needed. 
        (khtml::Selection::xPosForVerticalArrowNavigation):
        (khtml::Selection::clear): Reset affinity to UPSTREAM.
        (khtml::Selection::setBase): Ditto.
        (khtml::Selection::setExtent): Ditto.
        (khtml::Selection::setBaseAndExtent): Ditto.
        (khtml::Selection::layout): Pass affinity to caretRect().
        (khtml::Selection::validate): Pass along affinity parameter to new functions that
        require it.
        (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
        keep this code working with changes made in selectionForLine().
        (khtml::endOfLastRunAt): Ditto.
        (khtml::selectionForLine): Make this function work for all renderers, not just text
        renderers.
        * khtml/editing/selection.h:
        (khtml::operator==): Consider affinity in equality check.
        * khtml/editing/visible_units.cpp:
        (khtml::previousLinePosition): Pass affinity argument to function so it can take this 
        information into account while processing.
        (khtml::nextLinePosition): Ditto.
        (khtml::previousParagraphPosition): Ditto.
        (khtml::nextParagraphPosition): Ditto.
        * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
        * khtml/khtml_events.cpp:
        (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
        as this function is being removed.
        * khtml/khtml_part.cpp:
        (KHTMLPart::isPointInsideSelection): Ditto.
        (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
        call to positionForCoordinates, and set resulting affinity on the selection.
        (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
        NodeImpl::positionForCoordinates, as this function is being removed.
        (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::caretRect): Ditto.
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::positionForCoordinates): Ditto.
        (RenderBR::caretRect): Ditto.
        (RenderBR::inlineBox): Ditto.
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::positionForCoordinates): Ditto.
        * khtml/rendering/render_container.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::caretRect): Ditto.
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::positionForCoordinates): Ditto.
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::caretRect): Ditto.
        (RenderObject::positionForCoordinates): Ditto.
        (RenderObject::inlineBox): Ditto.
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::positionForCoordinates): Ditto.
        * khtml/rendering/render_replaced.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::positionForCoordinates): Ditto.
        (firstRendererOnNextLine): New helper used by caretRect().
        (RenderText::caretRect): Now takes an affinity argument.
        (RenderText::inlineBox): Ditto.
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
        * khtml/xml/dom_nodeimpl.h: Ditto.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousLinePosition): Now takes an affinity argument.
        (DOM::Position::nextLinePosition): Ditto.
        * khtml/xml/dom_position.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
        (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
        (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
        NodeImpl::positionForCoordinates, as this function is being removed.

2004-10-11  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab

        * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
        Scroll to reveal the text area, don't scroll to reveal the text view itself.
        Scrolling the text view ended up putting it at the top left, regardless of
        where the insertion point is.

2004-10-11  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3831546> More text is copied than is visually selected

        The bug here is that upstream was moving a position too far.

        * khtml/xml/dom_position.cpp:
        (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
        in for various checks. Also use local variables a bit more for slightly more efficiency.
        (DOM::Position::downstream): Ditto.

2004-10-11  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work

        * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
        (EventImpl::idToType): Changed to use table.

2004-10-10  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]

        (-[KWQAccObject accessibilityActionNames]):
        check for nil m_renderer

2004-10-09  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text

        * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
        I'm landing later, but it does no harm to add these now.
        * kwq/KWQTextArea.mm:
        (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
        determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
        where we don't want it to track the text view. This caused the bug. 
        (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
        (-[KWQTextArea setTextColor:]): Added.
        (-[KWQTextArea setBackgroundColor:]): Added.

2004-10-09  Darin Adler  <darin@apple.com>

        Reviewed by Adele.

        - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)

        The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
        This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
        "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
        call for <meta> redirect and not preventing tokenizing when that's in effect.

        * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
        isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
        * khtml/khtml_part.cpp:
        (KHTMLPart::openURL): Updated for new constant name.
        (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
        does the special case for redirection during load; a <meta> refresh can never be one of those special
        redirects during a load because it redirects the frame itself, not another frame. Also tightened up
        the logic by always stopping the redirect timer even if we aren't restarting it.
        (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
        so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
        and renamed to locationChangeScheduledDuringLoad.
        (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
        returns true only for location changes and history navigation, not <meta> redirects.
        (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
        and got rid of a silly timer delay computation that always resulted in 0.

        * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
        and also renamed one of the existing values.

        * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
        of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.

        * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
        instead of calling scheduleRedirection with delay of 0.
        * khtml/ecma/kjs_window.cpp:
        (Window::put): Ditto.
        (WindowFunc::tryCall): Ditto.
        (Location::put): Ditto.
        (LocationFunc::tryCall): Ditto.

2004-10-09  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3658277> REGRESSION (1.1-1.2): form submission should either not simulate a click at all or use (0,0) the way Mozilla does

        * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.

2004-10-09  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines

        * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
        makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
        a copy of the function in each file as an init routine for the framework.

        * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
        globals; their constructors were showing up as init routines for the framework.

        * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
        * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
        a normal function. When it was an inline function, the constructors for the per-file
        copies of the globals were showing up as init routines for the framework.

2004-10-09  Chris Blumenberg  <cblu@apple.com>

	Fixed: 
	<rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
	<rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
	<rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does

        Reviewed by hyatt, kocienda.

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::scroll): new
        * khtml/rendering/render_layer.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::scroll): new
        * khtml/rendering/render_object.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::scrollOverflow): new
        (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
        (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
        * kwq/KWQScrollBar.h:
        * kwq/KWQScrollBar.mm:
        (QScrollBar::setValue): return a bool
        (QScrollBar::scrollbarHit): ditto
        (QScrollBar::scroll): new
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
        (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
        (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection

2004-10-06  David Hyatt  <hyatt@apple.com>

	Back out style sharing perf fix.
	
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::locateCousinList):
        (khtml::CSSStyleSelector::canShareStyleWithElement):
        (khtml::CSSStyleSelector::locateSharedStyle):
        * khtml/css/cssstyleselector.h:
        * khtml/html/html_elementimpl.h:
        (DOM::HTMLElementImpl::inlineStyleDecl):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::recalcStyle):
        * khtml/xml/dom_elementimpl.h:

=== Safari-166 ===

2004-10-05  David Hyatt  <hyatt@apple.com>

	Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::locateCousinList):
        (khtml::CSSStyleSelector::elementsCanShareStyle):
        (khtml::CSSStyleSelector::locateSharedStyle):
        (khtml::CSSStyleSelector::styleForElement):

2004-10-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
        broke layout tests involving compacts.

2004-10-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Finish selection affinity implementation. This includes code to set the
        affinity correctly when clicking with the mouse, and clearing the
        affinity when altering the selection using any of the Selection object
        mutation functions.

        Each instance of the positionForCoordinates function in the render tree
        has been changed to include an EAffinity argument. It is now the job of this
        function to set the selection affinity.

        * khtml/editing/selection.cpp:
        (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
        (khtml::Selection::modify): Ditto.
        (khtml::Selection::clear): Ditto.
        (khtml::Selection::setBase): Ditto.
        (khtml::Selection::setExtent): Ditto.
        (khtml::Selection::setBaseAndExtent): Ditto.
        * khtml/editing/selection.h:
        (khtml::operator==): Consider affinity in equality check.
        * khtml/khtml_events.cpp:
        (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
        as this function is being removed.
        * khtml/khtml_part.cpp: 
        (KHTMLPart::isPointInsideSelection): Ditto.
        (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
        call to positionForCoordinates, and set resulting affinity on the selection.
        (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
        NodeImpl::positionForCoordinates, as this function is being removed.
        (KHTMLPart::khtmlMouseReleaseEvent):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::positionForCoordinates): Ditto.
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::positionForCoordinates): Ditto.
        * khtml/rendering/render_container.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::positionForCoordinates): Ditto.
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::positionForCoordinates): Ditto.
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::positionForCoordinates): Ditto.
        * khtml/rendering/render_replaced.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::positionForCoordinates): Ditto.
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
        * khtml/xml/dom_nodeimpl.h: Ditto.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
        NodeImpl::positionForCoordinates, as this function is being removed.

2004-10-05  David Hyatt  <hyatt@apple.com>

	Fix style sharing optimization to be fast again.  Go back to using pointer comparisons when looking for
	cousins to share.
	
        Reviewed by darin

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::locateCousinList):
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyleInternal):
        * khtml/rendering/render_object.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::recalcStyle):

2004-10-05  David Hyatt  <hyatt@apple.com>

	Fix lists so that they properly participate in line layout as though they are text (when text bullets are
	used) and as images (when image bullets are used).
	
        Reviewed by kocienda

        * khtml/rendering/render_list.cpp:
        (RenderListMarker::createInlineBox):
        * khtml/rendering/render_list.h:
        (khtml::ListMarkerBox:::InlineBox):
        (khtml::ListMarkerBox::isText):

2004-10-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
        we want is downstreamDeepEquivalent, as the deepEquivalent function returns
        an upstream position.

        * khtml/editing/selection.cpp:
        (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
        UPSTREAM uses deepEquivalent.
        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing 
        upstreamDeepEquivalent.
        * khtml/editing/visible_position.h

2004-10-05  David Hyatt  <hyatt@apple.com>

	New selection gap-filling architecture.  Makes the gap-filling much more like NSTextView and puts the responsibility
	for gap-filling in the block.  Fixes numerous bugs with selection drawing including bidi issues, incorrect old
	horizontal gap filling, and selection performance issues.
	
        Reviewed by kocienda

        * khtml/html/html_imageimpl.cpp:
        (HTMLImageLoader::notifyFinished):
        * khtml/misc/khtmllayout.h:
        (khtml::GapRects::left):
        (khtml::GapRects::center):
        (khtml::GapRects::right):
        (khtml::GapRects::uniteLeft):
        (khtml::GapRects::uniteCenter):
        (khtml::GapRects::uniteRight):
        (khtml::GapRects::unite):
        (khtml::GapRects::operator QRect):
        (khtml::GapRects::operator==):
        (khtml::GapRects::operator!=):
        * khtml/rendering/font.cpp:
        (Font::drawHighlightForText):
        * khtml/rendering/font.h:
        * khtml/rendering/render_block.cpp:
        (khtml:::RenderFlow):
        (khtml::RenderBlock::removeChild):
        (khtml::RenderBlock::paintObject):
        (khtml::RenderBlock::paintEllipsisBoxes):
        (khtml::RenderBlock::setSelectionState):
        (khtml::RenderBlock::shouldPaintSelectionGaps):
        (khtml::RenderBlock::isSelectionRoot):
        (khtml::RenderBlock::selectionGapRects):
        (khtml::RenderBlock::paintSelection):
        (khtml::RenderBlock::fillSelectionGaps):
        (khtml::RenderBlock::fillInlineSelectionGaps):
        (khtml::RenderBlock::fillBlockSelectionGaps):
        (khtml::RenderBlock::fillHorizontalSelectionGap):
        (khtml::RenderBlock::fillVerticalSelectionGap):
        (khtml::RenderBlock::fillLeftSelectionGap):
        (khtml::RenderBlock::fillRightSelectionGap):
        (khtml::RenderBlock::getHorizontalSelectionGapInfo):
        (khtml::RenderBlock::leftSelectionOffset):
        (khtml::RenderBlock::rightSelectionOffset):
        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::hasSelectedChildren):
        (khtml::RenderBlock::selectionState):
        (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
        (khtml::RenderBlock::BlockSelectionInfo::rects):
        (khtml::RenderBlock::BlockSelectionInfo::state):
        (khtml::RenderBlock::BlockSelectionInfo::block):
        (khtml::RenderBlock::selectionRect):
        * khtml/rendering/render_box.cpp:
        (RenderBox::position):
        * khtml/rendering/render_br.cpp:
        (RenderBR::inlineBox):
        * khtml/rendering/render_br.h:
        (khtml::RenderBR::selectionRect):
        (khtml::RenderBR::paint):
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::selectionRect):
        (RenderCanvas::setSelection):
        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::paint):
        * khtml/rendering/render_image.cpp:
        (RenderImage::paint):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_line.cpp:
        (khtml::InlineBox::nextLeafChild):
        (khtml::InlineBox::prevLeafChild):
        (khtml::InlineBox::selectionState):
        (khtml::InlineFlowBox::addToLine):
        (khtml::InlineFlowBox::firstLeafChild):
        (khtml::InlineFlowBox::lastLeafChild):
        (khtml::InlineFlowBox::firstLeafChildAfterBox):
        (khtml::InlineFlowBox::lastLeafChildBeforeBox):
        (khtml::InlineFlowBox::selectionState):
        (khtml::RootInlineBox::fillLineSelectionGap):
        (khtml::RootInlineBox::setHasSelectedChildren):
        (khtml::RootInlineBox::selectionState):
        (khtml::RootInlineBox::firstSelectedBox):
        (khtml::RootInlineBox::lastSelectedBox):
        (khtml::RootInlineBox::selectionTop):
        (khtml::RootInlineBox::block):
        * khtml/rendering/render_line.h:
        (khtml::RootInlineBox::RootInlineBox):
        (khtml::RootInlineBox::hasSelectedChildren):
        (khtml::RootInlineBox::selectionHeight):
        * khtml/rendering/render_object.cpp:
        (RenderObject::selectionColor):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::):
        (khtml::RenderObject::selectionState):
        (khtml::RenderObject::setSelectionState):
        (khtml::RenderObject::selectionRect):
        (khtml::RenderObject::canBeSelectionLeaf):
        (khtml::RenderObject::hasSelectedChildren):
        (khtml::RenderObject::hasDirtySelectionState):
        (khtml::RenderObject::setHasDirtySelectionState):
        (khtml::RenderObject::shouldPaintSelectionGaps):
        (khtml::RenderObject::SelectionInfo::SelectionInfo):
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::RenderReplaced):
        (RenderReplaced::shouldPaint):
        (RenderReplaced::selectionRect):
        (RenderReplaced::setSelectionState):
        (RenderReplaced::selectionColor):
        (RenderWidget::paint):
        (RenderWidget::setSelectionState):
        * khtml/rendering/render_replaced.h:
        (khtml::RenderReplaced::canBeSelectionLeaf):
        (khtml::RenderReplaced::selectionState):
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::checkVerticalPoint):
        (InlineTextBox::isSelected):
        (InlineTextBox::selectionState):
        (InlineTextBox::selectionRect):
        (InlineTextBox::paintSelection):
        (InlineTextBox::paintMarkedTextBackground):
        (RenderText::paint):
        (RenderText::setSelectionState):
        (RenderText::selectionRect):
        * khtml/rendering/render_text.h:
        (khtml::RenderText::canBeSelectionLeaf):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::drawHighlightForText):
        * kwq/KWQPtrDict.h:
        (QPtrDictIterator::toFirst):
        * kwq/KWQRect.mm:
        (QRect::unite):
        * kwq/WebCoreTextRenderer.h:
        * kwq/WebCoreTextRendererFactory.mm:
        (WebCoreInitializeEmptyTextGeometry):

2004-10-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin
        
        Use the new CSS properties I added with my previous check-in. Also makes
        some changes to caret positioning and drawing to make the proper editing
        end-of-line behavior work correctly.

        * khtml/editing/selection.cpp:
        (khtml::Selection::layout): Caret drawing now takes affinity into account
        when deciding where to paint the caret (finally!).
        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
        to determine the result. Use a simpler test involving comparisons between
        downstream positions while iterating. This is cheaper to do and easier to understand.
        (khtml::VisiblePosition::nextVisiblePosition): Ditto.
        * khtml/rendering/bidi.cpp:
        (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
        text renderers and for non-text renderers. Return a null Qchar instead. Returning
        non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
        (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that 
        contain with more spaces than can fit on the end of a line.
        (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
        (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
        in code to check and use new CSS properties.
        * khtml/rendering/break_lines.cpp:
        (khtml::isBreakable): Consider a non-breaking space a breakable character based
        on setting of new -khtml-nbsp-mode property.
        * khtml/rendering/break_lines.h: Ditto.
        * khtml/rendering/render_block.h: Declare skipWhitespace function.
        * khtml/rendering/render_text.cpp: 
        (RenderText::caretRect): Do not draw the caret beyond the right edge of the
        window when in white-space normal mode.

2004-10-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for these bugs:
        
        In this patch, I add two new CSS properties and their associated behavior.
        This is to support end-of-line and word-wrapping features that match the 
        conventions of text editors.

        There are also some other small changes here which begin to lay the groundwork
        for using these new properties to bring about the desired editing behavior.

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): Add support for new CSS properties.
        * khtml/css/cssproperties.c: Generated file.
        * khtml/css/cssproperties.h: Ditto.
        * khtml/css/cssproperties.in: Add new properties.
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
        * khtml/css/cssvalues.c: Generated file.
        * khtml/css/cssvalues.h: Ditto.
        * khtml/css/cssvalues.in:  Add support for new CSS properties.
        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
        * khtml/editing/visible_position.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::detach): Zero out inlineBoxWrapper.
        * khtml/rendering/render_style.cpp:
        (StyleCSS3InheritedData):
        (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
        (RenderStyle::diff): Ditto.
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::nbspMode): Ditto.
        (khtml::RenderStyle::khtmlLineBreak): Ditto.
        (khtml::RenderStyle::setNBSPMode): Ditto.
        (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
        (khtml::RenderStyle::initialNBSPMode): Ditto.
        (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.

2004-10-05  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating

        * kwq/KWQTextField.mm:
        (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
        Wrote a new version of this method that truncates incoming strings rather than rejecting them
        out of hand.

2004-10-04  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
        (KHTMLParser::reset): Use doc() to make code easier to read.
        (KHTMLParser::setCurrent): Ditto.
        (KHTMLParser::parseToken): Ditto.
        (KHTMLParser::insertNode): Ditto.
        (KHTMLParser::getElement): Ditto.
        (KHTMLParser::popOneBlock): Ditto.

        - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window

        * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
        (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
        (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
        (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
        (KWQKHTMLPart::registerCommandForRedo): Ditto.

        * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
        (-[WebCoreBridge redoEditing:]): Ditto.
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
        EditCommandPtr variable to make things slightly more terse.
        (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
        (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
        (-[WebCoreBridge fontAttributesForSelectionStart]): Added.

        - fix compile on Panther and other cleanup

        * khtml/khtml_part.cpp: Removed unneeded include.
        * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
        * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
        (-[KWQEditCommand initWithEditCommand:]): Changed name.
        (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
        (-[KWQEditCommand finalize]): Ditto.
        (+[KWQEditCommand commandWithEditCommand:]): Changed name.
        (-[KWQEditCommand command]): Changed name.

2004-10-04  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - did a more-robust version of the fix I just landed

        * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
        (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.

2004-10-04  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
        work well when current is 0, and there's no reason we need to reset the current block first.
        (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
        would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
        in a double-delete of the document, tokenizer, and parser.

2004-10-04  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)

        * khtml/khtmlview.cpp:
        (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
        (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
        (KHTMLViewPrivate::reset): Clear the click node.
        (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
        reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
        the node we we are clicking on.
        (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
        the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
        old click node for a long time.
        (KHTMLView::invalidateClick): Clear the click node.
        (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
        the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
        old click node for a long time.
        (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.

2004-10-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window

        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
        iteration. I have been wanting to make this change for a long time, but couldn't
        since other code relied on the leaf behavior. That is no longer true. Plus, the
        bug fix requires the new behavior.
        (khtml::VisiblePosition::nextPosition): Ditto.
        (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
        but we make a special case for the body element. This fixes the bug.

2004-10-04  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces

        * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
        doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
        * kwq/KWQTextUtilities.cpp: Removed.
        * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.

        - fixed a problem that would show up using HTML editing under garbage collection

        * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
        [super finalize].

        - another small change

        * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.

2004-10-01  Darin Adler  <darin@apple.com>

        Reviewed by Ken (or arguably done by Ken, reviewed by Darin).

        - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line

        * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
        Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
        This is a short term fix for something that needs a better longer-term fix.

        - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line

        * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
        case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.

2004-10-01  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)

        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
        (HTMLFrameElementImpl::isURLAllowed): Ditto.
        (HTMLFrameElementImpl::openURL): Ditto.

2004-10-01  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page

        I introduced a major regression where various JavaScript window properties would not be found when I
        fixed bug 3809600.

        * khtml/ecma/kjs_window.h: Added hasProperty.
        * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.

2004-09-30  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"

        Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
        are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
        to worry about it either.

        * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
        two parameters, rather than if there are more than one.

        - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>

        * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
        a signal is only emitted for changes that are not explicitly requested by the caller.

        - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
        not left floating if setStyle decides not to ref it.

        - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base

        * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
        the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
        to ref it.

2004-09-30  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
	
	Added nil check.
	
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setDisplaysWithFocusAttributes):

2004-09-30  Chris Blumenberg  <cblu@apple.com>
	
	Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags

        Reviewed by hyatt.

        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
        (HTMLObjectElementImpl::recalcStyle): ditto

2004-09-30  Darin Adler  <darin@apple.com>

        - rolled out bad image change that caused performance regression

        * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
        Don't reference the new image before doing the assignment.
        This forced an unwanted.

2004-09-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me, coded by Darin

        - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection

        * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
        was used as a distance threshold, but was a negative number. Now make it positive at the start
        of the function (and make a couple related changes).

2004-09-29  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object

	The fix has two parts, 1) make onblur and onfocus work for windows, 
        and 2), allow the dashboard to override WebKit's special key/non-key
        behaviors.

        Reviewed by Chris.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setDisplaysWithFocusAttributes):

2004-09-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bug:
        
        <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window, 
        it doesn't break and just runs off the right side

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): Ditto.
        * khtml/css/cssproperties.c: Generated file.
        * khtml/css/cssproperties.h: Ditto.
        * khtml/css/cssproperties.in: Add word-wrap property.
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
        * khtml/css/cssvalues.c: Generated file.
        * khtml/css/cssvalues.h: Ditto.
        * khtml/css/cssvalues.in: Add break-word value.
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
        * khtml/rendering/render_style.cpp:
        (StyleCSS3InheritedData): Add support for new wordWrap property.
        (StyleCSS3InheritedData::operator==): Ditto.
        (RenderStyle::diff): Ditto.
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::wordWrap): Ditto.
        (khtml::RenderStyle::setWordWrap): Ditto.
        (khtml::RenderStyle::initialWordWrap): Ditto.

2004-09-29  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- consolidated OS version checks into prefix header

        * WebCorePrefix.h:
        * khtml/rendering/render_canvasimage.cpp:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject roleDescription]):
        (-[KWQAccObject accessibilityActionDescription:]):
        * kwq/KWQComboBox.mm:
        (QComboBox::QComboBox):
        * kwq/KWQFoundationExtras.h:

2004-09-29  David Hyatt  <hyatt@apple.com>

	Make sure <br>s always get line boxes.  Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
	that follow <br>s.
	
        Reviewed by kocienda

        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::isCandidate):
        * khtml/rendering/render_br.cpp:
        (RenderBR::RenderBR):
        (RenderBR::createInlineBox):
        (RenderBR::baselinePosition):
        (RenderBR::lineHeight):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_line.cpp:
        (khtml::InlineFlowBox::placeBoxesVertically):
        * khtml/rendering/render_line.h:
        (khtml::InlineBox::isText):
        (khtml::InlineFlowBox::addToLine):
        * khtml/rendering/render_text.cpp:
        (RenderText::detach):
        * khtml/rendering/render_text.h:
        (khtml::InlineTextBox:::InlineRunBox):
        (khtml::InlineTextBox::isInlineTextBox):
        (khtml::InlineTextBox::isText):
        (khtml::InlineTextBox::setIsText):
        * khtml/xml/dom_textimpl.cpp:
        (TextImpl::rendererIsNeeded):
        * kwq/KWQRenderTreeDebug.cpp:
        (operator<<):

2004-09-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom

        * khtml/editing/selection.cpp:
        (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
        from a Selection. Return an empty Range when there is an exception.

        Fix for this bug:
        
        <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of 
        visible area of view with arrow keys

        * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
        Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
        (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
        (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
        (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
        is also calculated here.
        (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a 
        layout if needed.
        (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::paintCaret): Ditto.
        (khtml::Selection::validate): Ditto.
        * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and 
        expectedVisibleRect accessor.
        * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
        this is not only about making the caret visible anymore. Now it can reveal the varying
        end of the selection when scrolling with arrow keys.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to 
        ensureSelectionVisible name change.
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
        (-[WebCoreBridge insertNewline]): Ditto
        (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
        (-[WebCoreBridge deleteKeyPressed]): Ditto
        (-[WebCoreBridge ensureSelectionVisible]): Ditto

2004-09-29  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bug:
        
        <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
        
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
        and range selections correctly.
        * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
        * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit 
        method we use to do the centering, -[NSView scrollRectToVisible:],  does not alter 
        the view if the rectangle passed to it is already in view. When forceCentering is
        true, extra math is done to make scrollRectToVisible center the rectangle we want.
        (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to 
        _KWQ_scrollRectToVisible:forceCentering:
        (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
        (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
        (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
        math to implement the forceCentering effect.
        * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
        * kwq/KWQScrollView.mm:
        (QScrollView::ensureRectVisibleCentered): Ditto.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart. 

2004-09-28  Chris Blumenberg  <cblu@apple.com>

	Fixed: WebArchives begin with "<#document/>"

        Reviewed by hyatt.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML

2004-09-28  Chris Blumenberg  <cblu@apple.com>

	Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
	
        Reviewed by mjs.

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toString):
        (NodeImpl::recursive_toHTML):
        * khtml/xml/dom_nodeimpl.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge markupStringFromNode:nodes:]):

2004-09-28  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow

        * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
        (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
        of blowing away the selection.
        (khtml::EditCommand::unapply): Blow away the selection instead of marking misspellings.
        (khtml::EditCommand::reapply): Ditto.
        (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
        on inserted text; this doesn't match NSText behavior.
        (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
        function for greater clarity on what this actually does.

        * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
        "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
        boolean. This is a step on the way to simplifying how this works. Moved the code from the
        notifySelectionChanged function here, since there was no clear line between the two functions.
        (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
        the case of an empty selection.
        (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
        (KHTMLPart::unappliedEditing): Ditto.
        (KHTMLPart::reappliedEditing): Ditto.

        * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
        markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
        (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
        bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
        (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
        and changed logic so it won't mark misspellings in a word if the selection still starts in that word.

        - implemented empty-cells property in computed style

        * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.

2004-09-28  Chris Blumenberg  <cblu@apple.com>

	Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.

        Fixed by Darin, reviewed by me.

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): tweaks
        * kwq/KWQValueListImpl.mm:
        (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
        (KWQValueListImpl::KWQValueListPrivate::copyList):
        (KWQValueListImpl::clear):
        (KWQValueListImpl::appendNode):
        (KWQValueListImpl::prependNode):
        (KWQValueListImpl::removeEqualNodes):
        (KWQValueListImpl::containsEqualNodes):
        (KWQValueListImpl::removeIterator):
        (KWQValueListImpl::lastNode):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge nodesFromList:]): use iterator, not at()

2004-09-28  Richard Williamson   <rjw@apple.com>

	More dashboard region changes for John.

        <rdar://problem/3817421> add getter for dashboard regions (debugging)
        
        <rdar://problem/3817417> NSScrollView need autoregions for dashboard
        
        <rdar://problem/3817388> should have short form form control regions
        
        <rdar://problem/3817477> visibility does not work with dashboard control regions

        Reviewed by Hyatt.

        * WebCore-combined.exp:
        * WebCore.exp:
        * khtml/css/cssparser.cpp:
        (skipCommaInDashboardRegion):
        (CSSParser::parseDashboardRegions):
        * khtml/khtmlview.cpp:
        (KHTMLView::updateDashboardRegions):
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):
        (RenderObject::addDashboardRegions):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::setDashboardRegions):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::setDashboardRegionsDirty):
        (DOM::DocumentImpl::dashboardRegionsDirty):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::paint):
        (KWQKHTMLPart::dashboardRegionsDictionary):
        (KWQKHTMLPart::dashboardRegionsChanged):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dashboardRegions]):
        * kwq/WebDashboardRegion.h:
        * kwq/WebDashboardRegion.m:
        (-[WebDashboardRegion description]):

2004-09-28  John Sullivan  <sullivan@apple.com>

        Reviewed by Chris.

        - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank 
        because of <script type="application/x-javascript">

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::parseTag):
        add "application/x-javascript" to the list of legal scripting types. Mozilla
        accepts this, but WinIE doesn't.
        
        * layout-tests/fast/tokenizer/004.html:
        updated layout test to test some application/xxxx types

2004-09-27  David Hyatt  <hyatt@apple.com>

	Reworked lists to work well with RTL text.  Specifically the following bugs have been fixed:

	(1) All bullets use the same offset constant now (a padding of 7 pixels).  Before, images used 5 and others used 7.
	(2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
	(3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
	(4) RTL lists now properly apply padding and margin to the right side rather than the left.  This was done by adding
	-khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
	
        Reviewed by darin

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyDeclarations):
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/css/html4.css:
        * khtml/rendering/bidi.cpp:
        (khtml::BidiIterator::direction):
        * khtml/rendering/render_list.cpp:
        (RenderListItem::getAbsoluteRepaintRect):
        (RenderListMarker::paint):
        (RenderListMarker::calcMinMaxWidth):
        (RenderListMarker::lineHeight):
        (RenderListMarker::baselinePosition):

2004-09-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin
        
        Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
        the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
        undesirable since implicit use of the the constructor involved making the affinity choice, something
        which should be done explicitly.

        * khtml/editing/selection.cpp:
        (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
        (khtml::Selection::modifyMovingRightForward): Ditto.
        (khtml::Selection::modifyExtendingLeftBackward): Ditto.
        (khtml::Selection::modifyMovingLeftBackward): Ditto.
        (khtml::Selection::modify): Ditto.
        (khtml::Selection::validate): Ditto.
        * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
        * khtml/editing/visible_units.cpp: Ditto.
        (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
        (khtml::nextWordBoundary): Ditto.
        (khtml::previousLinePosition): Ditto.
        (khtml::nextLinePosition): Ditto.
        * kwq/KWQKHTMLPart.mm: Ditto.
        (KWQKHTMLPart::findString): Ditto.
        (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
        (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
        (KWQKHTMLPart::updateSpellChecking): Ditto.

2004-09-28  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed a storage leak discovered by code inspection

        * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
        the parser's current node in the rare case where it still has one.

2004-09-27  David Hyatt  <hyatt@apple.com>

	Don't allow nested headers when only inlines are in between them.  Fixes a hang related to pathological nesting
	on magicmethodsonline.com.
	
        Reviewed by darin

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::parseToken):
        (KHTMLParser::processCloseTag):
        (KHTMLParser::isHeaderTag):
        (KHTMLParser::popNestedHeaderTag):
        * khtml/html/htmlparser.h:

2004-09-27  Kevin Decker  <kdecker@apple.com>

        Reviewed by John.

        * khtml/css/css_base.cpp:
        (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names. 

2004-09-27  David Hyatt  <hyatt@apple.com>

	Fix style sharing so that it doesn't share when it shouldn't.  Partially fixes 3671516, table cells don't update
	their color on macosx.apple.com.

	Fix 3521639, iframe mispositioned on bidi page.  Make sure that when the width of a line exceeds the available line
	width that the spillage out of the block is determined by the direction of the block and not by the text-align value.

	Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
	of 0.

	Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
	
        Reviewed by john

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::locateCousinList):
        (khtml::CSSStyleSelector::elementsCanShareStyle):
        (khtml::CSSStyleSelector::locateSharedStyle):
        * khtml/css/cssstyleselector.h:
        * khtml/html/html_elementimpl.h:
        (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
        (DOM::HTMLElementImpl::inlineStyleDecl):
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::computeHorizontalPositionsForLine):
        * khtml/rendering/render_frames.cpp:
        (RenderFrameSet::layout):
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::calcMinMaxWidth):
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::inlineStyleDecl):
        (DOM::ElementImpl::hasMappedAttributes):

2004-09-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Removed closestRenderedPosition function from Position class and gave this work
        to VisiblePosition instead. However, in order to make the transfer possible,
        VisiblePosition needed upstream and downstream affinities added to its
        constructors. Also moved the EAffinity enum into its own file. Also moved it
        to the khtml namespace.

        Updated several functions which used closestRenderedPosition to use VisiblePosition
        instead.
        
        Also deleted Position::equivalentShallowPosition. This was unused.

        * ForwardingHeaders/editing/text_affinity.h: Added.
        * ForwardingHeaders/editing/visible_position.h: Added.
        * WebCore.pbproj/project.pbxproj: Added new files.
        * khtml/editing/selection.cpp:
        (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
        * khtml/editing/selection.h:
        * khtml/editing/text_affinity.h: Added.
        * khtml/editing/visible_position.cpp:
        (khtml::VisiblePosition::VisiblePosition):
        (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
        (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
        downstream checks for visible position. Renamed to describe this more clearly.
        * khtml/editing/visible_position.h:
        * khtml/editing/visible_units.cpp:
        (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
        (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::closestRenderedPosition): Removed.
        * khtml/xml/dom_position.h: Removed two functions mentioned above.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
        * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
        * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
        * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
        * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.

2004-09-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin and Maciej

        Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
        at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
        each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
        these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
        been emptied and are being removed.

        For the remainder of files, perform the mechanical changes necessary to make everything
        compile and run as before.

        * WebCore.pbproj/project.pbxproj
        * khtml/editing/htmlediting.cpp
        * khtml/editing/htmlediting.h
        * khtml/editing/htmlediting_impl.cpp: Removed.
        * khtml/editing/htmlediting_impl.h: Removed.
        * khtml/editing/jsediting.cpp
        * khtml/khtml_part.cpp
        (KHTMLPart::openURL)
        (KHTMLPart::lastEditCommand)
        (KHTMLPart::appliedEditing)
        (KHTMLPart::unappliedEditing)
        (KHTMLPart::reappliedEditing)
        (KHTMLPart::applyStyle):
        * khtml/khtml_part.h
        * khtml/khtmlpart_p.h
        * kwq/KWQEditCommand.h
        * kwq/KWQEditCommand.mm
        (-[KWQEditCommand initWithEditCommandImpl:])
        (+[KWQEditCommand commandWithEditCommandImpl:])
        (-[KWQEditCommand impl])
        * kwq/KWQKHTMLPart.h
        * kwq/KWQKHTMLPart.mm
        (KWQKHTMLPart::registerCommandForUndo)
        (KWQKHTMLPart::registerCommandForRedo)
        * kwq/WebCoreBridge.mm
        (-[WebCoreBridge undoEditing:])
        (-[WebCoreBridge redoEditing:])
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
        (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
        (-[WebCoreBridge deleteSelectionWithSmartDelete:])

2004-09-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)

        * khtml/ecma/kjs_html.h: Added width and height.
        * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
        * khtml/ecma/kjs_html.lut.h: Regenerated.

        - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
          something when the use count hits 0

        * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
        decrementing use count on old object.

2004-09-26  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement

        * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
        as part of the HTML editing work.

        * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
        code. Later this might need to be different per-node, but at the moment that does not seem to be so.

        * khtml/ecma/kjs_dom.cpp:
        (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
        having a special case for the string "null" in the DOM implementation.
        (DOMDOMImplementationProtoFunc::tryCall): Ditto.

        - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText        

        * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
        iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.

        - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly

        * khtml/html/html_elementimpl.h: Added cloneNode override.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
        (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
        (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
        (HTMLElementImpl::outerText): Tweaked comment.

        - other cleanup

        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::cloneNode): Removed an uneeded type cast.
        (XMLElementImpl::cloneNode): Ditto.

2004-09-24  Kevin Decker  <kdecker@apple.com>

        Reviewed by Maciej.

	<rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]

        * khtml/css/css_base.cpp:
        (CSSSelector::selectorText): Properly returns Class Selector names.  
	Before we would get *[CLASS"foo"] instead of .foo

2004-09-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
        before passing off to the RenderCanvas for drawing.
        * layout-tests/editing/selection/select-all-004-expected.txt: Added.
        * layout-tests/editing/selection/select-all-004.html: Added.

2004-09-24  John Sullivan  <sullivan@apple.com>

        Reviewed by Maciej.
        
        - fixed <rdar://problem/3528339> Turn on full keyboard access shows 
        invisible <input> elements

        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLGenericFormElementImpl::isFocusable):
        reject elements that have zero width or height, even if they aren't hidden

2004-09-24  Maciej Stachowiak  <mjs@apple.com>

	- fixed deployment build

        Reviewed by Ken.

        * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
	to match prototype.

2004-09-24  David Hyatt  <hyatt@apple.com>

	Fix for 3800316, test 37 for tables is failing on the layout tests.  Make sure we don't incorrectly match
	non-HTML elements with HTML tag selectors in CSS.
	
        Reviewed by rjw

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::checkOneSelector):

2004-09-23  David Hyatt  <hyatt@apple.com>

	Fix for 3601920, CSS "tabs" not switching properly on zen garden design.  Improve the repainting to account
	for layer changes of z-index that necessitate an invalidation.
	
        Reviewed by kocienda

        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):
        * khtml/rendering/render_style.cpp:
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::):

2004-09-24  Chris Blumenberg  <cblu@apple.com>

	Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
	<rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang

        Reviewed by rjw.

        * khtml/dom/dom_string.h:
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::startMarkup): new, factored out from recursive_toString
        (NodeImpl::endMarkup): ditto
        (NodeImpl::recursive_toString): call factored out methods
        * khtml/xml/dom_nodeimpl.h:

=== Safari-165 ===

2004-09-24  Ken Kocienda  <kocienda@apple.com>

        Hyatt made an improvement in the render tree which caused the results
        to get a little thinner.

        * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt
        * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt

2004-09-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bug:
        
        <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge. 
        Found by code inspection.

2004-09-23  John Sullivan  <sullivan@apple.com>

        Reviewed by Maciej.
        
        - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript 
        guarded by a deliberately bogus "language" attribute (www.riibe.com)

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::parseTag):
        Check for language attribute of <script> tag in a way that matches WinIE.
        Previously we were far too permissive.

2004-09-23  David Hyatt  <hyatt@apple.com>

	Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
	repainting happened.

        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::repaintViewRectangle):

2004-09-23  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
	Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling

        Reviewed by Chris.

        * khtml/css/css_valueimpl.cpp:
        (CSSPrimitiveValueImpl::cssText):
        * khtml/css/css_valueimpl.h:
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (skipCommaInDashboardRegion):
        (CSSParser::parseDashboardRegions):
        * khtml/khtmlview.cpp:
        (KHTMLView::layout):
        (KHTMLView::updateDashboardRegions):
        * khtml/khtmlview.h:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::scrollToOffset):
        * khtml/rendering/render_object.cpp:
        (RenderObject::addDashboardRegions):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dashboardRegionsChanged):
        * kwq/WebDashboardRegion.h:
        * kwq/WebDashboardRegion.m:
        (-[WebDashboardRegion initWithRect:clip:type:]):
        (-[WebDashboardRegion dashboardRegionClip]):
        (-[WebDashboardRegion description]):

2004-09-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        * khtml/xml/dom_position.cpp:
        (DOM::Position::inRenderedContent): Make the "empty block" check the same as the one
        use in visible position. This fixes a recent regression which broke up and down
        arrowing between blocks with an empty block in between.

2004-09-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3685235> REGRESSION (Mail): links are not properly editable
        
	* khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow
	the normal focus rules so the link does not swallow focus when you arrow key
	or drag-select into it.

2004-09-23  Darin Adler  <darin@apple.com>

        - added test for the DOM::Range bug fixed recently

        * layout-tests/fast/dom/clone-contents-0-end-offset-expected.txt: Added.
        * layout-tests/fast/dom/clone-contents-0-end-offset.html: Added.

2004-09-23  David Hyatt  <hyatt@apple.com>

	Fix for hitlist bug, crash when deleting.  

	Also fix repaint bug when inlines are inside overflow:auto/scroll regions.
	
        Reviewed by kocienda

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
        (khtml::DeleteSelectionCommandImpl::doApply):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::removeChild):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::getAbsoluteRepaintRect):

2004-09-23  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3527840> reproducible crash at johnbrown.v32.qikker.com 
        (nil-deref in NodeImpl::dispatchEvent)

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchEvent):
        guard against document or document->document() being nil

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - added new VisibleRange class; not used yet

        * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
        * khtml/editing/visible_range.cpp: Added.
        * khtml/editing/visible_range.h: Added.

        - tweaks

        * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
        Use switch statement instead of if statement so we get a warning if we ever add a new
        granularity.

        * khtml/editing/selection.h: khtml, not DOM, namespace
        * khtml/editing/visible_position.h: Ditto.

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
        (NodeImpl::dispatchGenericEvent): Ditto.
        (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
        (NodeImpl::dispatchMouseEvent): Ditto.
        (NodeImpl::dispatchUIEvent): Ditto.

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed some minor mistakes discovered by code inspection

        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
        Grabbing focus when we get the selection is also probably something that should be
        conditional, since you can use a WebView in a mode where it can have selection even
        when not first responder, ala NSTextView.
        (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
        Not sure if it's ever important to grab focus when making the caret visible, but by
        code inspection it seemed that was unlikely to do harm.

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)

        * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        Added CSS_PROP_TABLE_LAYOUT case.

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com

        Reversing the order of scope caused us to get and set too many properties in the window
        object; in the case of this bug setting value ended up setting a window.value property
        instead of the value of the <input> element.

        * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
        Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
        "need this to match IE behavior" comment in the file, which I believe is incorrect.
        * khtml/ecma/kjs_window.cpp: Ditto.

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0

        * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
        checks to prevent this function from crashing if offsets are greater than the
        number of child nodes. Added a special case for offset 0 in one case that has a loop
        that won't work correctly for that case.

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)

        This was mostly fixed by changes I made recently, but using the test case in the bug
        I discovered one regression I introduced and another problem that wasn't fixed yet.
        This change fixes both.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
        in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
        which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
        different flavors of word boundary to expand to words we touch in both directions.
        (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
        the anomalies reported in the bug report go away.

2004-09-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick

        Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.

        * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.

2004-09-23  Darin Adler  <darin@apple.com>

        - checked in a new file I forgot

        * khtml/editing/text_granularity.h: Added.

2004-09-22  Darin Adler  <darin@apple.com>

        - renamed

            DOM::CaretPosition -> khtml::VisibleRange
            DOM::Selection     -> khtml::Selection

        - moved all the functions in visible_units.h from DOM to khtml namespace
        - moved the one thing from Selection that KHTMLPart uses into its own header

        * WebCore.pbproj/project.pbxproj: Added text_granularity.h.

        * ForwardingHeaders/editing/selection.h: Added.
        * WebCore-combined.exp: Regenerated.
        * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.

        * khtml/ecma/kjs_window.cpp: Update names and namespaces.
        * khtml/editing/htmlediting.cpp: Ditto.
        * khtml/editing/htmlediting.h: Ditto.
        * khtml/editing/htmlediting_impl.cpp: Ditto.
        * khtml/editing/htmlediting_impl.h: Ditto.
        * khtml/editing/jsediting.cpp: Ditto.
        * khtml/editing/selection.cpp: Ditto.
        * khtml/editing/selection.h: Ditto.
        * khtml/editing/visible_position.cpp: Ditto.
        * khtml/editing/visible_position.h: Ditto.
        * khtml/editing/visible_text.h: Ditto.
        * khtml/editing/visible_units.cpp: Ditto.
        * khtml/editing/visible_units.h: Ditto.
        * khtml/khtml_part.cpp: Ditto.
        * khtml/khtml_part.h: Ditto.
        * khtml/khtmlpart_p.h: Ditto.
        * khtml/rendering/render_block.cpp: Ditto.
        * khtml/xml/dom_docimpl.h: Ditto.
        * khtml/xml/dom_nodeimpl.cpp: Ditto.
        * kwq/KWQKHTMLPart.h: Ditto.
        * kwq/KWQKHTMLPart.mm: Ditto.
        * kwq/KWQRenderTreeDebug.cpp: Ditto.
        * kwq/WebCoreBridge.mm: Ditto.

2004-09-22  Darin Adler  <darin@apple.com>

        * ForwardingHeaders/*: Use import instead of include.

2004-09-22  Darin Adler  <darin@apple.com>

        - renamed these files:

            misc/khtml_text_operations.h   -> editing/visible_text.h
            misc/khtml_text_operations.cpp -> editing/visible_text.cpp
            xml/dom_caretposition.cpp      -> editing/visible_position.cpp
            xml/dom_caretposition.h        -> editing/visible_position.h
            xml/dom_selection.cpp          -> editing/selection.cpp
            xml/dom_selection.h            -> editing/selection.h

        - broke out the word/line/paragraph part of visible_position.h into visible_units.h
        - removed some unnecessary includes from some header files to reduce the number of
          files that trigger "building the world"

        * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.

        * ForwardingHeaders/editing/jsediting.h: Added.
        * ForwardingHeaders/editing/visible_text.h: Added.
        * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
        * ForwardingHeaders/xml/dom_caretposition.h: Removed.
        * ForwardingHeaders/xml/dom_selection.h: Removed.

        * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
        * khtml/editing/htmlediting.cpp: Ditto.
        * khtml/editing/htmlediting.h: Ditto.
        * khtml/editing/htmlediting_impl.cpp: Ditto.
        * khtml/editing/htmlediting_impl.h: Ditto.
        * khtml/editing/jsediting.cpp: Ditto.
        * khtml/editing/selection.cpp: Ditto.
        * khtml/editing/selection.h: Ditto.
        * khtml/editing/visible_position.cpp: Ditto.
        * khtml/editing/visible_position.h: Ditto.
        * khtml/editing/visible_text.cpp: Ditto.
        * khtml/editing/visible_text.h: Ditto.
        * khtml/editing/visible_units.cpp: Added.
        * khtml/editing/visible_units.h: Added.
        * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
        * khtml/khtml_part.cpp: Ditto.
        * khtml/khtml_part.h: Ditto.
        * khtml/khtmlpart_p.h: Ditto.
        * khtml/khtmlview.cpp: Ditto.
        * khtml/misc/khtml_text_operations.cpp: Removed.
        * khtml/misc/khtml_text_operations.h: Removed.
        * khtml/rendering/render_block.cpp: Updated or removed #include lines.
        * khtml/xml/dom2_rangeimpl.cpp: Ditto.
        * khtml/xml/dom_caretposition.cpp: Removed.
        * khtml/xml/dom_caretposition.h: Removed.
        * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
        * khtml/xml/dom_docimpl.h: Ditto.
        * khtml/xml/dom_elementimpl.cpp: Ditto.
        * khtml/xml/dom_nodeimpl.cpp: Ditto.
        * khtml/xml/dom_position.cpp: Ditto.
        * khtml/xml/dom_selection.cpp: Removed.
        * khtml/xml/dom_selection.h: Removed.
        * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
        * kwq/KWQKHTMLPart.h: Ditto.
        * kwq/KWQRenderTreeDebug.cpp: Ditto.
        * kwq/WebCoreBridge.mm: Ditto.

2004-09-22  Richard Williamson   <rjw@apple.com>
	
	Pass dashboard regions up to WebKit.
	
	Don't collect regions from RenderTexts.

	Made more args and return types references to avoid
	copying value lists.

        Reviewed by Hyatt.

        * WebCore.pbproj/project.pbxproj:
        * khtml/khtmlview.cpp:
        (KHTMLView::layout):
        * khtml/rendering/render_object.cpp:
        (RenderObject::collectDashboardRegions):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::dashboardRegions):
        (DocumentImpl::setDashboardRegions):
        * khtml/xml/dom_docimpl.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::didFirstLayout):
        (KWQKHTMLPart::dashboardRegionsChanged):
        * kwq/WebCoreBridge.h:
        * kwq/WebDashboardRegion.h: Added.
        * kwq/WebDashboardRegion.m: Added.
        (-[WebDashboardRegion initWithRect:type:]):
        (-[WebDashboardRegion copyWithZone:]):
        (-[WebDashboardRegion dashboardRegionRect]):
        (-[WebDashboardRegion dashboardRegionType]):
        (-[WebDashboardRegion description]):

2004-09-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this hitlist bug:
        
        <rdar://problem/3805486> REGRESSION (Mail): Empty block elements can cause the caret to get "stuck" in one spot

        * khtml/xml/dom_caretposition.cpp:
        (DOM::CaretPosition::isCandidate): You can no longer caret into empty blocks with no height.
        Also did a little clean up in this function.
        * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Regenerated expected results. 
        This test was actually failing and had bogus results checked in!
        * layout-tests/editing/selection/select-all-003-expected.txt: Regenerated expected results.

2004-09-22  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag

        Reviewed by john.

        * khtml/editing/htmlediting.cpp:
        (khtml::MoveSelectionCommand::MoveSelectionCommand): take smartMove arg
        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::deleteSelection): take smartDelete arg
        (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): take smartMove arg
        (khtml::MoveSelectionCommandImpl::doApply): pass smartMove for smartDelete and smartReplace
        * khtml/editing/htmlediting_impl.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): take smartMove arg

2004-09-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): New overloaded 
	version of this function, one that takes a flag to determine whether to
	perform a document updateLayout() call before querying the style system.
        * khtml/css/css_computedstyle.h:
        (DOM::EUpdateLayout): Give a symbolic constant to true/false for the 
	purpose of the new call to getPropertyCSSValue.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::StyleChange::currentlyHasStyle): Pass DoNotUpdateLayout to call to
	getPropertyCSSValue.
        (khtml::CompositeEditCommandImpl::applyTypingStyle): Add in top-level calls
	to updateLayout before doing style changes that now do not update styles
	themselves.
        (khtml::ApplyStyleCommandImpl::doApply): Ditto.
        (khtml::ApplyStyleCommandImpl::removeCSSStyle): Pass DoNotUpdateLayout to call to
        getPropertyCSSValue.
        (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Remove this dead code.
        * khtml/editing/htmlediting_impl.h: Ditto.

2004-09-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        * WebCore.pbproj/project.pbxproj: New files added.
        * khtml/khtml_part.cpp:
        (KHTMLPart::clearSelection): No longer calls setFocusIfNeeded.
        (KHTMLPart::slotClearSelection): Merged old implementation from this function to
        clearSelection. Now just calls clearSelection. Also put in !APPLE_CHANGES since
        we do not call it.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::setFocusNode): Add some code to determine when setting the focus should
        clear the selection.
        * kwq/KWQWidget.mm:
        (QWidget::hasFocus): Call _webcore_effectiveFirstResponder to get view to check for focus.
        (QWidget::setFocus): Ditto.
        * kwq/WebCoreBridge.mm: 
        (-[WebCoreBridge deselectText]): Called slotClearSelection and should have been. Now calls
        clearSelection.
        * kwq/WebCoreView.h: Added.
        * kwq/WebCoreView.m: Added.
        (-[NSView _webcore_effectiveFirstResponder]): New method to yield the correct responder
        to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent 
        unwanted firstResponder switching.
        (-[NSClipView _webcore_effectiveFirstResponder]): Ditto.
        (-[NSScrollView _webcore_effectiveFirstResponder]): Ditto.

2004-09-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3805137> REGRESSION: Cannot search on pricetool.com

        The problem here is that residual style handling can cause an
	element associated with a misnested form to lose the association,
	because it can become detached and then reattached in this
	case. So we need to maintain the association.
	
        * khtml/html/html_formimpl.h: Added list of dormant elements to form,
	and dormant bit to generic form element.
	* khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::~HTMLFormElementImpl): Clear m_form field for
	dormant elements too.
        (DOM::HTMLFormElementImpl::registerFormElement): Remove from dormant list
	in addition to adding to main list.
        (DOM::HTMLFormElementImpl::removeFormElement): Remove from both lists.
        (DOM::HTMLFormElementImpl::makeFormElementDormant): New method, remove from
	main list, add to dormant list.
        (DOM::HTMLGenericFormElementImpl::HTMLGenericFormElementImpl): Initialize
	dormant bit to false.
        (DOM::HTMLGenericFormElementImpl::insertedIntoDocument): If the element is
	dormant and has a form, re-register it and clear the dormant bit.
        (DOM::HTMLGenericFormElementImpl::removedFromDocument): If the document has
	a form, tell the form it is dormant and set the dormant bit.

2004-09-22  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3811187> REGRESSION (Mail): Control-click past end of document does not spell check last word

        Reviewed by kocienda.

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::validate): if at the end of the document, expand to the left.

2004-09-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken and John.

	<rdar://problem/3759228> REGRESSION (Mail): stray characters when entering text via input method right after newline
        
	* khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::inputText): Add an optional 
	selectInsertedText parameter.
        (khtml::ReplaceSelectionCommandImpl::doApply): Let the inputText operation
	select the text when inserting plain text, because it already knows all the right
	information to do so, and this function doesn't (sometimes text is inserted
	before the start of the old selection, not after!)
        * khtml/editing/htmlediting_impl.h:

2004-09-22  Richard Williamson   <rjw@apple.com>

	More tweaks to dashboard regions.

	Move dashboard regions list into css3NonInheritedData so it will be shared
	by all styles that don't modify the empty region list.

	Make the initial value for dashboard region list a static to minimize allocations
	of empty lists.

	Make marquee and flex style accessor functions const.

        Reviewed by Hyatt.

        * khtml/rendering/render_style.cpp:
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::opacity):
        (khtml::RenderStyle::boxAlign):
        (khtml::RenderStyle::boxDirection):
        (khtml::RenderStyle::boxFlexGroup):
        (khtml::RenderStyle::boxOrdinalGroup):
        (khtml::RenderStyle::boxOrient):
        (khtml::RenderStyle::boxPack):
        (khtml::RenderStyle::marqueeIncrement):
        (khtml::RenderStyle::marqueeSpeed):
        (khtml::RenderStyle::marqueeLoopCount):
        (khtml::RenderStyle::marqueeBehavior):
        (khtml::RenderStyle::marqueeDirection):
        (khtml::RenderStyle::dashboardRegions):
        (khtml::RenderStyle::setDashboardRegions):
        (khtml::RenderStyle::setDashboardRegion):
        (khtml::RenderStyle::initialDashboardRegions):

2004-09-22  David Hyatt  <hyatt@apple.com>

	Fix for 3802766, entire view redrawn in Blot while typing.  Don't needlessly create text nodes just to find
	out the font for the caret position.
	
        Reviewed by darin

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection):

2004-09-21  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste
	<rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace

        Reviewed by darin.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::DeleteSelectionCommand): take smartDelete parameter
        (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take smartReplace parameter
        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): take smartDelete parameter
        (khtml::DeleteSelectionCommandImpl::doApply): delete whitespace before and after selection if necessary
        (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): take smartReplace parameter
        (khtml::ReplaceSelectionCommandImpl::doApply): add whitespace before and after the replacement if necessary
        * khtml/editing/htmlediting_impl.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): take smartReplace parameter
        (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): ditto
        (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): ditto
        (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): ditto
        (-[WebCoreBridge deleteSelectionWithSmartDelete:]): take smartDelete parameter

2004-09-21  Richard Williamson   <rjw@apple.com>

	More dashboard region work.

	Added support for computed style and cssText for new region property.
	Added restriction on length types allowed in region functions.
	Added initial and inheritance support for -apple-dashboard-region.

        Reviewed by Hyatt.

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        * khtml/css/css_valueimpl.cpp:
        (CSSPrimitiveValueImpl::cssText):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseDashboardRegions):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/rendering/render_object.cpp:
        (RenderObject::addDashboardRegions):
        * khtml/rendering/render_style.cpp:
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::StyleDashboardRegion::operator==):
        (khtml::RenderStyle::dashboardRegions):
        (khtml::RenderStyle::setDashboardRegions):
        (khtml::RenderStyle::initialDashboardRegions):

2004-09-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed problem where our updateLayout call ignores pending stylesheets all the time

        * khtml/xml/dom_docimpl.h: Added updateLayoutIgnorePendingStylesheets.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateLayout): Took out the "ignore pending stylesheets" business here.
        (DocumentImpl::updateLayoutIgnorePendingStylesheets): Put it in here.

        * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Call the new
        updateLayoutIgnorePendingStylesheets function.
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::getValueProperty): Ditto.
        (KJS::HTMLElement::putValue): Ditto.
        * khtml/ecma/kjs_views.cpp: (DOMAbstractViewFunc::tryCall): Ditto.
        * khtml/ecma/kjs_window.cpp:
        (Window::updateLayout): Ditto.
        (Selection::get): Ditto.
        (SelectionFunc::tryCall): Ditto.

        * khtml/html/html_imageimpl.h: Add ignorePendingStylesheets boolean parameter.
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::width): Respect new parameter.
        (HTMLImageElementImpl::height): Ditto.

        - tweaks

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Removed unneeded
        explicit "true" parameter to setSelection.
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto.

2004-09-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fix crash when pasting text at the end of the document and then doing an undo

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::EditCommandImpl::apply): Call markMisspellingsInSelection before doing
        the editing operation, and we'll tell setSelection not to unmark the old selection.
        Also call updateLayout before calling appliedEditing so DOM operations in the
        code responding to the selection change will work.
        (khtml::EditCommandImpl::unapply): Ditto.
        (khtml::EditCommandImpl::reapply): Ditto.

        * khtml/khtml_part.h: Added a third parameter to setSelection to tell it whether
        to unmark the old selection. We must pass false when editing, because the old
        selection might have now-invalid offsets inside it.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): Add unmarkOldSelection parameter, and respect it.
        (KHTMLPart::appliedEditing): Pass false for unmarkOldSelection.
        (KHTMLPart::unappliedEditing): Ditto.
        (KHTMLPart::reappliedEditing): Ditto.

2004-09-21  Richard Williamson   <rjw@apple.com>

        Part 2 of the feature requested in
        <rdar://problem/3752791> Dashboard: Need a better solution for control regions
	
        This patch actually collections the regions and converts to absolute coordinates.
        Only remaining piece is to pass over the bridge and up the alley to WebKit
        UI delegate.
 
        Reviewed by Ken.

        * khtml/css/css_valueimpl.h:
        (DOM::CSSPrimitiveValueImpl::getDashboardRegionValue):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::parseDashboardRegions):
        * khtml/css/cssproperties.c:
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/khtmlview.cpp:
        (KHTMLView::layout):
        * khtml/rendering/render_object.cpp:
        (RenderObject::computeDashboardRegions):
        (RenderObject::addDashboardRegions):
        (RenderObject::collectDashboardRegions):
        * khtml/rendering/render_object.h:
        (khtml::DashboardRegionValue::operator==):
        * khtml/rendering/render_style.cpp:
        * khtml/rendering/render_style.h:
        (khtml::StyleDashboardRegion::):
        (khtml::RenderStyle::dashboardRegions):
        (khtml::RenderStyle::setDashboardRegion):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::updateLayout):
        (DocumentImpl::acceptsEditingFocus):
        (DocumentImpl::dashboardRegions):
        (DocumentImpl::setDashboardRegions):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::hasDashboardRegions):
        (DOM::DocumentImpl::setHasDashboardRegions):

2004-09-21  John Sullivan  <sullivan@apple.com>

        Reviewed by Darin.
        
        - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135): 
        Option-tab doesn't always work as expected

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::tabsToAllControls):
        reworked logic to match what we promise in the UI; this worked correctly
        before for regular tabbing, but not for option-tabbing.

        * kwq/KWQButton.mm:
        (QButton::focusPolicy):
        check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
        
        * kwq/KWQComboBox.mm:
        (QComboBox::focusPolicy):
        ditto
        
        * kwq/KWQFileButton.mm:
        (KWQFileButton::focusPolicy):
        ditto
        
        * kwq/KWQListBox.mm:
        (QListBox::focusPolicy):
        ditto

2004-09-21  John Sullivan  <sullivan@apple.com>

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modify):
        initialize xPos to make compiler happy in deployment builds

2004-09-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - some small mechanical improvements to the position and selection classes

        * khtml/xml/dom_position.h: Added clear(), startPosition(), and endPosition().
        * khtml/xml/dom_position.cpp:
        (DOM::Position::clear): Added.
        (DOM::startPosition): Added.
        (DOM::endPosition): Added.

        * khtml/xml/dom_caretposition.h: Changed m_position to m_deepPosition. Added clear(),
        removed node() and offset().
        * khtml/xml/dom_caretposition.cpp:
        (DOM::CaretPosition::init): Updated for name change of m_position to m_deepPosition.
        (DOM::CaretPosition::isLastInBlock): Ditto.
        (DOM::CaretPosition::next): Ditto.
        (DOM::CaretPosition::previous): Ditto.
        (DOM::CaretPosition::debugPosition): Ditto.
        (DOM::CaretPosition::formatForDebugger): Ditto.

        * khtml/xml/dom_selection.h: Remove setStart, setEnd, setStartAndEnd, rangeStart, rangeEnd,
        and all the assignXXX functions.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::Selection): Wean from assign functions, get and set data members directly.
        (DOM::Selection::init): Don't clear base, extent, start, and end, since they have constructors.
        (DOM::Selection::operator=): Wean from assign functions, get and set data members directly.
        (DOM::Selection::moveTo): Ditto.
        (DOM::Selection::setModifyBias): Ditto.
        (DOM::Selection::modifyExtendingRightForward): Ditto.
        (DOM::Selection::modifyMovingRightForward): Ditto.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::modify): Ditto.
        (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
        (DOM::Selection::clear): Ditto.
        (DOM::Selection::setBase): Ditto.
        (DOM::Selection::setExtent): Ditto.
        (DOM::Selection::setBaseAndExtent): Ditto.
        (DOM::Selection::toRange): Ditto.
        (DOM::Selection::layoutCaret): Ditto.
        (DOM::Selection::needsCaretRepaint): Ditto.
        (DOM::Selection::validate): Ditto.
        (DOM::Selection::debugRenderer): Ditto.
        (DOM::Selection::debugPosition): Ditto.
        (DOM::Selection::end):

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::advanceToNextMisspelling): Tweaked whitespace.

2004-09-21  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com)

        Reviewed by john.

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget): when no MIME type is specified map from the WMP CLASSID to the WMP MIME type, look for the URL of the content in the URL PARAM tag

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed regression from my recent check-in where misspelled words do not get unmarked when moving the caret
        - changed CaretPosition to hold a Position instead of a node and offset
        - renamed isEmpty to isNull, etc.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::jumpToSelection): Updated for name changes.
        (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
        (KWQKHTMLPart::fontForSelection): Ditto.
        (KWQKHTMLPart::setDisplaysWithFocusAttributes): Ditto.
        (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
        (KWQKHTMLPart::updateSpellChecking): Fixed bug by using LeftWordIfOnBoundary.

        * khtml/xml/dom_position.h: Updated for name changes.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::element): Change to not use a separate null check.
        (DOM::Position::computedStyle): Updated for name changes.
        (DOM::Position::previousCharacterPosition): Ditto.
        (DOM::Position::nextCharacterPosition): Ditto.
        (DOM::Position::equivalentRangeCompliantPosition): Ditto.
        (DOM::Position::equivalentShallowPosition): Ditto.
        (DOM::Position::equivalentDeepPosition): Ditto.
        (DOM::Position::closestRenderedPosition): Ditto.
        (DOM::Position::inRenderedContent): Ditto.
        (DOM::Position::inRenderedText): Ditto.
        (DOM::Position::isRenderedCharacter): Ditto.
        (DOM::Position::rendersInDifferentPosition): Ditto.
        (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
        (DOM::Position::isLastRenderedPositionOnLine): Ditto.
        (DOM::Position::inFirstEditableInRootEditableElement): Ditto.
        (DOM::Position::leadingWhitespacePosition): Ditto.
        (DOM::Position::trailingWhitespacePosition): Ditto.
        (DOM::Position::debugPosition): Ditto.
        (DOM::Position::formatForDebugger): Ditto.

        * khtml/xml/dom_caretposition.h: Change to use m_position, and change names.
        * khtml/xml/dom_caretposition.cpp:
        (DOM::CaretPosition::CaretPosition): Remove code to set up m_node.
        (DOM::CaretPosition::init): Set m_position directly.
        (DOM::CaretPosition::isLastInBlock): Updated for name changes.
        (DOM::CaretPosition::next): Set m_position directly.
        (DOM::CaretPosition::previous): Set m_position directly.
        (DOM::CaretPosition::previousCaretPosition): Updated for name changes.
        (DOM::CaretPosition::nextCaretPosition): Ditto.
        (DOM::CaretPosition::previousPosition): Ditto.
        (DOM::CaretPosition::nextPosition): Ditto.
        (DOM::CaretPosition::atStart): Ditto.
        (DOM::CaretPosition::atEnd): Ditto.
        (DOM::CaretPosition::isCandidate): Ditto.
        (DOM::CaretPosition::debugPosition): Ditto.
        (DOM::CaretPosition::formatForDebugger): Ditto.
        (DOM::startOfWord): Ditto.
        (DOM::endOfWord): Ditto.
        (DOM::previousParagraphPosition): Ditto.
        (DOM::nextParagraphPosition): Ditto.

        * khtml/xml/dom_selection.h: Updated names. Added isCaret and isRange.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modifyMovingRightForward): Updated for name changes.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::modify): Ditto.
        (DOM::Selection::expandUsingGranularity): Ditto.
        (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
        (DOM::Selection::toRange): Ditto.
        (DOM::Selection::layoutCaret): Ditto.
        (DOM::Selection::needsCaretRepaint): Ditto.
        (DOM::Selection::validate): Ditto.
        (DOM::startOfFirstRunAt): Ditto.
        (DOM::endOfLastRunAt): Ditto.
        (DOM::selectionForLine): Ditto.
        (DOM::Selection::formatForDebugger): Ditto.

        * khtml/ecma/kjs_window.cpp:
        (Selection::get): Updated for name changes.
        (Selection::toString): Ditto.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::debugPosition): Ditto.
        (khtml::StyleChange::init): Ditto.
        (khtml::StyleChange::currentlyHasStyle): Ditto.
        (khtml::CompositeEditCommandImpl::deleteSelection): Ditto.
        (khtml::CompositeEditCommandImpl::deleteUnrenderedText): Ditto.
        (khtml::ApplyStyleCommandImpl::doApply): Ditto.
        (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
        (khtml::InputNewlineCommandImpl::doApply): Ditto.
        (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
        (khtml::InputTextCommandImpl::input): Ditto.
        (khtml::ReplaceSelectionCommandImpl::doApply): Ditto.
        (khtml::MoveSelectionCommandImpl::doApply): Ditto.
        (khtml::TypingCommandImpl::doApply): Ditto.
        (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Ditto.
        (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
        * khtml/editing/jsediting.cpp:
        (enabledAnySelection): Ditto.
        (enabledRangeSelection): Ditto.
        * khtml/khtml_part.cpp:
        (KHTMLPart::hasSelection): Ditto.
        (KHTMLPart::setFocusNodeIfNeeded): Ditto.
        (KHTMLPart::selectionLayoutChanged): Ditto.
        (KHTMLPart::timerEvent): Ditto.
        (KHTMLPart::isPointInsideSelection): Ditto.
        (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::handleMousePressEventSingleClick): Ditto.
        (KHTMLPart::handleMouseMoveEventSelection): Ditto.
        (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
        (KHTMLPart::selectionHasStyle): Ditto.
        (KHTMLPart::selectionComputedStyle): Ditto.
        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateSelection): Ditto.
        * khtml/xml/dom_positioniterator.cpp:
        (DOM::PositionIterator::peekPrevious): Ditto.
        (DOM::PositionIterator::peekNext): Ditto.
        (DOM::PositionIterator::atStart): Ditto.
        (DOM::PositionIterator::atEnd): Ditto.
        * khtml/xml/dom_positioniterator.h:
        (DOM::PositionIterator::isEmpty): Ditto.
        * kwq/KWQRenderTreeDebug.cpp:
        (writeSelection): Ditto.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge editableDOMRangeForPoint:]): Ditto.
        (-[WebCoreBridge deleteSelection]): Ditto.
        (-[WebCoreBridge ensureCaretVisible]): Ditto.
        (-[WebCoreBridge rangeOfCharactersAroundCaret]): Ditto.

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3808073> find is broken

        * khtml/misc/khtml_text_operations.h: Add m_pastEndNode and change name of m_endNode to
        m_endContainer to more accurately reflect its purpose.
        * khtml/misc/khtml_text_operations.cpp:
        (khtml::TextIterator::TextIterator): Use pastEnd() for end of iteration, and change to
        handle bad ranges better: just return an empty iterator instead of raising an exception.
        (khtml::TextIterator::advance): Change to use m_pastEndNode to detect the end of iteration.
        (khtml::TextIterator::handleTextNode): Update for name change.
        (khtml::TextIterator::handleTextBox): Ditto.
        (khtml::TextIterator::range): Handle case where m_endContainer is nil.

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::surroundContents): Use offsetInCharacters.
        (DOM::RangeImpl::startNode): Added check for nil start container and use offsetInCharacters.
        (DOM::RangeImpl::pastEndNode): Ditto.

2004-09-20  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3781290> REGRESSION (Mail): Crash in ReplaceSelectionCommandImpl attaching file to new message

        Reviewed by kocienda.

        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): setFocusNodeIfNeeded now works on the current selection so call setFocusNodeIfNeeded after setting the selection
        (KHTMLPart::clearSelection): don't call setFocusNodeIfNeeded with the current selection
        (KHTMLPart::setCaretVisible): ditto
        (KHTMLPart::setFocusNodeIfNeeded): do nothing if the part isn't focused, work with the current selection
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:
        (KHTMLPartPrivate::KHTMLPartPrivate): added m_isFocused
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart): removed _displaysWithFocusAttributes this is replaced by m_isFocused
        (KWQKHTMLPart::setSelectionFromNone): new, code factored out from setDisplaysWithFocusAttributes
        (KWQKHTMLPart::setDisplaysWithFocusAttributes): call setSelectionFromNone
        (KWQKHTMLPart::displaysWithFocusAttributes): now returns m_isFocused
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectionFromNone]): new

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed nil-deref happening often in Mail when I delete

        * khtml/rendering/render_br.cpp: (RenderBR::selectionRect): Check for nil lastLeafChild.
        Dave may want to figure out why it's nil and do a different fix later.

2004-09-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/3672101> HANG: typing into login field at dws-direkt.deutsche-bank.de (infinite recursion)
        
	* khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::defaultEventHandler): Copy the list of handlers
	before firing any of them, in case a handler affects the list of
	event handlers.

2004-09-20  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3429921> obey PARAM tags inside of OBJECT tags when necessary
	<rdar://problem/3515685> Object tag in Java 1.4.1 / Safari doesn't recognize params

        Reviewed by darin.

        * khtml/khtml_part.cpp:
        (KHTMLPart::requestFrame): take 2 parameter arrays rather than 1 which will have to be parsed
        (KHTMLPart::requestObject): ditto
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:
        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget): use PARAM tags when there is no EMBED specified
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::createPart): call renamed bridge method
        * kwq/KWQKJavaAppletWidget.mm:
        (KJavaAppletWidget::KJavaAppletWidget): ditto
        * kwq/KWQStringList.h:
        * kwq/KWQStringList.mm:
        (QStringList::getNSArray): return a const array
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge URLWithAttributeString:]): renamed to match API

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions)
        - fixed <rdar://problem/3735055> REGRESSION (Mail): WebCore double click rules treat style change as a boundary
        - fixed <rdar://problem/3789939> REGRESSION (Mail): double-clicking on border whitespace selects space plus word before/after
        - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word
        - fixed <rdar://problem/3806604> REGRESSION (164): Triple-click sometimes selects extra characters
        - fixed <rdar://problem/3806996> REGRESSION (125-162): Triple-click in <pre> tagged text behaves oddly (leuf.net)

        * khtml/xml/dom_caretposition.h: Added a lot of new functions. Removed implicit conversion operator
        that converts from CaretPosition to Position.
        * khtml/xml/dom_caretposition.cpp:
        (DOM::CaretPosition::CaretPosition): Change to call deepEquivalent so it works without the implicit
        Position conversion operator.
        (DOM::CaretPosition::operator=): Ditto.
        (DOM::CaretPosition::next): Ditto.
        (DOM::CaretPosition::previous): Ditto.
        (DOM::CaretPosition::setPosition): Added an assertion.
        (DOM::start): Added.
        (DOM::end): Added.
        (DOM::setStart): Added.
        (DOM::setEnd): Added.
        (DOM::previousWordBoundary): Added.
        (DOM::nextWordBoundary): Added.
        (DOM::startWordBoundary): Added.
        (DOM::startOfWord): Added.
        (DOM::endWordBoundary): Added.
        (DOM::endOfWord): Added.
        (DOM::previousWordPositionBoundary): Added.
        (DOM::previousWordPosition): Added.
        (DOM::nextWordPositionBoundary): Added.
        (DOM::nextWordPosition): Added.
        (DOM::previousLinePosition): Added.
        (DOM::nextLinePosition): Added.
        (DOM::startOfParagraph): Changed function name.
        (DOM::endOfParagraph): Changed function name. Fixed code in includeLineBreak to work around
        the CaretPosition constructor issue for <br>, pass the right parameter for the block flow case,
        and handle <pre> properly.
        (DOM::inSameParagraph): Added.
        (DOM::previousParagraphPosition): Added.
        (DOM::nextParagraphPosition): Added.

        * khtml/xml/dom_position.h: Removed a number of functions no longer used; also made some private.
        * khtml/xml/dom_position.cpp: Removed a number of functions no longer used.

        * khtml/xml/dom_selection.h: Replaced DOCUMENT with DOCUMENT_BOUNDARY. Added overloads of lots
        of functions that take CaretPosition directly. Added overload of modify that takes a parameter
        for vertical distance to help implement pageDown: and friends. Replaced getRepaintRect with
        two new functions named caretRect and caretRepaintRect. Removed nodeIsBeforeNode.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::Selection): Added constructor that takes two CaretPosition objects.
        (DOM::Selection::setModifyBias): Added. Helper function.
        (DOM::Selection::modifyExtendingRightForward): Don't set modify bias, since that's now the caller's
        responsibility. Reimplement WORD and LINE in terms of new CaretPosition functions. Implement PARAGRAPH
        and change PARAGRAPH_BOUNDARY to use CaretPosition function by its new name.
        (DOM::Selection::modifyMovingRightForward): Ditto.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::modify): Call setModifyBias, and use a switch statement instead of if.
        (DOM::caretY): Added. Helper for the new modify function that implements moving a pixel distance,
        used by pageDown: and friends.
        (DOM::Selection::modify): Added.
        (DOM::Selection::toRange): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
        (DOM::Selection::caretRect): Added. Replaces getRepaintRect, but does not add slop.
        (DOM::Selection::caretRepaintRect): Added. Replaces getRepaintRect; still adds slop.
        (DOM::Selection::needsCaretRepaint): Call caretRepaintRect.
        (DOM::Selection::validate): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
        Reimplement WORD to use new CaretPosition functions; this fixes the double-clicking problems.
        Change paragraph calls to use new names.

        * ForwardingHeaders/dom/dom_position.h: Removed. This was in the wrong location.
        * khtml/editing/htmlediting.cpp: Fixed include that said "dom/dom_position.h".
        * khtml/editing/htmlediting_impl.cpp: Fixed include that said "dom/dom_position.h".
        (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Rewrote this to use the new CaretPosition
        functions instead of the old Position functions.

        * khtml/misc/helper.h: Added const to character pointer parameter. Also put invertedColor inside
        an !APPLE_CHANGES since it doesn't do us any good.
        * khtml/misc/helper.cpp:
        (khtml::findWordBoundary): Added const to character pointer parameter.
        (khtml::nextWordFromIndex): Ditto.

        * kwq/KWQTextUtilities.h: Change parameters to const.
        * kwq/KWQTextUtilities.cpp: (KWQFindWordBoundary): Change parameter to const.
        * kwq/KWQTextUtilities.mm: (KWQFindNextWordFromIndex): Change parameter to const.

        * khtml/css/cssstyleselector.cpp: Disable code that uses invertedColor when APPLE_CHANGES, since it
        won't work for us.

        * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Added checks for selection end
        so we can set the selection end to nodes that are not leaf nodes and it will still work. Also took
        out bogus firstChild/lastChild loops for the same reason.

        * kwq/KWQKHTMLPart.h: Add "start before selection" flag to advanceToNextMisspelling.
        Needed to fix bug with spell checking.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::findString): Changed to use CaretPosition.
        (KWQKHTMLPart::advanceToNextMisspelling): Added code to handle "start before selection" flag
        and changed to use CaretPosition and new helper functions.
        (KWQKHTMLPart::markMisspellingsInSelection): More changes to use CaretPosition.
        (KWQKHTMLPart::updateSpellChecking): Ditto.

        * kwq/WebCoreBridge.h: Replaced WebSelectByDocument with WebSelectToDocumentBoundary.
        Added advanceToNextMisspellingStartingJustBeforeSelection,
        rangeByAlteringCurrentSelection:verticalDistance:, and
        alterCurrentSelection:verticalDistance:.

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge advanceToNextMisspellingStartingJustBeforeSelection]): Added.
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Added case for selecting by
        paragraph to save X position.
        (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:]): Added.
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Added.
        (-[WebCoreBridge ensureCaretVisible]): Call caretRect instead of getRepaintRect.

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - cleaned up DOM::RangeImpl a little so compareBoundaryPoints can be used outside the class

        * khtml/xml/dom2_rangeimpl.h: Added const to many of the member functions and made the
        compareBoundaryPoints that works on parameters be a const member function.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::commonAncestorContainer): Added const.
        (DOM::RangeImpl::compareBoundaryPoints): Added const.
        (DOM::RangeImpl::boundaryPointsValid): Added const, and wrote cleaner version.
        (DOM::RangeImpl::insertNode): Simplified by calling containedByReadOnly.
        (DOM::RangeImpl::toString): Added const.
        (DOM::RangeImpl::toHTML): Added const.
        (DOM::RangeImpl::createContextualFragment): Added const.
        (DOM::RangeImpl::cloneRange): Added const.
        (DOM::RangeImpl::surroundContents): Simplified by calling containedByReadOnly.

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3806990> REGRESSION (125-162): Crash on Select All at http://leuf.net/cgi/wikidn?PerlConvertEolScript

        * khtml/rendering/render_replaced.cpp: (RenderWidget::setSelectionState): Added nil check for the
        widget.

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3773740> calling addEventListener on a frame that hasn't loaded yet crashes

        * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Add nil checks for the document.
        The nil check prevents the crash but there's still a bug here; I filed 3807059 about that.

2004-09-20  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed problem where up and down arrow keys are not preserving X position

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectionLayoutChanged): Moved code to clear m_xPosForVerticalArrowNavigation out of here.
        (KHTMLPart::notifySelectionChanged): Moved it into here.

2004-09-18  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3805627> -[DOMRange _text] sometimes includes all text to the end of the document for certain ranges

        * khtml/misc/khtml_text_operations.cpp: (khtml::TextIterator::advance):
        Correctly handle the case when we are already on m_endNode. The concept here is that
        m_endNode is a node you must never "leave" when iterating.

=== Safari-164 ===

2004-09-17  Ken Kocienda  <kocienda@apple.com>

        * layout-tests/editing/selection/unrendered-004-expected.txt: Updated expected results.

2004-09-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3780245> REGRESSION (Mail): some lines are skipped when doing arrow navigation

        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousLinePosition): One-line fix. Make sure that BRs at the end of blocks
        are not skipped.

2004-09-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3805594> REGRESSION (Mail): Second return key stroke does not work when first was in blockquote

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::toRange): Code to convert caret positions moved the position upstream
        before making a range-compliant position, but erroneously would allow the position
        to cross blocks. Now it will no longer do so.

2004-09-16  Richard Williamson   <rjw@apple.com>

        Part 1 of the feature requested in
        <rdar://problem/3752791> Dashboard: Need a better solution for control regions

        This patch implements the CSS parsing necessary for dashboard regions.  
        Here's an example of the syntax we support:

        <style>
        #aDiv {
            -apple-dashboard-region:
                dashboard-region-circle(control 0 0 80 0)
                dashboard-region-rectangle(control,20,0,20,0)
                dashboard-region-circle(control 80 0 0 0); 
        }
        </style>


	Part 2 will determine the appropriate regions.

        Reviewed by Chris.

        * khtml/css/css_valueimpl.cpp:
        (CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
        * khtml/css/css_valueimpl.h:
        (DOM::CSSPrimitiveValueImpl::):
        (DOM::DashboardRegionImpl::DashboardRegionImpl):
        (DOM::DashboardRegionImpl::~DashboardRegionImpl):
        (DOM::DashboardRegionImpl::setNext):
        (DOM::DashboardRegionImpl::setLabel):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::parseContent):
        (skipCommaInDashboardRegion):
        (CSSParser::parseDashboardRegions):
        * khtml/css/cssparser.h:
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/dom/css_value.h:
        (DOM::CSSPrimitiveValue::):

2004-09-16  Darin Adler  <darin@apple.com>

        - fixed caret-drawing regression from my last patch

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::xPosForVerticalArrowNavigation): Pass false, meaning "vertical line caret"
        rather than true meaning "big box for overtyping".
        (DOM::Selection::layoutCaret): Ditto.

2004-09-16  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3803280> crash in selectAll on page with no contents

        * khtml/khtml_part.cpp: (KHTMLPart::selectAll): Handle case of 0 for documentElement().
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordPosition): Ditto.
        (DOM::Position::nextWordPosition): Ditto.

        - cleaned up caret code
        - changed DOM::Selection to use CaretPosition more

        * khtml/rendering/render_box.cpp: (RenderBox::caretRect): Change to use empty rectangles
        instead of an X value of -1 to mean no rectangle.
        * khtml/rendering/render_image.cpp: (RenderImage::selectionRect): Take advantage of the
        fixed QRect constructor.
        * khtml/rendering/render_object.cpp: (RenderObject::caretRect): Change to use empty
        rectangle instead of an X value of -1 to mean no rectangle.
        * khtml/rendering/render_text.cpp: (RenderText::caretRect): Cleaned up, and changed to use
        an empty rectangle instead of an X value of -1 to mean no rectangle.

        * khtml/xml/dom_caretposition.h: Made conversion from Position to CaretPosition something you
        can do implicitly, since it's an unambiguous conversion. Conversion in the other direction
        needs to be done explicitly. Moved EIncludeLineBreak here, and added startParagraphBoundary
        and endParagraphBoundary functions.
        * khtml/xml/dom_caretposition.cpp:
        (DOM::startParagraphBoundary): Added. Replaces, and made from, member function of DOM::Position.
        (DOM::endParagraphBoundary): Ditto.

        * khtml/xml/dom_position.h: Removed EIncludeLineBreak and startParagraphBoundary and
        endParagraphBoundary.
        * khtml/xml/dom_position.cpp: Removed startParagraphBoundary and endParagraphBoundary.

        * khtml/xml/dom_selection.h: Use CaretPosition instead of Position in a few places.
        Use a QRect for the caret rect. Change nodeIsBeforeNode to be a static member function.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::Selection): Change caret to store QRect instead of 3 separate fields.
        (DOM::Selection::init): Ditto.
        (DOM::Selection::operator=): Ditto.
        (DOM::Selection::modifyExtendingRightForward): Change to use CaretPosition instead of Position.
        Check for 0.
        (DOM::Selection::modifyMovingRightForward): Ditto. Check for 0.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::modify): Ditto.
        (DOM::Selection::layoutCaret): Change to use a QRect for the caret rect, and use an empty
        one to mean no rectangle.
        (DOM::Selection::getRepaintRect): Ditto.
        (DOM::Selection::paintCaret): Ditto.
        (DOM::Selection::validate): Change to use CaretPosition instead of Position. Also fixed
        PARAGRAPH_BOUNDARY, which was broken and doing the same thing as PARAGRAPH before, but
        it's not really used so that didn't matter. Check for 0.
        (DOM::Selection::nodeIsBeforeNode): Tightened up a bit and added some FIXMEs. This function
        has a number of problems and should probably be discarded in favor of the DOMStringImpl
        method that does the same thing.

2004-09-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bug:
        
        <rdar://problem/3787168> REGRESSION (Mail): Deleting text from the beginning of a quoted range removes the quoting from the rest

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Only move the text nodes (and their siblings) when
        doing this move between blocks. This serves to mimic NSText behavior very well.

2004-09-15  Darin Adler  <darin@apple.com>

        - fixed Panther build

        * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityActionDescription:]): Fixed backwards
        check in #if that was compiling the code on Panther only rather than Tiger only.

2004-09-15  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed lockFocus exception I observed; perhaps not a real issue in the field due to exception blocking

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::imageFromRect): Put most of the function inside a
        big if statement to avoid the exception we get from lockFocus otherwise.

2004-09-15  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3786467> REGRESSION (Mail): Reproducible crash replying to an HTML message when your preference is for plain text composing.

        * khtml/rendering/render_block.h: Remove removeChildrenFromLineBoxes.
        * khtml/rendering/render_block.cpp: (khtml::RenderBlock::removeChild): Remove calls
        to removeChildrenFromLineBoxes which was the old way of working around this.
        * khtml/rendering/render_flow.cpp: (RenderFlow::detach): Add comments and code to handle
        removing children from line boxes we are about to delete.

2004-09-15  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3781561> REGRESSION (Mail): typing in Mail became suddenly really sluggish (substitute font code)

	A DocumentMarker may begin before the InLineBox that includes
	it.  Ensure that we correctly handle that case.  The paintMarker()
	method and code that calls it could do with some cleanup to
	make it clearer how all the cases are handled, i.e. marker
	within box, or intersecting beginning or end of box.

        Reviewed by Darin.

        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintMarker):  Minimal change to ensure that we
	handle the case of marker starting before box.

2004-09-15  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - get rid of some of the localizable strings in here; we still have to figure out
          how we're going to localize the last few role descriptions

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject roleDescription]): Use NSAccessibilityRoleDescription for most
        descriptions instead of a hard-coded string (inside the UI_STRING placeholder).
        (-[KWQAccObject accessibilityActionDescription:]): Same thing, with NSAccessibilityActionDescription.

2004-09-15  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - did some QRect-related changes to facilitate later bug fixing

        * kwq/KWQPainter.h: Added fillRect overload that takes QRect to match the real Qt one.
        * kwq/KWQPainter.mm: (QPainter::fillRect): Added overload that takes QRect.

        * kwq/KWQRect.mm: (QRect::QRect): Change default constructed QRect to have a width and
        height of 0 rather than 1. Contrary to what we believed earlier, this is what Qt does.

2004-09-15  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3799512> REGRESSION (Mail): caret flashes 1 pixel too far to the left

        * khtml/rendering/render_text.cpp: (RenderText::caretRect): Added one to the horizontal position
        of the caret rect.

2004-09-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::doApply): The whitespace fixup code
        that makes sure proper whitespace renders after deletion was getting confused
        in cases where the deletion merged blocks. Basically, I needed to move some
        whitespace fixup code so it runs before deleting in the case where blocks
        need to be merged. It used to run after, and was getting confused by
        whitespace left over at the ends of the block after the deletion.
        * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-012.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-013-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-013.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-014-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-014.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-015-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-015.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-016.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-017.html: Added.

2004-09-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Renamed from moveNodesToBlock.
        Just some simplification and cleanup in this function.
        (khtml::DeleteSelectionCommandImpl::doApply): Remove a hunk of start-of-block code I thought
        I was going to get around to improving and refining. However, I no longer need this case.
        * khtml/editing/htmlediting_impl.h: Function name change.

2004-09-14  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - added method for fix to <rdar://problem/3788894> REGRESSION (Mail): ctrl-t emacs key binding does not work (transpose)

        * kwq/WebCoreBridge.h: Added rangeOfCharactersAroundCaret.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge rangeOfCharactersAroundCaret]): Added.

        * khtml/xml/dom_caretposition.h: Added range function to make a Range from two CaretPosition objects.
        * khtml/xml/dom_caretposition.cpp:
        (DOM::CaretPosition::rangeCompliantEquivalent): Fixed a bug in this that caused it to screw up
        ranges in text nodes. Also changed it to use offset 0 as Ken and I discussed.
        (DOM::range): Added.

        * kwq/DOM.mm: (-[DOMRange description]): Added.

2004-09-14  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3786986> REGRESSION: TEXTAREAs have extra wide right margins where the scrollbars used to be

        * kwq/KWQTextArea.mm:
        (-[KWQTextArea _updateTextViewWidth]): Renamed from _frameSizeChanged. Now uses the width of
        the size from the contentSize method rather than trying to compute a size.
        (-[KWQTextArea initWithFrame:]): Call method by new name.
        (-[KWQTextArea tile]): Override this instead of setFrame: to adjust the size as the size of
        the text area changes.

2004-09-14  Chris Blumenberg  <cblu@apple.com>

	Backed out my changes to these files. They were not meant to be checked. (I'm having a bad CVS day)

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]):
        (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]):
        (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]):
        (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]):

2004-09-14  David Hyatt  <hyatt@apple.com>

	Fix the crash in the layout tests caused by my recent selection changes.  Simply eliminate the buggy
	selection border setting code and let isSelectionBorder be implemented in terms of the SelectionState.
	
        Reviewed by kocienda

        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::setSelection):
        * khtml/rendering/render_object.cpp:
        (RenderObject::RenderObject):
        (RenderObject::container):
        (RenderObject::isSelectionBorder):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::minMaxKnown):
        (khtml::RenderObject::setReplaced):

2004-09-14  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3778680> REGRESSION: plug-in content sometimes doesn't show up

        Reviewed by dave.

        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::parseHTMLAttribute): set needWidgetUpdate to true only if there is a renderer
        (HTMLObjectElementImpl::attach): if needWidgetUpdate is true, call updateWidget

2004-09-14  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed <rdar://problem/3800315> encode-URI-test layout test is failing
	- updated escape/encodeURI layout test to match our new, more
	compatible behavior.

        * layout-tests/fast/js/global/encode-URI-test.html:

2004-09-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        Fix for this bug:
        
        <rdar://problem/3800834> REGRESSION (Mail): Can't delete backwards past quoted text using HTML editing

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::TypingCommandImpl::issueCommandForDeleteKey): Use CaretPosition class to get superior
        smarts about the selection to delete in the "start of block" case. This fixes the bug.
        While I was in the neighborhood, I cleaned up this function a bit.
        * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3800834-fix.html: Added.

2004-09-14  Ken Kocienda  <kocienda@apple.com>

        * khtml/css/parser.cpp: Did not regenerate this file from parser.y before last checkin.

2004-09-14  Chris Blumenberg  <cblu@apple.com>

	Fixed typos in last check-in.

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectClosestWordFromMouseEvent):
        (KHTMLPart::handleMousePressEventDoubleClick):
        * khtml/khtml_part.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendContextMenuEvent):

2004-09-09  David Hyatt  <hyatt@apple.com>

	Fix for 3667862, regression where dragging of selection became really slow.  This patch completely rewrites
	selection painting and drawing so that the enclosing rect is much more snug.  The containing block rect is no
	longer used at all.
	
        Reviewed by kocienda

        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::selectionRect):
        (getSelectionInfo):
        (RenderCanvas::setSelection):
        (RenderCanvas::clearSelection):
        * khtml/rendering/render_canvas.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::removeChildNode):
        * khtml/rendering/render_image.cpp:
        (RenderImage::selectionRect):
        (RenderImage::selectionTintColor):
        (RenderImage::paint):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::selectionStartEnd):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::selectionRect):
        (khtml::RenderObject::SelectionInfo::object):
        (khtml::RenderObject::SelectionInfo::rect):
        (khtml::RenderObject::SelectionInfo::state):
        (khtml::RenderObject::SelectionInfo::SelectionInfo):
        (khtml::RenderObject::SelectionInfo::m_state):
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::textObject):
        (InlineTextBox::selectionRect):
        (InlineTextBox::paintSelection):
        (RenderText::getAbsoluteRepaintRect):
        (RenderText::selectionRect):
        * khtml/rendering/render_text.h:
        * kwq/KWQPainter.mm:
        (getBlendedColorComponent):
        (QPainter::selectedTextBackgroundColor):

2004-09-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3794376> vertical formatting lines that show quote level are missing

        Rolling out change Dave made to fix 3787686. It turns out that we do not want this
        change, as it does not appear to have any effect on the bug. In addition, it caused
        the regression in quote bar behavior.

        * khtml/css/parser.cp
        * khtml/css/parser.y

2004-09-14  Chris Blumenberg  <cblu@apple.com>

	Fixed: Control-click shouldn't cause deselect when clicking selection.

        Reviewed by rjw.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendContextMenuEvent): don't attempt to select the closest word when the selection is clicked

2004-09-14  Chris Blumenberg  <cblu@apple.com>

	Fixed badness that my last patch caused. Because there was a conflict, my last patch added stuff that darin had just removed.

        Reviewed by darin.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendContextMenuEvent): don't call deref on the view

2004-09-14  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3783595> REGRESSION (Mail): control-click does not select closest word

        Reviewed by kocienda.

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectionGranularity): new getter, need this for an upcoming patch
        (KHTMLPart::selectClosetWordFromMouseEvent): new, factored from handleMousePressEventDoubleClick
        (KHTMLPart::handleMousePressEventDoubleClick): call selectClosetWordFromMouseEvent
        * khtml/khtml_part.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendContextMenuEvent): call selectClosetWordFromMouseEvent if nothing swallows the event

2004-09-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3800346> Inserting newline in BR after block not working

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InputNewlineCommandImpl::doApply): The code to insert the "extra" BR at the end
        of blocks (hack done to make BRs show up when they appear at the ends of blocks) did not
        cover this one quirky case where the insertion point can be placed in a BR at the end of 
        a block that does actually render. Now the input newline code can handle this addtional
        case.
        * layout-tests/editing/selection/insert-3800346-fix-expected.txt: Added.
        * layout-tests/editing/selection/insert-3800346-fix.html: Added.

2004-09-14  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3479392> REGRESSION (Mail): select all does not select all at some pages

        * khtml/xml/dom_caretposition.cpp: (DOM::CaretPosition::deepEquivalent):
        Use caretMaxOffset instead of maxOffset when descending to the last node.
        Also change around the function a bit.

2004-09-13  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari (Oracle Portal)

        This is a more complete fix, but it requires the previous attempt at a fix for this same
        bug below, because this is only the "don't destroy the KHTMLPart" portion; other fixes are
        still needed to survive shutdown of the part.

        * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::interpreter): Call the new keepAlive method.
        This is called whenever we're about to use an interpreter to run some JavaScript, and
        it's JavaScript that might destroy the part, hence the interpreter.

        * khtml/khtml_part.h: Added keepAlive() and slotEndLifeSupport() member functions.
        * khtml/khtmlpart_p.h: Added m_lifeSupportTimer.
        * khtml/khtml_part.cpp:
        (KHTMLPart::init): Connects m_lifeSupportTimer to slotEndLifeSupport.
        (KHTMLPart::write): Removed old attempt to work around this issue.
        (KHTMLPart::end): Ditto.
        (KHTMLPart::keepAlive): Added. References the part, then sets up a one-shot timer.
        (KHTMLPart::slotEndLifeSupport): Added. Stops the timer and then removes the reference
        from the part, possibly destroying it.

        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot): Added the new slot to the list of slots.
        (KWQSlot::call): Ditto.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendResizeEvent): Removed an old attempt to work around this same issue.
        (KWQKHTMLPart::mouseDown): Ditto.
        (KWQKHTMLPart::mouseDragged): Ditto.
        (KWQKHTMLPart::mouseUp): Ditto.
        (KWQKHTMLPart::mouseMoved): Ditto.
        (KWQKHTMLPart::sendContextMenuEvent): Ditto.

2004-09-13  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed regression caused by change earlier today

        * khtml/xml/dom_selection.cpp: (DOM::Selection::modifyExtendingRightForward):
        Use CaretPosition for CHARACTER, not WORD.

2004-09-13  Darin Adler  <darin@apple.com>

        Reviewed by Kevin.

        - fixed <rdar://problem/3798453> DIG failure: getting variable with same name as DOM element attribute gets attribute value instead

        * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): When adding current target and
        other event handler scope, put it below the existing scope chain. This ensures that things
        found in the function's scope will come before the event handler, as in other browsers.

2004-09-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin
        
        Fix for this bug:
        
        <rdar://problem/3798346> REGRESSION (125-162): crash pushing down arrow key on KLM.com site

        * khtml/xml/dom_position.cpp:
        (DOM::Position::nextLinePosition): This function was being called in a case where it was not expected
        until we traced the code. It has to do with some deeper issues associated with handling arrow keys, 
        resulting in the editing arrow-down code running in a case where we are not editing. I discussed this 
        with Darin, and we decided to handle the broader issues at a later date. The fix I am checking in
        here to fix the bug is merely avoiding a null-deref.

2004-09-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3784840> REGRESSION (Mail): Text is inserted in the wrong place after changing typing style

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InputTextCommandImpl::prepareForTextInsertion): Code to handle typing style did not
        check to see if the reference node used for the DOM node insertion operation was a block.
        If it is, then the new node containing the new editing style now is inserted at the start of the block,
        instead of after it.

2004-09-13  Ken Kocienda  <kocienda@apple.com>

        Added a couple new layout tests to cover recent changes.

        * layout-tests/editing/editing.js: Added some new functions to do by-word selection movement.
        * layout-tests/editing/selection/move-backwords-by-word-001-expected.txt: Added.
        * layout-tests/editing/selection/move-backwords-by-word-001.html: Added.
        * layout-tests/editing/selection/selection-3748164-fix-expected.txt: Added.
        * layout-tests/editing/selection/selection-3748164-fix.html: Added.

2004-09-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3765519> REGRESSION (Mail): word movement goes too far upstream at start of line
        
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordPosition): Use downstream position here when making final placement of caret. 

2004-09-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Various editing improvements, many focused on the improvements made possible by the
        new CaretPosition class.
        
        Includes fixes for these bugs:
        
        <rdar://problem/3748164> REGRESSION (Mail): Arrow navigation in typical mail message can result in stuck caret
        <rdar://problem/3782062> REGRESSION (Mail): option-delete can delete almost all of a message when it has trouble finding a word
        <rdar://problem/3790456> triple click does not select entire paragraph (folklore.org)

        * WebCore.pbproj/project.pbxproj: Added CaretPosition class files.
        * khtml/dom/dom2_range.h:
        (DOM::offsetInCharacters): Moved this helper here from khtml_text_operations.cpp. This
        function helps to determine how to interpret the offsets used in DOM Ranges.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InputNewlineCommandImpl::doApply): Use CaretPosition class to make "end-of-block" determination.
        Also, fix a caret placement glitch in "case 1" in the code: Place the caret in the node after the inserted
        BR. This makes it show up in the right place.
        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventDoubleClick): Don't limit double-click and triple-click handling only to text nodes.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::selectAll): Use CaretPosition class to implement improved selectAll.
        * khtml/misc/khtml_text_operations.cpp:
        (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Make a fix to the initial state setting of
        m_handledChildren. This is true if the offset into the end node is 0, meaning that we do not want to descend
        into its children at all.
        * khtml/xml/dom_caretposition.cpp: Added.
        * khtml/xml/dom_caretposition.h: Added.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::traverseNextNode): Fix bugs with the stayWithin implementation. We could miss nodes we want to test
        due to an erroneous check of stayWithin when no such check is needed.
        (NodeImpl::traverseNextSibling): Ditto.
        (NodeImpl::traversePreviousNodePostOrder): Ditto.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::Position): Remove spurious semi-colon.
        (DOM::Position::upstream): Move incoming Position to its equivalentDeepPosition. This is part of the transition
        that will make this code work better with increased use of CaretPosition.
        (DOM::Position::downstream): Ditto.
        (DOM::Position::atStartOfContainingEditableBlock): Removed. Dead code; was not being called.
        (DOM::Position::atStartOfRootEditableElement): Removed. Dead code; was not being called.
        (DOM::Position::isLastRenderedPositionInEditableBlock): Removed. Replaced with calls to CaretPosition class.
        (DOM::Position::inLastEditableInRootEditableElement): Removed. Dead code; was not being called.
        (DOM::Position::inFirstEditableInRootEditableElement): Removed. Was only being called by other code that has been removed.
        * khtml/xml/dom_position.h:
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modifyExtendingRightForward): Moved implementation of CHARACTER case to use CaretPosition class instead
        of Position class helpers.
        (DOM::Selection::modifyMovingRightForward): Ditto.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::validate): Made simplifications in code that used to call a concoction of Position class helpers to
        do the right thing. Now calls CaretPosition equivalents.

2004-09-13  Ken Kocienda  <kocienda@apple.com>

        This test was broken. The result is that it was not testing what it was supposed to 
        be testing. I fixed the test and updated the expected results.

        * layout-tests/editing/selection/move-between-blocks-no-001-expected.txt
        * layout-tests/editing/selection/move-between-blocks-no-001.html

2004-09-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for these bugs:
        
        <rdar://problem/3784835> REGRESSION (Mail): crash in DOM::ElementImpl::tagName inside delete text command code while editing a Mail message
        <rdar://problem/3788015> REGRESSION (Mail): Crash deleting before a blockquote
        <rdar://problem/3796366> REGRESSION (Mail): Crash Mail by deleting the right line from pasted HTML

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::doApply): All of these bugs are due to the same problem. When I
        made the delete command run even when the text is a caret (to make block merges work right when the
        caret is at the start of a block), I failed to handle one case when there might be no text to 
        delete. This resulted in a call to the DeleteTextCommand with a zero-length deletion request.
        This is not supported. Now, I have added an additional test in this one place in the code that
        was causing all these failures.

2004-09-12  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3797758> REGRESSION (155-156): Cannot tab between input fields at switchboard.com

        * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Use setFocus() instead of calling makeFirstResponder
        directly since it handles the case where the field editor has focus.

2004-09-12  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3792082> zero character codes in UTF-16 input cause crash

        * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUTF16): Fixed code that was using the wrong variable
        to decrement the input length, causing buffer overrun.

2004-09-12  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3798240> computed style error log messages seen with numbers in the range 74-77

        * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        Added implementations for CSS_PROP__KHTML_MARQUEE_INCREMENT, CSS_PROP_MAX_HEIGHT, CSS_PROP_MAX_WIDTH,
        CSS_PROP_MIN_HEIGHT, CSS_PROP_MIN_WIDTH, and CSS_PROP_VISIBILITY.

2004-09-12  Darin Adler  <darin@apple.com>

        * layout-tests/css1/text_properties/text-transform-expected.txt: Removed unused test result.

2004-09-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3787208> can't log in to SAP SDN site (JS parse error)

        * kwq/KWQKURL.mm:
        (KURL::decode_string): Check for find result >= 0 instead of >0,
	to handle case of first character in a string being encoded.

2004-09-09  Chris Blumenberg  <cblu@apple.com>

	Support for: <rdar://problem/3795485> debug menu item to enable RSS animation on first layout

        Reviewed by rjw.

        * khtml/khtml_part.h:
        (KHTMLPart::didFirstLayout): new
        * khtml/khtmlview.cpp:
        (KHTMLView::layout): call didFirstLayout
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::didFirstLayout): new
        * kwq/WebCoreBridge.h:

=== Safari-163 ===

2004-09-09  Maciej Stachowiak  <mjs@apple.com>

        - roll out the last change, it appears to cause a performance regression

        * khtml/rendering/render_box.cpp:
        (RenderBox::caretRect):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::caretRect):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::caretRect):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::caretRect):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect):
        * khtml/rendering/render_text.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:

2004-09-08  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	WebCore part of fix for:
	
	<rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
	
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
	DOMRange, or if the range is split into multiple lines, the rect for the part on
	the first line only.
	
        * khtml/rendering/render_object.cpp:
        (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
	for the overrides below.
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::caretRect):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::caretRect):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::caretRect):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect):

2004-09-06  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3790526> mark-related methods not implemented (needed for people with them in their key bindings files)

        * khtml/khtml_part.h: Added mark and setMark.
        * khtml/khtmlpart_p.h: Added m_mark.
        * khtml/khtml_part.cpp:
        (KHTMLPart::mark): Added.
        (KHTMLPart::setMark): Added.

        * kwq/KWQKHTMLPart.h: Change name of markedRange to markedTextRange to decrease
        the change it will be confused with the mark.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::clear): Update for name change.
        (KWQKHTMLPart::markedTextRange): Ditto.
        (KWQKHTMLPart::setMarkedTextRange): Ditto.

        * khtml/rendering/render_text.cpp: (RenderText::paint): Update for name change.

        * kwq/WebCoreBridge.h: Remove setSelectionFrom, selectionStart, selectionStartOffset,
        selectionEnd, selectionEndOffset, and clearMarkedDOMRange. Renamed setMarkedDOMRange
        to setMarkedTextDOMRange and markedDOMRange to markedTextDOMRange. Added setMarkDOMRange
        and markDOMRange for the Emacs "mark".
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setMarkDOMRange:]): Added.
        (-[WebCoreBridge markDOMRange]): Added.
        (-[WebCoreBridge setMarkedTextDOMRange:]): Renamed.
        (-[WebCoreBridge markedTextDOMRange]): Renamed.

        * khtml/xml/dom_selection.cpp: (DOM::Selection::validate): Make paragraph positions
        canonical by using deep rendered positions. Maybe someday this won't be an ad hoc
        decision any more.

        * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::removeChildren): Use ref and deref
        rather than the unconventional check for 0 refCount. This makes us a bit more
        robust against a node going away partway through the removal process.

        * WebCore.pbproj/project.pbxproj: Update MACOSX_DEPLOYMENT_TARGET to 10.3.

2004-09-08  Maciej Stachowiak  <mjs@apple.com>

        - fixed deployment build problems noticed by Grant

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::caretRect):
        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect):

2004-09-08  David Hyatt  <hyatt@apple.com>

	Fix XML so that elements with no namespace never make HTML elements (when their names coincidentally match).
	
        Reviewed by rjw

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createElementNS):

2004-09-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- renamed caretPos to caretRect and made it return a QRect instead
	of taking four out parameters by reference.
	
        * khtml/rendering/render_box.cpp:
        (RenderBox::caretRect):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::caretRect):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::caretRect):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::caretRect):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::caretRect):
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::xPosForVerticalArrowNavigation):
        (DOM::Selection::layoutCaret):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge caretRectAtNode:offset:]):

2004-09-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/3759209> REGRESSION (Mail): assertion failure when all of marked text deleted at start of document
	
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setMarkedRange): Allow any empty range, even if
	it's not in a text node, since in this case it won't matter and
	weird things can happen when all marked text is removed, there
	might not be any text nodes.

2004-09-07  David Hyatt  <hyatt@apple.com>

	Initial text-decoration CSS3 work for editing.  Just gets the properties and values parsed.
	
        Reviewed by darin

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::adjustRenderStyle):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:

2004-09-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin and Ken.

	<rdar://problem/3655568> window.open fails when URL contains trailing space

        * kwq/KWQKURL.mm:
        (KURL::KURL): Strip trailing and leading space when resolving relative URLs in all
	cases, instead of just leading in the non-absolute case as before.

	- refactored KURL constructor to put more work in separate
	functions and also to change static methods to static functions,
	to avoid having to change the header when only changing helper
	functions that do not affect the KURL API (since KURL.h is widely
	included).
	
        * kwq/KWQKURL.mm:
        (encodeHostname):
        (findHostnamesInMailToURL):
        (findHostnameInHierarchicalURL):
        (encodeHostnames):
        (encodeRelativeString):
        (substituteBackslashes):
	* kwq/KWQKURL.h:

	- add missing include of qvaluelist.h

        * khtml/ecma/kjs_dom.h:

2004-09-06  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3512066> REGRESSION (Mail): Select All highlights only part of the content, though all is copied
        - fixed <rdar://problem/3157025> REGRESSION (Mail): Should select paragraph instead of line on triple-click
        - fixed <rdar://problem/3735048> REGRESSION (Mail): HTML editing must select newline on triple click
        - fixed <rdar://problem/3788872> REGRESSION (Mail): ctrl-a emacs key binding does not work (move to start of paragraph)
        - fixed <rdar://problem/3788881> REGRESSION (Mail): ctrl-e emacs key binding does not work (move to end of paragraph)
        - fixed <rdar://problem/3789931> REGRESSION (Mail): typing style lost when you backspace
        - added code to select inserted text to help WebKit implement yankAndSelect:
        - did some clean-up on editing commands code
        
        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventTripleClick): Expand to a paragraph, not a line.
        (KHTMLPart::selectAll): Remove a lot of unneeded code and just expand to document using Selection.
        (KHTMLPart::selectionHasStyle): Remove check that limited us to only HTML elements, and add
        a check for nil. Together, these two changes fix a few cases I ran into during testing.

        * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Fix test that was checking if
        the old selection spanned multiple objects when it really should have checked whether the new
        new selection spans multiple objects. This caused the select all redraw bug.

        * khtml/editing/htmlediting.h: Fixed indenting. Remove command IDs, replacing them with a couple
        of specific type checking methods, and SharedCommandImpl, using EditCommandImpl directly instead.
        Got rid of virtual functions, since the command objects have no data members other than the ones
        inherited from SharedPtr. Removed explicit copy constructors and destructors. Removed unneeded
        empty constructors. Removed inline directives that were having no effect. Added some boolean
        selectInsertedText parameter to some commands. Made almost all member functions const, because
        the const here applies to the command object which is a smart pointer, not the pointed-to
        command implementation object.
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommand::EditCommand): Changed since SharedPtr is now a pointer to EditCommandImpl.
        (khtml::EditCommand::operator=): Added. By defining this explicitly, we don't need the class
        that we are pointing to defined in the header, which lets us get rid of SharedCommandImpl.
        (khtml::EditCommand::isInputTextCommand): Added.
        (khtml::EditCommand::isTypingCommand): Added.
        (khtml::EditCommand::setParent): Updated since EditCommandImpl.setParent takes an impl pointer now.
        (khtml::EditCommand::handle): Removed, since it's identical to get().
        (khtml::InputTextCommand::input): Added selectInsertedText parameter.
        (khtml::TypingCommand::TypingCommand): Ditto.
        (khtml::TypingCommand::insertText): Ditto.
        (khtml::TypingCommand::isOpenForMoreTypingCommand): Use isTypingCommand instead of commandID.
        (khtml::TypingCommand::closeTyping): Change parameter type to const reference.

        * khtml/editing/htmlediting_impl.h: Made StyleChange functions be const member functions.
        Changed parent() and setParent() to take and return EditCommandImpl pointers and be inlined.
        Added virtual isInputTextCommand, isTypingCommand, and preservesTypingStyle functions.
        Removed commandID functions and unneeded explicit destructors. Removed unneeded doApply
        function declaration in CompositeEditCommandImpl. Changed type of applyTypingStyle to return
        a node, not necessarily an element. Removed private execute function from InputTextCommandImpl.
        Added selectInsertedText to InputTextCommandImpl's input function and TypingCommandImpl's constructor
        and insertText function.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::StyleChange::StyleChange): Don't bother initializing the booleans since init handles that.
        (khtml::StyleChange::init): Added code to strip whitespace, and tweaked how the function does its job.
        (khtml::StyleChange::currentlyHasStyle): Added a check for null value, which can happen for properties
        where we don't have computed style implemented yet.
        (khtml::EditCommandImpl::EditCommandImpl): Updated since there is no SharedCommandImpl any more.
        (khtml::EditCommandImpl::apply): Call new preservesTypingStyle function rather than checking
        the command ID. This preserves typing style when deleting with the keyboard.
        (khtml::EditCommandImpl::setStartingSelection): Changed since parent is now a EditCommandImpl.
        Also rewrote to use for loop so it's simpler-looking.
        (khtml::EditCommandImpl::setEndingSelection): Ditto.
        (khtml::EditCommandImpl::setTypingStyle): Ditto.
        (khtml::EditCommandImpl::preservesTypingStyle): Added. Returns false.
        (khtml::EditCommandImpl::isInputTextCommand): Added. Returns false.
        (khtml::EditCommandImpl::isTypingCommand): Added. Returns false.
        (khtml::CompositeEditCommandImpl::applyTypingStyle): Changed this function to return a node rather
        than an element. Also change it so it returns the child as-is if the style change has nothing in it.
        (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl): Removed unneeded null checks.
        (khtml::DeleteSelectionCommandImpl::preservesTypingStyle): Added. Returns true.
        (khtml::DeleteTextCommandImpl::~DeleteTextCommandImpl): Removed unneeded null checks.
        (khtml::InputTextCommandImpl::input): Renamed execute function to input and got rid of the additional
        level of indirection, since it was the only caller. Added selectInsertedText parameter and changed
        the code so it will respect it.
        (khtml::InputTextCommandImpl::isInputTextCommand): Added. Returns true.
        (khtml::InsertNodeBeforeCommandImpl::~InsertNodeBeforeCommandImpl): Removed unneeded null checks.
        (khtml::JoinTextNodesCommandImpl::~JoinTextNodesCommandImpl): Ditto.
        (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): Hold a reference to the fragment
        while the command exists.
        (khtml::MoveSelectionCommandImpl::~MoveSelectionCommandImpl): Release the fragment.
        (khtml::RemoveNodeCommandImpl::~RemoveNodeCommandImpl): Remove unneeded null checks.
        (khtml::RemoveNodeCommandImpl::doUnapply): Take advantage of defined behavior of insertBefore when
        the node to insert before is 0 (means the same thing as appendChild).
        (khtml::RemoveNodePreservingChildrenCommandImpl::~RemoveNodePreservingChildrenCommandImpl):
        Remove unneeded null check.
        (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): Hold a reference to the fragment
        while the command exists.
        (khtml::ReplaceSelectionCommandImpl::~ReplaceSelectionCommandImpl): Release the fragment.
        (khtml::SetNodeAttributeCommandImpl::~SetNodeAttributeCommandImpl): Remove unneeded null check.
        (khtml::SplitTextNodeCommandImpl::~SplitTextNodeCommandImpl): Remove unneeded null check.
        (khtml::TypingCommandImpl::TypingCommandImpl): Added selectInsertedText parameter.
        (khtml::TypingCommandImpl::doApply): Pass along selectInsertedText parameter.
        (khtml::TypingCommandImpl::insertText): Ditto.
        (khtml::TypingCommandImpl::preservesTypingStyle): Added. Returns true for DeleteKey.
        (khtml::TypingCommandImpl::isTypingCommand): Added. Returns true.

        * khtml/editing/jsediting.cpp: Add a cut at implementing the underline command. May not work
        perfectly yet because text-decoration is not inherited the way, say, font-weight is.

        * khtml/xml/dom_selection.h: Removed some unneeded friend declarations for comparison operators
        that use only public members. Added PARAGRAPH_BOUNDARY.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modifyExtendingRightForward): Implemented paragraph boundary case, simplified line
        boundary case (by changing parameter types and function names, not the algorithm), and made
        paragraph case fall into line case for now.
        (DOM::Selection::modifyMovingRightForward): Ditto.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::validate): Implemented paragraph case and paragraph boundary case, simplified the
        line case as above and also fixed the document case.
        (DOM::startOfFirstRunAt): Changed to use DOM::Position instead of node
        offset pairs. Also renamed and got rid of separate bool to indicate "not found".
        (DOM::endOfLastRunAt): Ditto.
        (DOM::selectionForLine): Ditto.

        * khtml/xml/dom_position.h: Added startParagraphBoundary and endParagraphBoundary.
        Also used enums instead of bools in a couple of places. Removed some unneeded friend
        declarations for comparison operators that use only public members.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::Position): Coding style tweak.
        (DOM::Position::startParagraphBoundary): Added.
        (DOM::Position::endParagraphBoundary): Added.
        (DOM::Position::upstream): Use enum parameter instead of bool.
        (DOM::Position::downstream): Ditto.
        (DOM::Position::rendersOnSameLine): Removed unused function. Noticed some backwards logic
        here, and removed it rather than fixing it.

        * khtml/xml/dom_nodeimpl.h: Added traversePreviousNodePostOrder.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::traversePreviousNodePostOrder): Added. For some uses, this function is more analogous
        to traverseNextNode in reverse than traversePreviousNode, which does a backwards pre-order traversal.

        * kwq/WebCoreBridge.h: Replaced fontForCurrentPosition method with fontForSelection:, added
        selectInsertedText parameter to insertText method, and added selectionStartHasStyle: method.
        Add WebSelectToParagraphBoundary.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectedDOMRange:affinity:]): Added workaround for bug where isRenderedContent
        returns false for <br> elements at the ends of lines.
        (-[WebCoreBridge insertText:selectInsertedText:]): Added selectInsertedText parameter, passing it
        along to TypingCommand::insertText.
        (-[WebCoreBridge selectionStartHasStyle:]): Added. Calls code in the part that does the real work.
        (-[WebCoreBridge fontForSelection:]): Ditto.

        * kwq/KWQKHTMLPart.h: Renamed fontForCurrentPosition to fontForSelection, and added a feature
        where it tells us whether there are multiple fonts in the selection or not.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForSelection): Rewrote this to be a bit simpler, and added code to detect
        whether there are multiple fonts in the selection.
        (KWQKHTMLPart::didTellBridgeAboutLoad): Use a global character rather than a bad pointer here.
        Better not to rely on undefined behavior.
        (KWQKHTMLPart::documentFragmentWithText): Use lowercase HTML. I believe this works better when
        the document is XML, and we should probably visit all callers and change them.
        (KWQKHTMLPart::registerCommandForUndo): Call get() instead of handle().
        (KWQKHTMLPart::registerCommandForRedo): Call get() instead of handle().

        * khtml/misc/shared.h: Added a private, non-implemented copy constructor and assignment
        operator to Shared<> and TreeShared<> to prevent copying reference counts by accident.
        * khtml/rendering/render_style.h: Get rid of Shared<BorderData>, since it's not used that way.
        This makes BorderData smaller, and allows it to compile with the change to Shared<>.
        * khtml/xml/dom_docimpl.h: Remove unneeded copy constructor on DocumentFragmentImpl,
        which ran afoul of the change to Shared<> and was unused.
        * khtml/xml/dom_docimpl.cpp: Ditto.
        * khtml/xml/dom_stringimpl.cpp:
        (DOM::DOMStringImpl::empty): Changed code around so it doesn't run afoul of the change to
        Shared<>. The old code was copying a DOMStringImpl.
        (DOM::DOMStringImpl::ascii): Added code to null-terminate the string buffer.

2004-09-06  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - improved computed style code and implemented text-decoration and text-shadow (needed for, e.g., underline)

        * khtml/css/css_computedstyle.cpp:
        Added CSS_PROP_TEXT_DECORATION to the InheritableProperties array for now even though it's
        not inheritable. This makes underline work in some cases for typing style. We may decide to
        take it back out again after further consideration.
        (DOM::valueForLength): Use IDs in primitive values rather than strings.
        (DOM::valueForBorderStyle): Ditto, also renamed this.
        (DOM::valueForTextAlign): More of the same.
        (DOM::valueForShadow): Added this function.
        (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue): More IDs in primitive values.
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Changed all the cases to use
        IDs instead of strings in primitive values. Also put the style in a local variable for
        better code size and smaller source code too. Added implementation for CSS_PROP_TEXT_DECORATION
        and CSS_PROP_TEXT_SHADOW.

        * khtml/css/css_valueimpl.cpp:
        (CSSValueListImpl::cssText): Put commas between list elements.
        (CSSPrimitiveValueImpl::cssText): Fixed some messed up indenting and removed an unneeded
        default case that would just prevent a warning if we ever have an unhandled enum value.

2004-09-06  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - did some clean-up on form data code

        * khtml/misc/formdata.h: Added more public functions as suggested by Chris when he reviewed
        this class.
        * khtml/misc/formdata.cpp: (khtml::FormData::appendFile): Added. Will be needed soon.
        * kwq/KWQFormData.mm: (arrayFromFormData): Use new cleaned-up FormData API.

2004-09-06  Darin Adler  <darin@apple.com>

        Reviewed by John.

        * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration description]): Use cssText in the description
        so it's easier to see in the debugger.

2004-09-06  Darin Adler  <darin@apple.com>

        Reviewed by John.

        * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::send): Remove uneeded QCString copy.

2004-09-04  Richard Williamson   <rjw@apple.com>

        Fix build problem on panther.

        * khtml/ecma/kjs_html.cpp:
        * khtml/rendering/render_canvasimage.h:

2004-09-03  David Hyatt  <hyatt@apple.com>

	Simple tweak to background-attachment.  Don't apply the slow repaint flag until after the whole style has been
	resolved, since while cascading someone may set the attachment to fixed but later override with scroll.

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::adjustRenderStyle):
        (khtml::CSSStyleSelector::applyProperty):

2004-09-03  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3781001>: redirection of URL via resource load delegate does not correctly set base URL for subsequent loads

	Ensure that stylesheets have the correct URL when request
	is redirected.

        Reviewed by Maciej.

        * khtml/misc/loader.cpp:
        (CachedCSSStyleSheet::checkNotify):
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (KWQIsResponseURLEqualToURL):
        (KWQResponseURL):

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
	Compare parameter count with == instead of <=.

2004-09-03  David Hyatt  <hyatt@apple.com>

	Fix for 3779083, deleting large amount of text is really slow.  Don't use NodeLists in editing remove commands.
	
        Reviewed by darin

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::RemoveNodeCommandImpl::RemoveNodeCommandImpl):
        (khtml::RemoveNodePreservingChildrenCommandImpl::doApply):

2004-09-03  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3714501> REGRESSION (125.8-8A162): Chinese words display as garbage in search results (www.sz.net.cn)

        * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Resolve URL using the document method
        that passes the codec rather than calling the KURL constructor directly.

2004-09-03  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3788409> can't create or clone an embed element

        Reviewed by rjw.

        * khtml/html/htmlparser.cpp: added fixme about sharing code
        * khtml/xml/dom_docimpl.cpp: ditto
        (DocumentImpl::createHTMLElement): create and return a HTMLEmbedElementImpl

2004-09-03  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - fixed <rdar://problem/3410112> filename with non-ASCII name for <input type=file> should be sent in the page's encoding

        * khtml/html/html_formimpl.cpp: (DOM::HTMLFormElementImpl::formData):
        Encode filename using the codec rather than doing the &# dance. It turns out that Mozilla
        only does the &# thing under certain circumstances that are not important. Always encoding
        the filename is almost certainly better behavior, and will fix many serious problems for
        Japanese and Korean users and websites.

2004-09-03  Richard Williamson   <rjw@apple.com>

	Made drawImage() in <canvas> compliant with whatwg spec.
	
        Reviewed by John.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/html/html_imageimpl.h:
        (DOM::HTMLImageElementImpl::pixmap):

2004-09-03  David Hyatt  <hyatt@apple.com>

	Fix for 3787686, CSS parser should do case-sensitive matching of ids and attributes only in strict mode
	(and not whenever you have an HTML document).
	
        Reviewed by john

        * khtml/css/parser.cpp:
        * khtml/css/parser.y:

=== Safari-162 ===

2004-09-03  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - <rdar://problem/3788040> REGRESSION: text that i type into a textarea disappears when i tab out of the textarea

        * kwq/KWQTextArea.mm: (-[KWQTextArea textDidChange:]): Bring back an unconditional version of
        this method. Earlier, we deleted this method, but we should have instead removed the check.

2004-09-02  David Hyatt  <hyatt@apple.com>

	Swap RenderBox and RenderContainer.  Make leaf RenderObjects actually derive off of RenderBox instead.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::addChildToFlow):
        * khtml/rendering/render_box.cpp:
        (RenderBox::RenderBox):
        (RenderBox::detach):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::RenderContainer):
        (RenderContainer::detach):
        * khtml/rendering/render_container.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::detach):
        (RenderFlow::dirtyLineBoxes):
        (RenderFlow::createInlineBox):
        (RenderFlow::getAbsoluteRepaintRect):
        (RenderFlow::lowestPosition):
        (RenderFlow::rightmostPosition):
        (RenderFlow::leftmostPosition):
        (RenderFlow::caretPos):
        * khtml/rendering/render_flow.h:
        (khtml::RenderFlow::RenderFlow):
        * khtml/rendering/render_frames.cpp:
        (RenderFrameSet::RenderFrameSet):
        (RenderFrameSet::nodeAtPoint):
        (RenderFrameSet::dump):
        * khtml/rendering/render_frames.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::addChildToFlow):
        * khtml/rendering/render_replaced.cpp:
        * khtml/rendering/render_replaced.h:
        (khtml::RenderReplaced::setIntrinsicHeight):
        * khtml/rendering/render_table.cpp:
        (RenderTableSection::RenderTableSection):
        (RenderTableSection::detach):
        (RenderTableSection::setStyle):
        * khtml/rendering/render_table.h:

2004-09-02  Ken Kocienda  <kocienda@apple.com>

        * khtml/editing/htmlediting_impl.h: Fix some inconsistent use of whitespace. No code change.

2004-09-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3786848> REGRESSION (Mail): Typing styles and font panel updates broken

        * khtml/xml/dom_position.cpp:
        (DOM::Position::inRenderedContent): Check for inlines that can have kids is wrong.
        I busted this the other day when making the PositionIterator class iterate over
        all nodes and not just leaves of the DOM tree.
        
        Update all the following functions. These use the PositionIterator class, but still 
        only want to consider leaf nodes.
        
        (DOM::Position::isFirstRenderedPositionOnLine)
        (DOM::Position::isLastRenderedPositionOnLine)
        (DOM::Position::isLastRenderedPositionInEditableBlock)
        (DOM::Position::inFirstEditableInRootEditableElement)
        (DOM::Position::inLastEditableInRootEditableElement)
        (DOM::Position::inFirstEditableInContainingEditableBlock)
        (DOM::Position::inLastEditableInContainingEditableBlock)

2004-09-02  Richard Williamson   <rjw@apple.com>

	Support for patterns in <canvas>

        Reviewed by Hyatt.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        (Context2D::putValue):
        (drawPattern):
        (ImagePattern::ImagePattern):
        (ImagePattern::~ImagePattern):
        * khtml/ecma/kjs_html.h:
        (KJS::ImagePattern::getPattern):
        (KJS::ImagePattern::pixmap):
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (QPixmap::imageRef):
        * kwq/WebCoreImageRenderer.h:

2004-09-01  David Hyatt  <hyatt@apple.com>

	Fix for 3769409, a regression from 10.3.4 to 10.3.5 involving <colgroup>s in malformed HTML.
	
        Reviewed by mjs

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):

2004-09-01  David Hyatt  <hyatt@apple.com>

	Fix for the <colgroup> crasher.  Make sure adding to an anonymous box just returns immediately. Also eliminate
	all the redundant setPos -500000 calls, since we don't need those at all.
	
        Reviewed by john

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::addChildToFlow):
        (khtml::RenderBlock::makeChildrenNonInline):
        * khtml/rendering/render_inline.cpp:
        (RenderInline::splitFlow):

2004-09-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for these bugs:
        
        <rdar://problem/3729219> REGRESSION (Mail): Caret placement and navigation not working correctly at yahoo.com
        <rdar://problem/3758606> REGRESSION (Mail): Deletions across DIV elements is broken
        <rdar://problem/3784810> REGRESSION (Mail): delete at beginning of line instead deletes to the end of the document (simple reduced test)

        I made some very big improvements to the code which handles deletions of selections
        which span more than one block.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::deleteUnrenderedText): An new, overloaded version of this
        function which works on a NodeImpl. The code in this function fell out of some refactoring
        I did in the function with the same name which takes a Position as an argument.
        (khtml::DeleteSelectionCommandImpl::moveNodesToBlock): New function. This new logic provides
        the smarts to fix the bugs listed above and greatly improves the code to perform deleting 
        selections which span more than one block.
        (khtml::DeleteSelectionCommandImpl::doApply): Several changes. Constrain downstream positions
        so that they stay in the current block. This was a mistake before I think. Add code to detect
        when the insertion point is a caret at the start of a block. This is a special-case of a
        cross-block selection. Change the end-of-deletion-fixup case to operate on the downstreamEnd
        position of the selection rather than the upstream. This is more logical. Refine the block 
        merge logic to handle more cases, like dealing with whitespace. 
        * khtml/editing/htmlediting_impl.h: Associated header file changes.
        * khtml/xml/dom_nodeimpl.cpp: 
        (NodeImpl::rootEditableElement): Add code to clamp the return value to the body element.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::validate): Make selection canonicalizations stay in the current block.
        * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt:
        * layout-tests/editing/deleting/delete-block-merge-contents-001.html:
        * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-002.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-003.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-004.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-005-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-005.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-006-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-006.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-007.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-008.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-009-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-009.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-010-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-010.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-011-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-011.html: Added.
        * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Updated with new results.
        * layout-tests/editing/inserting/insert-3654864-fix.html: Updated test to deal better with
        improved select all behavior.
        * layout-tests/editing/selection/select-all-003-expected.txt: Updated with new results.

2004-09-01  Richard Williamson   <rjw@apple.com>

	Fixed panther build glitch.

        Reviewed by Ken.

        * khtml/ecma/kjs_html.cpp:

2004-09-01  Richard Williamson   <rjw@apple.com>

	Finished implementation of gradient support in <canvas>.

        Reviewed by John.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElementFunction::tryCall):
        (isGradient):
        (isImagePattern):
        (KJS::Context2DFunction::tryCall):
        (Context2D::putValue):
        (Context2D::Context2D):
        (KJS::GradientFunction::tryCall):
        (gradientCallback):
        (Gradient::commonInit):
        (Gradient::Gradient):
        (Gradient::~Gradient):
        (Gradient::getShading):
        (Gradient::addColorStop):
        (sortStops):
        (Gradient::colorStops):
        * khtml/ecma/kjs_html.h:
        (KJS::ColorStop::ColorStop):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-09-01  David Hyatt  <hyatt@apple.com>

	Fix for 3784686, hidden links still active.  Make sure text nodes exclude themselves from nodeAtPoint checks
	when hidden.
	
        * khtml/rendering/render_text.cpp:
        (RenderText::nodeAtPoint):

2004-08-31  David Hyatt  <hyatt@apple.com>

	Fixes for 3761411 and 3782201.  This patch makes two changes to percentage heights.  First it makes sure that
	replaced elements always flex inside a cell (unlike blocks and tables, which do so only sometimes under bizarre
	conditions that are still being guessed at by me).  The second fix is a recognition that empty tables do not
	actually honor their heights, and so it is a mistake to try to flex them.
	
        Reviewed by mjs

        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):
        * khtml/rendering/render_table.h:
        (khtml::RenderTable::hasSections):

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
    
        Fix for this bug:
        
        <rdar://problem/3781572> can't paste text in replied message view

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): Copying text placed in an anonymous block was failing
        since the code in here depending on the text node's containing block having an
        element, which it won't. In fact, using containing block is wrong anyway, since
        positioned elements can have containing blocks far from where they live in the
        tree. This "move up to block check" should use the more DOM-wise enclosingBlockFlowElement()
        in NodeImpl.

2004-08-30  David Hyatt  <hyatt@apple.com>

	Fix for 3742585, sony dhtml menus wrong size.  The percentage table height algorithm was wrong.  This patch
	unifies the table percentage height algorithm with the block percentage height algorithm and fixes bugs in
	both.
	
        Reviewed by john

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcPercentageHeight):
        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        Added more editing layout tests.

        * layout-tests/editing/deleting/delete-tab-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-tab-001.html: Added.
        * layout-tests/editing/deleting/delete-tab-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-tab-002.html: Added.
        * layout-tests/editing/deleting/delete-tab-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-tab-003.html: Added.
        * layout-tests/editing/deleting/delete-tab-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-tab-004.html: Added.
        * layout-tests/editing/editing.js: Fixed a little bug in one of the "delayed" commands.
        * layout-tests/editing/inserting/insert-tab-001-expected.txt: Added.
        * layout-tests/editing/inserting/insert-tab-001.html: Added.
        * layout-tests/editing/inserting/insert-tab-002-expected.txt: Added.
        * layout-tests/editing/inserting/insert-tab-002.html: Added.
        * layout-tests/editing/inserting/insert-tab-003-expected.txt: Added.
        * layout-tests/editing/inserting/insert-tab-003.html: Added.
        * layout-tests/editing/inserting/insert-tab-004-expected.txt: Added.
        * layout-tests/editing/inserting/insert-tab-004.html: Added.

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3782521> Typing newline at start of block does not work

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InputNewlineCommandImpl::doApply): Change handling of case to insert
        newline at the start of a block.
        * layout-tests/editing/inserting/insert-br-006-expected.txt: Updated layout test with
        new results.

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        Checked in incorrect results for these tests. There are the right ones.

        * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt
        * layout-tests/editing/selection/move-by-line-001-expected.txt

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        Added more editing layout tests.

        * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt: Added.
        * layout-tests/editing/deleting/collapse-whitespace-3587601-fix.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-001.html: Added.
        * layout-tests/editing/editing.js: Added some more navigation commands.
        * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
        * layout-tests/editing/selection/move-by-line-001-expected.txt: Added.
        * layout-tests/editing/selection/move-by-line-001.html: Added.
        * layout-tests/editing/style/typing-style-003-expected.txt: Added.
        * layout-tests/editing/style/typing-style-003.html: Added.

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        Added more editing layout tests. Renamed some others.

        * layout-tests/editing/inserting/insert-br-001-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-001.html: Added.
        * layout-tests/editing/inserting/insert-br-002-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-002.html: Added.
        * layout-tests/editing/inserting/insert-br-003-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-003.html: Added.
        * layout-tests/editing/inserting/insert-br-004-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-004.html: Added.
        * layout-tests/editing/inserting/insert-br-005-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-005.html: Added.
        * layout-tests/editing/inserting/insert-br-006-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-006.html: Added.
        * layout-tests/editing/inserting/insert-br-case1-expected.txt: Removed.
        * layout-tests/editing/inserting/insert-br-case1.html: Removed.
        * layout-tests/editing/inserting/insert-br-case2-expected.txt: Removed.
        * layout-tests/editing/inserting/insert-br-case2.html: Removed.
        * layout-tests/editing/inserting/insert-br-case3-expected.txt: Removed.
        * layout-tests/editing/inserting/insert-br-case3.html: Removed.
        * layout-tests/editing/inserting/insert-br-case6-expected.txt: Removed.
        * layout-tests/editing/inserting/insert-br-case6.html: Removed.
        * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt: Added.
        * layout-tests/editing/inserting/insert-text-with-newlines.html: Added.

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        * layout-tests/editing/editing.js: Modified typeCharacterCommand so it can accept a character
        as an argument.

2004-08-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for these bugs:

        <rdar://problem/3777629> REGRESSION (Mail): can't delete blank lines in quoted text in HTML mail replies
        <rdar://problem/3780309> REGRESSION (Mail): can't delete past an empty span in a particular test case
        <rdar://problem/3780315> REGRESSION (Mail): right arrow works incorrectly in a particular test case with an empty span
        <rdar://problem/3780320> REGRESSION (Mail): left arrow works incorrectly in a particular test case with an empty span
        <rdar://problem/3780336> REGRESSION (Mail): down arrow fails in a reduction of a Mail reply test case (seems to be inside a span)

        * khtml/xml/dom_position.cpp:
        (DOM::Position::upstream): If this position's node is a block, use it for the StayInBlock case, not the block's
        enclosing block.
        (DOM::Position::downstream): Ditto.
        (DOM::Position::inRenderedContent): Refine the case for non-text nodes. This was erroneously returning true
        for any empty element (like <span></span>).
        * khtml/xml/dom_positioniterator.cpp: Change the following four functions to consider all nodes, not just
        leaves of the DOM tree. This is a step towards making this iteration less cranky and unpredictable, and
        was necessary to do now to keep the inRenderedContent() change above from breaking editign layout tests.
        (DOM::PositionIterator::peekPrevious)
        (DOM::PositionIterator::peekNext)
        (DOM::PositionIterator::atStart)
        (DOM::PositionIterator::atEnd)
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForCurrentPosition): Check that the position being checked is an element and that the
        element is in rendered content. I ran across some null-check failures while I was coding this fix, and
        the additions seem prudent.
        
        Updated these layout tests with new results.
        
        * layout-tests/editing/deleting/delete-3608430-fix-expected.txt:
        * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
        * layout-tests/editing/deleting/delete-block-contents-001-expected.txt:
        * layout-tests/editing/deleting/delete-block-contents-002-expected.txt:
        * layout-tests/editing/deleting/delete-block-contents-003-expected.txt:
        * layout-tests/editing/deleting/delete-image-004-expected.txt:
        * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
        * layout-tests/editing/editing.js:
        * layout-tests/editing/execCommand/boldSelection-expected.txt:
        * layout-tests/editing/execCommand/italicizeByCharacter-expected.txt:
        * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt:
        * layout-tests/editing/execCommand/print-expected.txt:
        * layout-tests/editing/execCommand/selectAll-expected.txt:
        * layout-tests/editing/selection/extend-by-character-002-expected.txt:
        * layout-tests/editing/selection/extend-by-character-004-expected.txt:
        * layout-tests/editing/selection/extend-by-character-005-expected.txt:
        * layout-tests/editing/selection/extend-by-character-006-expected.txt:
        * layout-tests/editing/selection/select-all-001-expected.txt:
        * layout-tests/editing/selection/select-all-002-expected.txt:
        * layout-tests/editing/selection/select-all-003-expected.txt:

2004-08-30  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3637519> REGRESSION (125-128): unrepro crash in QListBox::sizeForNumberOfLines at istweb.apple.com

        * kwq/KWQListBox.h: Added a clearCachedTextRenderers function.
        * kwq/KWQListBox.mm:
        (itemTextRenderer): Change to use globals that are outside the function, and added retain calls.
        (groupLabelTextRenderer): Ditto.
        (QListBox::clearCachedTextRenderers): Release global text renderers and nil out the globals.

        * kwq/WebCoreBridge.h: Removed updateAllViews; not needed any more.
        * kwq/WebCoreBridge.mm: Ditto.

        * kwq/WebCoreTextRendererFactory.h: Added a clearCaches method.
        * kwq/WebCoreTextRendererFactory.mm:
        (-[WebCoreTextRendererFactory clearCaches]): Added. Tells all the views to repaint after clearing the cached
        text renderers from KWQListBox. To be more elegant, we could generalize the KWQListBox trick, but for now why bother?

        * kwq/WebCoreTextRendererFactory.m: Removed. I needed to put some C++ code in here, so changed the extension to .mm.
        * WebCore.pbproj/project.pbxproj: Removed WebCoreTextRendererFactory.m, and added WebCoreTextRendererFactory.mm.

2004-08-30  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3528538> can paste a Return character into the Search field at amazon.com, other browsers won't

        * kwq/KWQTextField.mm: (-[KWQTextFieldController controlTextDidChange:]):
        Truncate text before the first line break.

2004-08-30  Darin Adler  <darin@apple.com>

        * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC):
        Added some more assertions I used to track down what looks like a TEC bug.

2004-08-30  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3779122> No accesskey support on LABEL element

        * khtml/html/html_formimpl.h: Change type of m_currValue to DOMString. Should have been done
        as part of my form data check-in, but harmless to do now. Add accessKeyAction function for
        HTMLLabelElementImpl.
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLButtonElementImpl::parseHTMLAttribute): Remove conversion of DOMString to QString
        for m_currValue.
        (DOM::HTMLLabelElementImpl::formElement): If there's no "for" attribute, search children for
        the first control.
        (DOM::HTMLLabelElementImpl::accessKeyAction): Forward the accesskey action to the formElement.

2004-08-30  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3303968> final newline character omitted from <textarea> when parsing a new page

        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::processListing): Handle newline pending
        cases as well as space and tab pending spaces at the end of this function. This seems right for
        both scripts and text areas; it's not clear why omittiing the LF is ever needed. Tested by running
        all the layout tests; no regressions.

        - fixed <rdar://problem/3552736> word wrapped text fields that blur/focus when you type move the insertion point strangely (vtext.com)

        * khtml/rendering/render_form.cpp: (RenderTextArea::updateFromElement): Call text() instead of
        calling widget->text() directly. This prevents this function from running in cases where the
        text didn't really change for text areas in wrap mode.

2004-08-30  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - got rid of ERROR message when running layout tests by implementing text-transform in computed style

        * khtml/css/css_computedstyle.cpp:
        (DOM::numberAsString): Added. Helper that returns "1" rather then "1.0" for integer values.
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Fixed use of tabs instead of
        spaces. Fixed switch statements so they don't use default so we get errors if we leave
        a case out. Changed callers to use numberAsString instead of QString::number. Added implementation
        of CSS_PROP_TEXT_TRANSFORM. Added code to prevent falling through to next property when no item
        in a switch statement matches.

2004-08-30  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - did work to prepare for uploading files incrementally when submitting forms

        * khtml/misc/formdata.h: Added. Class for holding form data inside WebCore.
        * khtml/misc/formdata.cpp: Added.

        * khtml/html/html_formimpl.h: Added the FormDataList type, changed the formData function parameters
        and made it private, renamed the encoding method to appendFormData and changed the parameters around.
        * khtml/html/html_formimpl.cpp:
        (DOM::FormDataList): Added. Class that replaces the old use of QValueList<QCString> for form data.
        Later we'll change it to accomodate filenames too.
        (DOM::HTMLFormElementImpl::formData): Changed code to use FormDataList intsead of the old encodingList.
        Also changed to return the "OK" result as the function result and put the form data into something
        passed as an "out" parameter; the old way was the other way around.
        (DOM::HTMLFormElementImpl::submit): Change to use FormData rather than a QByteArray when getting the
        form data to submit.
        (DOM::HTMLButtonElementImpl::appendFormData): Rename from encoding, and use the new appendData function
        instead of the old way of doing += to put data on the list.
        (DOM::HTMLInputElementImpl::appendFormData): Ditto.
        (DOM::HTMLSelectElementImpl::appendFormData): Ditto.
        (DOM::HTMLKeygenElementImpl::appendFormData): Ditto.
        (DOM::HTMLTextAreaElementImpl::appendFormData): Ditto.
        (DOM::FormDataList::FormDataList): Added.
        (DOM::FormDataList::appendString): Added.
        (DOM::FormDataList::begin): Added.
        (DOM::FormDataList::end): Added.

        * khtml/khtml_part.h: Changed the type of the submitForm parameter to FormData instead of QByteArray.
        * khtml/khtmlpart_p.h: Changed the type of the submitFormData data member to FormData instead of QByteArray.
        * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Called the new flattenToString function in all the
        code that handles mailto forms. Called the new flatten function in the non-Apple code path.

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::submitForm): Pass NSArray for form data instead of NSData.

        * kwq/KWQKJob.h: Use FormData instead of QByteArray. A couple other small cleanups.
        * kwq/KWQKJobClasses.h: Ditto.
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate): Ditto.
        (KIO::TransferJob::TransferJob): Ditto.
        (KIO::TransferJob::postData): Ditto.
        * kwq/KWQKPartsBrowserExtension.h: Ditto.
        * kwq/KWQLoader.mm:
        (KWQServeRequest): Ditto.
        (KWQServeSynchronousRequest): Ditto.

        * kwq/KWQFormData.h: Added. A function to convert KHTML form data into an NSArray for communication
        with the WebKit side.
        * kwq/KWQFormData.mm: Added.

        * kwq/WebCoreBridge.h: Pass NSArray instead of NSData for form data.

        * kwq/KWQArrayImpl.h: Added a detach member function. The old version would do unnecessary work when
        detach was called on an array that had exactly one reference.
        * kwq/KWQArrayImpl.mm: (KWQArrayImpl::detach): Added.
        * kwq/KWQMemArray.h: (QMemArray::detach): Call through to KWQArrayImpl.

        * kwq/KWQValueList.h:
        (QValueList::first): Added overload for non-const.
        (QValueList::last): Ditto.

        * ForwardingHeaders/misc/formdata.h: Added.
        * WebCore.pbproj/project.pbxproj: Added formdata.h, formdata.cpp, KWQFormData.h, and KWQFormData.cpp.

        * WebCore-tests.exp: Updated for changes to QValueList, and re-sorted.
        * WebCore-combined.exp: Regenerated.

2004-08-30  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - improved multiple submit logic in preparation for making command-click on a form
          button load a form in another frame

        * kwq/KWQKHTMLPart.h: Added const to a bunch of member functions for cleanup.
        Added prepareForUserAction member function.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::submitForm): Simplified logic and removed special case for "http" and "https".
        (KWQKHTMLPart::renderer): Added const.
        (KWQKHTMLPart::keyEvent): Added call to prepareForUserAction.
        (KWQKHTMLPart::lastEventIsMouseUp): Added const.
        (KWQKHTMLPart::eventMayStartDrag): Added const.
        (KWQKHTMLPart::mouseDown): Added call to prepareForUserAction.
        (KWQKHTMLPart::overrideMediaType): Added const.
        (KWQKHTMLPart::canGoBackOrForward): Added const.
        (KWQKHTMLPart::prepareForUserAction): Added. Clears _submittedFormURL.
        * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityPerformAction:]): Added call to prepareForUserAction.

2004-08-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:

        <rdar://problem/3762231> REGRESSION (Mail): tab key inserts a single space

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::isTab): New helper. Checks a DOMString to see if it is one character and
        that character is a tab.
        (khtml::InputTextCommandImpl::execute): Trap tabs before handling insertion of
        other kinds of whitespace. Treat a tab like four spaces. Rearrange the code to
        update the ending position after the text insertion to cover the new tab case
        where the amount of advance is not the same as the number of character in the
        passed-in DOMString (i.e. tabs expand to four characters).
        
2004-08-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3779706> plain text on pasteboard loses indentation when pasted into Blot

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::documentFragmentWithText): New function that takes over the code from
        KWQKHTMLPart and improves it to handle converting tabs and spaces for suitable
        display in HTML.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge documentFragmentWithText:]): Move smarts from here to KWQKHTMLPart.

2004-08-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website

	Because we will stop parsing when there is a pending redirection,
	avoid setting one if no navigation would actually take place
	because the number of steps is out of range.
	
        * khtml/khtml_part.cpp:
        (KHTMLPart::scheduleHistoryNavigation):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::canGoBackOrForward):
        * kwq/KWQKPartsBrowserInterface.h:
        * kwq/WebCoreBridge.h:

2004-08-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Chris.

	- fixed <rdar://problem/3778043> REGRESSION: innerHTML is broken, breaks automated iBench testing
	- also fixed outerHTML, which would spill over past the node for whch it was supposed to get HTML
	
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::outerHTML):
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::toHTML):
        (NodeImpl::recursive_toString):
        (NodeImpl::recursive_toHTML):
        * khtml/xml/dom_nodeimpl.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge markupStringFromNode:nodes:]):

	- added new layout tests to cover the problems I fixed
        
	* layout-tests/fast/innerHTML/001-expected.txt: Added.
        * layout-tests/fast/innerHTML/001.html: Added.
        * layout-tests/fast/innerHTML/002-expected.txt: Added.
        * layout-tests/fast/innerHTML/002.html: Added.
        * layout-tests/fast/innerHTML/003-expected.txt: Added.
        * layout-tests/fast/innerHTML/003.html: Added.

2004-08-27  David Hyatt  <hyatt@apple.com>

	Fix for 3739239, getComputedStyle of top not being implemented broke a site that checked for it.
	
        Reviewed by kocienda

        * khtml/css/css_computedstyle.cpp:
        (DOM::valueForLength):
        (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue):
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        * khtml/css/css_computedstyle.h:

2004-08-27  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        Tweaked option-tab handling to match good suggestion from Tim Omernick of OmniWeb

        * kwq/KWQTextArea.mm:
        removed override of textDidChange:
        (-[KWQTextAreaTextView keyDown:]):
        moved option-tab handling that was in textDidChange to here. Rearranged existing code
        a little for clarity.

2004-08-27  Adele Amchan  <adele@apple.com>

        Reviewed by Darin.

	Fix for:
	<rdar://problem/3689949> Provide contentWindow access on an iframe

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::getValueProperty): added cases for contentWindow for frames and iframes
        * khtml/ecma/kjs_html.h: added contentWindow to the list of properties for frames and iframes
        * khtml/ecma/kjs_html.lut.h: regenerated file
        * khtml/html/html_baseimpl.cpp:
        (HTMLFrameElementImpl::contentPart): factored out old contentDocument code to return KHTMLPart for frame
        (HTMLFrameElementImpl::contentDocument): now just gets the contentDocument from contentPart
        * khtml/html/html_baseimpl.h: added declaration for contentPart

=== Safari-161 ===

2004-08-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3778059> Odd behaviour when editing between blockquote elements

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::deleteUnrenderedText): This function should not move
        the selection out of the current block, ever. This is exactly what the bug reported.
        What was I thinking? Now, the code looks at the passed-in position and then the equivalent
        upstream and downstream positions to see if the selection can be placed there after the
        delete, and settles on the block containing the passed-in position as a fallback.
        * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3778059-fix.html: Added.

2004-08-26  Richard Williamson   <rjw@apple.com>

        Boiler plate for canvas gradients and patterns.

        Reviewed by John.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        (Context2D::tryPut):
        (Context2D::~Context2D):
        (KJS::GradientFunction::tryCall):
        (Gradient::Gradient):
        (Gradient::tryGet):
        (Gradient::getValueProperty):
        (Gradient::tryPut):
        (Gradient::putValue):
        (Gradient::~Gradient):
        (ImagePattern::ImagePattern):
        (ImagePattern::tryGet):
        (ImagePattern::getValueProperty):
        (ImagePattern::tryPut):
        (ImagePattern::putValue):
        (ImagePattern::~ImagePattern):
        * khtml/ecma/kjs_html.h:
        (KJS::Gradient::toBoolean):
        (KJS::Gradient::classInfo):
        (KJS::Gradient::):
        (KJS::ImagePattern::toBoolean):
        (KJS::ImagePattern::classInfo):
        (KJS::ImagePattern::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-08-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3777899> REGRESSION (Mail): only first of several misspelled words separated by 
        carriage returns is marked

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Give the spellchecker a slightly larger 
        selection to work with while typing. This should preclude bugs of this type.

2004-08-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris
        
        Fix for this bug:
        
        <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point

        * khtml/rendering/render_box.cpp:
        (RenderBox::caretPos): Always use the font height for calculating the caret height in 
        non-replaced elements (like blocks), rather than the height of the box.

2004-08-26  Ken Kocienda  <kocienda@apple.com>

        Silly me. Forgot to add this file before.

        * layout-tests/editing/inserting/insert-3775316-fix-expected.txt: Added.

2004-08-26  David Hyatt  <hyatt@apple.com>

	Fix for 3777172, crash from nested colgroup.  Don't allow nested table sections or col groups.
	
        Reviewed by darin

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):

2004-08-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3775316> document sprouts an extra newline character at the end

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InputNewlineCommandImpl::doApply): There was in insufficient check
        in the code which adds extra BR elements at the ends of blocks, which we do 
        to work around the fact that BR elements, when they are the last element in a
        block, do not render. Now the code sees whether there already is one of these
        extra BR's in the document and won't add and "extra" extra. 
        * layout-tests/editing/inserting/insert-3775316-fix.html: Added.

2004-08-26  David Hyatt  <hyatt@apple.com>

	Fix for 3710721 and 3504114, crashes because of bad ownership model for list markers.
	
        Reviewed by mjs

        * khtml/rendering/render_container.cpp:
        (RenderContainer::detach):
        * khtml/rendering/render_list.cpp:
        (RenderListItem::setStyle):
        (RenderListItem::detach):
        (RenderListItem::updateMarkerLocation):
        * khtml/rendering/render_list.h:

2004-08-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::doApply): Remove the StayInBlock modifier from the
        call to upstream when passing the start position to removeStyle(). This makes the
        start position sufficiently upstream so that all relevant style tags are removed.
        (khtml::ApplyStyleCommandImpl::removeStyle): Pass the start position to nodeFullySelected.
        (khtml::ApplyStyleCommandImpl::nodeFullySelected): Change interface so start position
        for calculation is passed in, rather than recalculating it every time.
        * khtml/editing/htmlediting_impl.h: nodeFullySelected interface change.
        * khtml/xml/dom_position.h: Add a comment about the working of upstream() and
        downstream().

2004-08-26  Ken Kocienda  <kocienda@apple.com>

        Fix garbled contenteditable attribute. I must have checked
        this in with a typo.

        * layout-tests/editing/deleting/delete-3775172-fix.html

2004-08-25  Kevin Decker  <kdecker@apple.com>

        Reviewed by John and Maciej.

	- Fixes SAP bug <rdar://problem/3751295> Personalize link at the
 	top gives an error in the pop-up window. 

        * khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall): Passes a referrer to KHTMLPart::begin() 

2004-08-25  Richard Williamson   <rjw@apple.com>

	Updated to <canvas> API to match the spec.  (Still need
	to implement gradients and patterns.)

        Reviewed by Ken.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        (Context2D::getValueProperty):
        (Context2D::drawingContext):
        (Context2D::colorRefFromValue):
        (Context2D::colorFromValue):
        (Context2D::setShadow):
        (Context2D::putValue):
        (Context2D::save):
        (Context2D::restore):
        (Context2D::Context2D):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-08-25  Ken Kocienda  <kocienda@apple.com>

        * layout-tests/editing/deleting/delete-3775172-fix.html: Wrong version of test checked in
        a moment ago.

2004-08-25  Ken Kocienda  <kocienda@apple.com>

        Added test case for <rdar://problem/3775172> Blot crashes after typing one character then deleting it

        * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3775172-fix.html: Added.

2004-08-25  Ken Kocienda  <kocienda@apple.com>

        * layout-tests/editing/style/style-3690704-fix-expected.txt: Fewer styling spans added
        on this test as a result of the previously-checked-in fix.

2004-08-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
        now in the iteration when attempting to find nodes that can be styled together with one span.
        * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
        bug fix.

2004-08-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3775172> Blot crashes after typing one character then deleting it

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Bail early if the element
        being queried does not have a renderer or that renderer does not have a style. Prevents
        a crash in the cases that it does not.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::doApply): Add one more case to deleting when the
        start and end nodes are different. If the downstream end node is the last node in the
        block, then it may need to be deleted completely. Before this patch, the code
        erroneously assumed that any deletion in this node had to be trimming of a text node.
        This was asserted, and the description in 3775172 shows a simple case where this assertion
        does not hold. The additional case and associated checks now make it all better.
        * layout-tests/editing/deleting/delete-3775172-fix.html: Added.

2004-08-25  David Hyatt  <hyatt@apple.com>

	Fix for 3365086, large tables crash Safari.  Make sure to use ints rather than shorts for row and column
	counts.  Also fix a pathological array resize scenario for tables as rows are added.
	
        Reviewed by darin

        * khtml/rendering/render_table.cpp:
        (RenderTable::splitColumn):
        (RenderTable::appendColumn):
        (RenderTableSection::RenderTableSection):
        (RenderTableSection::ensureRows):
        (RenderTableSection::setCellWidths):
        (RenderTableSection::calcRowHeight):
        (RenderTableSection::layoutRows):
        (RenderTableSection::paint):
        (RenderTableSection::recalcCells):
        (RenderTableSection::clearGrid):
        * khtml/rendering/render_table.h:
        (khtml::RenderTableSection::numRows):

2004-08-25  David Hyatt  <hyatt@apple.com>

	To save memory in the common case, move the margin***Collapse variables into the CSS3 struct instead of
	bloating the surround struct.
	
        * khtml/rendering/render_style.cpp:
        (StyleSurroundData::StyleSurroundData):
        (StyleSurroundData::operator==):
        (marginBottomCollapse):
        (StyleCSS3NonInheritedData::operator==):
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::marginTopCollapse):
        (khtml::RenderStyle::marginBottomCollapse):
        (khtml::RenderStyle::setMarginTopCollapse):
        (khtml::RenderStyle::setMarginBottomCollapse):

2004-08-25  David Hyatt  <hyatt@apple.com>

	Fix the "extra space in TypePad blogs" Emerson problem by adding the ability to collapse away margins.
	Also added support for explicitly preventing margin collapsing.
	
        Reviewed by mjs

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::isSelfCollapsingBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        * khtml/rendering/render_style.cpp:
        (StyleSurroundData::StyleSurroundData):
        (StyleSurroundData::operator==):
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::marginTopCollapse):
        (khtml::RenderStyle::marginBottomCollapse):
        (khtml::RenderStyle::setMarginTopCollapse):
        (khtml::RenderStyle::setMarginBottomCollapse):
        (khtml::RenderStyle::initialMarginTopCollapse):
        (khtml::RenderStyle::initialMarginBottomCollapse):

2004-08-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Improved the ability of the bridge to report selection state.     

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::TypingCommandImpl::doApply): Bail when there is no selection.
        * kwq/WebCoreBridge.h: Added an enum to report selection state. These constants
        mirror those used in DOM::Selection.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge selectionState]): Replacement for haveSelection. Returns a value 
        from an enum telling whether the selection is in the None, Caret, or Range state, 
        rather than just true/false for the Range state as it did before.

2004-08-24  David Hyatt  <hyatt@apple.com>

	Make sure the ifdef XSLT is present for Panther.
	
        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::insertErrorMessageBlock):

2004-08-24  David Hyatt  <hyatt@apple.com>

	Polish the XML error message so that it indicates when a document is the result of an XSL transformation
	when reporting line/col #s.
	
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::applyXSLTransform):
        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::insertErrorMessageBlock):
        * khtml/xsl/xslt_processorimpl.cpp:
        (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):

2004-08-24  David Hyatt  <hyatt@apple.com>

	Add support for Atom and RSS MIME types to the set of XML types.
	
        Reviewed by rjw

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty):
        * khtml/khtml_part.cpp:
        (KHTMLPart::begin):
        * khtml/misc/loader.cpp:
        (CachedXSLStyleSheet::CachedXSLStyleSheet):
        (CachedXBLDocument::CachedXBLDocument):
        * khtml/xml/dom_xmlimpl.cpp:
        (DOM::ProcessingInstructionImpl::checkStyleSheet):

2004-08-24  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3746447> hang loading geocities.com/cinemaorchestra

        Reviewed by john.

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget): do nothing if the src URL is the same as the part's URL

2004-08-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3773564> REGRESSION (125-159): Code to remove HTML styles before applying new HTML styles is broken

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::doApply): Unrelated change to constrain downstream position of selection
        start to block boundaries. This is a new feature of the downstream function and I missed this usage
        when adding the feature.
        (khtml::ApplyStyleCommandImpl::removeCSSStyle): There once was code to remove style attributes from spans
        which became emptied as a result of removing CSS properties, but I do not see such code in the 
        tree any more. A quick review of the ChangeLog did not reveal anything. I do not remember making such
        a change myself...
        
        In any case, I have restored logic to prune out styling spans we insert if the process of 
        removing styles caused a span-plus-styles node to become emptied of markup which changes the style
        of its contents. This fixes the bug.

2004-08-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3765535> paste of text with newlines into text with newlines results in broken doc, crash
        
        This is a "belt and suspenders" fix. The issue is with the paste code path which was creating
        zero-length DOM text nodes when a selection being pasted ended with a newline. The normal
        code path for parsing HTML does not allow this, but the code to convert newlines to BR's 
        during paste was creating such nodes. This will no longer happen.
        
        In the case where someone inserts such zero-length nodes using the DOM API, the render tree
        will no longer create render objects for these nodes, and it was these empty render text 
        nodes that was confusing the code doing editing navigation.

        * khtml/xml/dom_textimpl.cpp:
        (CharacterDataImpl::rendererIsNeeded): Do not create renderers for zero-length DOM text nodes.
        * khtml/xml/dom_textimpl.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge documentFragmentWithText:]): Do not insert zero-length DOM text nodes as part
        of converting line-end sequences to BR's.

2004-08-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	- reduce cost of innerHTML from O(N^2) to O(N*D) where N is the
	number of nodes and D is the maximum DOM tree depth.
	
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toString): New static helper method for
	recursive_toHTML - this is recursive for children but iterative
	for siblings.
        (NodeImpl::recursive_toHTML): Call the helper with this as the
	first argument.
        * khtml/xml/dom_nodeimpl.h:

2004-08-23  David Hyatt  <hyatt@apple.com>

	Fix for 3558334. 

	Init the encodedURL explicitly for CSSStyleSelectors.  Construction time was too early to be passing in the
	document m_url, since it doesn't get set during construction.

	Fix for 3769643, crash on vancouverblast.org.
	
        Reviewed by darin

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::CSSStyleSelector):
        (khtml::CSSStyleSelector::init):
        (khtml::CSSStyleSelector::setEncodedURL):
        * khtml/css/cssstyleselector.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::setURL):
        (DocumentImpl::recalcStyleSelector):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::URL):

2004-08-23  Kevin Decker  <kdecker@apple.com>

        Reviewed by Maciej.

	- fixed rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall 	with application/xhtml+xml Content-Type
        * khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall): since this is an xml document, we get the
	domain from the xmlDocImpl(), not docImpl().

2004-08-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3771426> assertion failed due to reentering dispatchImageLoadEventsNow
        
	* khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::dispatchImageLoadEventsNow): Avoid re-entering this
	function, since it uses a data member for the copy of the list of events
	to be dispatched.

2004-08-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3770306> XMLHttpRequest does not honor character set encoding

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::slotData): Get encoding from the transfer job.
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate): Added retrievedCharset
	flag.
        (KIO::TransferJob::retrieveCharset): New method, gets the charset
	from the response.
        (KIO::TransferJob::queryMetaData): Handle charset.
        (KIO::TransferJob::emitReceivedResponse): Clear retreivedCharset flag.
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (KWQResponseTextEncodingName): New function, gets the encoding from the response.

2004-08-23  David Hyatt  <hyatt@apple.com>

	Apply leo's fix to marquees.
	
        Reviewed by hyatt

        * khtml/rendering/render_layer.cpp:
        (Marquee::start):

2004-08-20  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - added an ascii() member function to DOMString and DOMStringImpl to help debugging

        * khtml/dom/dom_string.h: Add ascii member function for debugging.
        * khtml/dom/dom_string.cpp: (DOM::DOMString::ascii): Added. Calls through to DOMStringImpl::ascii.
        * khtml/xml/dom_stringimpl.h: Add ascii member function for debugging.
        * khtml/xml/dom_stringimpl.cpp: (DOM::DOMStringImpl::ascii): Added. Makes a new buffer and puts
        a simple ASCII version in it. Maybe make it better about characters outside the 0x20-0x7E range
        some day, but for now this is way better than what we had before.

2004-08-20  David Hyatt  <hyatt@apple.com>

	Divorce the notion of a marquee being stopped from JS from the notion of being suspended by the back/forward cache.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElementFunction::tryCall):
        * khtml/rendering/render_layer.cpp:
        (m_direction):
        (Marquee::start):
        (Marquee::stop):
        (Marquee::updateMarqueePosition):
        * khtml/rendering/render_layer.h:

2004-08-20  Richard Williamson   <rjw@apple.com>

        Implemented new JNI abstraction.  We no longer invoke Java methods
        directly with JNI, rather we call into the plugin.  This allows the
        plugin to dispatch the call to the appropriate VM thread.  This
        change should (will?) fix a whole class of threading related problems with
        the Java VM.

        Reviewed by Hyatt.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getAppletInstanceForView):
        * kwq/WebCoreBridge.mm:
        (rootForView):
        (-[WebCoreBridge executionContextForView:]):

2004-08-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	More text paint cleanup. Separated the background and foreground
	passes instead of doing a weird for loop thing. Eliminated
	redundant if conditions. Added comments.

        * khtml/rendering/render_text.cpp:
        (RenderText::paint):

2004-08-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        * khtml/css/css_computedstyle.cpp:
        (DOM::): Changed CopyProperties constant to InheritableProperties. This reflects the
        name change of copy() to copyInheritableProperties()
        (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties: Renamed from copy().
        Now just copies those properties which can be inherited.
        (DOM::CSSComputedStyleDeclarationImpl::diff): Add a couple null checks.
        * khtml/css/css_computedstyle.h: copyInheritableProperties name change. No longer needs to be virtual.
        * khtml/css/css_valueimpl.cpp: Removed unneeded copy() function from CSSStyleDeclarationImpl.
        * khtml/css/css_valueimpl.h: Ditto.
        * khtml/editing/htmlediting.cpp:
        (khtml::EditCommand::typingStyle): Added.
        (khtml::EditCommand::setTypingStyle): Added.
        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::StyleChange::currentlyHasStyle): Fix leak of computed style used in this function.
        (khtml::EditCommandImpl::EditCommandImpl): Initialize m_typingStyle.
        (khtml::EditCommandImpl::~EditCommandImpl): Deref m_typingStyle.
        (khtml::EditCommandImpl::assignTypingStyle): New helper used in setting typing style.
        (khtml::EditCommandImpl::setTypingStyle): New setter.
        (khtml::DeleteSelectionCommandImpl::doApply): Use new method for managing typing style.
        * khtml/editing/htmlediting_impl.h:
        (khtml::EditCommandImpl::typingStyle): New accessor.
        * khtml/khtml_part.cpp:
        (KHTMLPart::appliedEditing): Restores typing style from command after setting selection.
        (KHTMLPart::applyStyle): Does a diff between the current style and the style of the caret.
        * khtml/khtml_part.h:
        * khtml/xml/dom_position.cpp:
        (DOM::Position::computedStyle): Now returns a CSSComputedStyleDeclarationImpl instead of a plain
        CSSStyleDeclarationImpl.
        * khtml/xml/dom_position.h:
        * layout-tests/editing/style/style-3681552-fix-002-expected.txt:

2004-08-20  Trey Matteson  <trey@apple.com>

	3655407 - Editing: -complete: method unimplemented (WebKit editing API)

	One new support routine here.

        Reviewed by John

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge caretRectAtNode:offset:]):  New routine.
        (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
	Fixed former misleading method name.

2004-08-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Trey

        Fix for this bug:
        
        <rdar://problem/3768378> crash typing newline in Blot

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InputNewlineCommandImpl::doApply): Adding an assert in a recent change
        showed up that inserting newlines that was not being handled correctly for the 
        case described in the bug. I added a new case to handle inserting BR's when
        at the caret max offset for a node, and this new code runs instead of the
        fall-through case that should not have been running and triggered the assert.
        * layout-tests/editing/inserting/insert-br-case2-expected.txt: Regenerated results.
        * layout-tests/editing/inserting/insert-br-case6-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-case6.html: Added.

2004-08-20  Trey Matteson  <trey@apple.com>

        Fixing: Spellchecker called once or twice for every char typed.

        Reviewed by Ken

        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection):  Don't do any spell checking if we're typing (it's done
        elsewhere, in markMisspellingsAfterTyping)
 
2004-08-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed <rdar://problem/3549369> Crash at www.e1.ru in HTMLTokenizer::notifyFinished

	Probably also fixed the following likely duplicates:

	<rdar://problem/3503938> Safari crashed opening many tabs (HTMLTokenizer::notifyFinished(khtml::CachedObject*))
	<rdar://problem/3566332> CrashTracer: ..405 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
	<rdar://problem/3703964> CrashTracer: ...86 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
	<rdar://problem/3703969> CrashTracer: ..234 crashes at com.apple.WebCore: HTMLTokenizer::notifyFinished + 0x1c8

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::open): call setParsing(true), because we need to know we are once again
	parsing when we re-open a document that has previously completed loading.

2004-08-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave and Darin.

        * khtml/rendering/render_text.cpp:
        (RenderText::paint): Split apple and non-apple code paths to allow further cleanup.

2004-08-19  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3767274> crash in partForWidget inside setFocus (test page attached)

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Remove code to do position
        the widget; no longer needed since we reworked how widgets get their positions.
        * kwq/KWQWidget.mm: (QWidget::setFocus): Ditto. This was the one that caused the bug.

2004-08-19  David Hyatt  <hyatt@apple.com>

	Fix crash when text is contained inside a table-colgroup.
	
        Reviewed by john

        * khtml/xml/dom_textimpl.cpp:
        (TextImpl::rendererIsNeeded):

2004-08-19  Trey Matteson  <trey@apple.com>

	Unexpected errors hit while finding word boundaries, leading to crash.

        Reviewed by Ken.

        * kwq/KWQTextUtilities.cpp:
        (KWQFindWordBoundary):  Don't call UCFindTextBreak with edge cases it thinks
	are param errors, and pass correct mask for forward case.  Also fix off-by-one
	crashers in fallback code.

2004-08-19  David Hyatt  <hyatt@apple.com>

	Make XSLT imports/includes work.  This code has to be turned off until the newer version of libxslt is
	available.
	
        Reviewed by kocienda

        * khtml/css/css_ruleimpl.cpp:
        (CSSImportRuleImpl::init):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::~DocumentImpl):
        (DocumentImpl::applyXSLTransform):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::setTransformSource):
        (DOM::DocumentImpl::transformSource):
        * khtml/xml/dom_xmlimpl.cpp:
        (DOM::ProcessingInstructionImpl::checkStyleSheet):
        * khtml/xml/xml_tokenizer.cpp:
        (khtml::matchFunc):
        (khtml::openFunc):
        (khtml::readFunc):
        (khtml::writeFunc):
        (khtml::createQStringParser):
        (khtml::XMLTokenizer::setTransformSource):
        * khtml/xsl/xsl_stylesheetimpl.cpp:
        (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
        (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
        (DOM::XSLStyleSheetImpl::isLoading):
        (DOM::XSLStyleSheetImpl::clearDocuments):
        (DOM::XSLStyleSheetImpl::parseString):
        (DOM::XSLStyleSheetImpl::loadChildSheets):
        (DOM::XSLStyleSheetImpl::loadChildSheet):
        (DOM::XSLImportRuleImpl::parentStyleSheet):
        (DOM::XSLStyleSheetImpl::compileStyleSheet):
        (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
        (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
        (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
        (DOM::XSLImportRuleImpl::setStyleSheet):
        (DOM::XSLImportRuleImpl::isLoading):
        (DOM::XSLImportRuleImpl::loadSheet):
        * khtml/xsl/xsl_stylesheetimpl.h:
        (DOM::XSLStyleSheetImpl::setOwnerDocument):
        (DOM::XSLStyleSheetImpl::setDocument):
        (DOM::XSLStyleSheetImpl::markAsProcessed):
        (DOM::XSLStyleSheetImpl::processed):
        (DOM::XSLImportRuleImpl::href):
        (DOM::XSLImportRuleImpl::styleSheet):
        (DOM::XSLImportRuleImpl::isImportRule):
        * khtml/xsl/xslt_processorimpl.cpp:
        (DOM::m_sourceDocument):
        (DOM::stylesheetLoadFunc):
        (DOM::XSLTProcessorImpl::transformDocument):
        * khtml/xsl/xslt_processorimpl.h:

=== Safari-158 ===

2004-08-18  Trey Matteson  <trey@apple.com>

	3765958	- downstreamPosition() can hit infinite loop when at end of doc
	
	The problem was that I had a position that was after the maximum position in the text
	node, because it was the old caret position before a backspace was processed.  Later
	I happened to call downstream() on that position, and hit the bug.  Fix is to consider
	a position past the end point of its node if it is *greater than* or equal to its max offset.
		 	
        Reviewed by Ken.

        * khtml/xml/dom_positioniterator.cpp:
        (DOM::PositionIterator::atEnd):

2004-08-18  David Hyatt  <hyatt@apple.com>

        - did WebCore part of <rdar://problem/3682969> SLIDER: absolute left position of slider should be headline only

	Make the header overlap the footer in the zero-line case.  Changes to Emerson's template will ensure the
	header draws over the footer.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::getHeightForLineCount):

2004-08-18  Richard Williamson   <rjw@apple.com>

        Replace horrible pollForAppletInView: with new
        webPlugInGetApplet.  The details of how the applet instance
        is provided now belong to the Java team.  Yeh.
		
        Reviewed by Chris.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getAppletInstanceForView):
        * kwq/WebCoreBridge.h:

2004-08-18  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)

        Reviewed by trey.

        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
        * khtml/xml/dom2_rangeimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
        * khtml/xml/dom_nodeimpl.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
        (-[WebCoreBridge markupStringFromRange:nodes:]): ditto

2004-08-18  Ken Kocienda  <kocienda@apple.com>

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
        Note to self: read code before making changes to it.

2004-08-18  Ken Kocienda  <kocienda@apple.com>

        Coded by Darin and Ken

        * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
        the properties we implement that we also want to copy in the new
        CSSComputedStyleDeclarationImpl::copy described below.
        (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
        computed values of all the properties listed in CopyProperties. In essence, this makes
        a freeze-dired version of a computed style.
        (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in 
        CSSStyleDeclarationImpl that is also in the computed style.
        * khtml/css/css_computedstyle.h:
        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
        straightforward. Returns a copy that will be unchanged when the original changes.
        * khtml/css/css_valueimpl.h:
        (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the 
        CSSStyleDeclarationImpl is const.

2004-08-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
	
        * khtml/khtmlview.cpp:
        (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
	assertion for m_part being null. It seems impossible for this to
	happen, so we want to debug it ourselves, but in the meantime,
	let's try to avoid causing crashes for our users.

2004-08-17  David Hyatt  <hyatt@apple.com>

	Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
	is visible.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::getHeightForLineCount):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutVerticalBox):

2004-08-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Rewrite of the command that deletes a selection. I deleted great 
        big swaths of bug-ridden code to accomplish this and replaced it
        with code that is much cleaner and smarter.
        
        Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
        upstream to downstream, respectively.
        
        Added a couple of new helper methods.
        
        * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
        RemoveNodeAndPruneCommand now obsolete. A huge win.
        * khtml/editing/htmlediting.h: Ditto.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
        (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
        version of 
        (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
        (khtml::ApplyStyleCommandImpl::nodeFullySelected):  upstream/downstream name change
        (khtml::DeleteSelectionCommandImpl::doApply):  upstream/downstream name change
        (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
        passed offset is less than the length of the text node.
        (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
        (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
        (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
        (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
        (khtml::InputTextCommandImpl::execute): upstream/downstream name change
        (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
        (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
        (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
        (khtml::TypingCommandImpl::deleteKeyPressed):
        * khtml/editing/htmlediting_impl.h:
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordBoundary):
        (DOM::Position::nextWordBoundary):
        (DOM::Position::upstream):
        (DOM::Position::downstream):
        (DOM::Position::inRenderedText): Add null check.
        (DOM::Position::isRenderedCharacter): New helper.
        (DOM::isWS): New helper in this file.
        (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
        (DOM::Position::trailingWhitespacePosition): Ditto.
        (DOM::Position::debugPosition): Add null check.
        * khtml/xml/dom_position.h:
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::toRange): upstream/downstream name change
        (DOM::Selection::validate): upstream/downstream name change
        (DOM::Selection::debugPosition): upstream/downstream name change
        * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
        * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
        * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
        * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
        * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
        * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
        * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.

2004-08-17  Trey Matteson  <trey@apple.com>

	Various spelling fixes.

        Reviewed by Ken.

        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): No misspellings in the spelling code comments
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::removeMarker):  Repaint if doc changes.  Sometimes the markers
	were not being erased when you clicked in a word.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordBoundary):  Small optimization.  Bail after first
	try if the second try will not come out any different.
        (DOM::Position::nextWordBoundary):  Ditto
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::markMisspellingsInSelection):  Comment.

2004-08-17  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)

        * khtml/khtml_part.h: Make completeURL public.
        * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
        before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
        '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
        and also is obviously correct behavior that may fix other sites too.

        - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)

        * kwq/KWQListBox.mm:
        (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
        a new detach method.
        (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
        source to nil, so we don't need nil checks in delegate and data source methods.
        (-[KWQTableView mouseDown:]): Add nil check.
        (-[KWQTableView keyDown:]): Add nil check.
        (-[KWQTableView keyUp:]): Add nil check.
        (-[KWQTableView becomeFirstResponder]): Add nil check.
        (-[KWQTableView resignFirstResponder]): Add nil check.
        (-[KWQTableView canBecomeKeyView]): Add nil check.
        (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
        callback, to handle cases where calls to JavaScript result in the QListBox going away partway
        through.
        (-[KWQTableView drawRow:clipRect:]): Add nil check.
        (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.

2004-08-17  Trey Matteson  <trey@apple.com>

	Fix ASSERT in spelling marker management.

        Reviewed by John.

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::shiftMarkers):  Use assert instead of ASSERT.
	Tweak test to allow for a start position of 0.

2004-08-17  Trey Matteson  <trey@apple.com>

	3764147 - failure of subframe to load leaves links in parent doc broken

        Reviewed by Maciej.

        * khtml/khtml_part.cpp:
        (KHTMLPart::childBegin):  New method to mark part as not complete.
        (KHTMLPart::processObjectRequest):  Mark child part imcomplete, so if we
	later get a failure on load it won't think it's already complete and do nothing.
        * khtml/khtml_part.h:

=== Safari-157 ===

2004-08-16  David Hyatt  <hyatt@apple.com>

	Fix the #define.  I had it all backwards.
	
        * WebCorePrefix.h:

2004-08-16  David Hyatt  <hyatt@apple.com>

	Land initial support for XSLT using xml-stylesheet PIs.
	
        * WebCore.pbproj/project.pbxproj:
        * khtml/khtml_part.cpp:
        (KHTMLPart::replaceDocImpl):
        * khtml/khtml_part.h:
        * khtml/khtmlview.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::~DocumentImpl):
        (DocumentImpl::recalcStyleSelector):
        (DocumentImpl::applyXSLTransform):
        (DocumentImpl::setTransformSourceDocument):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::setTransformSource):
        (DOM::DocumentImpl::transformSource):
        (DOM::DocumentImpl::transformSourceDocument):
        * khtml/xml/dom_xmlimpl.cpp:
        (DOM::ProcessingInstructionImpl::checkStyleSheet):
        * khtml/xml/dom_xmlimpl.h:
        (DOM::ProcessingInstructionImpl::isXSL):
        * khtml/xml/xml_tokenizer.cpp:
        (khtml::matchFunc):
        (khtml::openFunc):
        (khtml::createQStringParser):
        (khtml::XMLTokenizer::processingInstruction):
        (khtml::XMLTokenizer::finish):
        (khtml::XMLTokenizer::setTransformSource):
        * khtml/xml/xml_tokenizer.h:
        (khtml::Tokenizer::setTransformSource):
        * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
        * khtml/xml/xsl_stylesheetimpl.h: Removed.
        * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
        (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
        (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
        (DOM::XSLStyleSheetImpl::isLoading):
        (DOM::XSLStyleSheetImpl::checkLoaded):
        (DOM::XSLStyleSheetImpl::docLoader):
        (DOM::XSLStyleSheetImpl::parseString):
        * khtml/xsl/xsl_stylesheetimpl.h: Added.
        (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
        (DOM::XSLStyleSheetImpl::type):
        (DOM::XSLStyleSheetImpl::ownerDocument):
        (DOM::XSLStyleSheetImpl::document):
        (DOM::XSLStyleSheetImpl::clearDocument):
        * khtml/xsl/xslt_processorimpl.cpp: Added.
        (DOM::m_sourceDocument):
        (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
        (DOM::XSLTProcessorImpl::transformDocument):
        (DOM::bufferWrite):
        (DOM::XSLTProcessorImpl::addToResult):
        (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
        * khtml/xsl/xslt_processorimpl.h: Added.

2004-08-16  Maciej Stachowiak  <mjs@apple.com>

        Fix build.

        * khtml/khtml_part.cpp:
        (KHTMLPart::isImmediateRedirectPending):

2004-08-16  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage

	Use floats instead of ints to draw images.

        Reviewed by Ken.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::drawPixmap):
        (QPainter::drawFloatPixmap):

2004-08-13  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed <rdar://problem/3752509> Pop up windows not showing up within SAP's BW Module (changing location.href on new window created by window.open)
	
	(actually the previous fix for this bug was mostly correct, but
	this additional change is needed to avoid the regression in
	<rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
	as "need to upgrade to IE 6", but didn't reject 125.8

	So if merging for a software update, make sure to include both
	this and the previous fix.
	
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
	make sure to stop tokenizing, because we need to make sure no further
	script tags are processed beyond the one that triggered the redirect.
        * khtml/khtml_part.cpp:
        (KHTMLPart::isImmediateRedirectPending): New method to allow
	checking if a redirect is pending.
	* khtml/khtml_part.h:

2004-08-15  David Hyatt  <hyatt@apple.com>

        - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea

	Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
	to resync with the DOM.  This behavior matches WinIE.
	
        Reviewed by kocienda

        * khtml/html/html_formimpl.cpp:
        (HTMLTextAreaElementImpl::childrenChanged):
        * khtml/html/html_formimpl.h:

2004-08-13  Trey Matteson  <trey@apple.com>

	3761794 Slider doesn't call onmouseup handler

        Reviewed by Hyatt

        * khtml/rendering/render_form.cpp:
        (RenderSlider::RenderSlider):  Listen for signal.
        (RenderSlider::slotClicked):  Pass to superclass.
        * khtml/rendering/render_form.h:
        * kwq/KWQSlider.h:
        * kwq/KWQSlider.mm:
        (-[KWQSlider mouseDown:]):  Generate mouseUp and clicked events,
	since AK consumes the mouseUp event in a modal tracking loop.
        (QSlider::QSlider):  Make signal.
        (QSlider::clicked):  Send signal.

2004-08-12  Trey Matteson  <trey@apple.com>

	3761329 - query result links all dead in ingrammicro.com (sometimes)
	3761328 - links in some docs dead when doc is loaded from WebArchive

	Make sure to get part to completed state when end is called,
	even if we have no doc.  See WebKit changelog for more info.

        Reviewed by Richard and Darin.

        * khtml/khtml_part.cpp:
        (KHTMLPart::end):

2004-08-13  Trey Matteson  <trey@apple.com>

        3761098 - red dotted underline for misspelled words shows up in drag image

        Reviewed by Ken

        * khtml/rendering/render_text.cpp:
        (RenderText::paint):  Don't draw misspelling when creating selection image.

2004-08-12  Richard Williamson   <rjw@apple.com>

	Bring npruntime.h and friends closer to compliance with
	latest spec.

        Reviewed by Maciej.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::windowScriptNPObject):

2004-08-12  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
	<rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
	
        * kwq/KWQKURL.mm:
        (substituteBackslashes): Helper method
        (KURL::KURL): If the URL contains any backslashes, substitute all
	that appear before the query or fragment.

2004-08-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        Fix for this bug:
        
        <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
        document element was beyond the last node in the document. But this is not true, since the document
        element is the HTML element (generally). Instead, move to the index equal to the number of children
        of the document element. This puts us past everything.
        (DOM::Selection::modifyMovingRightForward): Ditto.

2004-08-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Trey

        Fix for this bug:
        
        <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
        
        Detect when current position is on first or last line and move to the
        start or end of that line, respectively.

        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousLinePosition)
        (DOM::Position::nextLinePosition)

=== Safari-156 ===

2004-08-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Some consolidation in style application code.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of 
        members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
        well as from a CSSStyleDeclarationImpl and a Position.
        (khtml::StyleChange::init): Common init function for StyleChange constructors.
        (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
        (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
        interface.
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
        * khtml/editing/htmlediting_impl.h:
        (khtml::StyleChange::StyleChange):
        (khtml::StyleChange::cssStyle): New accessor.
        (khtml::StyleChange::applyBold): Ditto.
        (khtml::StyleChange::applyItalic): Ditto.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::computedStyle): New helper.
        * khtml/xml/dom_position.h: Ditto.

2004-08-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
        
        Progress on this bug:
        <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
        Also, interface changed to take the node to which the typing style is to be applied. 
        This makes it easier to apply what may be up to three levels of nested tags to get the 
        desired style (<B>, <I>, and <SPAN STYLE="">).
        Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
        italic tags for applying styles when that is apprpriate. This creates on opportunity to
        factor the code to do this so that this function and the ApplyStyleCommandImpl class can
        share the implementation. I will follow up with a change to do that after landing this
        change. Some future code factoring could be done here to bring together some similar code
        into one place.
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
        (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
        ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
        function.
        (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
        (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
        * khtml/editing/htmlediting_impl.h:
        (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so 
        CompositeEditCommandImpl can use it.
        * khtml/khtml_part.cpp:
        (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
        changes, not only when closing typing. This fixes 3751098.
        
        These three tests actually had results that treated the buggy behavior as correct!
        
        * layout-tests/editing/style/style-3681552-fix-001-expected.txt
        * layout-tests/editing/style/style-3681552-fix-002-expected.txt
        * layout-tests/editing/style/typing-style-002-expected.txt

2004-08-12  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field

        * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
        effect of making the text field be first responder, call to bridge first to make it first responder.
        The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
        because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
        an additional setFocusNode(0) call, which is unnecessary and incorrect.

2004-08-12  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document

        * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
        * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
        one node too far in the case where the end container was not a text node.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
        to fix bug where it would run past the end node, including too many nodes in the generated
        HTML. Nice side benefit: easier to read the code.

2004-08-11  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once

        Reviewed by john.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https

2004-08-11  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext

        * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
        Enhanced workaround for shifting focus from one secure text field to another so that it works
        even for the case of shifting focus from a secure text field back to itself.

2004-08-11  Ken Kocienda  <kocienda@apple.com>

        Missed adding this file before.

        * kwq/KWQTextUtilities.mm: Added.
        (KWQFindNextWordFromIndex):

2004-08-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Trey

        Efficiency improvements on string manipulations in these two new function
        implementations. Use the versions of QString append/prepend that take
        (QChar *c, uint length) instead of creating new strings each time.

        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordPosition): Changed, as described above.
        (DOM::Position::nextWordPosition): Ditto.

2004-08-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
        
        I have implemented versions of previousWordPosition and nextWordPosition that are now
        different than previousWordBoundary and nextWordBoundary. The behavior of the new
        functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin! 

        * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
        * khtml/misc/helper.cpp:
        (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
        * khtml/misc/helper.h: Declare the function above.
        * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
        (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
        (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
        * khtml/misc/khtml_text_operations.h:
        (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
        (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
        AppKit to perform the same calculations NSText uses.
        (DOM::Position::nextWordBoundary): Ditto.
        (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
        (DOM::Position::nextWordPosition): Ditto
        (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
        to the number of child nodes it has. This handles more cases correctly, like when the position is
        gives as one beyond the end of a document element's last child.
        * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
        * kwq/KWQTextUtilities.mm: Added.
        (KWQFindNextWordFromIndex): New function.

2004-08-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectionComputedStyle): Added a null check.

2004-08-10  Darin Adler  <darin@apple.com>

        Reviewed by Trey.

        - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari

        I fixed three problems:

            1) script interpreter destroyed while it was interpreting scripts, caused random havoc
            2) code trying to get to view after view was detached from part, caused nil-deref
            3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref

        Now the test page works fine. Hope the real sites do too.

        * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
        * khtml/khtml_part.cpp:
        (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
        (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
        Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
        the interpreter itself is running.
        (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
        checkCompleted.
        (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
        (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
        old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
        (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
        the bug fix, but an earlier version of the fix had changes in this function.
        (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
        (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.

        * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
        child from the frames list.

2004-08-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Trey.

	WebCore part of:

	- made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
	a marked range in WebCore. The provided DOMRange must start and end in the same
	node, which must be a text node.
        (-[WebCoreBridge markedDOMRange]): New call to get the marked range. 
        (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
        * kwq/WebCoreBridge.h: Prototype new methods.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
        (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
	store the marked range, and repaint new and old nodes if needed.
        (KWQKHTMLPart::clear): Clear marked range.
        * kwq/KWQKHTMLPart.h: Prototype new methods.
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintMarkedTextBackground): New method to paint the background
	for marked text, modeled on paintSelection.
	(RenderText::paint): Optionally handle painting marked text
	background as well as selection background in the marked text
	pass.
        * khtml/rendering/render_text.h: Prototype new method.

2004-08-10  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed

        * kwq/KWQRegExp.mm:
        (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
        (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.

2004-08-10  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - minor cleanup

        * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
        The dictionary lookup is case insensitive.

        * kwq/KWQFoundationExtras.h: Remove inaccurate comment.

2004-08-10  Trey Matteson  <trey@apple.com>

	3757094 - crash spell checking after a paste

        Reviewed by Ken

        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintSelection):  Add nil check.

2004-08-09  Trey Matteson  <trey@apple.com>

	3756195 - spell checking leaves misspelling marker behind after bad word is deleted
	... and other follow-on spell check fixes

        Reviewed by Ken

        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintMarker):  Close inspection shows we were drawing the 
	misspelling marker one pixel lower than AK, and one pixel outside the selection
	rect we draw, in the case of Times-16.  So move it up one.  Still not an exact
	match for AK, but less bad.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::removeMarker):  Track whether we make any changes, so we only
	repaint if something actually changed.
        (DocumentImpl::removeAllMarkers):  New utility.
        (DocumentImpl::removeAllMarkers):  Use clear() instead of (errant)
	hand-rolled loop to empty array.
        (DocumentImpl::shiftMarkers):  Track whether we make any changes, so we only
	repaint if something actually changed.
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_textimpl.cpp:
        (CharacterDataImpl::deleteData):  Along with shifting existing markers around,
	remove any markers in the deleted range.  Fixes 3756195.
        (CharacterDataImpl::replaceData):  Ditto for the replaced range.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::updateSpellChecking): comment

2004-08-08  Trey Matteson  <trey@apple.com>

	3745023 - Safari crashes trying to access anchor while downloading

	I bet this is behind a few other crashers as well.  In this bug the start of the
	download leaves a KWQPageState hanging around, and when that is freed it damages
	the part and view.  If you're still using that page, you're dead.

	The fix is to properly invalidate the PageState when we receive an error before
	reaching WebFrameCommitted state.  Normally this happens when a page is reheated
	from the PageState, but in this case we never manage to leave the page to begin
	with, although we've already created the PageState.

	Other errors besides the synthetic one download generates would have caused similar
	crashing.  Another example would be clicking on a second link before the load
	caused by clicking on the first link reached committed state.

        Reviewed by Richard

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge didNotOpenURL:pageCache:]):  Invalidate the pageCache state
	when a load doesn't get off the ground.

2004-08-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

        Finish off spellchecking support to HTML editing. Includes work to
        enable continuous spellchecking.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
        make the call over to the KWQKHTMLPart.
        (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
        inserted content can be spell-checked. The function is basically the same, except for
        the addition of calls to markMisspellingsInSelection.
        (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
        selection that results after typing and determines whether it needs to spellcheck. 
        Since the word containing the current selection is never marked, this does a check to
        see if typing made a new word that is not in the current selection. Basically, you
        get this by being at the end of a word and typing a space.
        (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
        * khtml/editing/htmlediting_impl.h: Add new function declarations.
         * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): Since spell checks are updated when the selection changes, 
        and every selection change passes through here, this is a good place to put the call 
        to the spellchecker.
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
        call that does AppKit-style drawing. Fix up some comments.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show 
        up on setting it.
        (DocumentImpl::removeMarker): Ditto.
        (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
        Used when not in continuous spellchecking mode.
        (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
        This shifts the marker offsets by a given amount. This keeps the markers in the right
        place when a user types in a node with markers already set on it.
        * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
        declarations.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
        needlessly so. Basically, if the current position is at a word boundary, run the code again
        to find the previous word boundary.
        (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
        * khtml/xml/dom_textimpl.cpp:
        (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
        (CharacterDataImpl::insertData): Ditto.
        (CharacterDataImpl::deleteData): Ditto.
        (CharacterDataImpl::replaceData): Ditto.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::advanceToNextMisspelling):
        (KWQKHTMLPart::markMisspellingsInSelection):
        (KWQKHTMLPart::updateSpellChecking):
        (KWQKHTMLPart::respondToChangedSelection):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
        setSelection call. 
        * kwq/WebCoreTextRenderer.h:

=== Safari-155 ===

2004-08-05  David Hyatt  <hyatt@apple.com>

	Fix for 3752542, stack overflow that crashes Safari at www.dr.dk.  This bug is a regression caused by a fix that
	attempted to repair <caption> behavior to make it behave like Panther.  This fix was incorrect, and in addition
	even our <caption> behavior on Panther was incorrect.

	The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
	a <th>, or various table section tags (<tbody>, <tfoot>, <thead>).  The <caption> is pulled out and inserted just before
	the relevant ancestor table section.  This behavior matches other browsers.
	
        Reviewed by mjs

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):

2004-08-04  David Hyatt  <hyatt@apple.com>

	The top-level XSL sheet is now loaded and shows up in the activity window.  It is not yet parsed.
	
        Reviewed by kocienda

        * WebCore.pbproj/project.pbxproj:
        * khtml/css/css_base.h:
        (DOM::StyleBaseImpl::isXSLStyleSheet):
        * khtml/css/css_stylesheetimpl.cpp:
        (CSSStyleSheetImpl::CSSStyleSheetImpl):
        * khtml/css/css_stylesheetimpl.h:
        (DOM::StyleSheetImpl::isLoading):
        * khtml/misc/loader.cpp:
        * khtml/xml/dom_xmlimpl.cpp:
        (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
        (DOM::ProcessingInstructionImpl::checkStyleSheet):
        (DOM::ProcessingInstructionImpl::sheet):
        (DOM::ProcessingInstructionImpl::isLoading):
        (DOM::ProcessingInstructionImpl::setStyleSheet):
        * khtml/xml/dom_xmlimpl.h:

2004-08-04  David Hyatt  <hyatt@apple.com>

	Add XSL Stylesheets to the WebCore cache.
	
        Reviewed by kocienda

        * khtml/misc/loader.cpp:
        (CachedXSLStyleSheet::CachedXSLStyleSheet):
        (CachedXSLStyleSheet::ref):
        (CachedXSLStyleSheet::deref):
        (CachedXSLStyleSheet::data):
        (CachedXSLStyleSheet::checkNotify):
        (CachedXSLStyleSheet::error):
        (DocLoader::requestXSLStyleSheet):
        (Cache::requestXSLStyleSheet):
        (Cache::getStatistics):
        * khtml/misc/loader.h:
        (khtml::CachedObject::):
        (khtml::CachedXSLStyleSheet::sheet):
        (khtml::CachedXSLStyleSheet::schedule):

2004-08-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Changes to improve our handling of object tags during editing, including
        fixing this bug:
        
        <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns 

        Part of the fix for this bug involves removing the close() function from render objects.
        It was decided that this code was no longer needed, as the work it did could be moved
        to other, more modern, places.

        Fixed this bug:
        
        <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text

        Finally, I filed and fixed this bug I discovered while fixing the one above:
        
        <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
        checks. Bail, returning 0 for typing style if any null checks yield a null.
        (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
        up deleting the node where we calculated that we wanted to put the selection after deleting.
        If this happens, move this ending selection to a sensible alternative.
        (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead 
        of traversePreviousNode when doing the prune.
        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
        (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
        to canRenderImageType.
        (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date 
        as their children change. This also will help to make object tags respond properly to having their
        params changed by DOM calls.
        * khtml/html/html_objectimpl.h: Cosmetic change.
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
        (KHTMLParser::popOneBlock): Ditto.
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
        * khtml/rendering/render_container.cpp:
        (RenderContainer::updatePseudoChild): Ditto.
        * khtml/rendering/render_form.cpp: Remove obsolete close() function.
        * khtml/rendering/render_form.h: Ditto.
        * khtml/rendering/render_frames.cpp: Ditto.
        * khtml/rendering/render_frames.h: Ditto.
        * khtml/rendering/render_inline.cpp:
        (RenderInline::splitFlow): Remove calls to obsolete close() function.
        * khtml/rendering/render_object.h: Remove obsolete close() function.
        * khtml/rendering/render_table.cpp:
        (RenderTableCell::layout): Ditto.
        * khtml/rendering/render_table.h: Ditto.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::closeInternal): Remove call to obsolete close() function.
        * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
        (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
        (NodeImpl::attach): Remove call to obsolete close() function.
        (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
        be treated as an atomic node for the purposes of editing.
        (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
        into account.
        (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
        (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to 
        prevent deleting PARAM tag portions of object tags erroneously.
        (NodeImpl::nextLeafNode): Ditto.
        * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
        tree.
        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.

2004-08-03  David Hyatt  <hyatt@apple.com>

	Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
	documents.
	
        Reviewed by john

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty):
        * khtml/khtml_part.cpp:
        (KHTMLPart::begin):
        * khtml/misc/loader.cpp:
        (CachedXBLDocument::CachedXBLDocument):

2004-08-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	- remove assertions that asserted text is non-empty, just avoid
	doing anything for the empty case; this is needed because input
	methods like to insert empty text in various cases.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
        (khtml::InsertTextCommandImpl::doApply):
        (khtml::InsertTextCommandImpl::doUnapply):

2004-08-03  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)

        * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
        * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.

        * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
        * kwq/DOMPrivate.h: Added.

        * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).

2004-08-02  John Sullivan  <sullivan@apple.com>

        Reviewed by Darin.
        
        WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption: 
        Tab key should cycle around toolbar and page content

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
        Made this method start looking from the current focus node. This won't
        affect any existing callers because there were no existing callers.
        (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
        ditto

2004-08-02  David Hyatt  <hyatt@apple.com>

	Create a #define for XSLT support that at the moment will only be enabled on Tiger.
	
        Reviewed by kocienda

        * WebCorePrefix.h:

2004-08-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3747945> Deleting replaced element can cause crash

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::layoutCaret): The crux of the problem is that
        the caret drawing code tries to draw the caret at the image
        offset after it has been removed from the document. So, make
        sure the start node for the selection is in the document before
        trying to lay out the caret using that node.

2004-07-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
        <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
        
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
        a good place to put the caret if focus is turning "on", the part is contentEditable,
        and it does not currently have a selection. This has the effect of flashing the caret 
        in a contentEditable view automatically without requiring the programmer to set a 
        selection explicitly. This also fixes the bug listed above. Both are cases where the
        bad behavior happened since the editing code tried to process input without an active 
        selection. I always took the extra step of setting the selection explicitly when
        opening new windows in programs like Blot, but it seems silly to require developers to
        do this in general. With this patch, they no longer need to.

2004-07-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
        content. The validate() bottleneck function will do all it can to make sure that the start is
        moved to rendered content if at all possible before this function runs. If no rendered position can
        be found, like in the case of an empty body element, we still want to flash the caret there.
        (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
        base before making this move, and set the selection to the enclosing block flow element of this
        original base if no rendered positions can be found. This has the effect of flashing the caret 
        someplace in an editable block, even if it does not contain any rendered content.

2004-07-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix a large number of editing layout test regressions.

        * khtml/misc/khtml_text_operations.cpp:
        (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
        purposes of text iteration. The end offset is either child count of a node with children,
        or the maxOffset() of a node that does not.
        * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This 
        conflicted with the usage of this function that is needed for editing.
        * khtml/xml/dom_nodeimpl.h: Ditto.

2004-07-30  Trey Matteson  <trey@apple.com>

	Next steps for spell checking:  We have data structures for the marked pieces of
	text and the smarts to draw them (although at this point, they just get a green
	underline instead of using the real AppKit pattern.)

	Note we don't call this code outside of development, since at this point I suspect
	it could be made to crash by mixing spelling and editing. 

        Reviewed by Ken.

        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintMarker):  Paint one marker's intersection with a text run
        (RenderText::paint):  Find intersections of all markers and runs, call paintMarker
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::addMarker):  Adds a marker to a DOM Range.
        (DocumentImpl::removeMarker):  Removes a marker from a DOM Range.
        (DocumentImpl::addMarker):  Adds a marker to a single DOM Node, merging previous
	markers as needed.
        (DocumentImpl::removeMarker):  Removes a marker from a single DOM Node, breaking
	up previous markers as needed.
        (DocumentImpl::markersForNode):  Return markers for a Node.
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentMarker::):  New marker struct
        (DOM::DocumentMarker::operator == ):
        (DOM::DocumentMarker::operator != ):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::advanceToNextMisspelling):  Mark misspelled ranges when we find them.
	Debug only for now.

2004-07-29  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3745808> Seed: WebKit: Table's caption broken
	
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode): When a caption appears in an illegal
	place in a table, pop blocks until we hit a place where it's
	allowed.

=== Safari-154 ===

2004-07-29  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - added constants for motion across entire document for use in operations like
          move to beginning of document

        * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
        (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
        (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
        (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
        (DOM::Selection::validate): Changed if statements into switch statement,
        added case for DOCUMENT.

        * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.

2004-07-28  Trey Matteson  <trey@apple.com>

	Small refinement of last checkin.  The text iterators now return reasonable values
	for range() when atEnd, which gets rid of special cases and pitfalls in the client.

        Reviewed by Ken.

        * khtml/misc/khtml_text_operations.cpp:
        (khtml::TextIterator::TextIterator):  Set endOffset to a valid value instead of
	using LONG_MAX.
        (khtml::TextIterator::range):  Implement when atEnd.
        (khtml::CharacterIterator::range):  Don't massage result when atEnd.
        (khtml::WordAwareIterator::WordAwareIterator):  Now that this is fixed, we no
	longer need this special case.
        (khtml::WordAwareIterator::advance):  Always set range, even when atEnd, now that
	TextIterator::range() always works.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::childNodeCount):  Made const
        (NodeBaseImpl::maxOffset):  Add missing implementation
        * khtml/xml/dom_nodeimpl.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::advanceToNextMisspelling):  Get rid of special cases, always call
	range on our iterator even when it is atEnd.

2004-07-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Trey.

	<rdar://problem/3678534> controls on page at http://help.sap.com don't work properly

        To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
	
	* khtml/ecma/kjs_window.cpp:
        (Window::Window):
        (Window::locationbar):
        (Window::menubar):
        (Window::personalbar):
        (Window::statusbar):
        (Window::toolbar):
        (Window::scrollbars):
        (Window::mark):
        (Window::get):
        (SelectionFunc::tryCall):
        (BarInfo::BarInfo):
        (BarInfo::~BarInfo):
        (BarInfo::get):
        (BarInfo::put):
        * khtml/ecma/kjs_window.h:
        (KJS::Window::):
        (KJS::BarInfo::):
        (KJS::BarInfo::part):
        (KJS::BarInfo::classInfo):
        * khtml/ecma/kjs_window.lut.h:
        (KJS::):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::locationbarVisible):
        (KWQKHTMLPart::menubarVisible):
        (KWQKHTMLPart::personalbarVisible):
        (KWQKHTMLPart::scrollbarsVisible):
        (KWQKHTMLPart::statusbarVisible):
        (KWQKHTMLPart::toolbarVisible):

2004-07-28  Ken Kocienda  <kocienda@apple.com>

        Added more layout tests.

        * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
        * layout-tests/editing/style/style-3681552-fix-001.html: Added.
        * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
        * layout-tests/editing/style/style-3681552-fix-002.html: Added.
        * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
        * layout-tests/editing/style/style-3690704-fix.html: Added.
        * layout-tests/editing/style/typing-style-001-expected.txt: Added.
        * layout-tests/editing/style/typing-style-001.html: Added.
        * layout-tests/editing/style/typing-style-002-expected.txt: Added.
        * layout-tests/editing/style/typing-style-002.html: Added.

2004-07-28  Ken Kocienda  <kocienda@apple.com>

        Added some layout tests.

        * layout-tests/editing/selection/select-all-001-expected.txt: Added.
        * layout-tests/editing/selection/select-all-001.html: Added.
        * layout-tests/editing/selection/select-all-002-expected.txt: Added.
        * layout-tests/editing/selection/select-all-002.html: Added.
        * layout-tests/editing/selection/select-all-003-expected.txt: Added.
        * layout-tests/editing/selection/select-all-003.html: Added.

2004-07-28  Trey Matteson  <trey@apple.com>

	Spellchecking, Part I.  Basic spellcheck is working.  Spelling panel is hooked up.

	At this point, no special marking of misspellings, no grammar check, no context
	menu integration, no "check continually" mode.

	Much of the TextIterator and CharacterIterator interface got published outside
	of khtml_text_operations.cpp, with a little API rationalizing.

        Reviewed by Ken.

        * khtml/misc/khtml_text_operations.cpp:
        (khtml::TextIterator::range):  Name changes.
        (khtml::CharacterIterator::CharacterIterator):  Ditto.
        (khtml::CharacterIterator::range):  Ditto.
        (khtml::CharacterIterator::advance):  Ditto.
        (khtml::CharacterIterator::string):  New method to consume chars into a string.
        (khtml::WordAwareIterator::WordAwareIterator):  New class that iterates over
	the text respecting word boundaries.
        (khtml::WordAwareIterator::advance):
        (khtml::WordAwareIterator::length):
        (khtml::WordAwareIterator::characters):
        (khtml::plainText):  Name changes.
        (khtml::findPlainText):  Ditto.

	API moved from cpp to header file.
        * khtml/misc/khtml_text_operations.h:
        (khtml::TextIterator::atEnd):
        (khtml::TextIterator::length):
        (khtml::TextIterator::characters):
        (khtml::CharacterIterator::atBreak):
        (khtml::CharacterIterator::atEnd):
        (khtml::CharacterIterator::length):
        (khtml::CharacterIterator::characters):
        (khtml::CharacterIterator::characterOffset):
        (khtml::WordAwareIterator::atEnd):
        (khtml::WordAwareIterator::range):

        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousWordBoundary):  New name for the old routine.  This routines semantics
	match the current behavior of this code.
        (DOM::Position::nextWordBoundary):  Ditto.
        (DOM::Position::previousWordPosition):  Call old code with the new name.  When we fix
	word advancement, this routine will have its own impl.
        (DOM::Position::nextWordPosition):  Ditto.
        * khtml/xml/dom_position.h:
        * khtml/xml/dom_selection.h:
        (DOM::Selection::rangeStart):  New convenience methods
        (DOM::Selection::rangeEnd):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::findString):  Ensure we use range-compatible positions.
        (KWQKHTMLPart::advanceToNextMisspelling):  Brand new.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge advanceToNextMisspelling]):  Typical bridge glue.

2004-07-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej
        
        Fixed this bug:
        
        <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
        pass off to the function that applies styles. While this is meant to be conservative in
        order to leave the DOM well-formed in all cases, it contained an error where the set
        of nodes to be styled together erroneously could include a node that was meant for 
        the next set. Fixed.
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
        resolution qualifier. Unneeded here.

2004-07-28  Darin Adler  <darin@apple.com>

        Reviewed by Trey.

        - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child

        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
        It returns true if the parameter is an ancestor of this, but had been changed to return true if this
        is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
        that it does not consider a node an ancestor of itself.

        * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
        * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
        Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
        any cases where the pointer might be 0.

        * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
        new uses to all compile.

2004-07-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
        dealing with typing styles.
        * khtml/css/css_valueimpl.h:
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
        typing style based on the current selection. This is a convenient bottleneck for all
        the code that needs to worry about typing style.
        (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
        (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
        Improve comments. 
        (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when 
        figuring out where to insert style node. Not even sure what I was trying to do here, but
        it does not seem to be needed any more.
        (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
        * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
        in this function. The selection did not change simply by calling this function, but it
        does need a layout.
        (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
        instead of clearing it unconditionally.
        (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
        style being applied with any current typing style that already exists.

2004-07-28  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders

        * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
        Compute the size without ever calling cellSize. After talking with Andrew Platzer,
        we decided that hard-coding the size of the borders of a text field was the best
        way for WebCore to handle this.

2004-07-28  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()

        * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
        Added a check for nil.

2004-07-27  Darin Adler  <darin@apple.com>

        Reviewed by Trey.

        - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"

        * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
        "rgba" when alpha is 0xFF, not when alpha is 0.

2004-07-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fixed the problem where BR elements on lines by themselves don't paint when selected.

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
        * khtml/rendering/render_br.cpp:
        (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_text.cpp: 
        (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
        reuse function argument as a local). Also, improve the logic for determining whether to 
        extend the selection to block boundaries.
        (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
        extensions is now fully contained in paintSelection.
        * khtml/rendering/render_text.h:

2004-07-27  David Hyatt  <hyatt@apple.com>

	Fix for 3665211 (again).  Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::removeChild):

2004-07-26  Chris Blumenberg  <cblu@apple.com>

	Fixed: WebView scrolls to the top after making an editing change via drag & drop

        Fixed by Ken, reviewed by me.

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret

=== Safari-153 ===

2004-07-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
        
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
	trick as for inline script execution.

	Added new layout tests covering this and other recent tokenizer
	bugs.
	
        * layout-tests/fast/tokenizer/001-expected.txt: Added.
        * layout-tests/fast/tokenizer/001.html: Added.
        * layout-tests/fast/tokenizer/002-expected.txt: Added.
        * layout-tests/fast/tokenizer/002.html: Added.
        * layout-tests/fast/tokenizer/003-expected.txt: Added.
        * layout-tests/fast/tokenizer/003.html: Added.
        * layout-tests/fast/tokenizer/resources/003-script.js: Added.

2004-07-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Trey

        Fix for this bug:
        
        <rdar://problem/3738920> Caret blinks in inactive window

        As part of the fix, I cleaned up the way we handle special drawing that needs
        to be done in the HTML view that is first responder in the key window (e.g the
        drawing of text selection highlight and caret blinking).

        * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
        is now done in setDisplaysWithFocusAttributes, described below.
        * khtml/khtml_part.h: Ditto.
        * khtml/khtmlpart_p.h:
        (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
        the caret from blinking when an app is started from the command line and remains in the
        background.
        * khtml/khtmlview.cpp:
        (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
        (KHTMLView::focusOutEvent): Ditto.
        * kwq/KWQKHTMLPart.h:
        (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
        in WebCore.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):
        (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
        to do the display updating in a clearer way....and now has comments!
        * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
        setDisplaysWithFocusAttributes function (and did so less well).
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
        text selection background.
        (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in 
        KWQKHTMLPart.
        (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
        change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
        (-[WebCoreBridge setCaretVisible:]): Removed.

2004-07-23  John Sullivan  <sullivan@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link 
        now also extends selection (even if there wasn't one before)

        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventSingleClick):
        Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
        than ever. I did test this before, so my best guess is an accidental undo or
        something before committing.

2004-07-23  David Hyatt  <hyatt@apple.com>

	Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
	should be the *first* line box and not the last.
	
        Reviewed by kocienda

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):

2004-07-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
        of how selection validation works. The idea is to let the selection validation process
        end up with an empty selection given real DOM position inputs if the validation code
        cannot find a rendered position. Since selection is all about display, this makes sense.
        Currently, the code will allow the selection to be placed in a location that is not
        rendered, and this does nobody any good, as it can lead to bugs like accepting key input
        in a div that is set to display:none.

2004-07-23  Ken Kocienda  <kocienda@apple.com>

        Updated layout tests with new expected results.

        * layout-tests/editing/execCommand/boldSelection-expected.txt
        * layout-tests/editing/selection/extend-by-character-001-expected.txt
        * layout-tests/editing/selection/extend-by-character-003-expected.txt
        * layout-tests/editing/selection/unrendered-005-expected.txt

2004-07-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
	<rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
	
        * khtml/rendering/render_frames.cpp:
        (RenderFrameSet::layout): When returning early because there are
	no children, make sure to mark self as no longer needing
	layout. Otherwise, when children are added, we'll fail to
	propagate childrenNeedLayout to our own parent! This is almost
	certainly a long-standing bug that was just masked by our old
	layout tomfoolery.

2004-07-22  Kevin Decker  <kdecker@apple.com>

	Reviewed by Darin

	Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).

        * khtml/ecma/kjs_events.cpp:
        (JSLazyEventListener::JSLazyEventListener):
        (JSLazyEventListener::parseCode):
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::createHTMLEventHandler):
        * khtml/ecma/kjs_window.cpp:
        (Window::getJSLazyEventListener):
        * khtml/ecma/kjs_window.h:

2004-07-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/3724344> Bolding and unbolding creates extraneous tags

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
        before calling removeStyle. This makes sure we remove all styles that could apply to the 
        selection, and not just ones in from the start position of the selection passed to us. 
        This fixes the bug.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::validate): Related fix to "constrain" the selection to be the 
        smallest equivalent range of nodes, in effect making a "canonical" version of the
        selection. While this is not strictly necessary to fix the bug, it is a step I have been 
        wanting to take this step for a long time, and some recent improvements made it 
        possible for me to do now in just two lines of code.

2004-07-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags

        * khtml/rendering/render_container.cpp:
        (RenderContainer::positionForCoordinates): Don't assume you can pass off
        the check to a first child if there is one, since the child can be an element
        we do not want to place the caret in, like a table row with no cells (the case
        in the bug above). So now, we iterate of the renderer's children looking for
        the closest one, but only consider those renderers which either have children
        themselves, or are render block flows or are render inlines. 

2004-07-22  Darin Adler  <darin@apple.com>

        - remove a bunch of now-unused code

        * ForwardingHeaders/qxml.h: Removed.
        * kwq/KWQXmlAttributes.h: Removed.
        * kwq/KWQXmlAttributes.mm: Removed.
        * kwq/KWQXmlDefaultHandler.h: Removed.
        * kwq/KWQXmlDefaultHandler.mm: Removed.
        * kwq/KWQXmlSimpleReader.h: Removed.
        * kwq/KWQXmlSimpleReader.mm: Removed.

2004-07-22  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - got rid of QXml classes and changed XML parsing to use libxml directly

        This is the first step toward more direct use of libxml and libxslt.
        Dave is planning to build on this to implement XSLT and to improve our handling
        of XML documents (faster and more feature complete, including DTDs).

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::createContextualFragment):
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::HTMLTokenizer):
        * khtml/html/htmltokenizer.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createTokenizer):
        (DocumentImpl::open):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::tokenizer):
        * khtml/xml/dom_xmlimpl.cpp:
        (DOM::ProcessingInstructionImpl::checkStyleSheet):
        * khtml/xml/dom_xmlimpl.h:
        * khtml/xml/xml_tokenizer.h:
        * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.

        * WebCore.pbproj/project.pbxproj: Removed a bunch of files.

2004-07-21  Trey Matteson  <trey@apple.com>

	DHTML dragging should use UTI for MIME-pboard type conversion

        Reviewed by Ken

        * kwq/KWQClipboard.mm:
        (cocoaTypeFromMIMEType):  Use UTI, except for cases we need to hardwire.  Only cut off
	MIME args following a semi-colon for text/plain.
        (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.  
        (KWQClipboard::types):  Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.

2004-07-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Trey

        Remove handling of HTML editing key events from WebCore.
        This now happens in WebKit if an event passes all the
        way through WebCore without being handled by the DOM.

        In each case below, function were removed, as their
        only purpose was to handle editing key events.

        * khtml/xml/dom_elementimpl.cpp
        * khtml/xml/dom_elementimpl.h
        * kwq/KWQKHTMLPart.h
        * kwq/KWQKHTMLPart.mm
        * kwq/WebCoreBridge.h

2004-07-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
        function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
        position.
        (DOM::Selection::modifyMovingRightForward): Ditto
        (DOM::Selection::modifyExtendingLeftBackward): Ditto
        (DOM::Selection::modifyMovingLeftBackward): Ditto
        * khtml/xml/dom_selection.h: 
        (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
        specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
        behavior which AppKit binds to cmd+left/right arrow keys.
        * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches

2004-07-20  David Hyatt  <hyatt@apple.com>

	Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
	
        Reviewed by john

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::CSSStyleSelector):

2004-07-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::defaultEventHandler): No longer check whether
        the command key is modifying the key event. This check is
        now done elsewhere in the code. See the WebKit checkin that
        added the _web_keyBindingManagerHasBinding method to 
        WebNSEventExtras.

2004-07-20  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
	<rdar://problem/3612691> Missing image icons (blue ?) lack context menu

        Reviewed by john.

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway

2004-07-20  David Hyatt  <hyatt@apple.com>

	Fix for alt text not working on images.
	
        Reviewed by john

        * khtml/rendering/render_image.cpp:
        (RenderImage::RenderImage):
        (RenderImage::setPixmap):
        (RenderImage::paint):
        (RenderImage::calcReplacedWidth):
        (RenderImage::calcReplacedHeight):

2004-07-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	<rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
	
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
        (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
	active prependingSrc variable on the stack, the better to handle weird cases
	of scripts writing out additional script tags and so forth.
        (khtml::HTMLTokenizer::write): Deal with the above.
        * khtml/html/htmltokenizer.h: Declare new member field.

2004-07-20  David Hyatt  <hyatt@apple.com>

	Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
	elements.
	
        Reviewed by john

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateLayerPosition):

2004-07-20  Trey Matteson  <trey@apple.com>

	3705624	REGRESSION: can't rearrange photos on homepage.mac.com album

	A subtle problem stemming from some interaction between focus handing and
	event propagation.  We previously made it so when a focus shift fails we
	don't propagate the event to KHTML.  The fix is to get rid of the inverse
	effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
	the page already canceled default behavior.

	In this specific case, the page is cancelling default behavior since it
	does its own dragging, and the bug was our new system dragging was
	kicking in.

        Reviewed by Ken.

        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent):  What he said.

2004-07-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
        line endings into BR elements.

2004-07-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body

        * khtml/khtml_part.cpp:
        (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
        on the caret, this seems like a better name.
        * khtml/khtml_part.h:
        * khtml/khtmlview.cpp:
        (KHTMLView::focusInEvent): Call setCaretVisible(true)
        (KHTMLView::focusOutEvent): Call setCaretVisible(false)
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
        * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setCaretVisible:]): Ditto.

2004-07-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Trey.

	<rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
        
	* khtml/misc/stringit.h:
        (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
	stableUnicode() method to get the unicode pointer.
        * kwq/KWQString.h:
        * kwq/KWQString.mm:
        (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
	It does not leave around a zombie internal data handle but rather destroys it right away,
	and leaves the object pointing to the new handle (which it can then deref). This makes
	the code more clear.
        (QString::~QString): Simplify.
        (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
	is internal to a string besides this one. This guarantees that if you get the unicode()
	pointer, it won't go bad so long as this string is still alive.

2004-07-19  David Hyatt  <hyatt@apple.com>

	Fix for 3715117, crash from a bug in removeChildren.  Clean up node removal and fix an n-squared removal
	bug.  Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
	make node removal more efficient.
	
        Reviewed by kocienda

        * khtml/xml/dom_nodeimpl.cpp:

2004-07-19  John Sullivan  <sullivan@apple.com>

        Reviewed by Trey.
        
        - fixed <rdar://problem/3141150> can't undo in form textarea fields

        * kwq/KWQTextArea.mm:
        (-[KWQTextArea _createTextView]):
        call setAllowsUndo:YES. My, wasn't this easy?

2004-07-19  David Hyatt  <hyatt@apple.com>

	Merge @import fix for CSS1 test suite from Stephan Kulow.
	
        Reviewed by hyatt

        * khtml/css/parser.cpp:
        * khtml/css/parser.y:
        * layout-tests/css1/basic/containment-expected.txt:

2004-07-19  David Hyatt  <hyatt@apple.com>

	Fix for 3718697, crash clicking on JS tab at alaskaair.com.
	
        Reviewed by kocienda

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::detach):
        (RenderFlow::dirtyLinesFromChangedChild):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::dirtyLinesFromChangedChild):
        * khtml/rendering/render_object.h:

2004-07-16  David Hyatt  <hyatt@apple.com>

	Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
	relies on it.  The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
	will be up-to-date.
	
        Reviewed by john

        * khtml/khtmlview.cpp:
        (KHTMLView::layout):

2004-07-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
        more robust. I do not understand how Grant ended up with null start or end 
        blocks in the case of his bug report, but by adding two null checks, the code is 
        now hardened a bit in case it happens again.

2004-07-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for these bugs:

        <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
        <rdar://problem/3730790> Caret does not blink when placed in empty table cell

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
        don't block the painting of the caret in this case. This was the case in 3730790.
        We had the right geometry for the caret but blocked its painting. 
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
        that the new position we would navigate to had a line box, but empty table cells, for
        instance will not. So, deal with this situation as well. The end result is a 
        function that worked like it did before in cases where the previous line position has
        a line box, but now also will allow navigation to work when it does not.
        (DOM::Position::nextLinePosition): Ditto.

2004-07-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3687216> editable inline causes crash when focused

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::relinquishesEditingFocus): Add null check for rootEditableElement.
        (DocumentImpl::acceptsEditingFocus): Ditto.

2004-07-16  David Hyatt  <hyatt@apple.com>

	Fix for 3709337, crash when using display: compact.  Need to make sure that the isCompact() check in bidi.cpp is
	also checking for RenderBlocks, since otherwise you match text nodes (and that's just wrong).
	
        Reviewed by kocienda

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):

=== Safari-152 ===

2004-07-15  David Hyatt  <hyatt@apple.com>

	Fix for 3625611, images offset on first visit to page.  The method for determining the last clean line was
	flawed and would incorrectly miss dirty lines that occurred after the first clean line.
	
        Reviewed by john

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::determineEndPosition):

2004-07-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
        
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
        that nodes are text nodes during the walk of eligible nodes that could possibly be
        deleted. Change the assertion to an conditional check for text nodes. We may have 
        unrendered nodes in the mix here (as is the case in the bug where the assertion
        failed on an AREA element), and the conditional check is sufficient to
        skip them while leaving the delete logic we want unperturbed. 

2004-07-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject): Add null check on DOM node before
        asking if it is contentEditable.

2004-07-14  David Hyatt  <hyatt@apple.com>

	Fix for 3595073, setting innerHTML on a <table> should work.
	
        Reviewed by rjw

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::createContextualFragment):

2004-07-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Updated these layout tests as a result of the last patch.
        These results are better.

        * layout-tests/editing/execCommand/selectAll-expected.txt
        * layout-tests/editing/selection/extend-by-character-006-expected.txt
        * layout-tests/editing/selection/unrendered-001-expected.txt
        * layout-tests/editing/selection/unrendered-003-expected.txt

2004-07-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/rendering/render_block.cpp: 
        (khtml::RenderBlock::paintObject): Change back to start() from caretPosition().
        Since the policy is now to move the selection to rendered content, if possible,
        when the selection is set, there is no longer any reason to have the additional
        caretPosition() function to store where the caret should be drawn.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection): No longer any need to call closestRenderedPosition here.
        This is done in Selection::validate.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::closestRenderedPosition): Improved algorithm. Now much simpler.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::Selection): caretPosition() and m_caretPosition now obsolete.
        (DOM::Selection::init): Ditto.
        (DOM::Selection::modifyExtendingRightForward): No longer any need to call 
        closestRenderedPosition here. This is done in Selection::validate.
        (DOM::Selection::modifyMovingRightForward): Ditto.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::layoutCaret): Ditto.
        (DOM::Selection::validate): Add code to move the selection to rendered content if possible.
        * khtml/xml/dom_selection.h: caretPosition() and m_caretPosition now obsolete.

2004-07-14  David Hyatt  <hyatt@apple.com>

	Fix for 3716082, assert when you dynamically remove float or position styles.
	
        Reviewed by kevin

        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):

2004-07-14  David Hyatt  <hyatt@apple.com>

	Fix for various table regressions (malumovies.com and cityofheroes.gameamp.com) involving bungling of
	percentage heights.
	
        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcPercentageHeight):
        (RenderBox::availableHeightUsing):
        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):
        (RenderTableSection::calcRowHeight):
        (RenderTableSection::layoutRows):
        (RenderTableCell::updateFromElement):
        * khtml/rendering/render_table.h:

2004-07-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentDeepPosition): New helper function to improve selection handling.
        Soon, I plan to land some changes that use this new function.
        * khtml/xml/dom_position.h:

2004-07-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki

        * WebCore-combined.exp: Added QString.at symbol to tests exports to facilitate debugging
        data formatting change that is to come.
        * WebCore-tests.exp:
        
2004-07-13  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - fixed <rdar://problem/3705500> REGRESSION (125.8-146): Cmd-E on an 
        HTML page puts a trailing space on Find pasteboard

        * khtml/misc/khtml_text_operations.cpp:
        (khtml::TextIterator::handleTextBox):
        In the case where a subrun doesn't extend to the end of the text box,
        the well-commented code was supposed to return from this routine, but
        the wrong variable was being compared. This would send us through another
        pass of the loop, which would end up worrying about collapsed space at the
        end of the current box, even though we only cared about the beginning of the
        current box.

2004-07-12  Richard Williamson   <rjw@apple.com>

	Fixed 3717982.  Implemented navigator.language!

        Reviewed by John.

        * khtml/ecma/kjs_navigator.cpp:
        (Navigator::getValueProperty):

2004-07-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/xml/dom_position.cpp:
        (DOM::Position::inRenderedContent): I broke selection drawing with my last patch. This 
        function is now used in selection drawing, and it was making an unneeded check to see
        that content was editable to answer whether or not is was rendered. Bad. Fixed.

2004-07-12  David Hyatt  <hyatt@apple.com>

	Fix for 3621138, crash on hrweb.apple.com.  Make sure that in the case where objects get pulled up from merging
	blocks that we just delete all line boxes.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::removeChild):

2004-07-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3706080>: (REGRESSION (125.8-147u): Nested <ul> do not display bullets)
	<rdar://problem/3676376>: (Second level bullets not printed when printing Xcode release notes)
	
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (CGColorFromNSColor):
        (QPainter::drawEllipse):
        (QPainter::setShadow):

2004-07-12  Ken Kocienda  <kocienda@apple.com>

        Added new editing-related layout tests

        * layout-tests/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-after-span-ws-001.html: Added.
        * layout-tests/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-after-span-ws-002.html: Added.
        * layout-tests/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-after-span-ws-003.html: Added.
        * layout-tests/editing/selection/unrendered-001-expected.txt: Added.
        * layout-tests/editing/selection/unrendered-001.html: Added.
        * layout-tests/editing/selection/unrendered-002-expected.txt: Added.
        * layout-tests/editing/selection/unrendered-002.html: Added.
        * layout-tests/editing/selection/unrendered-003-expected.txt: Added.
        * layout-tests/editing/selection/unrendered-003.html: Added.
        * layout-tests/editing/selection/unrendered-004-expected.txt: Added.
        * layout-tests/editing/selection/unrendered-004.html: Added.
        * layout-tests/editing/selection/unrendered-005-expected.txt: Added.
        * layout-tests/editing/selection/unrendered-005.html: Added.
        * layout-tests/traversal/node-iterator-008-expected.txt: Added.
        * layout-tests/traversal/node-iterator-008.html: Added.
        * layout-tests/traversal/tree-walker-005-expected.txt: Added.
        * layout-tests/traversal/tree-walker-005.html: Added.

2004-07-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fixes for these bugs:
        
        <rdar://problem/3723359> Extending then "unextending" selection with arrow keys should draw caret but doesn't
        <rdar://problem/3724626> White-space deletion code deletes wrong character when space follows span
        
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteSelectionCommandImpl::doApply): Modify special-case white-space deletion code so it runs
        only in the special case. It was throwing its net too widely, catching the case described in 3724626.
        By tightening up the special-case white-space deletion, and allowing the more general-purpose code to run,
        the bug is fixed.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection): Use recently-added closestRenderedPosition helper in Position class
        to figure out the start and end positions for selection drawing.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentUpstreamPosition): Added code to handle white-space that causes line breaks.
        (DOM::Position::equivalentDownstreamPosition): Ditto.
        (DOM::Position::closestRenderedPosition): Trap empty selections at function entry, return *this.
        (DOM::Position::isFirstRenderedPositionOnLine): Can't be first rendered position on line if not rendered.
        Add check for this.
        (DOM::Position::isLastRenderedPositionOnLine): Ditto, but s/first/last/
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::validate): A selection is in caret state if the start and end are equal *or* equivalent.
        The equivalence case is new, and fixes 3723359.

2004-07-09  Kevin Decker  <kdecker@apple.com>

        Reviewed by Hyatt.
        
        fixes the width:auto problem in
        <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
        
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):

2004-07-09  Ken Kocienda  <kocienda@apple.com>

        Updated some layout test results.

        * layout-tests/editing/deleting/delete-image-004-expected.txt:
        * layout-tests/editing/selection/extend-by-character-006-expected.txt:

2004-07-09  Chris Blumenberg  <cblu@apple.com>

	Allowed my change for 3715785 to compile on Jaguar.

        Reviewed by kocienda.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar

2004-07-09  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Some improvements to fix:
        
        <rdar://problem/3723111> Caret not drawn when selection set to unrendered content

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
        selected position is not rendered.
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
        figure out whether to paint.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousCharacterPosition): Now correctly deals with a start
        position that is not rendered.
        (DOM::Position::nextCharacterPosition): Ditto.
        (DOM::Position::closestRenderedPosition): New helper.
        * khtml/xml/dom_position.h:
        (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
        after a caret layout. This may be different from start or end if start and end are not rendered. 
        (DOM::Selection::init):
        (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
        (DOM::Selection::modifyMovingRightForward): Ditto.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::modify): Use new helpers to make this more readble.
        (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
        content.
        (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
        * khtml/xml/dom_selection.h:
        (DOM::Selection::caretPosition): New accessor.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.

2004-07-08  David Hyatt  <hyatt@apple.com>

	Fix for the table layout test that failed because of a change in how innerText worked.  We need to do
	updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
	that might otherwise be out of date.
	
        Reviewed by kocienda

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::innerText):

2004-07-08  John Sullivan  <sullivan@apple.com>

        Reviewed by Ken.
        
        - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link 
        now also extends selection (even if there wasn't one before)

        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventSingleClick):
        if there's a URL associated with the event, don't extend the selection

2004-07-08  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki

        Added some helper functions which provide strings to display in the 
        Xcode debugger's variable inspector window. These functions are called
        from the LabyrinthDataFormatter debugger plugin I just checked in to 
        the Labyrinth/Tools directory.
        
        Note that these functions are compiled in on Development builds only.

        * WebCore-combined.exp:
        * WebCore-tests.exp: Export all the formatForDebugger symbols so the
        debugger program can link with them.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::formatForDebugger):
        * khtml/xml/dom2_rangeimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::formatForDebugger):
        * khtml/xml/dom_elementimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_nodeimpl.h:
        * khtml/xml/dom_position.cpp:
        (DOM::Position::formatForDebugger):
        * khtml/xml/dom_position.h:
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::formatForDebugger):
        * khtml/xml/dom_selection.h:
        * khtml/xml/dom_textimpl.cpp:
        (TextImpl::formatForDebugger):
        * khtml/xml/dom_textimpl.h:

2004-07-08  John Sullivan  <sullivan@apple.com>

        Reviewed by Vicki.
        
        - fixed <rdar://problem/3721544> crash increasing font size; 
        entrezeroetun.com (works in IE and Firefox)

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::updateFirstLetter):
        Check for nil originalString() before dereffing

2004-07-08  David Hyatt  <hyatt@apple.com>

	Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
	
        Reviewed by john

        * khtml/css/cssstyleselector.cpp:

=== Safari-151 ===

2004-07-07  David Hyatt  <hyatt@apple.com>

	Fix for 3712133, crash from first-line pseudo-style use.
	
        Reviewed by kocienda

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::styleForElement):
        * khtml/css/cssstyleselector.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::getPseudoStyle):

2004-07-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
        
        The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
        Formerly, new TypingCommands would apply themselves (which was a no-op) and then
        do their action in some code a way different than other commands. This type of command
        application is different than for all other commands since TypingCommands can be coalesced.
        The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
        consequence of causing editing delegate notifications to be sent before the command 
        has actually run. This change takes a small step towards making TypingCommandImpl function like
        other commands, where the command work is done in doApply. This makes the notification
        happen in the right order.

        * khtml/editing/htmlediting.cpp:
        (khtml::TypingCommand::TypingCommand):
        (khtml::TypingCommand::insertText):
        (khtml::TypingCommand::insertNewline):
        (khtml::TypingCommand::deleteKeyPressed):
        * khtml/editing/htmlediting.h:
        (khtml::TypingCommand::):
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::TypingCommandImpl::TypingCommandImpl):
        (khtml::TypingCommandImpl::doApply):
        * khtml/editing/htmlediting_impl.h:

2004-07-06  Ken Kocienda  <kocienda@apple.com>

        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::addChild): Added a better comment in the
        code I just checked in a few minutes ago.

2004-07-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for this bug:
        
        <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply 
        due to non-0 exception code trying to insert a DIV markup string
        
        The solution was to revert to the code that was rolled out, and removing
        the child checks from NodeImpl::checkAddChild. However, this time, I added
        code very similar to this check into the code that runs while HTML is 
        being parsed to build up tables. This code relies on child-add failure
        to ensure the proper construction of well-formed tables (as gross as that
        sounds), so the check needs to be retained there. No other code seems to
        be so affected. Layout tests are unchanged by this patch.

        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::addChild):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::checkAddChild):

2004-07-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Simple change. I switched the arguments of the appendNode helper function
        and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to 
        insert now comes before the parent node in the argument list. I did this
        to make this function match the convention of others in the HTML editing code.
        This was the only one that was "different" in the way that it ordered arguments.
        As a result, I was always looking to see that I was passing things in the right
        order.
        
        * khtml/editing/htmlediting.cpp:
        (khtml::AppendNodeCommand::AppendNodeCommand):
        (khtml::AppendNodeCommand::appendChild):
        (khtml::AppendNodeCommand::parentNode):
        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::insertNodeAfter):
        (khtml::CompositeEditCommandImpl::insertNodeAt):
        (khtml::CompositeEditCommandImpl::appendNode):
        (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
        (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
        (khtml::AppendNodeCommandImpl::doApply):
        (khtml::AppendNodeCommandImpl::doUnapply):
        (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
        (khtml::DeleteSelectionCommandImpl::doApply):
        (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
        (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
        (khtml::InputTextCommandImpl::prepareForTextInsertion):
        * khtml/editing/htmlediting_impl.h:
        (khtml::AppendNodeCommandImpl::parentNode):

2004-07-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Trey

        Fixed several problems with traversal classes. For one, NodeIterators treat
        FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
        flat collection of nodes free of hierarchy. The code before this change did
        not do this correctly. It sure pays to go back and read the specs. :)
        
        Also, the code to traverse from node to node when filters were applied was
        not working correctly. My first attemmpt to implement this was just plain
        buggy, as I discovered when I tried to write tests for my WWDC talk. I have
        settled on an implementation which is much simpler and worked for all the
        tests I threw at it. 

        * khtml/xml/dom2_traversalimpl.cpp:
        (DOM::NodeIteratorImpl::findNextNode):
        (DOM::NodeIteratorImpl::nextNode):
        (DOM::NodeIteratorImpl::findPreviousNode):
        (DOM::NodeIteratorImpl::previousNode):
        (DOM::TreeWalkerImpl::parentNode):
        (DOM::TreeWalkerImpl::firstChild):
        (DOM::TreeWalkerImpl::lastChild):
        (DOM::TreeWalkerImpl::previousSibling):
        (DOM::TreeWalkerImpl::nextSibling):
        (DOM::TreeWalkerImpl::previousNode):
        (DOM::TreeWalkerImpl::nextNode):
        (DOM::TreeWalkerImpl::ancestorRejected):
        * khtml/xml/dom2_traversalimpl.h:

2004-07-06  Vicki Murley  <vicki@apple.com>

        Reviewed by kocienda.

	- added backColorCommand, foreColorCommand, fontNameCommand, 
	and fontSizeCommand
  
        * layout-tests/editing/editing.js:

2004-07-06  Trey Matteson  <trey@apple.com>

	3716053 - www.theage.com.au has extra back/forward items due to ads

	This turned out to be easily fixed by generalizing the fix to 3438441.  We prevent
	addition to the b/f list not just during an onload event, but during any non-user
	gesture, which includes top level script executing.

        Reviewed by Richard.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::openURL):  Only real change - prevent adding to b/f list if not
	a user gesture.
        (KWQKHTMLPart::openURLRequest):  Rename "onLoadEvent" to "userGesture", swap sense
        (KWQKHTMLPart::submitForm):  Ditto
        (KWQKHTMLPart::urlSelected): Ditto
        * kwq/KWQKHTMLPartBrowserExtension.mm:
        (KHTMLPartBrowserExtension::createNewWindow):  Ditto
        * kwq/WebCoreBridge.h:

2004-07-02  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used

        * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
        are done with the header.

2004-06-30  Trey Matteson  <trey@apple.com>

	Dragging within a web view should be allowed to start when the window isn't key.

	A few months ago, Chris made this work, but it relied on the fact that all dragging
	was done in WebKit.  When WebCore got involved in dragging, it was broken.  Now we
	have a new scheme that gets it working again that properly involves WebCore.

	The general idea is that when AK asks us whether to accept the first mouse and do
	"delayed window ordering", we must consult WC to see if we might start a drag.  In
	addition, instead of these drags in non-active windows being started as a special
	case in WK, they go through the normal WK-WC drag machinery.

        Reviewed by John.

        * khtml/khtml_part.cpp:
        (KHTMLPart::shouldDragAutoNode):  New x,y args.
        * khtml/khtml_part.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::draggableNode):  Pass through new x,y args.
        * khtml/rendering/render_object.h:
        * kwq/KWQKHTMLPart.h:
        (KWQKHTMLPart::setActivationEventNumber):  New setter.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):  Init new ivar.
        (KWQKHTMLPart::eventMayStartDrag):  New routine that checks if we might start
	a drag in response to a mouseDown.
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Pass x,y to the routine that finds a draggable
	node.  This eventually gets back up to WK's _mayStartDragAtEventLocation:.
	Delay requirement when dragging the selection now implemented here.
        (KWQKHTMLPart::khtmlMouseReleaseEvent):  Must avoid changing the selection if we
	wind up here as part of the first click in a window (because we started handling
	the click to possible start a drag, but that never came through).
        (KWQKHTMLPart::mouseDown): Save away event timestamp.
        (KWQKHTMLPart::shouldDragAutoNode):  Pass location up to WK instead of the
	most recent event we stashed.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setActivationEventNumber:]):  Trivial glue.
        (-[WebCoreBridge eventMayStartDrag:]):  Ditto.

2004-06-29  Trey Matteson  <trey@apple.com>

	Need to tighten up JS error checking for requesting drag props
	in the wrong cases.

        Reviewed by John.

        * khtml/ecma/kjs_events.cpp:
        (Clipboard::getValueProperty):  Assert if someone somehow set
	dropEffect or effectAllowed and it's a copy/paste clipboard
	instead of a dragging clipboard.
        (Clipboard::putValue):  Don't let anyone set dropEffect or
	effectAllowed on a copy/paste clipboard.
        (ClipboardProtoFunc::tryCall):  Disallow setting dragImage on
	a copy/paste clipboard.

2004-06-29  Trey Matteson  <trey@apple.com>

	DHTML dragging - source should have access to the operation chosen
	by the destination.

        Reviewed by John

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dragSourceEndedAt):  Set the destination's operation
	on the clipboard.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragExitedWithDraggingInfo:]):  For completeness
	we set the source op for the ondragexit event.
        (-[WebCoreBridge concludeDragForDraggingInfo:]):  Ditto for the
	drop event.
        (-[WebCoreBridge dragSourceEndedAt:operation:]):  Pass through of operation.

2004-06-24  Trey Matteson  <trey@apple.com>

	3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank

	Simple fix - don't try to send the event to the body element if we have no body element.

        Reviewed by John

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dispatchCPPEvent):

2004-06-24  Trey Matteson  <trey@apple.com>

	3704950	drag image in DB ConfigBar has horizontal graphics turd	WebCore JavaScript

	When we generate a drag image (or a selection image too, for that matter) we
	translate the CTM using a CG call.  Later, WebImageRenderer adjusts the pattern
	phase based on the CTM of the focused view, which doesn't include our translate.
	So we must inform WebKit about the additional phase adjustment.

        Reviewed by Richard

        * kwq/KWQKHTMLPart.mm:  Tell WebKit about the phase adjustment.
        (KWQKHTMLPart::imageFromRect):
        * kwq/WebCoreGraphicsBridge.h:
        * kwq/WebCoreGraphicsBridge.m:
        (-[WebCoreGraphicsBridge setAdditionalPatternPhase:]):  New routine to receive
	the phase adjustment.

2004-06-24  Trey Matteson  <trey@apple.com>

	3679986 - screenX and screenY are flipped and relative to the bottom left of the WebView, rather than the screen
	3699510 - synthesized click events have bogus screen coords

        Reviewed by Darin.

        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchDragEvent):  Generate screen coords for drag events using new func.
        (KHTMLView::dispatchMouseEvent):   Ditto.
        * khtml/khtmlview.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchMouseEvent):  Comment tricky semantics.
	Calc screen coords in apple-specific way.
        * kwq/KWQKHTMLView.mm:
        (KHTMLView::viewportToGlobal):  Passthrough to window widget.
        * kwq/KWQScrollView.mm:
        * kwq/KWQWindowWidget.h:
        * kwq/KWQWindowWidget.mm:
        (KWQWindowWidget::mapToGlobal):  Call former code factored to new method below.
        (KWQWindowWidget::viewportToGlobal):  New method to convert "viewport" (which for us
	really means NSWindow coords) to screen coords.

2004-06-24  Trey Matteson  <trey@apple.com>

	3693420 - onbeforecut and onbeforepaste need real implementaion

        Reviewed by Chris.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::mayCut):  Dispatch event to DHTML.
        (KWQKHTMLPart::mayCopy):  Ditto
        (KWQKHTMLPart::mayPaste):  Ditto
        (KWQKHTMLPart::tryCut):  No more need to send fake onbefore event
        (KWQKHTMLPart::tryCopy):  Ditto
        (KWQKHTMLPart::tryPaste): Ditto
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge mayDHTMLCut]):  Standard glue
        (-[WebCoreBridge mayDHTMLCopy]):  Ditto
        (-[WebCoreBridge mayDHTMLPaste]):  Ditto

2004-06-24  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3709385> Find on page doesn't find a string at the very end of the file

        * khtml/misc/khtml_text_operations.cpp: (khtml::findPlainText): Rearrange loop to avoid an early
        exit once we have all the characters we need, but are at the end of the range we are searching.

        - fixed <rdar://problem/3102271>: (text areas have scroll bars even when they don't need them)
        - fixed <rdar://problem/3665430>: (horizontal scroll bar of text area does not show, even when text is wide in "no wrap" mode)

        * kwq/KWQTextArea.mm:
        (-[KWQTextArea _configureTextViewForWordWrapMode]): Added. Helper method that sets up the
        view for a new word wrap mode.
        (-[KWQTextArea _createTextView]): Moved much of the code inside _configureTextViewForWordWrapMode.
        (-[KWQTextArea _frameSizeChanged]): Added. Method shared by setFrame: and initWithFrame: to
        avoid duplicate code that was there before. The old code also had redundant code to update
        the text container size, but NSText handles that automatically.
        (-[KWQTextArea initWithFrame:]): Set wrap to YES by default, which is the key to fixing bug 3665430.
        Call setAutohidesScrollers:YES, which fixes bug 3102271. Also call the new _frameSizeChanged method.
        (-[KWQTextArea setWordWrap:]): Call _configureTextViewForWordWrapMode instead of trying
        to do the work here. The old version did both too little and too much.
        (-[KWQTextArea setFrame:]): Call _frameSizeChanged instead of trying to do the work here.
        The old version did both too little and too much.

2004-06-24  John Sullivan  <sullivan@apple.com>

        Darin made this change on my machine; I reviewed it.
        
        - fixed <rdar://problem/3698333> Find on page doesn't find a particular string 
        with a newline in the source

        * khtml/misc/khtml_text_operations.cpp:
        (khtml::TextIterator::handleTextBox):
        Clear m_lastTextNodeEndedWithCollapsedSpace after taking it into account.

2004-06-23  Richard Williamson   <rjw@apple.com>

	Implemented changes for latest npruntime.h.

        Reviewed by Chris.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):
        (KWQKHTMLPart::windowScriptNPObject):
        (KWQKHTMLPart::getEmbedInstanceForView):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge windowScriptObject]):
        (-[WebCoreBridge windowScriptNPObject]):

2004-06-22  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3707162>: accessing embeds[] plug-in interface may crash

	embedInstance was uninitialized.

        Reviewed by Chris.

        * khtml/html/html_objectimpl.cpp:
        (HTMLEmbedElementImpl::HTMLEmbedElementImpl):

2004-06-18  John Sullivan  <sullivan@apple.com>

        Reviewed by Darin
        
        - fixed <rdar://problem/3534851> Pop up windows not showing up within SAP's 
        BW Module (changing location.href on new window created by window.open)

        * khtml/khtml_part.cpp:
        (KHTMLPart::scheduleRedirection):
        allow new redirect to win if delay <= current delay, not just <

=== WebCore-146.1 ===

2004-06-18  Trey Matteson  <trey@apple.com>

	3702053 - DHTML dragging destination can't control the cursor (by setting the drop operation)

	Fallout from security work, but an easy fix.

        Reviewed by Darin

        * kwq/KWQClipboard.mm:
        (KWQClipboard::setDropEffect):  Allow dest side to set dropEffect.

2004-06-18  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - re-fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)

        * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
        Check !isInlineFlow rather than checking hasMarkupTruncation. Otherwise, we break
        plain old non-markup truncation.

2004-06-18  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3701893> show expert preferences notes in xcode causes crash (in EllipsisBox code)

        * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paintEllipsisBoxes):
        Only walk the ellipsis list if hasMarkupTruncation is true.

=== Safari-146 ===

2004-06-17  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3698867> setting the canvas or parent to display:none and updating the causes a nil-deref

	Ensured that we have a renderer before rendering.

        Reviewed by John.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):

2004-06-17  David Hyatt  <hyatt@apple.com>

	Fix for 3674601, "Read More..." links should trail articles in Emerson.
	
        Reviewed by darin

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        (khtml::RenderBlock::deleteEllipsisLineBoxes):
        (khtml::RenderBlock::checkLinesForTextOverflow):
        * khtml/rendering/render_block.cpp:
        (khtml:::RenderFlow):
        (khtml::RenderBlock::paintEllipsisBoxes):
        (khtml::RenderBlock::nodeAtPoint):
        (khtml::shouldCheckLines):
        (khtml::getLineAtIndex):
        (khtml::getHeightForLineCount):
        (khtml::RenderBlock::lineAtIndex):
        (khtml::RenderBlock::lineCount):
        (khtml::RenderBlock::heightForLineCount):
        (khtml::RenderBlock::clearTruncation):
        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::setHasMarkupTruncation):
        (khtml::RenderBlock::hasMarkupTruncation):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutVerticalBox):
        * khtml/rendering/render_line.cpp:
        (khtml::EllipsisBox::m_str):
        (khtml::InlineBox::adjustPosition):
        (khtml::InlineFlowBox::adjustPosition):
        (khtml::InlineFlowBox::clearTruncation):
        (khtml::EllipsisBox::paint):
        (khtml::EllipsisBox::nodeAtPoint):
        (khtml::RootInlineBox::clearTruncation):
        (khtml::RootInlineBox::placeEllipsis):
        (khtml::RootInlineBox::paintEllipsisBox):
        (khtml::RootInlineBox::hitTestEllipsisBox):
        (khtml::RootInlineBox::adjustPosition):
        (khtml::RootInlineBox::childRemoved):
        * khtml/rendering/render_line.h:
        (khtml::InlineBox::clearTruncation):
        * khtml/rendering/render_text.cpp:
        * khtml/rendering/render_text.h:
        (khtml::InlineTextBox::clearTruncation):

2004-06-17  Trey Matteson  <trey@apple.com>

	3698514 - coordinates in ondragstart and ondrag events are wrong

	This part fixes the ondragstart coords.  We salt away the window-based mouseDown
	location, since we need that when we dispatch the ondragstart event.  Previously
	we were errantly using a mouseDown point that had already been converted to view
	coords, and then the dispatch converted it again.

        Reviewed by Maciej.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Use window based mouse event coords to dispatch event.
        (KWQKHTMLPart::mouseDown):  Save window based mouse event coords .

2004-06-16  David Hyatt  <hyatt@apple.com>

	Fix for 3596620, implement a subset of CSS3 text truncation for Emerson.
	
        Reviewed by mjs

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::checkLinesForTextOverflow):
        * khtml/rendering/font.cpp:
        (Font::checkSelectionPoint):
        * khtml/rendering/font.h:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject):
        (khtml::RenderBlock::paintFloats):
        (khtml::RenderBlock::paintEllipsisBoxes):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_line.cpp:
        (InlineBox::canAccommodateEllipsis):
        (InlineBox::placeEllipsisBox):
        (InlineFlowBox::paintDecorations):
        (InlineFlowBox::placeEllipsisBox):
        (EllipsisBox::paint):
        (RootInlineBox::placeEllipsis):
        (RootInlineBox::placeEllipsisBox):
        * khtml/rendering/render_line.h:
        (khtml::EllipsisBox::m_str):
        (khtml::RootInlineBox::ellipsisBox):
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::placeEllipsisBox):
        (InlineTextBox::paintDecoration):
        (InlineTextBox::offsetForPosition):
        (RenderText::positionForCoordinates):
        (RenderText::paint):
        * khtml/rendering/render_text.h:
        * kwq/KWQFontMetrics.h:
        * kwq/KWQFontMetrics.mm:
        (QFontMetrics::checkSelectionPoint):
        * kwq/WebCoreTextRenderer.h:

=== WebCore-145.1 ===

2004-06-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3697602> REGRESSION (144.2-TOT) Selection highlight does not draw

        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::setSelection):

=== Safari-145 ===

2004-06-16  Richard Williamson   <rjw@apple.com>

	Fixed 3695730:  Added support for embeds[], much like
	applets[], to allow access to a plugin's exported interface.

        Reviewed by Chris.

        * khtml/dom/html_document.cpp:
        (HTMLDocument::embeds):
        * khtml/dom/html_document.h:
        * khtml/ecma/kjs_dom.cpp:
        (KJS::getRuntimeObject):
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):
        (KJS::HTMLElement::tryGet):
        (KJS::HTMLCollection::tryGet):
        (KJS::HTMLCollection::getNamedItems):
        * khtml/ecma/kjs_html.h:
        (KJS::HTMLDocument::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::calcLength):
        (HTMLCollectionImpl::getItem):
        (HTMLCollectionImpl::getNamedItem):
        * khtml/html/html_miscimpl.h:
        (DOM::HTMLCollectionImpl::):
        * khtml/html/html_objectimpl.cpp:
        (HTMLEmbedElementImpl::getEmbedInstance):
        * khtml/html/html_objectimpl.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getEmbedInstanceForView):

2004-06-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	<rdar://problem/3695907>: (can't enable selection inside parent where it is disabled via CSS)

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue): 
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/rendering/render_object.cpp:
        (RenderObject::shouldSelect):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::userSelect):
        (khtml::RenderStyle::setUserSelect):
        (khtml::RenderStyle::initialUserSelect):

2004-06-15  David Hyatt  <hyatt@apple.com>

	Initial impl of the EllipsisBox.  This code just gets the box created and gets it placed vertically.  The next
	stage will be to position the box horizontally as well.
	
        Reviewed by trey

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::checkLinesForTextOverflow):
        * khtml/rendering/render_line.cpp:
        (RootInlineBox::placeEllipsis):
        * khtml/rendering/render_line.h:
        (khtml::EllipsisBox::m_str):

2004-06-15  David Hyatt  <hyatt@apple.com>

	Implement canAccommodateEllipsis.  The basic idea is that everything on a line will allow an ellipsis to be
	drawn on top of it unless it's a replaced element.  Then, if the replaced element overlaps, the ellipsis won't
	be allowed.
	
        Reviewed by john

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::checkLinesForTextOverflow):
        * khtml/rendering/render_line.cpp:
        (InlineBox::closestLeafChildForXPos):
        (InlineBox::canAccommodateEllipsis):
        (InlineFlowBox::canAccommodateEllipsis):
        (RootInlineBox::canAccommodateEllipsis):
        * khtml/rendering/render_line.h:

2004-06-15  Vicki Murley <vicki@apple.com>

	- added a few layout tests, rdar://3694510

        * layout-tests/editing/deleting/delete-image-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-image-004.html: Added.
        * layout-tests/editing/selection/extend-by-character-006-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-006.html: Added.

2004-06-15  Trey Matteson  <trey@apple.com>

	Dragging tweak:  We pass the mouse down coords instead of the
	latest mouse drag coords to the ondragstart event.  This makes it
	easy for the client to figure the correct drag image offset,
	whereas the mouse drag location is next to useless for that.

        Reviewed by Louch

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::khtmlMouseMoveEvent):

2004-06-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3685236>: (Safari does not support onselectstart event handler)

        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty):
        (DOMNode::putValue):
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMNode::):
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseHTMLAttribute):
        * khtml/misc/htmlattrs.c:
        (hash_attr):
        (findAttr):
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:
        * khtml/rendering/render_object.cpp:
        (RenderObject::shouldSelect):
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId):
        (EventImpl::idToType):
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::):

2004-06-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	Fix crash with last checkin.

        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::domObjectsPerDocument): check the same
	property we want to initialize.

2004-06-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3685309>: (properties not shared for JS wrappers of same DOM object, accessed from different frames)

        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::domObjects):
        (ScriptInterpreter::domObjectsPerDocument):
        (ScriptInterpreter::ScriptInterpreter):
        (ScriptInterpreter::forgetDOMObject):
        (ScriptInterpreter::getDOMObjectForDocument):
        (ScriptInterpreter::putDOMObjectForDocument):
        (ScriptInterpreter::deleteDOMObjectsForDocument):
        (ScriptInterpreter::mark):
        (ScriptInterpreter::forgetDOMObjectsForDocument):
        (ScriptInterpreter::updateDOMObjectDocument):
        * khtml/ecma/kjs_binding.h:
        (KJS::ScriptInterpreter::getDOMObject):
        (KJS::ScriptInterpreter::putDOMObject):
        (KJS::ScriptInterpreter::deleteDOMObject):

2004-06-15  Darin Adler  <darin@apple.com>

        - rolled out Ken's fix for <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
          (it was making most layout tests fail)

        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Rolled check back in.

2004-06-15  David Hyatt  <hyatt@apple.com>

	Add a truncation variable to text run boxes that will eventually be used to know how to cut out some of the glyphs when
	rendering.
	
        Reviewed by darin

        * khtml/rendering/render_text.cpp:
        (RenderText::clearTextOverflowTruncation):
        * khtml/rendering/render_text.h:
        (khtml::InlineTextBox:::InlineRunBox):
        (khtml::InlineTextBox::clearTruncation):

2004-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed some things for GC that Patrick missed, or that happened after the branch

        * kwq/DOM-CSS.mm:
        (-[DOMStyleSheet finalize]): Added.
        (-[DOMStyleSheetList finalize]): Added.
        (-[DOMCSSStyleSheet finalize]): Added.
        (-[DOMMediaList finalize]): Added.
        (-[DOMCSSRuleList finalize]): Added.
        (-[DOMCSSRule finalize]): Added.
        (-[DOMCSSStyleDeclaration finalize]): Added.
        (-[DOMCSSValue finalize]): Added.
        (-[DOMRGBColor finalize]): Added.
        (-[DOMRect finalize]): Added.
        (-[DOMCounter finalize]): Added.
        * kwq/DOM.mm:
        (-[DOMObject finalize]): Added.
        (-[DOMNode finalize]): Added.
        (-[DOMNamedNodeMap finalize]): Added.
        (-[DOMNodeList finalize]): Added.
        (-[DOMImplementation finalize]): Added.
        (-[DOMRange finalize]): Added.
        (-[DOMNodeFilter finalize]): Added.
        (-[DOMNodeIterator finalize]): Added.
        (-[DOMTreeWalker dealloc]): Removed unneeded nil check.
        (-[DOMTreeWalker finalize]): Added.
        * kwq/DOMHTML.mm:
        (-[DOMHTMLCollection finalize]): Added.
        (-[DOMHTMLOptionsCollection finalize]): Added.
        * kwq/KWQClipboard.mm:
        (KWQClipboard::KWQClipboard): Use KWQRetain instead of retain.
        (KWQClipboard::~KWQClipboard): Use KWQRelease instead of release.
        * kwq/KWQEditCommand.mm:
        (-[KWQEditCommand finalize]): Added.
        * kwq/KWQFont.mm:
        (QFont::~QFont): Use KWQRelease instead of release.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::keyEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
        (KWQKHTMLPart::mouseDown): Use KWQRetain instead of retain, and KWQRelease instead of release.
        (KWQKHTMLPart::mouseDragged): Use KWQRetain instead of retain, and KWQRelease instead of release.
        (KWQKHTMLPart::mouseUp): Use KWQRetain instead of retain, and KWQRelease instead of release.
        (KWQKHTMLPart::mouseMoved): Use KWQRetain instead of retain, and KWQRelease instead of release.
        (KWQKHTMLPart::sendContextMenuEvent): Use KWQRetain instead of retain, and KWQRelease instead of release.
        * kwq/KWQPageState.mm:
        (-[KWQPageState finalize]): Added. Filed <rdar://problem/3694163> about the fact that this is not right.
        * kwq/KWQTimer.mm:
        (-[KWQSingleShotTimerTarget finalize]): Added.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge finalize]): Added. Filed <rdar://problem/3694165> about the fact that this is not right.

2004-06-15  David Hyatt  <hyatt@apple.com>

	Initial work on text truncation.  Working top-down, I think I've made all the changes I will need to bidi.cpp
	and to the block code itself.  The rest of the code can be concentrated in the render_line and render_text files.
	
        Reviewed by darin

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        (khtml::RenderBlock::findNextLineBreak):
        (khtml::RenderBlock::deleteEllipsisLineBoxes):
        (khtml::RenderBlock::checkLinesForTextOverflow):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_line.cpp:
        (RootInlineBox::detach):
        (RootInlineBox::detachEllipsisBox):
        (RootInlineBox::canAccommodateEllipsis):
        (RootInlineBox::placeEllipsis):
        * khtml/rendering/render_line.h:
        (khtml::RootInlineBox::RootInlineBox):
        * khtml/rendering/render_text.cpp:
        (RenderText::clearTextOverflowTruncation):
        * khtml/rendering/render_text.h:

2004-06-14  Trey Matteson  <trey@apple.com>

	3692690 - REGRESSION: canceling drag from WebView cause link to load
	Just need to take extra care to cancel any click handling in
	all cases once we're committed to doing the drag.

        Reviewed by Darin.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Call invalidateClick once
	we're past the hysteresis point, and definitely going to try
	to start a drag and drop.

2004-06-14  Darin Adler  <darin@apple.com>

        - fixed crash on boot

        * kwq/KWQFoundationExtras.h: (KWQRetainNSRelease):
        Fixed return value of this method; was uninitialized.

2004-06-14  Trey Matteson  <trey@apple.com>

	Dashboard wants access to pastboard data during the drag gesture.

	We address this need be allowing docs that are local files to access the
	pasteboard data during a drag, while other pages can only get at the types
	list until the drop happens.  This is deemed safe because local files already
	have such broad super powers.

        Reviewed by Maciej.

        * kwq/KWQKURL.h:
        * kwq/KWQKURL.mm:
        (KURL::isLocalFile):  Implement this QT method to look for the file scheme.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragOperationForDraggingInfo:]):  Use more relaxed clipboard
	security for local file pages.
        (-[WebCoreBridge dragExitedWithDraggingInfo:]):  Ditto.

2004-06-14  Darin Adler  <darin@apple.com>

        Reviewed by me, code changes by Patrick Beard.

        - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)

        * WebCore.pbproj/project.pbxproj: Added KWQFoundationExtras.h.
        * kwq/KWQFoundationExtras.h: Added.
        (KWQRetain): Cover for CFRetain that is tolerant of nil.
        (KWQRelease): Cover for CFRelease that is tolerant of nil.
        (KWQRetainNSRelease): Combination of a CFRetain and an -[NSObject release] that is tolerant of nil.
        Also includes a declaration of finalize so we can call [super finalize] without warnings on Panther.

        * kwq/DOM.mm:
        (ObjCNodeFilterCondition::ObjCNodeFilterCondition): Use CFRetain instead of retain.
        (ObjCNodeFilterCondition::~ObjCNodeFilterCondition): Use CFRelease instead of release.
        * kwq/KWQComboBox.mm:
        (QComboBox::~QComboBox): Use KWQRelease instead of release.
        (QComboBox::setFont): Use KWQRelease instead of release.
        (QComboBox::labelFont): Use KWQRetain instead of retain.
        * kwq/KWQCursor.mm:
        (QCursor::QCursor): Use KWQRetain instead of retain.
        (QCursor::~QCursor): Use KWQRelease instead of release.
        (QCursor::operator=): More of the same.
        * kwq/KWQFileButton.mm:
        (KWQFileButton::KWQFileButton): Use KWQRetainNSRelease to retain a newly-allocated object.
        (KWQFileButton::~KWQFileButton): Use CFRelease instead of release.
        * kwq/KWQFont.mm:
        (QFont::QFont): Use KWQRetain instead of retain.
        (QFont::operator=): More of the same.
        (QFont::setFamily): Use KWQRelease instead of release.
        (QFont::setFirstFamily): Use KWQRelease instead of release.
        (QFont::setPixelSize): Use KWQRelease instead of release.
        (QFont::setWeight): Use KWQRelease instead of release.
        (QFont::setItalic): Use KWQRelease instead of release.
        (QFont::getNSFont): Use KWQRetain instead of retain.
        * kwq/KWQFontMetrics.mm:
        (QFontMetricsPrivate::~QFontMetricsPrivate): Use KWQRelease instead of release.
        (QFontMetricsPrivate::getRenderer): Use KWQRetain instead of retain.
        (QFontMetricsPrivate::setFont): Use KWQRelease instead of release.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::~KWQKHTMLPart): Use KWQRelease instead of release.
        (KWQKHTMLPart::clearRecordedFormValues): Use KWQRelease instead of release.
        (KWQKHTMLPart::recordFormValue): Use KWQRetainNSRelease and use KWQRetain instead of retain.
        (KWQKHTMLPart::windowScriptObject): Use KWQRetainNSRelease.
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate): Use KWQRetainNSRelease.
        (KIO::TransferJobPrivate::~TransferJobPrivate): Use KWQRelease instead of release.
        (KIO::TransferJob::setLoader): More of the same.
        * kwq/KWQLoader.mm:
        (KWQRetainResponse): Use KWQRetain instead of retain.
        (KWQReleaseResponse): Use KWQRelease instead of release.
        * kwq/KWQPainter.mm:
        (QPainterPrivate::~QPainterPrivate): Use KWQRelease instead of release.
        (QPainter::_updateRenderer): More of the same.
        (QPainter::initFocusRing): Use KWQRetainNSRelease.
        (QPainter::clearFocusRing): Use KWQRelease instead of release.
        * kwq/KWQPixmap.mm:
        (QPixmap::QPixmap): Use KWQRetain instead of retain.
        (QPixmap::~QPixmap): Use KWQRelease instead of release.
        (QPixmap::receivedData): Use KWQRetain instead of retain.
        (QPixmap::resize): Use KWQRetainNSRelease and use KWQRelease instead of release.
        (QPixmap::operator=): More of the same.
        * kwq/KWQRegion.mm:
        (QRegion::QRegion): Use KWQRetain instead of retain.
        (QRegion::~QRegion): Use KWQRelease instead of release.
        (QRegion::operator=): More of the same.
        * kwq/KWQTimer.mm:
        (QTimer::start): Use KWQRetain instead of retain.
        (QTimer::stop): Use KWQRelease instead of release.
        (QTimer::fire): Use KWQRelease instead of release.
        * kwq/KWQWidget.mm:
        (QWidget::QWidget): Use KWQRetain instead of retain.
        (QWidget::~QWidget): Use KWQRelease instead of release.
        (QWidget::setView): More of the same.
        * kwq/WebCoreSettings.mm: (-[WebCoreSettings finalize]):
        Delete the storage here, as well as in dealloc.

2004-06-14  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Trey.

	<rdar://problem/3693818>: (Safari should use CG calls for circle drawing for better performance)

	* kwq/KWQPainter.mm:
        (QPainter::drawEllipse): Use CG calls instead of NS calls for faster circle drawing.
        (QPainter::drawArc): Ditto.

2004-06-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Vicki

        Fix for this bug:
        
        <rdar://problem/3690115> Crash deleting text out of iChat's profile (an editable Webview)

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::isFocusable): Added null-check of parent node before deref'ing it.

2004-06-14  Trey Matteson  <trey@apple.com>

	Two tweaks to recently added "drag" pseudo-class, as suggested by
	Dave.  The class is renamed to "-khtml-drag", and we update layout
	when using it, instead of only updating styles.

        Reviewed by hyatt.

        * khtml/css/css_base.cpp:
        (CSSSelector::extractPseudoType):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::snapshotDragImage):

2004-06-13  Trey Matteson  <trey@apple.com>

	Support for DHTML cut/copy/paste.  We now support oncut, oncopy, onpaste.  The events
	are sent to the first node in the selection, or else the body.  Current holes are
	that we do not send events for operations in text fields or text areas (because it
	is hard to get the right hooks into the AppKit).

	We also send onbeforecut, onbeforecopy, onbeforepaste before the other events, which
	isn't really WinIE compatible, but is close.  WinIE uses these to enable cut/paste
	menu items in its UI.  DB doesn't need this for now.

        Reviewed by Chris

        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty):  Boilerplate for new events
        (DOMNode::putValue):    Boilerplate for new events
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMNode::):    Boilerplate for new events
        * khtml/ecma/kjs_dom.lut.h:
        * khtml/ecma/kjs_events.cpp:
        (DOMEvent::DOMEvent): "dataTransfer" and "clipboardData" properties are conditionally
	defined on DOMEvent, depending on if the event is a dragging or clipboard event.
        (DOMMouseEvent::mark):  Pass mark along to any clipboard object we have.
        (DOMEvent::getValueProperty):  Return "dataTransfer" or "clipboardData".
        (DOMMouseEvent::getValueProperty):  Returning "dataTransfer" now handled by
	the superclass.
        * khtml/ecma/kjs_events.h:
        (KJS::DOMEvent::):
        (KJS::DOMMouseEvent::DOMMouseEvent):
        (KJS::DOMMouseEvent::):
        (KJS::DOMMouseEvent::toMouseEvent):
        * khtml/ecma/kjs_events.lut.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseHTMLAttribute):  Boilerplate for new events
        * khtml/misc/htmlattrs.c:
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:  Boilerplate for new events
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId):  Boilerplate for new events
        (EventImpl::idToType):  Boilerplate for new events
        (EventImpl::isDragEvent):  New utility
        (EventImpl::isClipboardEvent):  New utility
        (MouseEventImpl::isDragEvent):  New utility
        (ClipboardEventImpl::ClipboardEventImpl):  ref optional clipboard
        (ClipboardEventImpl::~ClipboardEventImpl):  deref optional clipboard
        (ClipboardEventImpl::isClipboardEvent):  New utility
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::):  Boilerplate for new events
        (DOM::ClipboardEventImpl::clipboard):
        * kwq/KWQClipboard.h:  Monkey business so this file is includable in C++.
        * kwq/KWQClipboard.mm:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dispatchCPPEvent):  Send one of the new events.
        (KWQKHTMLPart::tryCut):  Declare pasteboard types, send cut events.
        (KWQKHTMLPart::tryCopy):  Declare pasteboard types, send copy events.
        (KWQKHTMLPart::tryPaste):  Send paste events.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge tryDHTMLCut]):  Pass through to part
        (-[WebCoreBridge tryDHTMLCopy]):  Ditto
        (-[WebCoreBridge tryDHTMLPaste]):  Ditto

2004-06-14  Trey Matteson  <trey@apple.com>

	A new CSS pseudo-class ".drag" is added.  Analogous to the "hover" class,
	this class determines styles used while an element is generating a drag
	image.

        Reviewed by hyatt.

        * khtml/css/css_base.cpp:
        (CSSSelector::extractPseudoType):  Boilerplate for adding new class.
        * khtml/css/css_base.h:  Boilerplate for adding new class.
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::checkOneSelector):  Match new class against
	elements being dragged.
        * khtml/css/cssstyleselector.h:
        (khtml::StyleSelector::):  Boilerplate for adding new class.
        * khtml/rendering/render_object.cpp:
        (RenderObject::RenderObject):  Init new member.
        (RenderObject::isDragging):  Return whether this object is being dragged.
        (RenderObject::updateDragState):  Paint us an all children with a new dragged state.
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_style.h: Boilerplate for adding new class.
        (khtml::RenderStyle::NonInheritedFlags::operator==):
        (khtml::RenderStyle::setBitDefaults):
        (khtml::RenderStyle::affectedByDragRules):
        (khtml::RenderStyle::setAffectedByDragRules):
        * kwq/KWQClipboard.mm:
        (KWQClipboard::dragNSImage):  Method rename.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::snapshotDragImage):  Mark the element as being dragged before
	we snapshot it, so new style class will apply.

2004-06-14  Ken Kocienda  <kocienda@apple.com>

        Added a few more editing-related layout tests.

        * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3654864-fix.html: Added.
        * layout-tests/editing/inserting/insert-3659587-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3659587-fix.html: Added.
        * layout-tests/editing/inserting/insert-after-delete-001-expected.txt: Added.
        * layout-tests/editing/inserting/insert-after-delete-001.html: Added.
        * layout-tests/editing/inserting/insert-br-case1-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-case1.html: Added.
        * layout-tests/editing/inserting/insert-br-case2-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-case2.html: Added.
        * layout-tests/editing/inserting/insert-br-case3-expected.txt: Added.
        * layout-tests/editing/inserting/insert-br-case3.html: Added.

2004-06-14  Ken Kocienda  <kocienda@apple.com>

        Regarding the bug below, removing some tests since we have removed the execCommand("paste") 
        feature, at least for now.

        <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)

        * layout-tests/editing/pasteboard/copy-paste-text-001-expected.txt: Removed.
        * layout-tests/editing/pasteboard/copy-paste-text-001.html: Removed.
        * layout-tests/editing/pasteboard/cut-paste-text-002-expected.txt: Removed.
        * layout-tests/editing/pasteboard/cut-paste-text-002.html: Removed.

2004-06-14  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply due to non-0 exception code trying to insert a DIV markup string
        
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::checkAddChild): This function was being too strict in disallowing certain nodes
        to be added as other child nodes, applying rules we typically use for parsing. However,
        those parsing rules are primarily for dealing with "bad" HTML, and should not be
        applied to programmatic DOM operations. The fix involves removing calls to childAllowed().

2004-06-12  Trey Matteson  <trey@apple.com>

	The drag image may be updated during a DHTML drag.  This includes updating
	from a Timer instead of a drag event handler.  In addition, an arbitrary
	element can be set as the one to snapshot for the drag image.

        Reviewed by John

        * khtml/ecma/kjs_events.cpp:
        (ClipboardProtoFunc::tryCall):  setDragImage accepts a node.  Previously,
	it had to be an Image object.
        * khtml/rendering/render_object.cpp:
        (RenderObject::paintingRootRect):  Also returns top element's rect.
        * khtml/rendering/render_object.h:
        * khtml/xml/dom2_eventsimpl.h:
        * kwq/KWQClipboard.h:  New security mode where image is still writable, but
	pasteboard is not.
        (KWQClipboard::):
        (KWQClipboard::setDragHasStarted):
        * kwq/KWQClipboard.mm:
        (KWQClipboard::KWQClipboard):    Part may be passed.  Needed in the source
	case to generate an image from an element.
        (KWQClipboard::setAccessPolicy):  New, replaces former becomeNumb method
	which wasn't flexible enough.
        (KWQClipboard::accessPolicy):  New getter.
        (KWQClipboard::dragImage):  No change, diff confusion.
        (KWQClipboard::setDragImage):  Call new helper, below.
        (KWQClipboard::dragImageElement):  New, return any element set.
        (KWQClipboard::setDragImageElement):  New, call new helper.
        (KWQClipboard::setDragImage):  New helper, set the image via either a
	pixmap or an element to snapshot, pushes the result to WebKit if we've
	already started the drag.
        (KWQClipboard::dragNSImage):  Generate an NSImage and mouse offset, no
	matter how the drag image was set (Image or element).
        * kwq/KWQKHTMLPart.h:  A single clipboard is kept over the life of a
	source drag instead of making one for each event.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):  Init clipboard.
        (KWQKHTMLPart::~KWQKHTMLPart):  Free clipboard.
        (KWQKHTMLPart::freeClipboard):  New helper.
        (KWQKHTMLPart::dispatchDragSrcEvent):  Most code moved to caller.
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Make clipboard for this drag session.
	Init clipboard to make an image from the dragSource element.  Mark the
	drag as having started.
        (KWQKHTMLPart::dragSourceMovedTo):  Clipboard will update WK with any new
	drag image, so we don't need to.
        (KWQKHTMLPart::dragSourceEndedAt):  Ditto.
        (KWQKHTMLPart::elementImage):  Also return element rect.
        * kwq/WebCoreBridge.h:  Glue moved to WebCoreGraphicsBridge.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragOperationForDraggingInfo:]):  Use new method.
        (-[WebCoreBridge dragExitedWithDraggingInfo:]):  Ditto
        (-[WebCoreBridge concludeDragForDraggingInfo:]):  Ditto
        * kwq/WebCoreGraphicsBridge.h:
        * kwq/WebCoreGraphicsBridge.m:
        (-[WebCoreGraphicsBridge setDraggingImage:at:]):  Glue moved from WebBridge

2004-06-11  Chris Blumenberg  <cblu@apple.com>

	Support for WebKit drag & drop API.

        Reviewed by trey.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge _positionForPoint:]): new
        (-[WebCoreBridge moveDragCaretToPoint:]): call _positionForPoint
        (-[WebCoreBridge editableDOMRangeForPoint:]): new

2004-06-11  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3645846>: (REGRESSION: Stuck "Loading" when logging into Google's Gmail on newer versions of Safari)

        * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::parseHTMLAttribute):
        Call through to base class for ATTR_ID so the "has ID" bit gets set.
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::parseHTMLAttribute): Move ATTR_COMPOSITE code up and out of the way so
        it doesn't screw up ATTR_ID parsing.
        (HTMLMapElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
        so the "has ID" bit gets set.
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::parseHTMLAttribute): Remove ATTR_ID case; not needed.
        (HTMLParamElementImpl::parseHTMLAttribute): Call through to base class for ATTR_ID
        so the "has ID" bit gets set.

2004-06-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3659587>: "when typing in Blot, bold style does not carry over to next line after pressing 'return'"

        Did some work to improve the insert newline command. The refinement is to insert the newline
        at the upstream position of the caret, ensuring that the newline takes on the 
        appropriate style, and does not let the caret "escape" from an element that is
        conferring style.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): New helper. Adds smarts about adding
        newlines when the selection is a caret in a block.
        (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): Ditto.
        (khtml::InputNewlineCommandImpl::doApply): Simplified cases. One case in the code could not
        happen.
        * khtml/editing/htmlediting_impl.h:

        Fix for this bug:
    
        <rdar://problem/3654864>: "Pasting content at start of line places it at end of previous line"

        (khtml::InputTextCommandImpl::prepareForTextInsertion): Simple code mistake. Content was indeed
        being added to the line before. Fixed to add new content after the line break.

2004-07-10  Trey Matteson  <trey@apple.com>

	Prep work for latest delegate API for dragging.  In addition, I also straightened out all
	the cases of DHTML setting a drag image or setting pasteboard data, and how that would
	override WebKit's default behavior (which follows how WinIE does things).

        Reviewed by Chris.

        * khtml/rendering/render_object.cpp:
        (RenderObject::draggableNode):  Obey new params for whether a DHTML or UserAgent (i.e.,
	WebKit) drag source is allowed.
        * khtml/rendering/render_object.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dispatchDragSrcEvent):  Setting pasteboard data was moved out of here, now
	caller's responsibility.
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Ask bridge for allowable drag actions (DHTML vs UA).
	Only send drag events if DHTML is allowed.  Only generate a drag image if the source is
	a DHTML element.  Note whether event handler set any pasteboard	data, and pass that fact
	to WebKit.
        (KWQKHTMLPart::dragSourceMovedTo): Only send drag events if DHTML is allowed.  
        (KWQKHTMLPart::dragSourceEndedAt): Only send drag events if DHTML is allowed.  
        * kwq/WebCoreBridge.h:

2004-06-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Trey

        Lay some groundwork for better testing of inserting newlines. Layout
        tests that use this new code will be coming soon.

        * khtml/editing/jsediting.cpp: Add commands for bold and inserting newlines.
        * layout-tests/editing/editing.js: Added new insertNewline command.
        which calls through to TypingCommand::insertNewline. There was no way to get
        to this command from JS before this addition.

2004-06-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Javascript execCommand system wants to use case-insensitive QDict.
        The interface for QDict offers this feature, but it was never implemented.
        Now it is.

        * kwq/KWQDictImpl.h: Declare bool to store case-sensitive bit.
        * kwq/KWQDictImpl.mm:
        (KWQDictImpl::KWQDictImpl): No longer drops caseSensitive on the floor; stores
        it in instance variable.
        (KWQDictImpl::insert): Make lowercase version of key for operation, if necessary.
        (KWQDictImpl::remove): Ditto.
        (KWQDictImpl::find): Ditto.
        (KWQDictIteratorImpl::currentStringKey): Whitespace cleanup.

=== Safari-144 ===

2004-06-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for this bug:
        
        <rdar://problem/3654850>: "Style changes do not work across blocks"
        
        Now, applying styles works across blocks. I did quite a bit
        of internal redsign on the member functions of this class to
        make this work. As a bonus, from an architectural standpoint,
        all style changes are now done "in place". There is no more
        copying of content in order to perform style changes.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::doApply):
        (khtml::ApplyStyleCommandImpl::removeHTMLStyleNode):
        (khtml::ApplyStyleCommandImpl::removeCSSStyle):
        (khtml::ApplyStyleCommandImpl::removeStyle):
        (khtml::ApplyStyleCommandImpl::nodeFullySelected):
        (khtml::ApplyStyleCommandImpl::splitTextAtStartIfNeeded):
        (khtml::ApplyStyleCommandImpl::splitTextAtEndIfNeeded):
        (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded):
        (khtml::ApplyStyleCommandImpl::positionInsertionPoint):
        * khtml/editing/htmlediting_impl.h:

2004-06-10  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - filled out execCommand a lot more
        - fixed <rdar://problem/3685231>: (execCommand italic is not implemented)
        - fixed <rdar://problem/3685232>: (execCommand bold is not implemented)
        - fixed <rdar://problem/3675899>: (Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan)
        - fixed <rdar://problem/3675901>: (Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan)
        - fixed <rdar://problem/3675904>: (Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan)

        * khtml/editing/jsediting.cpp:
        (DOM::JSEditor::queryCommandIndeterm): Changed to use KHTMLPart::TriState instead of CommandState.
        (DOM::JSEditor::queryCommandState): Ditto.
        (execStyleChange): Changed to use KHTMLPart::applyStyle.
        (stateStyle): Used KHTMLPart::selectionHasStyle for this.
        (selectionStartHasStyle): Use KHTMLPart::selectionStartHasStyle for this.
        (valueStyle): Used KHTMLPart::selectionStartStylePropertyValue for this.
        (execBold): Implemented toggling, using selectionStartHasStyle.
        (execItalic): Implemented toggling, using selectionStartHasStyle.
        (execPrint): Implemented.
        (enabledRedo): Implemented, using canRedo.
        (enabledUndo): Implemented, using canUndo.
        (stateNone): Renamed from stateNo.
        (valueBackColor): Implemented, using valueStyle.
        (valueFontName): Implemented, using valueStyle.
        (valueFontSize): Implemented, using valueStyle.
        (valueForeColor): Implemented, using valueStyle.
        (valueFontSize): Implemented, using valueStyle.

        * khtml/khtml_part.h: Added editing operations.
        * khtml/khtml_part.cpp:
        (KHTMLPart::copyToPasteboard): Added.
        (KHTMLPart::cutToPasteboard): Added.
        (KHTMLPart::redo): Added.
        (KHTMLPart::undo): Added.
        (KHTMLPart::applyStyle): Added.
        (updateState): Added.
        (KHTMLPart::selectionHasStyle): Added.
        (KHTMLPart::selectionStartHasStyle): Added.
        (KHTMLPart::selectionStartStylePropertyValue): Added.
        (KHTMLPart::selectionComputedStyle): Added.
        (KHTMLPart::print): Added.

        * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Call print() on plain old part, not KWQ(part).

        * kwq/KWQKHTMLPart.h: Removed print(), added _haveUndoRedoOperations.
        * kwq/KWQKHTMLPart.mm:
        (KHTMLPart::print): Moved from KWQKHTMLPart to KHTMLPart.
        (KWQKHTMLPart::registerCommandForUndo): Moved code here from bridge.
        (KWQKHTMLPart::registerCommandForRedo): Moved code here from bridge.
        (KWQKHTMLPart::clearUndoRedoOperations): Moved code here from bridge.
        (KWQKHTMLPart::issueUndoCommand): Moved code here from bridge.
        (KWQKHTMLPart::issueRedoCommand): Moved code here from bridge.
        (KWQKHTMLPart::issuePasteCommand): Moved code here from bridge.
        (KHTMLPart::canUndo): Added.
        (KHTMLPart::canRedo): Added.

        * kwq/WebCoreBridge.h: Added undoManager, removed undo-related methods.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge applyStyle:]): Changed to call
        KHTMLPart::applyStyle.

        * WebCore.pbproj/.cvsignore: Updated for new Xcode files.

2004-06-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	<rdar://problem/3671555>: Blot scrolls to the top every time you type
	
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::getRepaintRect): If the caret position is invalid, recompute it.

2004-06-09  David Hyatt  <hyatt@apple.com>

	Fix for 3607091, implement a style that prevents zoom and min font size from taking effect.
	The name of the new style is "-apple-text-size-adjust" with values of "none" and "auto."  The default
	is "auto."
	
        Reviewed by mjs

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::styleForElement):
        (khtml::CSSStyleSelector::pseudoStyleForElement):
        (khtml::CSSStyleSelector::applyDeclarations):
        (khtml::CSSStyleSelector::applyProperty):
        (khtml::CSSStyleSelector::checkForTextSizeAdjust):
        * khtml/css/cssstyleselector.h:
        * khtml/rendering/render_style.cpp:
        (textSizeAdjust):
        (StyleCSS3InheritedData):
        (StyleCSS3InheritedData::operator==):
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::lineClamp):
        (khtml::RenderStyle::textSizeAdjust):
        (khtml::RenderStyle::setTextSizeAdjust):
        (khtml::RenderStyle::initialTextSizeAdjust):

2004-06-09  David Hyatt  <hyatt@apple.com>

	Implement parsing and setting of the text-overflow CSS3 property.
	
        Reviewed by kocienda

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/rendering/render_style.cpp:
        (textOverflow):
        (StyleCSS3NonInheritedData::operator==):
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::textOverflow):
        (khtml::RenderStyle::setTextOverflow):
        (khtml::RenderStyle::initialTextOverflow):

2004-06-09  David Hyatt  <hyatt@apple.com>

	Fix for 3678031, implement better flexing for Emerson headers.  This involved adding support for max-width: intrinsic,
	fixing the box layout algorithm to properly deal with max-widths, and implementing support for baseline alignment
	so that boxes can be aligned vertically along their interior baselines.
	
        Reviewed by kocienda

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::parseShadow):
        * khtml/css/cssparser.h:
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/misc/khtmllayout.h:
        (khtml::):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::baselinePosition):
        (khtml::RenderBlock::getBaselineOfFirstLineBox):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::RenderBox):
        (RenderBox::overrideWidth):
        (RenderBox::overrideHeight):
        (RenderBox::calcWidth):
        (RenderBox::calcHeight):
        * khtml/rendering/render_box.h:
        (khtml::RenderBox::overrideSize):
        (khtml::RenderBox::setOverrideSize):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::calcMinMaxWidth):
        (khtml::RenderFlexibleBox::layoutBlock):
        (khtml::RenderFlexibleBox::layoutHorizontalBox):
        (khtml::RenderFlexibleBox::layoutVerticalBox):
        (khtml::RenderFlexibleBox::placeChild):
        (khtml::RenderFlexibleBox::allowedChildFlex):
        * khtml/rendering/render_flexbox.h:
        * khtml/rendering/render_image.cpp:
        (RenderImage::isWidthSpecified):
        (RenderImage::isHeightSpecified):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::getBaselineOfFirstLineBox):
        (khtml::RenderObject::overrideSize):
        (khtml::RenderObject::overrideWidth):
        (khtml::RenderObject::overrideHeight):
        (khtml::RenderObject::setOverrideSize):
        * khtml/rendering/render_style.cpp:
        (StyleFlexibleBoxData::StyleFlexibleBoxData):
        (StyleFlexibleBoxData::operator==):
        (ShadowData::operator==):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::boxPack):
        (khtml::RenderStyle::setBoxPack):
        * khtml/rendering/table_layout.cpp:
        (AutoTableLayout::layout):

2004-06-09  Richard Williamson   <rjw@apple.com>

	Added support for drawing un-rasterized transformed PDFs.

        Reviewed by John.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):

2004-06-09  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - implemented still more execCommand commands

        * khtml/editing/jsediting.cpp: Added a lot more commands, and reformatted a bit.

2004-06-08  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - implemented a bunch more execCommand commands
        - fixed <rdar://problem/3684792>: (JavaScript execCommand("paste") presents security issues)
        - fixed <rdar://problem/3675898>: (Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan)
        - fixed <rdar://problem/3675903>: (Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan)
        - about half of <rdar://problem/3685231>: (execCommand italic is not implemented)
        - about half of <rdar://problem/3685232>: (execCommand bold is not implemented)

        * khtml/editing/jsediting.h: Made constructor inline. Deleted a few unneeded member functions
        that are now just private functions inside jsediting.cpp.

        * khtml/editing/jsediting.cpp:
        (commandImp): Changed this around, so the dictionary is a static local to this function,
        and initialized with C++ "first time initialization" rule.
        (DOM::JSEditor::execCommand): Got rid of special case for 0 for function pointer and added const.
        (DOM::JSEditor::queryCommandEnabled): Ditto.
        (DOM::JSEditor::queryCommandIndeterm): Got rid of special case for 0 for function pointer, added const,
        and use a common three-state state function rather than a separate "indeterm" function.
        (DOM::JSEditor::queryCommandState): Ditto.
        (DOM::JSEditor::queryCommandValue): More of the same.
        (execNotImplemented): Added. Used for unimplemented commands; there are only a few left.
        (execCopy): Renamed.
        (execCut): Renamed.
        (execDelete): Renamed.
        (execInsertText): Renamed.
        (execPaste): Renamed, and disabled.
        (execRedo): Renamed.
        (execSelectAll): Renamed.
        (execUndo): Renamed.
        (execStyleChange): Added. Helper function for commands that are style changes.
        (execBold): Added.
        (execItalic): Added.
        (execJustifyCenter): Added.
        (execJustifyFull): Added.
        (execJustifyLeft): Added.
        (execJustifyRight): Added.
        (execSubscript): Added.
        (execSuperscript): Added.
        (execUnselect): Added.
        (stateNotImplemented): Added. Used for unimplemented state queries; there are a few left.
        (noState): Added.
        (valueNotImplemented): Added. Used for unimplemented value queries; there are a few left.
        (nullStringValue): Added.
        (createCommandDictionary): Changed the initDict function into this function. Added implementations
        for many commands and condensed format so it's easier to work with.

2004-06-08  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        - our part of fix to <rdar://problem/3629334>: (REGRESSION (Tiger): titles on pop-ups menus are truncated and show ellipses)

        * kwq/KWQComboBox.mm: (QComboBox::QComboBox): Call setLineBreakMode:NSLineBreakByClipping.
        In the current version of Tiger I am using, this is not implemented yet.

        - a couple of other unrelated changes

        * khtml/rendering/render_form.cpp: (RenderTextArea::calcMinMaxWidth): Put a little more code
        inside the APPLE_CHANGES ifdef.
        * kwq/KWQTextEdit.h: Remove unused setTabStopWidth function, and make empty setTextFormat
        function an inline for slightly smaller code size.
        * kwq/KWQTextEdit.mm: Ditto.
        * kwq/KWQTextField.mm: Update copyright date.

2004-06-08  Trey Matteson  <trey@apple.com>

	A DHTML drag source can now change the dragging image during the drag.  Currently
	it may only be set to a static image.

        Reviewed by John

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dragSourceMovedTo):  If the ondrag event handler set an image,
	pass it to WebKit.
        * kwq/WebCoreBridge.h:

2004-06-08  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Changes to the selection state for these tests as a result of my previous
        checkin. The changes are minor to a couple of offsets. I looked at the
        changes and approve them.

        * layout-tests/editing/deleting/delete-block-contents-001-expected.txt
        * layout-tests/editing/deleting/delete-block-contents-002-expected.txt
        * layout-tests/editing/deleting/delete-block-contents-003-expected.txt

2004-06-08  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/3654841>: "Hitting delete key with start of block selected 
        does not merge content with preceding block"

        Selections that span blocks now work correctly for deleting the selection and inserting
        over the selection. The largest part of the change is adding a new field to the 
        RemoveNodeAndPruneCommand and its impl version. This was done since the starting block
        for a multi-block selection should always be preserved when deleting, and this was
        a convenient way to express this using the code structure already in place.
        
        * khtml/editing/htmlediting.cpp:
        (khtml::RemoveNodeAndPruneCommand::RemoveNodeAndPruneCommand): Modify this command to 
        take two nodes: the node to remove and a node to stop at when pruning back up the tree.
        (khtml::RemoveNodeAndPruneCommand::pruneNode): New accessor, replaces old node() accessor.
        (khtml::RemoveNodeAndPruneCommand::stopNode): New accessor for additional feature described 
        above.
        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::shouldPruneNode): blow flow renderers can now be deleted, but not if they are a 
        rootEditableElement.
        (khtml::CompositeEditCommandImpl::removeNodeAndPrune): Pass new stopNode param and change the
        name of the existing node argument to pruneNode to distinguish it.
        (khtml::DeleteSelectionCommandImpl::doApply): Pass the block containing the start of the
        selection to removeNodeAndPrune in each case. Also, add one little loop to move all
        the content from the block containing the end of the selection if that block is different
        than the start block.
        (khtml::RemoveNodeAndPruneCommandImpl::RemoveNodeAndPruneCommandImpl): Implement the
        pruneNode/stopNode design already described.
        (khtml::RemoveNodeAndPruneCommandImpl::~RemoveNodeAndPruneCommandImpl): Manage the
        lifecycle of stopNode.
        (khtml::RemoveNodeAndPruneCommandImpl::doApply): Add a check to stop at the stop
        node while pruning.
        * khtml/editing/htmlediting_impl.h:
        (khtml::RemoveNodeAndPruneCommandImpl::pruneNode): New accessor.
        (khtml::RemoveNodeAndPruneCommandImpl::stopNode): Ditto.

2004-06-07  Trey Matteson  <trey@apple.com>

	Clipboard access during DHTML dragging is made secure.

        Reviewed by John.

        * kwq/KWQClipboard.h:
        (KWQClipboard::):
        * kwq/KWQClipboard.mm:
        (KWQClipboard::KWQClipboard):    Init new policy and changeCount members.
        (KWQClipboard::becomeNumb):  Set policy to numb.
        (KWQClipboard::clearData):   Check policy.
        (KWQClipboard::clearAllData):   Check policy.
        (KWQClipboard::getData):   Check policy and changeCount.
        (KWQClipboard::setData):   Check policy.
        (KWQClipboard::types):   Check policy and ChangeCount.
        (KWQClipboard::setDragLocation):   Check policy.
        (KWQClipboard::setDragImage):   Check policy.
        (KWQClipboard::setDropEffect):   Check policy.
        (KWQClipboard::setEffectAllowed):   Check policy.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dispatchDragSrcEvent):  Set policy when creating clipboard,
	and numb-ify it when we're done.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragOperationForDraggingInfo:]): Set policy when creating clipboard,
	and numb-ify it when we're done.
        (-[WebCoreBridge dragExitedWithDraggingInfo:]):  Ditto
        (-[WebCoreBridge concludeDragForDraggingInfo:]):  Ditto

2004-06-08  Ken Kocienda  <kocienda@apple.com>

        * khtml/editing/jsediting.cpp:
        (DOM::EditorCommand::): Stray capital letter in "selectAll" command static
        initializer prevented the command from ever working since the command
        strings are lower-cased when trying to find a match, but not when they
        are inserted into the dictionary. This is a one character change to make
        the string "selectall" in the initializer.

2004-06-07  Trey Matteson  <trey@apple.com>

	WebCore will now generate a default drag image when an element serves as a drag
	source.  The basic idea is the image contains the element and all its children.

	As for the implementation, instead of adding a new paintAction I added a new
	field to the paintInfo struct, "paintingRoot".  If this field is set, painting will
	only paint that root's descendants.

	Some code also moved from the bridge to the part, to be available within WebCore.

        Reviewed by hyatt.

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject):  Pass along paintingRoot to kids.
        (khtml::RenderBlock::paintFloats):  Pass along paintingRoot to kids.
        * khtml/rendering/render_box.cpp:
        (RenderBox::paintBoxDecorations):  Test paintingRoot before painting.
        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::paint):    Test paintingRoot before painting.
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLineBoxBackgroundBorder):    Test paintingRoot before painting.
        (RenderFlow::paintLineBoxDecorations):    Test paintingRoot before painting.
        * khtml/rendering/render_image.cpp:
        (RenderImage::paint):    Test paintingRoot before painting.
        * khtml/rendering/render_inline.cpp:
        (RenderInline::paint):    Pass along paintingRoot to kids.
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::paint):   Pass along paintingRoot to kids.
        (RenderLayer:: paintLayer):  Pass along paintingRoot to kids.  Test if we are within the
	paintingRoot to decide whether to pass the root to our renderer.
        * khtml/rendering/render_layer.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::hasAncestor):  New utility.
        (RenderObject::absoluteBoundingBoxRect): Helper for paintingRootRect
        (RenderObject::addAbsoluteRectForLayer):  Helper for paintingRootRect
        (RenderObject::paintingRootRect):  Return rect that will be painted if we are
	the painting root.
        (RenderObject::draggableNode):  Add test to avoid rare NULL ptr crash.
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::PaintInfo::PaintInfo):  Add paintingRoot field.
        (khtml::RenderObject::paintingRootForChildren):  New utility.  Return the current
	paintingRoot, or nil if we are the root (so kids draw normally).
        (khtml::RenderObject::shouldPaintWithinRoot):  New utility.  We can paint if we
	are the paintingRoot, or no root is set.
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::shouldPaint):  Pass along paintingRoot to kids.
        * khtml/rendering/render_table.cpp:
        (RenderTable::paint):   Pass along paintingRoot to kids.
        * khtml/rendering/render_text.cpp:
        (RenderText::paint):  Test paintingRoot before painting.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):  Init new _elementToDraw member.
        (KWQKHTMLPart::paint):  Generalized to handle cases of painting selection or a
	given element.
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Make a default image if dragSrc didn't
	provide one.
        (KWQKHTMLPart::selectionRect):  Moved from bridge.
        (KWQKHTMLPart::visibleSelectionRect):  Ditto.
        (KWQKHTMLPart::imageFromRect):  Newly factored code, from bridge.
        (KWQKHTMLPart::selectionImage):  Moved from bridge, wrapper around imageFromRect.
        (KWQKHTMLPart::elementImage):  New method, wrapper around imageFromRect.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge drawRect:withPainter:]):  Just call part to draw.
        (-[WebCoreBridge visibleSelectionRect]):  Guts moved to part.
        (-[WebCoreBridge selectionImage]):  Ditto.

2004-06-07  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - fixed <rdar://problem/3682821>: (setTimeout fails when additional parameters are used and timeout function is a string)

        * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Ignore excess arguments instead
        of rejecting the argument list for window.scrollBy, scroll, scrollTo, moveBy, moveTo,
        resizeBy, resizeTo, and setTimeout (when the timeout is a string rather than an object).

        - did a refinement of JSEditor to be slightly more efficient, and not have to edit
          both the .cpp file and the .h when adding more implementation

        * khtml/khtml_part.h: Hack so we can get to the docImpl and xmlDocImpl without being a friend.
        * khtml/editing/jsediting.h: Simplified a bit.
        * khtml/editing/jsediting.cpp: Redid to use a table, and simplified a bit.

2004-06-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for this bug:
        
        <rdar://problem/3682354>: "Typing style does not work yet"
        
        Did the final hook-up of support that has landed in the tree in the
        recent past as part of ongoing style-application work.
        
        For the most part, this patch modifies the InputNewlineCommandImpl and
        InputTextCommandImpl commands to insert a styling span when there is
        a typing style active. 

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::createTypingStyleElement): Helper
        shared by the two commands modified.
        (khtml::InputNewlineCommandImpl::doApply): Create a styling span if the
        part has a typing style. Maintain a nodeToInsert local variable, which is
        either the break to insert or a styling span containing the break. Also,
        remove some utterly bogus derefs. They are just plain wrong.
        (khtml::InputTextCommandImpl::InputTextCommandImpl): Don't need to keep
        m_insertedTextNode. The composite commands this command uses will keep
        track of that object's lifetime. We do not need to do that here.
        (khtml::InputTextCommandImpl::~InputTextCommandImpl): No longer need 
        to deref obsolete m_insertedTextNode.
        (khtml::InputTextCommandImpl::prepareForTextInsertion): Handle the case
        where a styling span needs to be added.
        (khtml::TypingCommandImpl::insertText): Create a new InputTextCommand when
        there is an active typping style.
        * khtml/editing/htmlediting_impl.h: Declare createTypingStyleElement helper.
        Remove m_insertedTextNode from InputTextCommandImpl.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge applyStyle:]): Swicth on the state of the selection, calling
        setTypingStyle when a caret and ApplyStyleCommand when a range.

2004-06-07  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        * khtml/editing/jsediting.h: Elide some unnecessary namespace prefixes.
        * khtml/editing/jsediting.cpp: Make typed constants instead of macros.
        (DOM::JSEditor::commandDict): Elide unnecessary namespace prefix.
        (DOM::JSEditor::execCommand): Remove xxxNotImplemented functions; just return false instead.
        (DOM::JSEditor::queryCommandEnabled): Ditto.
        (DOM::JSEditor::queryCommandIndeterm): Ditto.
        (DOM::JSEditor::queryCommandState): Ditto.
        (DOM::JSEditor::queryCommandSupported): Ditto.
        (DOM::JSEditor::queryCommandValue): Ditto.

2004-06-05  Trey Matteson  <trey@apple.com>

	As agreed with Hyatt and Louch, do not post incoming dragging events
	to text nodes.

        Reviewed by Maciej

        * khtml/khtmlview.cpp:
        (KHTMLView::updateDragAndDrop):  For any drag target that is a text node,
	use its parent instead.

2004-06-03  Trey Matteson  <trey@apple.com>

	DHTML dragging uses the Cocoa NSDragOperation on both the source and dest ends.

	In addition, I caught a prime gaffe where I had used "dropAllowed" instead of "effectAllowed"
	for that particular WinIE property.  That is renamed throughout.

        Reviewed by rjw

        * khtml/ecma/kjs_events.cpp:
        (stringOrUndefined):  New little helper.
        (Clipboard::getValueProperty):  Return Undefined if dropEffect or effectAllowed are not set.
        (Clipboard::putValue):  Rename.
        * khtml/ecma/kjs_events.h:
        (KJS::Clipboard::):  Rename.
        * khtml/ecma/kjs_events.lut.h:
        * khtml/xml/dom2_eventsimpl.h:  Rename.
        * kwq/KWQClipboard.h: Rename, add access to Cocoa drag op.
        * kwq/KWQClipboard.mm:
        (KWQClipboard::dropEffect):   These 4 just moved in the file.
        (KWQClipboard::setDropEffect):
        (KWQClipboard::effectAllowed):
        (KWQClipboard::setEffectAllowed):
        (cocoaOpFromIEOp):  Convert from an IE operation string to a Cocoa DragOp
        (IEOpFromCocoaOp):  and vice-versa
        (KWQClipboard::sourceOperation):  Return effectAllowed, converted to a NSDragOp
        (KWQClipboard::destinationOperation):  Return dropEffect, converted to a NSDragOp
        (KWQClipboard::setSourceOperation):  Set effectAllowed, using a Cocoa value
        (KWQClipboard::setDestinationOperation):  Set dropEffect, using a Cocoa value
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::dispatchDragSrcEvent):  Return the drag op specified by the source element.
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Pass our drag op up to WebKit.
        (KWQKHTMLPart::dragSourceMovedTo):  Pass NULL for new arg.
        (KWQKHTMLPart::dragSourceEndedAt):  Ditto
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragOperationForDraggingInfo:]):  Set the incoming dragOp onto the clipboard
	so DHTML can access it.  In addition, validate whatever op DHTML returns so we play well
	with Cocoa.

2004-06-04  David Hyatt  <hyatt@apple.com>

	Add support for auto values in flex transitions.  Add support for mapping the back end values to
	front end values.  Next it's time to actually try to use this stuff in render_flexbox.
	
        Reviewed by darin

        * khtml/css/css_valueimpl.cpp:
        (length):
        * khtml/css/css_valueimpl.h:
        (DOM::FlexGroupTransitionValueImpl::isAuto):
        * khtml/css/cssparser.cpp:
        (FlexGroupTransitionParseContext::length):
        (FlexGroupTransitionParseContext::commitAutoValue):
        (FlexGroupTransitionParseContext::commitValue):
        (CSSParser::parseFlexGroupTransition):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/rendering/render_style.cpp:
        (FlexGroupTransitionData::operator==):
        * khtml/rendering/render_style.h:
        (khtml::FlexGroupTransitionData::next):
        (khtml::FlexGroupTransitionData::isAuto):

=== Safari-143 ===

2004-06-04  Kevin Decker  <kdecker@apple.com>

        Reviewed by Dave.

        - kwq/KWQKHTMLPart.mm: addMessagetoConsole places sourceURL in the dictionary
        - khtml/xml/dom_docimpl.cpp: right now, we don't have a way to get a url,
          so we leave this blank
        - khtml/ecma/kjs_window.cpp: still need to get the real line number and sourceURL
        - khtml/ecma/kjs_proxy.cpp: now passing the sourceURL to addMessageToConsole
        - khtml/ecma/kjs_events.cpp: still need to grab an accurate line number and sourceURL
        
        * khtml/ecma/kjs_events.cpp:
        (JSEventListener::handleEvent):
        (JSLazyEventListener::handleEvent):
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::evaluate):
        * khtml/ecma/kjs_window.cpp:
        (Window::isSafeScript):
        (ScheduledAction::execute):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::open):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::addMessageToConsole):

2004-06-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix a comical little bug where the style-applying code did not take into
        account deleting content from the start of a block. After the deletion, 
        the caret is placed in the node before the deleted content and so 
        inserting a styled fragment after the deletion position works great.
        The problem is that if the selectionis at the start of a block, there
        is no "position before the deletion" and the caret is placed in the new
        first child of the block. Inserting the styled content after this 
        node is just plain wrong. Now, this case is handled correctly, and the
        styled content is inserted in the proper position.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::insertFragment):

2004-06-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren): Only add additional line height
        in for root editable elements. This helps to keep layout from deviating too
        much from the intended page layout, but still gives an empty document a line
        in which it can blink the caret.

2004-06-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Made some progress on this set of related bugs:
        
        <rdar://problem/3675867>: "Make execCommand work as specified in the Javascript execCommand Compatibility Plan"
        <rdar://problem/3675898>: "Make queryCommandEnabled work as specified in the Javascript execCommand Compatibility Plan"
        <rdar://problem/3675899>: "Make queryCommandIndeterm work as specified in the Javascript execCommand Compatibility Plan"
        <rdar://problem/3675901>: "Make queryCommandState work as specified in the Javascript execCommand Compatibility Plan"
        <rdar://problem/3675903>: "Make queryCommandSupported work as specified in the Javascript execCommand Compatibility Plan"
        <rdar://problem/3675904>: "Make queryCommandValue work as specified in the Javascript execCommand Compatibility Plan"
        
        I did several things to move the ahead with the plan:
        
        1. The latter five methods did not appear in the tree at all. Now they do, although
        
        2. I removed the implementation for these editing methods from dom_docimpl.cpp, and moved
           them out to new js_editing.cpp/js_editing.h files. The remaining code in dom_docimpl.cpp
           is glue to call over to the new JSEditor object defined in the new files.
           
        3. For a couple of the command implementations in js_editing.cpp, I made a stab at returning sensible values.
           For others, I just return place-holder values. I have added some comments to describe what has been done and
           what still needs to be done. 

        * WebCore.pbproj/project.pbxproj:
        * khtml/dom/dom_doc.cpp: Add call-overs for these methods.
        (DOM::Document::queryCommandEnabled):
        (DOM::Document::queryCommandIndeterm):
        (DOM::Document::queryCommandState):
        (DOM::Document::queryCommandSupported):
        (DOM::Document::queryCommandValue):
        * khtml/dom/dom_doc.h:
        * khtml/ecma/kjs_dom.cpp: Add queryCommandXXX terminology.
        (DOMDocumentProtoFunc::tryCall):
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMDocument::):
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::):
        * khtml/editing/jsediting.cpp: Added. This file implements the guts of editing-related JS methods.
        (DOM::execCommandNotImplemented):
        (DOM::queryBoolNotImplemented):
        (DOM::queryValueNotImplemented):
        (DOM::JSEditor::commandDict):
        (DOM::JSEditor::JSEditor):
        (DOM::JSEditor::~JSEditor):
        (DOM::JSEditor::commandIdentifier):
        (DOM::JSEditor::addCommand):
        (DOM::JSEditor::initDict):
        (DOM::JSEditor::execCommand):
        (DOM::JSEditor::queryCommandEnabled):
        (DOM::JSEditor::queryCommandIndeterm):
        (DOM::JSEditor::queryCommandState):
        (DOM::JSEditor::queryCommandSupported):
        (DOM::JSEditor::queryCommandValue):
        (DOM::JSEditor::execCommandCopy):
        (DOM::JSEditor::execCommandCut):
        (DOM::JSEditor::execCommandDelete):
        (DOM::JSEditor::execCommandInsertText):
        (DOM::JSEditor::execCommandPaste):
        (DOM::JSEditor::execCommandRedo):
        (DOM::JSEditor::execCommandSelectAll):
        (DOM::JSEditor::execCommandUndo):
        (DOM::JSEditor::enabledIfPartNotNull):
        (DOM::JSEditor::enabledIfSelectionNotEmpty):
        (DOM::JSEditor::enabledIfSelectionIsRange):
        (DOM::JSEditor::commandSupported):
        * khtml/editing/jsediting.h: Added.
        (DOM::JSEditor::CommandIdentifier::CommandIdentifier):
        (DOM::JSEditor::document):
        (DOM::JSEditor::part):
        * khtml/xml/dom_docimpl.cpp: Rework JS editing support into glue that calls over into new JSEditor object.
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::~DocumentImpl):
        (DocumentImpl::jsEditor):
        (DocumentImpl::execCommand):
        (DocumentImpl::queryCommandEnabled):
        (DocumentImpl::queryCommandIndeterm):
        (DocumentImpl::queryCommandState):
        (DocumentImpl::queryCommandSupported):
        (DocumentImpl::queryCommandValue):
        * khtml/xml/dom_docimpl.h:

2004-06-03  Richard Williamson   <rjw@apple.com>

	Added setCompositeOperation method to Context2D.
	Actually pass composite operation to drawPixmap (instead of 1).

        Reviewed by jay lo.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::compositeOperatorFromString):
        (QPainter::drawPixmap):

2004-06-03  David Hyatt  <hyatt@apple.com>

	Add support for box-flex-group-transition (whew!), a new property that is going to enable some incredibly
	complicated flexing layouts in HTML.

	This is Stage 1 - wire up the CSS property and make it get parsed into front-end data.  Nobody actually looks
	at this data yet.
	
        Reviewed by darin

        * khtml/css/css_valueimpl.cpp:
        (CSSInheritedValueImpl::cssText):
        (ShadowValueImpl::cssText):
        (length):
        (FlexGroupTransitionValueImpl::~FlexGroupTransitionValueImpl):
        (FlexGroupTransitionValueImpl::cssText):
        * khtml/css/css_valueimpl.h:
        (DOM::FlexGroupTransitionValueImpl::cssValueType):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::parseShadow):
        (FlexGroupTransitionParseContext::length):
        (FlexGroupTransitionParseContext::~FlexGroupTransitionParseContext):
        (FlexGroupTransitionParseContext::failed):
        (FlexGroupTransitionParseContext::allowGroup):
        (FlexGroupTransitionParseContext::commitGroup):
        (FlexGroupTransitionParseContext::commitSlash):
        (FlexGroupTransitionParseContext::commitLength):
        (FlexGroupTransitionParseContext::commitValue):
        (CSSParser::parseFlexGroupTransition):
        * khtml/css/cssparser.h:
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/rendering/render_style.cpp:
        (StyleFlexibleBoxData::StyleFlexibleBoxData):
        (StyleFlexibleBoxData::operator==):
        (StyleFlexibleBoxData::transitionDataEquivalent):
        (StyleCSS3InheritedData::operator==):
        (StyleCSS3InheritedData::shadowDataEquivalent):
        (ShadowData::operator==):
        (RenderStyle::setBoxFlexGroupTransition):
        (length):
        (FlexGroupTransitionData::operator==):
        * khtml/rendering/render_style.h:
        (khtml::FlexGroupTransitionData::next):
        (khtml::FlexGroupTransitionData::~FlexGroupTransitionData):
        (khtml::FlexGroupTransitionData::operator!=):
        (khtml::StyleFlexibleBoxData::~StyleFlexibleBoxData):
        (khtml::RenderStyle::boxFlexGroupTransition):

2004-06-03  Richard Williamson   <rjw@apple.com>

	Add extra sanity check to Image parameter of drawImage...

        Reviewed by Hyatt.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):

2004-06-02  David Hyatt  <hyatt@apple.com>

	Fix for 3673931, negative margins on objects that dodge floats not handled correctly.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):

2004-06-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Fix for layout regression I caused when fixing:

        <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"

        Extra height is added to empty blocks that are editable, so we can click to place
        the caret in them. This extra height was erroneously being added to non-editable
        blocks as a result of my earlier change. After looking at this and doing some
        code review, there are the following changes:
        
        Change away from "containingBlock" terminology in the NodeImpl class. The
        operation we are doing in NodeImpl is not the same as what is done in CSS
        when it uses the term "containingBlock" so:
            containingBlock changes to enclosingBlockFlowElement, and
            rootEditableBlock changes to rootEditableElement
        
        The vast majority of changes here are to make these name changes. The other
        significant piece of work, and the fix for the regression, is to change 
        bidi.cpp to only include this extra line height if a block is empty
        and is content-editable.    

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::leadingWhitespacePosition):
        (khtml::trailingWhitespacePosition):
        (khtml::DeleteSelectionCommandImpl::doApply):
        (khtml::InputNewlineCommandImpl::doApply):
        (khtml::RemoveNodeAndPruneCommandImpl::doApply):
        (khtml::TypingCommandImpl::issueCommandForDeleteKey):
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::relinquishesEditingFocus):
        (DocumentImpl::acceptsEditingFocus):
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_nodeimpl.h:
        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentLeafPosition):
        (DOM::Position::previousCharacterPosition):
        (DOM::Position::nextCharacterPosition):
        (DOM::Position::previousLinePosition):
        (DOM::Position::nextLinePosition):
        (DOM::Position::equivalentUpstreamPosition):
        (DOM::Position::equivalentDownstreamPosition):
        (DOM::Position::atStartOfRootEditableElement):
        (DOM::Position::inRenderedContent):
        (DOM::Position::rendersOnSameLine):
        (DOM::Position::rendersInDifferentPosition):
        (DOM::Position::isLastRenderedPositionInEditableBlock):
        (DOM::Position::inFirstEditableInRootEditableElement):
        (DOM::Position::inLastEditableInRootEditableElement):
        (DOM::Position::inFirstEditableInContainingEditableBlock):
        (DOM::Position::inLastEditableInContainingEditableBlock):
        * khtml/xml/dom_position.h:
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::moveToRenderedContent):

2004-06-02  Trey Matteson  <trey@apple.com>

	Added types property to JS clipboard object.

        Reviewed by Richard.

        * khtml/ecma/kjs_events.cpp:
        (Clipboard::getValueProperty):  Create JS array for strings coming from the clipboard impl.
        * khtml/ecma/kjs_events.h:
        (KJS::Clipboard::):
        * khtml/ecma/kjs_events.lut.h:
        * kwq/KWQClipboard.mm:
        (MIMETypeFromCocoaType):  New helper routine to map types.
        (KWQClipboard::types):  Implement based on NSPasteboard's types.

2004-06-02  Richard Williamson   <rjw@apple.com>

	Corrected typo ID_IMG should have been ID_CANVAS when
	checking for the canvas composite operator.

        Reviewed by Ken.

        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::paint):

2004-06-02  Richard Williamson   <rjw@apple.com>

	Correctly size the <CANVAS> if margins, borders, or
	padding is added.

        Reviewed by Trey.

        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::createDrawingContext):

2004-06-01  Trey Matteson  <trey@apple.com>

	First cut at the source side of DHTML dragging.  Following IE, new events are added:
	ondragstart, ondrag, ondragend.  The recently added CSS property -khtml-user-drag can
	be used to make an element draggable.  event.dataTransfer.setDragImage(ImageObject,x,y)
	can be used from ondragstart to set a static image for the dragImage.  x,y is the location
	of the mouse within the image from the upper right corner.  clipboard methods setdata
	and cleardata are implemented.

        Reviewed by hyatt.

        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty):  Boilerplate for new events
        (DOMNode::putValue):  Boilerplate for new events
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMNode::):   Boilerplate for new events
        * khtml/ecma/kjs_dom.lut.h:
        * khtml/ecma/kjs_events.cpp:
        (DOMMouseEvent::getValueProperty):  Return undefined for clipboard when its not a drag event.
        (ClipboardProtoFunc::tryCall):  setDragImage glue to clipboard routine.
        * khtml/ecma/kjs_events.h:
        (KJS::Clipboard::):
        * khtml/ecma/kjs_events.lut.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseHTMLAttribute):  Boilerplate for new events
        * khtml/khtml_part.cpp:
        (KHTMLPart::shouldDragAutoNode):  Empty impl of new method, where UA determines
	draggability for events with -khtml-user-drag=auto
        * khtml/khtml_part.h:
        * khtml/misc/htmlattrs.c:
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:  Boilerplate for new events
        * khtml/rendering/render_object.cpp:
        (RenderObject::draggableNode):  Find the node or parent node which might be dragged.
        * khtml/rendering/render_object.h:
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId):  Boilerplate for new events
        (EventImpl::idToType):  Boilerplate for new events
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::):  Boilerplate for new events
        * kwq/KWQClipboard.h:
        * kwq/KWQClipboard.mm:
        (KWQClipboard::clearData):  Implemented to call NSPasteboard
        (KWQClipboard::clearAllData): ditto
        (KWQClipboard::getData):  fix corner case that came up testing
        (KWQClipboard::setData):  Implemented to call NSPasteboard
        (KWQClipboard::dragLocation):  Simple setter/getters
        (KWQClipboard::setDragLocation):
        (KWQClipboard::dragImage):
        (KWQClipboard::setDragImage):
        (KWQClipboard::dragNSImage):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart): init new member var
        (KWQKHTMLPart::dragHysteresisExceeded):  Hysteresis moved here from WebKit
        (KWQKHTMLPart::dispatchDragSrcEvent):  Send a dragging event to the current dragSource
        (KWQKHTMLPart::khtmlMouseMoveEvent):  Initiate dragging, now including consulting DHTML,
	hysteresis and sending ondragstart.
        (KWQKHTMLPart::dragSourceMovedTo):  simple passthrough
        (KWQKHTMLPart::dragSourceEndedAt):  simple passthrough
        (KWQKHTMLPart::mouseDown):  salt away _mouseDownX, _mouseDownY
        (KWQKHTMLPart::shouldDragAutoNode):  Called for -khtml-user-drag=auto.  We just call
	out to WebKit.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragSourceMovedTo:]):  New glue to drive new dragging events.
        (-[WebCoreBridge dragSourceEndedAt:operation:]):

2004-06-02  Ken Kocienda  <kocienda@apple.com>

        Finish off name change from previous check-in by changing dom_edititerator
        file names to dom_positioniterator. Files copied and renamed in repository.
        Includes updated as needed.

        * ForwardingHeaders/xml/dom_edititerator.h: Removed.
        * ForwardingHeaders/xml/dom_positioniterator.h: Added.
        * WebCore.pbproj/project.pbxproj:
        * khtml/editing/htmlediting_impl.cpp:
        * khtml/xml/dom_edititerator.cpp: Removed.
        * khtml/xml/dom_edititerator.h: Removed.
        * khtml/xml/dom_position.cpp:
        * khtml/xml/dom_positioniterator.cpp: Added.
        (DOM::PositionIterator::peekPrevious):
        (DOM::PositionIterator::peekNext):
        (DOM::PositionIterator::atStart):
        (DOM::PositionIterator::atEnd):
        * khtml/xml/dom_positioniterator.h: Added.
        (DOM::PositionIterator::PositionIterator):
        (DOM::PositionIterator::current):
        (DOM::PositionIterator::previous):
        (DOM::PositionIterator::next):
        (DOM::PositionIterator::setPosition):
        (DOM::PositionIterator::isEmpty):
        * khtml/xml/dom_selection.cpp:

2004-06-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Probable fix for this bug:
        
        <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
        
        I could not reproduce the bug myself, which is why I call the fix
        as probable.
        
        Darin and I did some code inspection and found some problems
        with the equivalentUpstreamPosition and
        equivalentDownstreamPosition functions on DOM::Position and how
        these functions dealt with changing from editable to
        non-editable content. As a result of these discoveries, I went
        over this code and the helpers and functions which support them,
        and made some corrections and simplifications. The big changes
        are as follows:
        
        1. Rename EditIterator class to PositionIterator. This class needs
        to run code for selections in non-editable content, so the name
        change is appropriate.
        
        2. Change containingEditableBlock to containingBlock. It turns out
        that none of the editing code relies on the distinction between
        editable blocks and non-editable blocks. The important distinction
        is the block boundary. The notion of rootEditableBlock remains.
         
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): PositionIterator name change.
        (khtml::DeleteSelectionCommandImpl::joinTextNodesWithSameStyle): Ditto.
        (khtml::DeleteSelectionCommandImpl::containsOnlyWhitespace): Ditto.
        (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
        (khtml::InputNewlineCommandImpl::doApply): Ditto.
        (khtml::RemoveNodeAndPruneCommandImpl::doApply): Ditto.
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren): Ditto.
        * khtml/xml/dom_edititerator.cpp:
        (DOM::PositionIterator::peekPrevious): Call for previousLeafNode instead of previousEditable.
        Editable check is not appropriate as this class is used for non-editable content.
        (DOM::PositionIterator::peekNext): Call nextLeafNode instead of nextEditable, as above.
        (DOM::PositionIterator::atStart): Call for previousLeafNode instead of previousEditable, as above.
        (DOM::PositionIterator::atEnd): Call nextLeafNode instead of nextEditable, as above.
        * khtml/xml/dom_edititerator.h:
        (DOM::PositionIterator::PositionIterator): PositionIterator name change. Remove unused and unneeded constructors.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::previousEditable): Simplify. Rely on previousLeafNode as a helper.
        (NodeImpl::nextEditable): Ditto, but rely on nextLeafNode.
        (NodeImpl::previousLeafNode): Remove tree-walking code. Rely on traversePreviousNode as a helper.
        (NodeImpl::nextLeafNode): Ditto, but rely on traverseNextNode.
        (NodeImpl::containingBlock): Renamed replacement for containingEditableBlock.
        (NodeImpl::inSameContainingEditableBlock): Call renamed containingBlock.
        * khtml/xml/dom_nodeimpl.h:
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousCharacterPosition): Various name changes, as described above.
        (DOM::Position::nextCharacterPosition): Ditto.
        (DOM::Position::previousWordPosition): Ditto.
        (DOM::Position::nextWordPosition): Ditto.
        (DOM::Position::previousLinePosition): Ditto.
        (DOM::Position::nextLinePosition): Ditto.
        (DOM::Position::equivalentUpstreamPosition): Remove bogus check for editable node in loop. Perform
        improved block-crossing check at start of loop which works for editable and non-editable content.
        This is the crux of the fix for the bug.
        (DOM::Position::equivalentDownstreamPosition): Ditto.
        (DOM::Position::inRenderedContent): Various name changes, as described above.
        (DOM::Position::rendersOnSameLine): Ditto.
        (DOM::Position::rendersInDifferentPosition): Ditto.
        (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
        (DOM::Position::isLastRenderedPositionOnLine): Ditto.
        (DOM::Position::isLastRenderedPositionInEditableBlock): Ditto.
        (DOM::Position::inFirstEditableInRootEditableBlock): Ditto.
        (DOM::Position::inLastEditableInRootEditableBlock): Ditto.
        (DOM::Position::inFirstEditableInContainingEditableBlock): Ditto.
        (DOM::Position::inLastEditableInContainingEditableBlock): Ditto.

2004-06-01  Richard Williamson   <rjw@apple.com>

        Fixed deployment build warning.

        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::paint):

2004-06-01  Richard Williamson   <rjw@apple.com>

        Added support for composite attribute to <CANVAS>
        Added support for drawImage and drawImageFromRect to <CANVAS>, i.e.:

            <html>
            <head>
            <script>
            
            var img = new Image(600,600);
            
            function drawImage()
            {
                    var aCanvas = document.getElementById ("canvas1");
                    var context = aCanvas.getContext("context-2d");
                    context.drawImage (img, 0, 0, 600, 600, "copy");
            }
            
            img.onload = drawImage;
            img.src = "http://www.google.com/images/logo.gif";
            
            </script>
            </head>
            <body>
            <canvas id="canvas1" width=600 height=600>
            </body>
            <html>

        Reviewed by Trey.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        (Context2D::Context2D):
        * khtml/ecma/kjs_html.h:
        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::paint):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::getCompositeOperation):
        (QPainter::setCompositeOperation):
        (QPainter::drawPixmap):
        (QPainter::drawTiledPixmap):
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (QPixmap::flushRasterCache):
        * kwq/WebCoreImageRenderer.h:
        * kwq/WebCoreImageRendererFactory.h:

2004-06-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Fix for these bugs:
        
        <rdar://problem/3655028>: "Text styles have hard-coded values making bold the only supported text style"
        <rdar://problem/3656969>: "HTML Editing: Font panel doesn't work"

        * khtml/css/css_valueimpl.cpp:
        (FontFamilyValueImpl::cssText): Added implementation for this subclass. Returns parsedFontName.  
        * khtml/css/css_valueimpl.h: Declare cssText() on FontFamilyValueImpl.
        (DOM::CSSProperty::value):
        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::ApplyStyleCommand): Changed signature to take a CSSStyleDeclarationImpl.
        (khtml::ApplyStyleCommand::style): Added accessor.
        * khtml/editing/htmlediting.h: Changed constructor signature to take a CSSStyleDeclarationImpl.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::styleSpanClassString): Added helper to return attribute used to tag spans we add to apply styles.
        (khtml::ApplyStyleCommandImpl::ApplyStyleCommandImpl): Ref style passed in.
        (khtml::ApplyStyleCommandImpl::~ApplyStyleCommandImpl): Deref style passed in.
        (khtml::ApplyStyleCommandImpl::doApply): m_removingStyle is obsolete. Removed.
        (khtml::ApplyStyleCommandImpl::isHTMLStyleNode): Now checks all properties in the object's declaration.
        (khtml::ApplyStyleCommandImpl::removeCSSStyle): Again, now is multi-property-savvy. Will now remove an empty span
        if we added it.
        (khtml::ApplyStyleCommandImpl::currentlyHasStyle): Replaced, bold-only code with code that can handle all styles.
        (khtml::ApplyStyleCommandImpl::computeStyleChange): Helper which helps to determine whether we want to apply
        HTML-style markup for bold and italic, and gathers up all style changes that need to be done.
        (khtml::ApplyStyleCommandImpl::positionInsertionPoint): Added comment explaining possible optimization that might be
        done in the future.
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Significant reworking; now handles applying multiple styles.
        (khtml::ApplyStyleCommandImpl::cloneSelection): Assert fragment has at least one child. Don't want to work
        on empty fragments.
        (khtml::ApplyStyleCommandImpl::surroundContentsWithElement): New helper.
        (khtml::RemoveCSSPropertyCommandImpl::~RemoveCSSPropertyCommandImpl): Juggle asserts and lifecycle methods to be
        more like other commands.
        (khtml::RemoveCSSPropertyCommandImpl::doApply): Ditto.
        (khtml::RemoveNodeAttributeCommandImpl::~RemoveNodeAttributeCommandImpl): Ditto.
        (khtml::RemoveNodeAttributeCommandImpl::doApply):Ditto.
        * khtml/editing/htmlediting_impl.h:
        (khtml::ApplyStyleCommandImpl::style): Added.
        (khtml::ApplyStyleCommandImpl::StyleChange::StyleChange): Added.
        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration setProperty:::]): Fix problem where passing an empty NSString to a function expecting a boolean
        made all properties important priority.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge applyStyle:]): Remove provisional code and comment. Now pass along style, following the intended design.

2004-06-01  Chris Blumenberg  <cblu@apple.com>

        Reviewed by kocienda.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragCaretDOMRange]): new, lets WebKit pass the drag caret DOM range to the editing delegate

2004-05-28  John Louch  <ouch@apple.com>

        Reviewed by gramps.

        - removed setShadowWithColor and change setShadow to work with optional attributes
          it follows the same rules as setFill/StrokeColor
        - Fixed bug in setFillColor and setStrokeColor for CMYK colors (missing break in case).

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-05-28  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - various editing-related improvements

        * khtml/xml/dom_selection.h: Removed UP and DOWN directions, and added PARAGRAPH granularity.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::modify): Got rid of the UP and DOWN directions, and made movement
        between lines happen when granularity is LINE. Added a new unimplemented granularity:
        PARAGRAPH.
        (DOM::Selection::validate): Remove some unneeded APPLE_CHANGES. The code need not be ifdef'd.
        (DOM::Selection::debugPosition): Ditto.

        * kwq/WebCoreBridge.h: Removed WebSelectUp and WebSelectDown, and added WebSelectByParagraph.
        Added stringForRange: and selectedDOMRangeWithGranularity:, and renamed replaceSelectionWithNewline
        to insertNewline because it has the insertText: semantic, not the replaceSelectionWithText: one.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge stringForRange:]): Added.
        (-[WebCoreBridge selectedDOMRangeWithGranularity:]): Added.
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Updated code to understand
        that vertical movement is based on granularity now, not direction.
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): Moved an ensureCaretVisible
        from the WebKit down here. I think perhaps this should go down even further in WebCore.
        (-[WebCoreBridge insertNewline]): Renamed, and moved ensureCaretVisible here.
        (-[WebCoreBridge insertText:]): Moved ensureCaretVisible here.
        (-[WebCoreBridge deleteKeyPressed]): Moved ensureCaretVisible here.

        * khtml/xml/dom_position.cpp: Some ifdef tweaks.

        * khtml/misc/helper.cpp: Namespace and formatting tweaks.
        * khtml/misc/helper.h: Removed some unused stuff.

        * khtml/dom/dom2_range.h: Make range constructor public so that anyone with
        a RangeImpl can easily make a Range.

2004-05-28  Richard Williamson   <rjw@apple.com>

	setStrokeColor and setFillColor now support
	old school web color string, oswcs+alpha, gray, gray+alpha,
	rgba, and cmyka.

        Reviewed by jay-lo.

        * khtml/css/cssparser.cpp:
        (CSSParser::parseColor):
        (CSSParser::parseColorFromValue):
        * khtml/css/cssparser.h: Made parseColor static public class method
        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):

2004-05-28  David Hyatt  <hyatt@apple.com>

	Implement -khtml-user-select and add support for the property -khtml-user-drag (although someone will still
	need to wire it up).
	
        Reviewed by rjw

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventDoubleClick):
        (KHTMLPart::handleMousePressEventTripleClick):
        (KHTMLPart::handleMousePressEventSingleClick):
        (KHTMLPart::handleMouseMoveEventSelection):
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::setSelection):
        * khtml/rendering/render_object.cpp:
        (RenderObject::shouldSelect):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_style.cpp:
        (userSelect):
        (StyleCSS3NonInheritedData::operator==):
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::userDrag):
        (khtml::RenderStyle::userSelect):
        (khtml::RenderStyle::setUserDrag):
        (khtml::RenderStyle::setUserSelect):
        (khtml::RenderStyle::initialUserDrag):
        (khtml::RenderStyle::initialUserSelect):

2004-05-28  John Louch  <set EMAIL_ADDRESS environment variable>
	added addArc and clip path routines.

        Reviewed by sullivan.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-05-28  John Louch  <ouch@apple.com>

	Added addArcToPoint and addRect path routines.

        Reviewed by sullivan.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-05-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::toRange): Add call to update document layout before returning a Range.
        This is done to ensure recently-done editing changes are reflected in the calculation
        of the Range. This change solves a specific problem with updating the font panel, where
        the wrong Range was used, resulting in an incorrect font. Also, defer converting 
        positions to be range-compliant positions. The nodeIsBeforeNode function is not 
        range-compliant-position-savvy.

2004-05-27  Kevin Decker  <kdecker@apple.com>

        Reviewed by Ken.
        
        - added support for the new JavaScript error console
        - error messages are now wired directly to the bridge
        - revised generated error message content
        
        * khtml/ecma/kjs_events.cpp:
        (JSEventListener::handleEvent):
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::evaluate):
        * khtml/ecma/kjs_window.cpp:
        (Window::isSafeScript):
        (ScheduledAction::execute):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::addMessageToConsole):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:

2004-05-27  Trey Matteson  <trey@apple.com>

	Two dragging tweaks:  ondragleave events are sent before ondragenter events when
	going across element boundaries, to match WinIE.
	For compatibility with WinIE, we honor MIME types of "Text" and "URL".

        Reviewed by rjw.

        * khtml/khtmlview.cpp:
        (KHTMLView::updateDragAndDrop):
        * kwq/KWQClipboard.mm:
        (cocoaTypeFromMIMEType):

=== Safari-142 ===

2004-05-27  Vicki Murley <vicki@apple.com>

        Reviewed by Darin.

	- Fix Tiger build failure.  Rename constant "S" to "WHITESPACE",
	and change all instances of S to WHITESPACE.

        * khtml/css/cssparser.cpp:
        (DOM::CSSParser::lex): S to WHITESPACE
        * khtml/css/parser.cpp: regenerated file
        * khtml/css/parser.h: regenerated file
        * khtml/css/parser.y: S to WHITESPACE
        * khtml/css/tokenizer.cpp: regenerated file
        * khtml/css/tokenizer.flex: S to WHITESPACE

2004-05-27  John Louch  <set EMAIL_ADDRESS environment variable>

        Reviewed by NOBODY (OOPS!).

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-05-27  Trey Matteson  <trey@apple.com>

 	First cut at DHTML dragging, destination side.  Dragging text, files
        and URLs onto elements works.  Type conversion from NSPasteboard to
	MIME types is hardwired.  No JS access yet to modifier keys, or
	drag operations mask.

	Per IE's dragging API, we have the new DOM events ondragenter,
	ondragover, ondragleave and ondrop.
	We also have an event.dataTransfer object providing access to the
	NSPasteboard bearing the incoming data.

        Reviewed by rjw.

        * WebCore.pbproj/project.pbxproj:  add 2 new files.
        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty):  JS access to ondragenter and pals
        (DOMNode::putValue):  Ditto
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMNode::):  New attr enum values.
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::):
        * khtml/ecma/kjs_events.cpp:
        (DOMMouseEvent::mark):  Pass along mark to dataTransfer we hold.
        (DOMMouseEvent::getValueProperty):  Create and return dataTransfer.
        (Clipboard::Clipboard):  New class exposed in JS.
        (Clipboard::~Clipboard):
        (Clipboard::tryGet):  Boilerplate.
        (Clipboard::getValueProperty):  Return the clipboard's props.
        (Clipboard::tryPut):  Boilerplate.
        (Clipboard::putValue):  Set the clipboard's props.
        (ClipboardProtoFunc::tryCall): Implement clipboard's funcs.
        * khtml/ecma/kjs_events.h:
        (KJS::DOMMouseEvent::DOMMouseEvent):  Init clipboard ptr.
        (KJS::DOMMouseEvent::):
        (KJS::Clipboard::toBoolean):
        (KJS::Clipboard::classInfo):
        (KJS::Clipboard::):
        * khtml/ecma/kjs_events.lut.h:
        (KJS::):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseHTMLAttribute):  Enable setting ondragenter
	and friends as html attributes.
        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchDragEvent):  Send a drag related event to the DOM.
        (KHTMLView::updateDragAndDrop):  Handle a dragenter or dragupdate.
        (KHTMLView::cancelDragAndDrop):  Handle a dragexit.
        (KHTMLView::performDragAndDrop):  Handle an actual drop.
        * khtml/khtmlview.h:
        * khtml/misc/htmlattrs.c:  Generated code.
        * khtml/misc/htmlattrs.h:  Generated code.
        * khtml/misc/htmlattrs.in:  Add ondragenter, etc
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId):  Handle new event types for dragging.
        (EventImpl::idToType):  Ditto.
        (MouseEventImpl::MouseEventImpl):  Init new clipboard ptr.
        (MouseEventImpl::~MouseEventImpl):  Deref clipboard.
        (ClipboardImpl::ClipboardImpl):
        (ClipboardImpl::~ClipboardImpl):
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::):  New event enums.
        (DOM::MouseEventImpl::clipboard):
        * kwq/KWQClipboard.h: Added.
        * kwq/KWQClipboard.mm: Added.
        (KWQClipboard::KWQClipboard):
        (KWQClipboard::~KWQClipboard):
        (KWQClipboard::isForDragging): Trivial getter/setters.
        (KWQClipboard::dropEffect):
        (KWQClipboard::setDropEffect):
        (KWQClipboard::dropAllowed):
        (KWQClipboard::setDropAllowed):
        (cocoaTypeFromMIMEType):  Convert MIME pboard type to Cocoa type.
        (KWQClipboard::clearData):  OSX specific clipboard impl. of IE func
        (KWQClipboard::clearAllData):   Ditto
        (KWQClipboard::getData): Ditto
        (KWQClipboard::setData): Ditto
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge dragOperationForDraggingInfo:]):  Passthrough from WebKit to khtmlpart
        (-[WebCoreBridge dragExitedWithDraggingInfo:]):  Ditto
        (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto

2004-05-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Gramps

        * kwq/KWQKHTMLPart.h: Declare new fontForCurrentPosition helper.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fontForCurrentPosition): Determines the "current font" in the way that Cocoa
        does. Either the font of the character before the caret, when the selection is a caret, or
        the font of the first character selected, when the selection is a range.
        * kwq/WebCoreBridge.h: Declare bridge method so this can be called from WebKit.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge fontForCurrentPosition]): Calls through to fontForCurrentPosition on KWQKHTMLPart.

2004-05-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Gramps
        
        Adds a typing style member variable to khtml part.
        This patch adds basic life-cycle management and 
        accessors. In addition, one essential piece of
        behavior has been added: Clearing the typing style
        whenever the selection changes.

        Follow-on work will make this typing style a fully 
        functional part of applying styles to text while typing.

        * khtml/khtml_part.cpp:
        (KHTMLPart::notifySelectionChanged): Clear typing style.
        (KHTMLPart::typingStyle): Getter.
        (KHTMLPart::setTypingStyle): Setter.
        (KHTMLPart::clearTypingStyle): Convenience. Sets to 0.
        * khtml/khtml_part.h: Function declarations.
        * khtml/khtmlpart_p.h:
        (KHTMLPartPrivate::KHTMLPartPrivate): Initialize member variable.
        (KHTMLPartPrivate::~KHTMLPartPrivate): Deref if necessary.

2004-05-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Gramps

        Add helper to get the DOM element for a Position.
        
        * khtml/xml/dom_position.cpp:
        (DOM::Position::element): Returns the Position's node if it is an element, or
        the first ancestor of the node that is an element. Returns 0 if node is not
        an element and has no parent that is an element.
        * khtml/xml/dom_position.h: Added declaration.

2004-05-27  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - moved to new symlink technique for embedding frameworks

        * WebCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
        because we don't need it any more.

2004-05-27  Darin Adler  <darin@apple.com>

        - fixed bug where all pages with images would cause a crash
        - fixed Deployment build

        * kwq/KWQPainter.mm: (QPainter::drawPixmap): Put #if 0 around placeholder code
        for setting up the graphics context.

2004-05-26  Richard Williamson   <rjw@apple.com>

	Added shadow support (w/ Louch).
	Added infrastructure for drawing images.

	New context methods:

	setShadow
	setShadowWithColor
	clearShadow

	Reviewed by me and Louch.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::Image::image):
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::drawPixmap):

2004-05-26  Richard Williamson   <rjw@apple.com>

	Fixed build snafu.

        * khtml/ecma/kjs_html.cpp:
        (KJS::Context2DFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2004-05-26  Richard Williamson   <rjw@apple.com>

	Part 2 of the new <CANVAS> tag implementation.  This adds the 
	basic machinery and draw operations for the <CANVAS> tag.  Pretty cool.  

        function drawLine() {
	    var canvas1 = document.getElementById ("canvas1");
	    var context = canvas1.getContext("context-2d");

	    context.setStrokeColor ("red");
	    context.setLineWidth (10);
	    context.beginPath();
	    context.moveToPoint (0,0);
	    context.addLineToPoint (400,400);
	    context.strokePath();
        }

        ...

        <canvas id="canvas1" width="400" height="400">

Currently supported operations on the 2D context are:

Save, Restore,
Scale, Rotate, Translate,
BeginPath, ClosePath,
SetStrokeColor, SetFillColor, SetLineWidth, SetLineCap, SetLineJoin, SetMiterLimit,
FillPath, StrokePath,
MoveToPoint, AddLineToPoint, AddQuadraticCurveToPoint, AddBezierCurveToPoint,
ClearRect

	More to come.

        Reviewed by Dave.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElementFunction::tryCall):
        (KJS::Context2DFunction::tryCall):
        (Context2D::tryGet):
        (Context2D::getValueProperty):
        (Context2D::tryPut):
        (Context2D::putValue):
        (Context2D::Context2D):
        (Context2D::~Context2D):
        * khtml/ecma/kjs_html.h:
        (KJS::Context2D::toBoolean):
        (KJS::Context2D::classInfo):
        (KJS::Context2D::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):
        * khtml/html/html_canvasimpl.cpp:
        (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::getElement):
        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::RenderCanvasImage):
        (RenderCanvasImage::~RenderCanvasImage):
        (RenderCanvasImage::createDrawingContext):
        (RenderCanvasImage::drawingContext):
        (RenderCanvasImage::setNeedsImageUpdate):
        (RenderCanvasImage::updateDrawnImage):
        (RenderCanvasImage::drawnImage):
        (RenderCanvasImage::paint):
        (RenderCanvasImage::layout):
        * khtml/rendering/render_canvasimage.h:
        * khtml/rendering/render_image.cpp:
        (RenderImage::paint):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::shouldPaint):
        (RenderWidget::paint):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::currentContext):

2004-05-26  Darin Adler  <darin@apple.com>

        - fixed warning that prevents Deployment build from compiling

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent):
        Moved use of single-click boolean outside the scope of the "block exceptions" macros.

2004-05-25  Chris Blumenberg  <cblu@apple.com>

	Fixed a regression where selections that were created via double or triple were not draggable.

        Reviewed by darin.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::khtmlMousePressEvent): if the click count is greater than 1, don't allow drags
        (KWQKHTMLPart::khtmlMouseMoveEvent): allow drags to occur even if the selection was originally created via double or triple click

2004-05-25  Chris Blumenberg  <cblu@apple.com>

	Fixed regression where undoing typing would undo character-by-character.

        Reviewed by kocienda.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge insertText:]): new, this method used to be replaceSelectionWithText, but replaceSelectionWithText now is one operation whereas calls to insertText: are coalesced

2004-05-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Change postDidChangeSelectionNotification and postDidChangeNotification tp
        respondToChangedSelection and respondToChangedContents, respectively, to
        account for the fact that we do work in these calls other than post a
        notification.

        * khtml/khtml_part.cpp:
        (KHTMLPart::notifySelectionChanged): Use new names.
        (KHTMLPart::appliedEditing): Ditto.
        (KHTMLPart::unappliedEditing): Ditto.
        (KHTMLPart::reappliedEditing): Ditto.
        * kwq/KWQKHTMLPart.h: Change name of functions as described.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::respondToChangedSelection): Ditto.
        (KWQKHTMLPart::respondToChangedContents): Ditto.
        * kwq/WebCoreBridge.h: Ditto.

2004-05-25  Maciej Stachowiak  <mjs@apple.com>

        Fixed build.

        * ForwardingHeaders/misc/khtml_text_operations.h: Added.

2004-05-25  Richard Williamson   <rjw@apple.com>

	Part 1 of the new <CANVAS> tag implementation.  This patch
	adds the boiler plate for the new element.

        Reviewed by Dave.

        * ForwardingHeaders/html/html_canvasimpl.h: Added.
        * ForwardingHeaders/rendering/render_canvasimage.h: Added.
        * WebCore.pbproj/project.pbxproj:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::classInfo):
        (KJS::HTMLElementFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::HTMLElement::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):
        * khtml/html/dtd.cpp:
        (DOM::checkChild):
        * khtml/html/html_canvasimpl.cpp: Added.
        (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
        (HTMLCanvasElementImpl::~HTMLCanvasElementImpl):
        (HTMLCanvasElementImpl::id):
        (HTMLCanvasElementImpl::mapToEntry):
        (HTMLCanvasElementImpl::parseHTMLAttribute):
        (HTMLCanvasElementImpl::createRenderer):
        (HTMLCanvasElementImpl::attach):
        (HTMLCanvasElementImpl::detach):
        (HTMLCanvasElementImpl::isURLAttribute):
        * khtml/html/html_canvasimpl.h: Added.
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::getElement):
        * khtml/misc/htmltags.c:
        (hash_tag):
        (findTag):
        * khtml/misc/htmltags.h:
        * khtml/misc/htmltags.in:
        * khtml/rendering/render_canvasimage.cpp: Added.
        (RenderCanvasImage::RenderCanvasImage):
        (RenderCanvasImage::~RenderCanvasImage):
        (RenderCanvasImage::paint):
        (RenderCanvasImage::layout):
        * khtml/rendering/render_canvasimage.h: Added.
        (khtml::RenderCanvasImage::renderName):
        (khtml::RenderCanvasImage::element):

2004-05-25  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3546418>: (when dragging text within an editable HTML doc, the selection should be moved not copied)

        Reviewed by kocienda.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::MoveSelectionCommandImpl::doApply): implemented
        * khtml/khtml_part.cpp:
        (KHTMLPart::setDragCaret): make the old drag cursor rect dirty
        * khtml/khtml_part.h:

2004-05-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed <rdar://problem/3657363>: (Editing: export innerText, innerHTML, outerText, outerHTML and setters to Objective-C)
	- partial fix for <rdar://problem/3656706>: (Fix innerText and setInnerText DOM extensions)
	
        * khtml/html/html_elementimpl.cpp:
	(HTMLElementImpl::innerText): Use plainText() to make the text, to
	match other browsers.
        (HTMLElementImpl::outerText): Extended comment.
        * khtml/misc/khtml_text_operations.h:
        * kwq/DOMExtensions.h:
        * kwq/DOMHTML.mm:
        (-[DOMHTMLElement outerText]): Added new ObjC wrapper for this.
        (-[DOMHTMLElement setOuterText:]): Ditto.

2004-05-25  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris
        
        Defer setting the selection to delete when none has been passed in to the
        time that the command is run. This fixes a problem where a command nested
        in a composite was not correctly picking up the right selection to begin
        its work. Now, the command will correctly use the ending selection of
        its parent when no selection has been passed in.

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl):
        (khtml::DeleteCollapsibleWhitespaceCommandImpl::doApply):
        (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
        (khtml::DeleteSelectionCommandImpl::doApply):
        * khtml/editing/htmlediting_impl.h:

2004-05-24  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	Added a new simple layout test for outerText.

        * layout-tests/fast/dom/outerText-expected.txt: Added.
        * layout-tests/fast/dom/outerText.html: Added.

2004-05-24  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        - fixed <rdar://problem/3665813>: (iBench is crashing in TOT)

        * khtml/html/html_formimpl.cpp: (HTMLSelectElementImpl::HTMLSelectElementImpl):
        Initialize m_options to 0.

2004-05-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::toRange): Improved the code to return ranges that are
        convenient to use by WebKit code which needs to perform text-editor-like
        operations with ranges. Comments in the code describe this behavior.
        (DOM::Selection::nodeIsBeforeNode): Make this method const.
        * khtml/xml/dom_selection.h: Ditto.

2004-05-24  Chris Blumenberg  <cblu@apple.com>

	Improved editing via drag.

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp: Renamed PasteMarkupCommand to ReplaceSelectionCommand
        (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
        (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
        (khtml::ReplaceSelectionCommand::impl):
        (khtml::MoveSelectionCommand::MoveSelectionCommand):
        (khtml::MoveSelectionCommand::~MoveSelectionCommand):
        (khtml::MoveSelectionCommand::impl):
        * khtml/editing/htmlediting.h:
        (khtml::):
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl):
        (khtml::ReplaceSelectionCommandImpl::~ReplaceSelectionCommandImpl):
        (khtml::ReplaceSelectionCommandImpl::commandID):
        (khtml::ReplaceSelectionCommandImpl::doApply):
        (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): new command
        (khtml::MoveSelectionCommandImpl::~MoveSelectionCommandImpl):
        (khtml::MoveSelectionCommandImpl::commandID):
        (khtml::MoveSelectionCommandImpl::doApply):
        * khtml/editing/htmlediting_impl.h:
        * khtml/khtml_part.cpp:
        (KHTMLPart::dragCaret): new
        (KHTMLPart::setDragCaret): new
        (KHTMLPart::notifyDragCaretChanged): new
        (KHTMLPart::paintDragCaret): new
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject): paint the drag caret
        * kwq/DOM.mm:
        (+[DOMDocumentFragment _documentFragmentWithImpl:]): made internally available
        (-[DOMDocumentFragment _fragmentImpl]):
        * kwq/DOMInternal.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): new
        (-[WebCoreBridge documentFragmentWithText:]): new
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]): new
        (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]): renamed to take the selectReplacement BOOL
        (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]): ditto
        (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]): ditto
        (-[WebCoreBridge replaceSelectionWithNewline]): moved
        (-[WebCoreBridge setSelectionToDragCaret]): new
        (-[WebCoreBridge moveSelectionToDragCaret:]): new
        (-[WebCoreBridge moveDragCaretToPoint:]): set the drag caret, not the selection
        (-[WebCoreBridge removeDragCaret]): new

2004-05-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Fixed some life-cycle issues with node iterators and detaching. Big deal is
        to detach in DOMNodeIterator dealloc. Otherwise, NodeIterators created from
        obj-c leak.

        * khtml/xml/dom2_traversalimpl.cpp:
        (DOM::NodeIteratorImpl::detach): Only detach if not yet detached.
        * khtml/xml/dom2_traversalimpl.h:
        (DOM::NodeIteratorImpl::setDetached): New convenience.
        * kwq/DOM.mm:
        (-[DOMNodeIterator dealloc]): Detach here, if not yet detached; fixes leak.

2004-05-24  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Fixed to return the property value, 
        as it should, instead of the whole property, as it was doing before.

2004-05-23  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3259919>: (Shift click should extend selection)

        * khtml/khtmlpart_p.h: Renamed m_textElement to m_selectionGranularity and
        m_mouseMovedSinceLastMousePress to m_beganSelectingText.
        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventDoubleClick): Set m_beganSelectingText if the double-click
        began selecting text.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::handleMousePressEventSingleClick): Added code to extend selection if shift is down.
        (KHTMLPart::khtmlMousePressEvent): Remove code that sets the selection granularity to
        "by character". We only want to do that if we start selecting with a single click.
        Otherwise we want to leave the selection granularity alone.
        (KHTMLPart::khtmlMouseReleaseEvent): Change the code that clears the selection on a plain old
        click to check the m_beganSelectingText boolean so it won't run when you shift-click, for example.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMouseMoveEvent): Updated for m_textElement
        name change.

2004-05-22  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - went through things marked "unimplemented" or "not implemented" and removed
          or implemented as many as possible

        * kwq/DOM.mm: (-[DOMNode dispatchEvent:]): Implemented.
        Also moved DOMAbstractView and DOMDocumentView into DOMViews.mm.
        * kwq/DOM-CSS.mm: (-[DOMDocument getComputedStyle::]): Implemented.

        * kwq/DOMEventsInternal.h: Added.
        * kwq/DOMEvents.mm:
        (-[DOMEvent type]): Implemented.
        (-[DOMEvent target]): Implemented.
        (-[DOMEvent currentTarget]): Implemented.
        (-[DOMEvent eventPhase]): Implemented.
        (-[DOMEvent bubbles]): Implemented.
        (-[DOMEvent cancelable]): Implemented.
        (-[DOMEvent timeStamp]): Implemented.
        (-[DOMEvent stopPropagation]): Implemented.
        (-[DOMEvent preventDefault]): Implemented.
        (-[DOMEvent initEvent:::]): Implemented.
        (-[DOMEvent _eventImpl]): Added.
        (-[DOMEvent _initWithEventImpl:]): Added.
        (+[DOMEvent _eventWithImpl:]): Added.
        (-[DOMMouseEvent _mouseEventImpl]): Added.
        (-[DOMMouseEvent screenX]): Implemented.
        (-[DOMMouseEvent screenY]): Implemented.
        (-[DOMMouseEvent clientX]): Implemented.
        (-[DOMMouseEvent clientY]): Implemented.
        (-[DOMMouseEvent ctrlKey]): Implemented.
        (-[DOMMouseEvent shiftKey]): Implemented.
        (-[DOMMouseEvent altKey]): Implemented.
        (-[DOMMouseEvent metaKey]): Implemented.
        (-[DOMMouseEvent button]): Implemented.
        (-[DOMMouseEvent relatedTarget]): Implemented.
        (-[DOMMouseEvent initMouseEvent:::::::::::::::]): Implemented.
        (-[DOMMutationEvent _mutationEventImpl]): Added.
        (-[DOMMutationEvent relatedNode]): Implemented.
        (-[DOMMutationEvent prevValue]): Implemented.
        (-[DOMMutationEvent newValue]): Implemented.
        (-[DOMMutationEvent attrName]): Implemented.
        (-[DOMMutationEvent attrChange]): Implemented.
        (-[DOMMutationEvent initMutationEvent::::::::]):
        (-[DOMUIEvent _UIEventImpl]): Added.
        (-[DOMUIEvent view]): Implemented.
        (-[DOMUIEvent detail]): Implemented.
        (-[DOMUIEvent initUIEvent:::::]): Implemented.
        (-[DOMDocument createEvent:]): Implemented.

        * kwq/DOMHTMLInternal.h: Added.
        * kwq/DOMHTML.mm:
        (+[DOMHTMLOptionsCollection _optionsCollectionWithImpl:]): Added.
        (-[DOMHTMLOptionsCollection length]): Implemented.
        (-[DOMHTMLOptionsCollection setLength:]): Implemented.
        (-[DOMHTMLOptionsCollection item:]): Implemented.
        (-[DOMHTMLOptionsCollection namedItem:]): Implemented.
        (-[DOMHTMLSelectElement options]): Implemented.

        * kwq/DOMViews.h: Changed DOMDocumentView to be a category on DOMDocument
        rather than a separate class.
        * kwq/DOMViewsInternal.h: Added.
        * kwq/DOMViews.mm: Added.
        (-[DOMAbstractView document]): Implemnted.
        (-[DOMAbstractView _abstractViewImpl]): Added.
        (-[DOMAbstractView _initWithAbstractViewImpl:]): Added.
        (+[DOMAbstractView _abstractViewWithImpl:]): Added.
        (-[DOMDocument defaultView]): Implemented.

        * khtml/dom/dom2_views.h: Made AbstractView constructor public to allow creation in
        the bindings. Would not be necessary if the impl classes were used consistently.

        * khtml/html/html_formimpl.h: Added options() function to HTMLSelectElementImpl.
        Added HTMLOptionsCollectionImpl class.
        * khtml/html/html_formimpl.cpp:
        (HTMLSelectElementImpl::~HTMLSelectElementImpl): Added code to detach and deref the
        options collection.
        (HTMLSelectElementImpl::options): Create an options collection if needed.
        (HTMLOptionsCollectionImpl::length): Added. Not yet implemented.
        (HTMLOptionsCollectionImpl::setLength): Ditto.
        (HTMLOptionsCollectionImpl::item): Ditto.
        (HTMLOptionsCollectionImpl::namedItem): Ditto.

        * khtml/khtmlview.h: Move unused focusNextPrevChild virtual function inside !APPLE_CHANGES.
        * khtml/khtmlview.cpp: Put the tp, paintBuffer, and formCompletions fields entirely
        inside !APPLE_CHANGES. Also made QT_NO_TOOLTIP entirely disable the tooltip field.
        Also put focusNextPrevChild and formCompletionItems functions inside !APPLE_CHANGES.

        * khtml/rendering/render_text.h: Removed unused isFixedWidthFont member function.
        * khtml/rendering/render_text.cpp: Ditto.

        * kwq/KWQCursor.h: Removed unused pos member function.
        * kwq/KWQCursor.mm: Ditto.

        * kwq/KWQFontMetrics.h: Removed unused rightBearing and leftBearing member functions.
        * kwq/KWQFontMetrics.mm: Ditto.

        * kwq/KWQKComboBox.h: Removed KCompletionBase as a base class.

        * kwq/KWQKConfigBase.h: Removed unused readBoolEntry, writeEntry, and readListEntry
        member functions.
        * kwq/KWQKConfigBase.mm: Ditto.
        (KConfig::readEntry): Improved "not implemented" message to indicate which key is uinimplemented.
        (KConfig::readNumEntry): Ditto.
        (KConfig::readUnsignedNumEntry): Ditto.

        * kwq/KWQKLineEdit.h: Removed everything, since all the KLineEdit stuff was unused.
        Changed KLineEdit to just be a typedef for QLineEdit.

        * kwq/KWQSlot.mm: Removed slotAutoScroll.
        (KWQSlot::KWQSlot): And from here.
        (KWQSlot::call): And from here.

        * kwq/KWQTextStream.h: Removed unused QTextOStream and QTextIStream.
        * kwq/KWQTextStream.mm: Removed unused QTextIStream function. Also made buffer sizes larger
        so we don't have any problems on 64-bit systems. 10 bytes might not be long enough to sprintf an
        integer or a long or a pointer, but 100 bytes surely will.

        * kwq/KWQWidget.h: Removed unused focusNextPrevChild.
        * kwq/KWQWidget.mm: Ditto.

        * WebCore.pbproj/project.pbxproj: Removed some files, added others.

        * ForwardingHeaders/kcompletionbox.h: Emptied out, no KWQKCompletionBox.h any more.
        * ForwardingHeaders/kiconloader.h: Emptied out, no KWQKIconLoader.h any more.
        * ForwardingHeaders/kmimetype.h: Emptied out, no KWQKMimeType.h any more.
        * ForwardingHeaders/ksimpleconfig.h: Emptied out, no KWQKSimpleConfig.h any more.
        * ForwardingHeaders/qfontinfo.h: Emptied out, no KWQFontInfo.h any more.
        * ForwardingHeaders/qtooltip.h: Replaced with define of QT_NO_TOOLTIP, no
        KWQToolTip.h any more.

        * kwq/KWQCompletion.h: Removed.
        * kwq/KWQCompletion.mm: Removed.
        * kwq/KWQFontInfo.h: Removed.
        * kwq/KWQFontInfo.mm: Removed.
        * kwq/KWQKCompletionBox.h: Removed.
        * kwq/KWQKIconLoader.h: Removed.
        * kwq/KWQKIconLoader.mm: Removed.
        * kwq/KWQKMimeType.h: Removed.
        * kwq/KWQKMimeType.mm: Removed.
        * kwq/KWQKSimpleConfig.h: Removed.
        * kwq/KWQKSimpleConfig.mm: Removed.
        * kwq/KWQToolTip.h: Removed.

2004-05-21  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3663659>: (result of toString mistakenly includes all subsequent sibling content)

        * khtml/xml/dom2_rangeimpl.h: Added private startNode() and pastEndNode() functions.
        * khtml/xml/dom2_rangeimpl.cpp:
        (DOM::RangeImpl::toString): Rewrote to use startNode(), pastEndNode(), and traverseNextNode().
        The old code here was wrong, and it was easier to rewrite than fix.
        (DOM::RangeImpl::checkDeleteExtract): Extracted the logic to compute the start node and the past-end
        node into separate functions.
        (DOM::RangeImpl::startNode): Added. Started with code extracted from checkDeleteExtract, but then
        also fixed bugs by using the new traverseNextSibling. The old code handled cases where the offset was
        past the last child in a container incorrectly.
        (DOM::RangeImpl::pastEndNode): Added. Started with code extracted from checkDeleteExtract, but then
        also fixed bugs by using the new traverseNextSibling. The old code hanlded cases where the offset was
        past the last child in a container incorrectly, and also iterated one node too few in cases where the
        end contaier was a text node.

        * khtml/xml/dom2_traversalimpl.h: Removed a bunch of unused and unneeded member functions.

        * khtml/xml/dom_nodeimpl.h: Added traverseNextSibling.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::traverseNextNode): Reformatted the code a little bit.
        (NodeImpl::traverseNextSibling): Added. Like traverseNextNode except it starts after the node's children
        instead of starting at the beginning of the first child.

2004-05-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Trey.

	<rdar://problem/3656722>: Implement outerText and setOuterText DOM extensions
        
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::outerText): Return same value as innerText().
        (HTMLElementImpl::setInnerText): Fix comment.
        (HTMLElementImpl::setOuterText): Replace node with text, merge neighboring text nodes.
        * khtml/html/html_elementimpl.h: Prototype new methods.
	* khtml/dom/html_element.cpp:
        (HTMLElement::outerText): Hook up to impl.
        (HTMLElement::setOuterText): Ditto.
        * khtml/dom/html_element.h: Prototype new methods.
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::getValueProperty): Glue up outerText.
        (KJS::HTMLElement::putValue): Ditto. 
        * khtml/ecma/kjs_html.h: Added new enum value.
        * khtml/ecma/kjs_html.lut.h:
        (KJS::): Regenerated.

2004-05-21  Richard Williamson   <rjw@apple.com>

        Removed _bindObject:forFrame: SPI.
        
        Reviewed by Chris.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:

2004-05-21  David Hyatt  <hyatt@apple.com>

	Fix for 3663644, repaints don't occur when the .innerHTML of a positioned element is changed.
	
        Reviewed by john

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_layer.h:
        (khtml::RenderLayer::repaintRect):

=== Safari-141 ===

2004-05-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken and Chris.

        - fixed <rdar://problem/3656948>: (markup strings that contain <html> and <body> elements don't work, producing nothing)

        * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment):
        Changed things around so that nodes are removed from their parent node before 

2004-05-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken and Chris.

        - fixed part of <rdar://problem/3656948>: (HTML Editing: -[WebView replaceSelectionWithMarkupString:] doesn't seem to work)

        * khtml/editing/htmlediting_impl.cpp: (khtml::PasteMarkupCommandImpl::doApply):
        Changed code to handle case where contextual fragment parses to nothing without crashing.

2004-05-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        * kwq/DOM-CSS.mm: Change DOMCSSStyleDeclaration methods to use strings with dash-separators in them
        rather than interCaps.

2004-05-21  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3090663>: (scroll to top of page when anchor is "#top" or "#")

        * khtml/khtml_part.cpp:
        (KHTMLPart::gotoAnchor): Detect anchor by checking for non-null, not non-empty, because an
        empty anchor is not the same as no anchor.
        (KHTMLPart::gotoAnchor): Add special case for anchors named "" and "top" (case insensitive),
        to scroll to the top left of the frame to match what WinIE and Mozilla do.
        (KHTMLPart::checkCompleted): Check for non-null here too for consistency.

        * kwq/KWQKURL.mm:
        (KURL::ref): Change check so that we return empty, not null, if there's an empty ref,
        as opposed to no ref.
        (KURL::hasRef): Return true if there's an empty ref, as opposed to no ref.
        (KURL::parse): Preserve an empty fragment when parsing.

2004-05-20  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3575385>: (multiple radio buttons checked when arriving at sites (poll at www.1170kfaq.com, many others))

        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::parseHTMLAttribute): Use setChecked to set the default value if we are still in
        "use default checked" mode. That way, other radio buttons will be unchecked properly and the proper
        changed methods will be dispatched.
        (HTMLInputElementImpl::reset): Ditto.
        * khtml/html/html_formimpl.h: (DOM::HTMLInputElementImpl::checked): Changed to just return m_checked.
        The m_useDefaultChecked flag is now only really looked at when you parse a checked attribute; that's
        because m_checked and m_defaultChecked are kept equal as long as m_useDefaultChecked is true.

        * khtml/xml/dom_nodeimpl.h: Removed an unnecessary virtual, to make code a little smaller and faster.

2004-05-20  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - fixed <rdar://problem/3662383>: (REGRESSION: drag slide-back sometimes causes link to load)
        - fixed <rdar://problem/3662556>: (REGRESSION: letting up mouse while dragging over link activates the link)

        * khtml/khtmlview.h: Added invalidateClick.
        * khtml/khtmlview.cpp: (KHTMLView::invalidateClick): Added. Sets clickCount to 0.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::matchLabelsAgainstElement): Changed a string replace to a character replace for slightly
        faster code and smaller code size.
        (KWQKHTMLPart::khtmlMouseMoveEvent): Call invalidateClick at the appropriate times. To do this correctly,
        had to add a boolean result to handleMouseDragged: so I can tell if a drag started or not (due to hysteresis).
        (KWQKHTMLPart::attributedString): Changed a string append to a character append for slightly faster code
        and smaller code size.

        * kwq/WebCoreBridge.h: Added BOOL result to handleMouseDragged:.

        Reviewed by Dave.

        - handle rules with empty bodies properly

        * khtml/css/parser.y: Remove bogus check for empty body that prevents the rule
        from being created.
        * khtml/css/parser.cpp: Regenerated.

2004-05-20  David Hyatt  <hyatt@apple.com>

	Revise the patch for incorrect caret positions when brs get deleted.  It can be even simpler.
	
        Reviewed by kocienda

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):
        * khtml/rendering/render_text.cpp:
        (RenderText::detach):

2004-05-20  David Hyatt  <hyatt@apple.com>

	Fix for 3629816, caret in wrong position when deleting <br>s on lines by themselves or when moving <br>s
	on lines by themselves.
	
        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::detach):
        * khtml/rendering/render_br.cpp:
        (RenderBR::setPos):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::dirtyLinesFromChangedChild):

2004-05-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Provide the methods to glue the WebView's editing delegate so that these methods work:
        
        <rdar://problem/3655316>: "Editing: -webViewShouldBeginEditing:inDOMRange: method unimplemented (WebKit editing API)"
        <rdar://problem/3655317>: "Editing: -webViewShouldEndEditing:inDOMRange: method unimplemented (WebKit editing API)"

        While I was in the neighborhood and working on understanding focus shifts, I fixed this bug as well:
        
        <rdar://problem/3645154>: "contentEditable div receives focus and blur twice when focus changes to new element"

        * khtml/khtml_part.cpp:
        (KHTMLPart::invalidateSelection): Do not move focus in this function. That is just a mistake. This function
        is all about redraw.
        (KHTMLPart::selectionLayoutChanged): New function. Factor out the redraw parts of notifySelectionChanged so
        that invalidateSelection can call it.
        (KHTMLPart::notifySelectionChanged): Call selectionLayoutChanged now that the redraw parts have been
        factored out.
        (KHTMLPart::shouldBeginEditing): New function that calls through to the KWQKHTMLPart in an APPLE_CHANGES
        block. This is part of the code path that will eventually The WebView's delegate to ask the
        shouldBeginEditing question. 
        (KHTMLPart::shouldEndEditing): Ditto, except the question is about shouldEndEditing.
        * khtml/khtml_part.h:
        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent): Now looks at the boolean value returned from DocumentImpl::setFocusNode 
        (described below). If the focus shift was blocked, swallow the mouse event.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::relinquishesEditingFocus): Part of the WebView's delegation call chain described above.
        (DocumentImpl::acceptsEditingFocus): Ditto.
        (DocumentImpl::setFocusNode): Many improvements. Now handles WebView delegation and switching focus
        in the handlers called as a result of the DOM events that this function calls. Also now returns a 
        boolean to say whether the attempt to set focus was blocked by a handler or by the WebView's delegate.
        * khtml/xml/dom_docimpl.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::shouldBeginEditing): More WebView's delegation glue.
        (KWQKHTMLPart::shouldEndEditing): Ditto.
        * kwq/WebCoreBridge.h:

2004-05-20  Richard Williamson   <rjw@apple.com>

        Reviewed by NOBODY (OOPS!).

        * kwq/DOM.mm:
        (-[DOMObject _init]):
        * kwq/DOMInternal.mm:
        (-[WebScriptObject _init]):
        (-[WebScriptObject _initializeScriptDOMNodeImp]):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):
        (KWQKHTMLPart::bindingRootObject):
        (KWQKHTMLPart::windowScriptObject):

2004-05-20  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3661918>: "repro nil-deref in RenderImage::paint (www.codepoetry.net)"

        * khtml/rendering/render_image.cpp: (RenderImage::paint): Check renderer pointer to see if it's
        nil before dereferencing it.

        - fixed <rdar://problem/3658455>: "readFromData:options:documentAttributes: crashes when passed page without a body (in WebKit mode)"

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::bodyBackgroundColor): Check renderer pointer to see if it's
        nil before dereferencing it.

        - fixed <rdar://problem/2948112>: "implement addRule for JavaScript for style sheets"

        * khtml/dom/css_stylesheet.h: Added addRule.
        * khtml/dom/css_stylesheet.cpp: (CSSStyleSheet::addRule): Added.
        * khtml/css/css_stylesheetimpl.h: Added addRule.
        * khtml/css/css_stylesheetimpl.cpp: (CSSStyleSheetImpl::addRule): Added an implementation
        based on the Microsoft documentation. An index of -1 means "at the end of the list".

        * khtml/dom/dom_string.h: Changed the string-append operator to be a non-member function
        so it works even if the left side has to undergo type conversion.
        * khtml/dom/dom_string.cpp: (DOM::operator+): Changed implementation to match above.
        Also changed to not use anything private or protected so it doesn't have to be a friend.

        * khtml/ecma/kjs_css.h: Added addRule to the list of functions for CSS style sheets.
        * khtml/ecma/kjs_css.cpp: (DOMCSSStyleSheetProtoFunc::tryCall): Add support for addRule,
        based on the Microsoft documentation; always returns -1. Also removed unused string conversions.
        * khtml/ecma/kjs_css.lut.h: Regenerated.

2004-05-19  David Hyatt  <hyatt@apple.com>

	Implement support for notification posting to accessibility clients for layouts and loads.
	
        * khtml/khtmlview.cpp:
        (KHTMLView::layout):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::close):
        * kwq/KWQAccObjectCache.h:
        (KWQAccObjectCache::enableAccessibility):
        (KWQAccObjectCache::accessibilityEnabled):
        * kwq/KWQAccObjectCache.mm:
        (KWQAccObjectCache::accObject):
        (KWQAccObjectCache::setAccObject):
        (KWQAccObjectCache::removeAccObject):
        (KWQAccObjectCache::detach):
        (KWQAccObjectCache::childrenChanged):
        (KWQAccObjectCache::postNotification):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge accessibilityTree]):

2004-05-19  Chris Blumenberg  <cblu@apple.com>

	Tweaks for forthcoming dragging improvements.

        Reviewed by john.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge moveDragCaretToPoint:]): renamed for future reasons, removed text only restrictions

2004-05-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt and Darin

        Fix for this bug:
        
        <rdar://problem/3643230>: "can't tab out of contentEditable Elements"

        * khtml/xml/dom_elementimpl.cpp: Now checks if key event was intercepted by the editing
        key-handler before setting the event as defaultHandled.
        (ElementImpl::defaultEventHandler):
        * kwq/KWQKHTMLPart.h: Name change from editingKeyEvent.
        Also now returns a BOOL to report whether the event was handled or not.
        * kwq/KWQKHTMLPart.mm: 
        (KWQKHTMLPart::interceptEditingKeyEvent): Ditto.
        * kwq/WebCoreBridge.h: Renamed from _editingKeyDown.

2004-05-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3655601>: "deleting characters is much slower than inserting them"

        Cleaned up the way selections are set in edit commands, and how KHTMLPart is
        notified of these changes. This clears up a number of inefficiencies, including unnecessary repaints
        which were causing the performace problem.

        * khtml/editing/htmlediting.cpp: Removed moveToStartingSelection and moveToEndingSelection functions.
        This work is going to be done using another pre-existing communication facility shared by edit commands
        and the part.
        * khtml/editing/htmlediting.h: Ditto.
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::EditCommandImpl::setStartingSelection): Fix coding mistake which caused double recursion while setting
        ancestor values.
        (khtml::EditCommandImpl::setEndingSelection): Ditto.
        (khtml::CompositeEditCommandImpl::doUnapply): No longer calls moveToStartingSelection. Work done in the part now.
        (khtml::CompositeEditCommandImpl::doReapply): No longer calls moveToEndingSelection. Work done in the part now.
        (khtml::TypingCommandImpl::typingAddedToOpenCommand): New function. Provides a hook for
        typing commands to tell the part about additional typing that has been done.
        (khtml::TypingCommandImpl::insertText): Now calls typingAddedToOpenCommand.
        (khtml::TypingCommandImpl::insertNewline): Ditto.
        (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
        (khtml::TypingCommandImpl::deleteKeyPressed): Ditto.
        * khtml/editing/htmlediting_impl.h: Removed moveToStartingSelection and moveToEndingSelection functions.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): Modified to take an argument which tells whether the set closes an active
        typing command.
        (KHTMLPart::notifySelectionChanged): Changed endTyping variable to be consistent with "close typing"
        terminology used elsewhere.
        (KHTMLPart::appliedEditing): Now sets the selection using the value of the passed-in command. Added
        an assert for typing cases. Fixed problem where didChangeNotification was not being posted for typing
        changes after the first one.
        (KHTMLPart::unappliedEditing): Now sets the selection using the value of the passed-in command.
        (KHTMLPart::reappliedEditing): Now sets the selection using the value of the passed-in command.
        * khtml/khtml_part.h:
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::clearSelection): Do not call repaint when the selection is a caret.

2004-05-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::isContentEditable): Ask if the part is contenteditable.
        True value is treated as an "override" and will short-circuit, returning true.
        * khtml/khtml_part.cpp:
        (KHTMLPart::isContentEditable): Call over bridge. Has the effect of checking the
        isEditable method on the WebView which contains this part.
        * khtml/khtml_part.h: Declare isContentEditable.
        * kwq/KWQKHTMLPart.h: Declare isContentEditable.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::isContentEditable): Call over bridge, as described above.
        * kwq/WebCoreBridge.h: Declare isEditable.

2004-05-19  Darin Adler  <darin@apple.com>

        - fixed headers with licenses mangled by Xcode auto-indenting

        * kwq/DOMExtensions.h:
        * kwq/KWQAccObject.h:
        * kwq/KWQAccObject.mm:
        * kwq/KWQAccObjectCache.h:
        * kwq/KWQKSSLKeyGen.mm:
        * kwq/KWQScrollBar.mm:
        * kwq/KWQSlider.mm:
        * kwq/WebCoreGraphicsBridge.h:
        * kwq/WebCoreGraphicsBridge.m:
        * kwq/WebCoreKeyGenerator.h:
        * kwq/WebCoreKeyGenerator.m:

2004-05-18  David Hyatt  <hyatt@apple.com>

	Add two new attributes for accessibility that can be polled by the screen reader.  AXLayoutCount indicates
	the number of layouts that have occurred, and AXLoaded indicates whether or not a page has finished loading.
	
        * khtml/khtmlview.cpp:
        (KHTMLViewPrivate::reset):
        (KHTMLView::layoutCount):
        (KHTMLView::layout):
        * khtml/khtmlview.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject roleDescription]):
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityAttributeValue:]):

2004-05-18  David Hyatt  <hyatt@apple.com>

	Fix crash when retrieving the AXHelp text.
	
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject helpText]):

2004-05-18  David Hyatt  <hyatt@apple.com>

	Improve layout scheduling and add instrumentation for debugging layout scheduling
	
        Reviewed by kocienda

        * khtml/khtml_part.cpp:
        (KHTMLPart::slotFinishedParsing):
        (KHTMLPart::checkCompleted):
        * khtml/khtmlview.cpp:
        (KHTMLViewPrivate::KHTMLViewPrivate):
        (KHTMLViewPrivate::reset):
        (KHTMLView::layout):
        (KHTMLView::scheduleRelayout):
        (KHTMLView::haveDelayedLayoutScheduled):
        (KHTMLView::unscheduleRelayout):
        * khtml/khtmlview.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::repaintAfterLayoutIfNeeded):
        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::updateWidgetPositions):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::close):
        (DocumentImpl::setParsing):
        (DocumentImpl::shouldScheduleLayout):
        (DocumentImpl::minimumLayoutDelay):
        (DocumentImpl::elapsedTime):
        (DocumentImpl::finishParsing):
        (DocumentImpl::updateStyleSelector):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::allDataReceived):
        * kwq/KWQDateTime.h:
        * kwq/KWQDateTime.mm:
        (QTime::elapsed):
        * kwq/KWQWidget.mm:
        (QWidget::setFrameGeometry):

2004-05-18  Richard Williamson   <rjw@apple.com>

	Finished implementing support for windowScriptObject.

        Reviewed by Maciej.

        * khtml/khtml_part.cpp:
        (KHTMLPart::begin):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart):
        (KWQKHTMLPart::~KWQKHTMLPart):
        (KWQKHTMLPart::windowScriptObject):
        * kwq/WebCoreBridge.mm:
        (updateRenderingForBindings):

2004-05-18  Richard Williamson   <rjw@apple.com>

	Added stubs to get the WebScriptObject for the window
	JS object.
	
	Made updateRenderingForBindings more robust when handed a
	nil root object.  This was causing a crash in DB.  Still need to
	address root cause of nil root object.

        Reviewed by Maciej.

        * khtml/khtml_part.cpp:
        (KHTMLPart::begin):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::windowScriptObject):
        (KWQKHTMLPart::partClearedInBegin):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (updateRenderingForBindings):
        (-[WebCoreBridge init]):
        (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]):
        (-[WebCoreBridge windowScriptObject]):

2004-05-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3656719>: Implement outerHTML and setOuterHTML DOM extensions

	They were already implemented (by Chris), all that was required
	was exporting them to JavaScript.

        * khtml/dom/html_element.cpp:
        (HTMLElement::outerHTML): Call impl.
        (HTMLElement::setOuterHTML): Ditto.
        * khtml/dom/html_element.h: Prototype new methods.
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::getValueProperty): Add OuterHTML.
        (KJS::HTMLElement::putValue): Add OuterHTML.
        * khtml/ecma/kjs_html.h: Add new enum values.
        * khtml/ecma/kjs_html.lut.h: Regenerated.

2004-05-18  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Removed support for designMode attribute, which we will not be supporting for Tiger.
        Removed inEditMode from KHTMLPart. This cached designMode value.
        Removed KHTMLPart::isEditingAtNode function. Asking a node if it is content-editable
        is a suitable replacement.

        * khtml/dom/dom_misc.h: Remove TristateFlag enum that was used to track designMode values.
        * khtml/dom/html_document.cpp: Remove designMode and setDesignMode.
        * khtml/dom/html_document.h: Ditto.
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet): Remove designMode.
        (KJS::HTMLDocument::putValue): Ditto.
        * khtml/ecma/kjs_html.lut.h:
        (KJS::): Ditto.
        * khtml/html/html_documentimpl.cpp: Remove designMode and setDesignMode.
        * khtml/html/html_documentimpl.h: Ditto.
        * khtml/khtml_part.cpp: Remove setEditMode, editMode, inEditMode, and isEditingAtNode.
        * khtml/khtml_part.h: Ditto.
        * khtml/khtmlpart_p.h: Remove m_inEditMode variable.
        (KHTMLPartPrivate::KHTMLPartPrivate):
        * khtml/khtmlview.cpp:
        (KHTMLView::focusNextPrevNode): Change over one use in tree of isEditingAtNode to use
        isContentEditable instead. isContentEditable will be modified in future patch to handle
        whether the per-part switch has been thrown to override whether something is editable or not.

2004-05-17  Richard Williamson   <rjw@apple.com>

	Implemented new API for WebScriptObject.
	Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)

        Reviewed by Hyatt.

        * kwq/WebCoreBridge.mm:
        (updateRenderingForBindings):
        (-[WebCoreBridge init]):

2004-05-14  Vicki Murley  <vicki@apple.com>

        Reviewed by mjs.
 
	<rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release

        * WebCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0

2004-05-14  Darin Adler  <darin@apple.com>

        Reviewed by Darin, coded by Maciej.

        - fixed extra repaints when doing auto-fill checks on all pages that have pop-up buttons

        * kwq/KWQComboBox.mm:
        (QComboBox::populateMenu): Set the populating-menu flag and clear it when done.
        (-[KWQPopUpButton setPopulatingMenu:]): Added. Sets flag.
        (-[KWQPopUpButton setNeedsDisplayInRect:]): Do nothing if the flag is set.

2004-05-14  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3650026>: "background property doesn't work right on webdevtips.com due to background:inherit"

        * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
        Added CSS_PROP_BACKGROUND to the list of properties that must be applied in the first pass.

=== Safari-140 ===

2004-05-13  David Hyatt  <hyatt@apple.com>

	Fix image loading for <input type=image> and <object>.  Make sure it works dynamically and make sure
	the renderer is properly null-checked at attach time.
	
        Reviewed by darin

        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::HTMLInputElementImpl):
        (HTMLInputElementImpl::~HTMLInputElementImpl):
        (HTMLInputElementImpl::parseHTMLAttribute):
        (HTMLInputElementImpl::attach):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::HTMLObjectElementImpl):
        (HTMLObjectElementImpl::~HTMLObjectElementImpl):
        (HTMLObjectElementImpl::parseHTMLAttribute):
        (HTMLObjectElementImpl::attach):
        * khtml/html/html_objectimpl.h:

2004-05-14  Chris Blumenberg  <cblu@apple.com>

	- Made DOMEventTarget a formal protocol that is implemented by DOMNode
	- Made DOMEventListener a formal protocol that any object can implement

        Reviewed by kocienda.

        * kwq/DOMCore.h:
        * kwq/DOMEvents.h:

2004-05-13  Richard Williamson   <rjw@apple.com>

	Removed vestigial isSelected method.

        Reviewed by Chris.

        * kwq/KWQWidget.h:
        * kwq/KWQWidget.mm:
        (QWidget::setIsSelected):
        * kwq/WebCoreBridge.h:

2004-05-13  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3616555>: (API: Make DOM extensions and WebKit DOM operations public)

        Reviewed by rjw.

        * kwq/DOM.h: added DOMExtensions.h
        * kwq/DOMHTML.h: renamed frame on DOMHTMLTableElement to frameBorders to avoid NSView conflicts
        * kwq/DOMHTML.mm:
        (-[DOMHTMLTableElement frameBorders]):
        (-[DOMHTMLTableElement setFrameBorders:]):

2004-05-13  Richard Williamson   <rjw@apple.com>

	Changed imports of all DOM headers.  DOM headers
	should be imported using the normal #import <WebCore/foo.h>,
	they import is modified when copied to WebKit.

        Reviewed by Chris.

        * ChangeLog:
        * kwq/DOM.h:
        * kwq/DOMCSS.h:
        * kwq/DOMCore.h:
        * kwq/DOMEvents.h:
        * kwq/DOMExtensions.h:
        * kwq/DOMHTML.h:
        * kwq/DOMInternal.h:
        * kwq/DOMRange.h:
        * kwq/DOMStylesheets.h:
        * kwq/DOMTraversal.h:
        * kwq/DOMViews.h:

2004-05-13  Ken Kocienda  <kocienda@apple.com>

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Fix deployment
        build bustage. Uninitialized variable.

2004-05-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Implemented first cut at text style change code.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::ApplyStyleCommand):
        (khtml::ApplyStyleCommand::~ApplyStyleCommand):
        (khtml::ApplyStyleCommand::impl):
        (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand):
        (khtml::RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand):
        (khtml::RemoveCSSPropertyCommand::impl):
        (khtml::RemoveCSSPropertyCommand::styleDeclaration):
        (khtml::RemoveCSSPropertyCommand::property):
        (khtml::RemoveNodeAttributeCommand::RemoveNodeAttributeCommand):
        (khtml::RemoveNodeAttributeCommand::~RemoveNodeAttributeCommand):
        (khtml::RemoveNodeAttributeCommand::impl):
        (khtml::RemoveNodeAttributeCommand::element):
        (khtml::RemoveNodeAttributeCommand::attribute):
        (khtml::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
        (khtml::RemoveNodePreservingChildrenCommand::~RemoveNodePreservingChildrenCommand):
        (khtml::RemoveNodePreservingChildrenCommand::impl):
        (khtml::RemoveNodePreservingChildrenCommand::node):
        (khtml::SetNodeAttributeCommand::SetNodeAttributeCommand):
        (khtml::SetNodeAttributeCommand::~SetNodeAttributeCommand):
        (khtml::SetNodeAttributeCommand::impl):
        (khtml::SetNodeAttributeCommand::element):
        (khtml::SetNodeAttributeCommand::attribute):
        (khtml::SetNodeAttributeCommand::value):
        * khtml/editing/htmlediting.h:
        (khtml::):
        (khtml::ApplyStyleCommand::):
        
        Removed a bunch of unnecessary DOM namespace qualifiers.
        Fixed calls to parent(), which relied on the TreeShared interface to get a parent,
        and changed to the parentNode() DOM Node call, which is more suitable given the
        intention.
        
        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::insertNodeBefore):
        (khtml::CompositeEditCommandImpl::insertNodeAfter):
        (khtml::CompositeEditCommandImpl::appendNode):
        (khtml::CompositeEditCommandImpl::removeNode):
        (khtml::CompositeEditCommandImpl::removeNodeAndPrune):
        (khtml::CompositeEditCommandImpl::removeNodePreservingChildren):
        (khtml::CompositeEditCommandImpl::splitTextNode):
        (khtml::CompositeEditCommandImpl::joinTextNodes):
        (khtml::CompositeEditCommandImpl::insertText):
        (khtml::CompositeEditCommandImpl::deleteText):
        (khtml::CompositeEditCommandImpl::replaceText):
        (khtml::CompositeEditCommandImpl::removeCSSProperty):
        (khtml::CompositeEditCommandImpl::removeNodeAttribute):
        (khtml::CompositeEditCommandImpl::setNodeAttribute):
        
        
        Text style change command implementations.
        There are a couple more parent() -> parentNode() changes in here as well.
        
        (khtml::ApplyStyleCommandImpl::ApplyStyleCommandImpl):
        (khtml::ApplyStyleCommandImpl::~ApplyStyleCommandImpl):
        (khtml::ApplyStyleCommandImpl::commandID):
        (khtml::ApplyStyleCommandImpl::doApply):
        (khtml::ApplyStyleCommandImpl::isHTMLStyleNode):
        (khtml::ApplyStyleCommandImpl::removeHTMLStyleNode):
        (khtml::ApplyStyleCommandImpl::removeCSSStyle):
        (khtml::ApplyStyleCommandImpl::removeCSSProperty):
        (khtml::ApplyStyleCommandImpl::setNodeAttribute):
        (khtml::ApplyStyleCommandImpl::removeNodeAttribute):
        (khtml::ApplyStyleCommandImpl::removeNodePreservingChildren):
        (khtml::ApplyStyleCommandImpl::mustExlicitlyApplyStyle):
        (khtml::ApplyStyleCommandImpl::createExplicitApplyStyleNode):
        (khtml::ApplyStyleCommandImpl::currentlyHasStyle):
        (khtml::ApplyStyleCommandImpl::cssProperty):
        (khtml::ApplyStyleCommandImpl::matchesTargetStyle):
        (khtml::ApplyStyleCommandImpl::positionInsertionPoint):
        (khtml::ApplyStyleCommandImpl::splitTextAtStartIfNeeded):
        (khtml::ApplyStyleCommandImpl::splitTextAtEndIfNeeded):
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded):
        (khtml::ApplyStyleCommandImpl::removeStyle):
        (khtml::ApplyStyleCommandImpl::cloneSelection):
        (khtml::ApplyStyleCommandImpl::insertFragment):
        (khtml::ApplyStyleCommandImpl::applyInPlace):
        (khtml::ApplyStyleCommandImpl::applyUsingFragment):
        (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
        (khtml::InsertNodeBeforeCommandImpl::doApply):
        (khtml::InsertNodeBeforeCommandImpl::doUnapply):
        (khtml::JoinTextNodesCommandImpl::doApply):
        (khtml::PasteMarkupCommandImpl::PasteMarkupCommandImpl):
        (khtml::RemoveCSSPropertyCommandImpl::RemoveCSSPropertyCommandImpl):
        (khtml::RemoveCSSPropertyCommandImpl::~RemoveCSSPropertyCommandImpl):
        (khtml::RemoveCSSPropertyCommandImpl::commandID):
        (khtml::RemoveCSSPropertyCommandImpl::doApply):
        (khtml::RemoveCSSPropertyCommandImpl::doUnapply):
        (khtml::RemoveNodeAttributeCommandImpl::RemoveNodeAttributeCommandImpl):
        (khtml::RemoveNodeAttributeCommandImpl::~RemoveNodeAttributeCommandImpl):
        (khtml::RemoveNodeAttributeCommandImpl::commandID):
        (khtml::RemoveNodeAttributeCommandImpl::doApply):
        (khtml::RemoveNodeAttributeCommandImpl::doUnapply):
        (khtml::RemoveNodePreservingChildrenCommandImpl::RemoveNodePreservingChildrenCommandImpl):
        (khtml::RemoveNodePreservingChildrenCommandImpl::~RemoveNodePreservingChildrenCommandImpl):
        (khtml::RemoveNodePreservingChildrenCommandImpl::commandID):
        (khtml::RemoveNodePreservingChildrenCommandImpl::doApply):
        (khtml::SetNodeAttributeCommandImpl::SetNodeAttributeCommandImpl):
        (khtml::SetNodeAttributeCommandImpl::~SetNodeAttributeCommandImpl):
        (khtml::SetNodeAttributeCommandImpl::commandID):
        (khtml::SetNodeAttributeCommandImpl::doApply):
        (khtml::SetNodeAttributeCommandImpl::doUnapply):
        (khtml::SplitTextNodeCommandImpl::doUnapply):
        (khtml::TypingCommandImpl::insertText):


        Text style change command implementations.

        * khtml/editing/htmlediting_impl.h:
        (khtml::ApplyStyleCommandImpl::):
        (khtml::ApplyStyleCommandImpl::removingStyle):
        (khtml::RemoveCSSPropertyCommandImpl::styleDeclaration):
        (khtml::RemoveCSSPropertyCommandImpl::property):
        (khtml::RemoveNodeAttributeCommandImpl::element):
        (khtml::RemoveNodeAttributeCommandImpl::attribute):
        (khtml::RemoveNodePreservingChildrenCommandImpl::node):
        (khtml::SetNodeAttributeCommandImpl::element):
        (khtml::SetNodeAttributeCommandImpl::attribute):
        (khtml::SetNodeAttributeCommandImpl::value):
        
        
        Fixed a bug where the TreeWalker returned the current node instead
        of null when an attempt was made to use the iterator to go to a
        non-existent location.
        
        * khtml/xml/dom2_traversalimpl.cpp:
        (DOM::TreeWalkerImpl::parentNode):
        (DOM::TreeWalkerImpl::firstChild):
        (DOM::TreeWalkerImpl::lastChild):
        (DOM::TreeWalkerImpl::previousSibling):
        (DOM::TreeWalkerImpl::nextSibling):
        (DOM::TreeWalkerImpl::previousNode):
        (DOM::TreeWalkerImpl::nextNode):
        
        
        A convenience.
        
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::hasAttributes):
        * khtml/xml/dom_elementimpl.h:
        
        
        New helpers to begin moving us to using DOM Range-compliant positions in our code.
        
        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentRangeCompliantPosition):
        (DOM::Position::equivalentShallowPosition):
        (DOM::Position::inLastEditableInContainingEditableBlock):
        
        
        (DOM::Position::debugPosition): Debugging aid.
        * khtml/xml/dom_position.h:
       
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge applyStyle:]): First bit of wiring up. Some hard-coded temporary code 
        in here will need to be improved soon.

2004-05-12  David Hyatt  <hyatt@apple.com>

	Improve layout scheduling.  Make sure no layouts can be scheduled until over a minimum delay threshold.
	
        * khtml/khtmlview.cpp:
        (KHTMLView::scheduleRelayout):
        * khtml/rendering/render_frames.cpp:
        (RenderPart::updateWidgetPositions):
        * khtml/rendering/render_text.cpp:
        (RenderText::paint):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::close):
        (DocumentImpl::setParsing):
        (DocumentImpl::shouldScheduleLayout):
        (DocumentImpl::minimumLayoutDelay):
        * khtml/xml/dom_docimpl.h:

2004-05-11  Chris Blumenberg  <cblu@apple.com>

	Support for: <rdar://problem/3616471>: (API: provide way to get from WebFrame to DOMDocument and vice versa)

        Reviewed by rjw.

        * kwq/DOM.mm:
        (-[DOMDocument _ownerElement]): new
        * kwq/DOMInternal.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge frameElement]): new

2004-05-11  David Hyatt  <hyatt@apple.com>

	Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.

        Fix block minmaxwidth to add together contiguous runs of floats.

	Fix the content image loader to not destroy the image when removed from the document.

        Reviewed by darin
	
        * ChangeLog:
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageLoader::~HTMLImageLoader):
        (HTMLImageElementImpl::detach):
        * khtml/html/html_imageimpl.h:
        (DOM::):
        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::createRenderer):
        * khtml/html/html_objectimpl.h:
        * khtml/rendering/render_block.cpp:
        (khtml::getInlineRun):
        (khtml::RenderBlock::calcInlineMinMaxWidth):
        (khtml::RenderBlock::calcBlockMinMaxWidth):

2004-05-06  David Hyatt  <hyatt@apple.com>

	Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.

	Fix block minmaxwidth to add together contiguous runs of floats.

	Fix the content image loader to not destroy the image when removed from the document.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::getInlineRun):
        (khtml::RenderBlock::calcBlockMinMaxWidth):

2004-05-11  Vicki Murley  <vicki@apple.com>

        Reviewed by Vicki (fixed by Darin).

        * kwq/KWQKSSLKeyGen.h: fix build failure in B&I due to case sensitivity

2004-05-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- avoid redecoding animated images that are only used once for
	~2.5% iBench speedup (WebCore part of fix)

        * khtml/rendering/render_image.cpp:
        (RenderImage::setPixmap): Maintain use count for pixmap.
        (RenderImage::~RenderImage): Likewise.
        * kwq/KWQPixmap.h:
        * kwq/KWQPixmap.mm:
        (QPixmap::increaseUseCount): Call WebCoreImageRenderer
        (QPixmap::decreaseUseCount): Call WebCoreImageRenderer
        * kwq/WebCoreImageRenderer.h: Prototype new protocol methods.

2004-05-10  David Hyatt  <hyatt@apple.com>

	Make sure that when finished parsing if all the right conditions are met, we just go ahead and updateRendering and
	layout.
	
        Reviewed by rjw
	
        * khtml/khtmlview.cpp:
        (KHTMLView::scheduleRelayout):

2004-05-08  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- some minor performance tweaks that together give .5% or so on
	the HTML iBench
	
        * khtml/css/css_valueimpl.h: don't use a bitfield for id and important,
	unpacking the bitfield is too expensive
        * kwq/KWQArrayImpl.h:
        * kwq/KWQArrayImpl.mm:
        (KWQArrayImpl::at): inline this method because it's so hot
        * kwq/KWQString.mm:
        (allocateHandle): inline this function because it's so hot
        (initializeHandleNodes): move this in the file so above can be inlined
        (allocateNode): ditto

2004-05-10  David Hyatt  <hyatt@apple.com>

	Move image loading to content.
	
        Reviewed by kocienda

        * khtml/html/html_imageimpl.cpp:
        (m_imageComplete):
        (HTMLImageLoader::~HTMLImageLoader):
        (HTMLImageLoader::updateFromElement):
        (HTMLImageLoader::removedFromDocument):
        (HTMLImageLoader::dispatchLoadEvent):
        (HTMLImageLoader::notifyFinished):
        (HTMLImageElementImpl::HTMLImageElementImpl):
        (HTMLImageElementImpl::parseHTMLAttribute):
        (HTMLImageElementImpl::attach):
        (HTMLImageElementImpl::detach):
        (HTMLImageElementImpl::removedFromDocument):
        (HTMLImageElementImpl::currentImage):
        * khtml/html/html_imageimpl.h:
        (DOM::):
        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::HTMLObjectElementImpl):
        (HTMLObjectElementImpl::removedFromDocument):
        (HTMLObjectElementImpl::attach):
        * khtml/html/html_objectimpl.h:
        * khtml/misc/loader.cpp:
        (CachedImage::ref):
        * khtml/rendering/render_image.cpp:
        (RenderImage::RenderImage):
        (RenderImage::setImage):
        (RenderImage::updateAltText):
        * khtml/rendering/render_image.h:
        (khtml::RenderImage::getImage):
        * khtml/rendering/render_object.cpp:
        (RenderObject::canvas):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::dispatchImageLoadEventSoon):
        (DocumentImpl::removeImage):
        (DocumentImpl::dispatchImageLoadEventsNow):
        * khtml/xml/dom_docimpl.h:

2004-05-10  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        - fixed build failure seen in B&I log (due to case sensitive file system?)

        * kwq/KWQLoader.h: Include "KWQCString.h" rather than "QCString.h". The latter was
        failing because the forwarding header is called "qcstring.h" and I guess B&I started
        building with a case sensitive file system. I could have changed this to "qcstring.h",
        but it seemed better to use the header's real name since we're inside KWQ here.

2004-05-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- change things around so extremely hot TokenizerString::current()
	method doesn't have to do any work. It's cheaper to maintain the
	relevant state than to always compute it.
	
        * khtml/misc/stringit.h:
        (khtml::TokenizerString::TokenizerString): Initialize m_currentChar
        (khtml::TokenizerString::push): update m_currentChar
        (khtml::TokenizerString::advance): ditto
        (khtml::TokenizerString::current): return m_currentChar
        * khtml/misc/stringit.cpp:
        (khtml::TokenizerString::clear): update m_currentChar
        (khtml::TokenizerString::append): update m_currentChar
        (khtml::TokenizerString::prepend): update m_currentChar

2004-05-07  Don Melton  <gramps@apple.com>

        Reviewed by Dave.

	Fixed minor, edge-case regression in KEYGEN RSA logic caused by Dave's
	"atomic string" patch back in January.

        * khtml/html/html_formimpl.cpp:
        (HTMLKeygenElementImpl::encoding):

=== Safari-139 ===

2004-05-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- two trivial changes for a 1% speedup, thanks to Shark
	
        * khtml/dom/dom_string.cpp:
        * khtml/dom/dom_string.h:
        (DOM::DOMString::~DOMString): inline this method because it's hot and the
	function call overhead was very costly.
        * WebCore.pbproj/project.pbxproj: Add -falign-loops=16
	optimization flag, as suggested by Shark.

2004-05-06  Chris Blumenberg  <cblu@apple.com>

	Added alpha to DOMRGBColor as an extension.

        Reviewed by dave.

        * kwq/DOM-CSS.mm:
        (-[DOMRGBColor alpha]): new
        * kwq/DOMExtensions.h:

2004-05-05  David Hyatt  <hyatt@apple.com>

	Fix whitespace rendering for brs inside pres. The bug is 3640711.
	
        Reviewed by kocienda

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        (khtml::RenderBlock::findNextLineBreak):

2004-04-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

        * khtml/ecma/kjs_events.cpp:
        (JSLazyEventListener::parseCode): Make sure to protect the
	permanent "event" string object.

2004-05-05  David Hyatt  <hyatt@apple.com>

	Fixes for 3637924, 3643356, and 3558513, all crashes in recalcStyle.  Make sure the tree is always in a
	sane state when removing children while changing .innerHTML.
	
        Reviewed by darin

        * khtml/xml/dom_nodeimpl.cpp:

2004-05-05  David Hyatt  <hyatt@apple.com>

	A collection of fixes.

	(1) Fix a regression from the style sharing landing that made visited and unvisited links accidentally share.
	(2) Make sure 100% height divs fill the <body> in quirks mode, even if the body has no height specified.
	(3) Make sure table cell percentage heights exclude border/padding.
	(4) Make sure that before flexing auto height is used for the contents of the cells.
	
        Reviewed by darin

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::canShareStyleWithElement):
        (khtml::CSSStyleSelector::locateSharedStyle):
        * khtml/rendering/render_box.cpp:
        (RenderBox::calcPercentageHeight):
        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):
        (RenderTableSection::layoutRows):

2004-05-05  Chris Blumenberg  <cblu@apple.com>

	- DOM Extensions API tweaks
	- Implemented outerHTML

        Reviewed by kocienda.

        * WebCore-combined.exp:
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::outerHTML): new
        (HTMLElementImpl::setOuterHTML): mew
        * khtml/html/html_elementimpl.h:
        * kwq/DOMExtensions.h: removed background methods on table and table cell since these are unnecessary conveniences
        * kwq/DOMHTML.mm:
        (-[DOMHTMLElement outerHTML]): new
        (-[DOMHTMLElement setOuterHTML:]): mew

2004-05-04  David Hyatt  <hyatt@apple.com>

	Fix for 3641331, make sure <th> elements don't reset text-align to center if they inherit a specified
	value.

	Also remove the styles from <abbr> and <acronym>.
	
        Reviewed by darin

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::adjustRenderStyle):
        * khtml/css/html4.css:
        * khtml/css/quirks.css:

2004-05-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Fix for behavior which extends selection drawing to beginning and end of blocks.
        I added this feature a few days ago, but my checks to see if the extension should
        be done was naive: Is first or last item in root line box selected? Clearly this 
        needs to be "selection is *beyond* first or last item in root line box. Done.

        * khtml/rendering/render_image.cpp:
        (RenderImage::paint): Add selectionState() == SelectionInside check.
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintSelection): Constrain passed-in offsets to be relative to box.
        Use passed-in offsets to check whether selection extends beyond this box. Also, now
        passes in flag to tell whether the whole RenderText has selectionState() == SelectionInside
        (in which case you always want to extend).
        (RenderText::paint): Remove box offset constraining from here. Now done in above function.
        * khtml/rendering/render_text.h: Modify paintSelection interface to add 
        selectionState() == SelectionInside flag.

2004-05-04  Ken Kocienda  <kocienda@apple.com>

        Added layout tests for DOM traversal objects.

        * layout-tests/traversal/node-iterator-001-expected.txt: Added.
        * layout-tests/traversal/node-iterator-001.html: Added.
        * layout-tests/traversal/node-iterator-002-expected.txt: Added.
        * layout-tests/traversal/node-iterator-002.html: Added.
        * layout-tests/traversal/node-iterator-003-expected.txt: Added.
        * layout-tests/traversal/node-iterator-003.html: Added.
        * layout-tests/traversal/node-iterator-004-expected.txt: Added.
        * layout-tests/traversal/node-iterator-004.html: Added.
        * layout-tests/traversal/node-iterator-005-expected.txt: Added.
        * layout-tests/traversal/node-iterator-005.html: Added.
        * layout-tests/traversal/node-iterator-006-expected.txt: Added.
        * layout-tests/traversal/node-iterator-006.html: Added.
        * layout-tests/traversal/node-iterator-007-expected.txt: Added.
        * layout-tests/traversal/node-iterator-007.html: Added.
        * layout-tests/traversal/traversal.js: Added.
        * layout-tests/traversal/tree-walker-001-expected.txt: Added.
        * layout-tests/traversal/tree-walker-001.html: Added.
        * layout-tests/traversal/tree-walker-002-expected.txt: Added.
        * layout-tests/traversal/tree-walker-002.html: Added.
        * layout-tests/traversal/tree-walker-003-expected.txt: Added.
        * layout-tests/traversal/tree-walker-003.html: Added.
        * layout-tests/traversal/tree-walker-004-expected.txt: Added.
        * layout-tests/traversal/tree-walker-004.html: Added.

2004-05-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/xml/dom2_traversalimpl.cpp:
        (DOM::NodeIteratorImpl::nextNode): Change to make NodeIterators behave like the spec in that
        reference node is null until you iterate the first time. 
        (DOM::NodeIteratorImpl::previousNode): Ditto.

2004-05-04  Ken Kocienda  <kocienda@apple.com>

        * WebCore.pbproj/project.pbxproj: Backed out unintentional
        change.

2004-05-04  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Implemented DOM traversal objects, NodeIterator and TreeWalker.

        * WebCore-combined.exp: Regenerate
        * WebCore.exp: Export DOMNodeFilter protocol
        * khtml/dom/dom2_traversal.cpp: Completed half-done implementation pulled from KDE tree.
        * khtml/dom/dom2_traversal.h: Ditto.
        * khtml/dom/dom_doc.cpp:
        (DOM::Document::createNodeIterator): Ditto.
        (DOM::Document::createTreeWalker): Ditto.
        * khtml/dom/dom_doc.h: Ditto.
        * khtml/ecma/kjs_dom.cpp:
        (DOMDocumentProtoFunc::tryCall): Fix cases that create traversal objects.
        * khtml/ecma/kjs_traversal.cpp:
        (DOMNodeIterator::getValueProperty): Add referenceNode and pointerBeforeReferenceNode
        properties to node interator.
        (DOMTreeWalkerProtoFunc::tryCall): Fix typo where DOMTreeWalker::PreviousNode case called previousSibling function.
        (JSNodeFilterCondition::JSNodeFilterCondition): Implement JS glue class for node filter conditions.
        (JSNodeFilterCondition::acceptNode): Ditto.
        * khtml/ecma/kjs_traversal.h:
        (KJS::DOMNodeIterator::): Add ReferenceNode and PointerBeforeReferenceNode constants.
        * khtml/ecma/kjs_traversal.lut.h:
        (KJS::): Regenerated
        * khtml/xml/dom2_traversalimpl.cpp: Completed half-done implementation pulled from KDE tree.
        * khtml/xml/dom2_traversalimpl.h: Ditto.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createNodeIterator): Ditto.
        (DocumentImpl::createTreeWalker): Ditto.
        * khtml/xml/dom_docimpl.h: Ditto.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::checkAddChild): Patched due to change in isAncestor function. This was the one pre-existing caller.
        (NodeImpl::isAncestor): Changed so that it does not return true for itself: node->isAncestor(node) now returns false.
        * khtml/xml/dom_nodeimpl.h: Made isAncestor const.
        * kwq/DOM.mm: Implemented obj-c glue for traversal objects.
        * kwq/DOMInternal.h: Ditto.
        * kwq/DOMTraversal.h: Ditto.

2004-05-04  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3642252>: "starting to drag a link and then releasing needs to activate the link if you are still over it"

        * khtml/khtmlview.cpp:
        (KHTMLView::viewportMouseMoveEvent): Put hysteresis check inside !APPLE_CHANGES because
        the Web Kit does our hysteresis checks.
        (KHTMLView::viewportMouseReleaseEvent): Ditto.

        * kwq/KWQApplication.h: Removed startDragDistance and globalStrut; unused.
        * kwq/KWQApplication.mm: Removed the implementations.
        * kwq/KWQPointArray.h: Removed manhattanLength; unused.
        * kwq/KWQPoint.mm:  Removed the implementation.

        * WebCore-tests.exp: Removed manhattanLength.
        * WebCore-combined.exp: Regenerated.

2004-05-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Nifty hack to work around problem where BR's inserted at the end of a block do not 
        render. Since only the *last* BR has this quirk, insert two when at the end of a block.
        Once done, you can't caret past the last one, so you never insert two again.

        * khtml/editing/htmlediting_impl.cpp:
        (InputNewlineCommandImpl::doApply)

2004-05-03  Darin Adler  <darin@apple.com>

        Reviewed by Ken

        - fixed <rdar://problem/3091531>: "should format copied tables with tabs between cells, spreadsheet-style, for pasting to Excel"
        - fixed <rdar://problem/3110002>: "Find doesn't match across formatting boundaries"
        - fixed <rdar://problem/3640340>: "REGRESSION (136-137): nil-deref in KHTMLPart::setFocusNodeIfNeeded inside triple click code after repeatedly click/drag selecting text"
        - fixed <rdar://problem/3640422>: "too many blank lines between paragraphs in copied text"

        * khtml/dom/dom2_range.h: Added == and != operators to DOMRange.
        * khtml/dom/dom2_range.cpp: (DOM::operator==): Added.

        * khtml/khtml_part.cpp:
        (KHTMLPart::init): Don't call findTextBegin any more; it's now not used at all
        in WebCore.
        (KHTMLPart::clear): Don't call findTextBegin any more. Also don't set up the
        load statistics variables.
        (KHTMLPart::findTextNext): Roll out APPLE_CHANGES; this function is no longer
        used in WebCore any more and instead the entire thing is compiled out.
        (KHTMLPart::text): Reimplement this by calling one of the new text operations. All the interesting
        parts were moved into the TextIterator class.
        (KHTMLPart::setFocusNodeIfNeeded): Add a check for nil; this is the fix for 364030.

        * khtml/khtmlpart_p.h: (KHTMLPartPrivate::KHTMLPartPrivate): Put m_findPos,
        m_findNode, m_overURL, m_overURLTarget, m_scrollTimer, m_loadedObjects,
        m_totalObjectCount, and m_jobPercent inside !APPLE_CHANGES.

        * khtml/xml/dom_selection.h: Replaced uses of 4-character tabs with spaces.
        (DOM::Selection::Selection): Added a constructor that takes a DOM range.
        (DOM::Selection::operator=): Overloaded operator= for DOM range and position.
        This is slightly more efficient than letting a second Selection object be constructed.
        * khtml/xml/dom_selection.cpp: Replaced uses of 4-character tabs with spaces.
        (DOM::Selection::Selection): Added a constructor that takes a DOM range.

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::findString): Reimplement find so it uses
        the new text operations function for finding.

        * khtml/misc/khtml_text_operations.h:
        * khtml/misc/khtml_text_operations.cpp:
        * WebCore.pbproj/project.pbxproj:
        Added new text iterator classes that do the heavy lifting.

2004-05-03  David Hyatt  <hyatt@apple.com>

	Make sure that XML processing instructions set themselves as the parent node of the stylesheets they load,
	so that they will get stylesheetLoaded() notifications when @imported stylesheets are contained inside the
	sheet.

        Reviewed by cblu

        * khtml/xml/dom_xmlimpl.cpp:
        (ProcessingInstructionImpl::setStyleSheet):

2004-04-30  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3543662>: HITLIST-137: REGRESSION: reproducible hang copying all text at Dave's blog, and other pages

        Reviewed by dave.

        * khtml/xml/dom2_rangeimpl.cpp:
        (RangeImpl::toHTMLWithOptions): when looping with containingBlock, check the value to see if it is the same

2004-04-30  David Hyatt  <hyatt@apple.com>

	Fix for 3639530, regression on generated content pages.  They crash because I forgot to null-check the style
	object.
	
        Reviewed by kocienda

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::checkOneSelector):

2004-04-30  John Sullivan  <sullivan@apple.com>

        - added bridge method to get the NSFont used to render a node, to
        help with supporting the font panel

        Reviewed by Ken.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge renderedFontForNode:]):
        return nil if no renderer, otherwise return NSFont

2004-04-29  David Hyatt  <hyatt@apple.com>

	Expose summary on tables.
	
        Reviewed by darin

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject helpText]):

2004-04-29  David Hyatt  <hyatt@apple.com>

	Implement image maps for accessibility.
	
        Reviewed by darin

        * khtml/html/html_imageimpl.cpp:
        (HTMLAreaElementImpl::getRect):
        * khtml/html/html_imageimpl.h:
        * khtml/rendering/render_image.cpp:
        (RenderImage::imageMap):
        (RenderImage::nodeAtPoint):
        * khtml/rendering/render_image.h:
        * kwq/KWQAccObject.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject initWithRenderer:]):
        (-[KWQAccObject anchorElement]):
        (-[KWQAccObject parentObject]):
        (-[KWQAccObject parentObjectUnignored]):
        (-[KWQAccObject addChildrenToArray:]):
        (-[KWQAccObject role]):
        (-[KWQAccObject helpText]):
        (-[KWQAccObject value]):
        (-[KWQAccObject title]):
        (-[KWQAccObject position]):
        (-[KWQAccObject size]):
        (-[KWQAccObject accessibilityIsIgnored]):
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        * kwq/KWQRegion.mm:
        (QRegion::boundingRect):

2004-04-29  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3631431>: web archive of .Mac welcome page renders has gaps in layout
	<rdar://problem/3631470>: news.google.com web archive has a different font than the live site

        Reviewed by kocienda.

        * khtml/html/html_documentimpl.cpp:
        (HTMLDocumentImpl::determineParseMode): don't set a name on the doc type when there is no doc type in the source
        * khtml/xml/dom_docimpl.cpp:
        (DocumentTypeImpl::toString): don't return "<!DOCTYPE>" when there is no doc type in the source
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithOptions): don't escape STYLE text, don't include the end tags for document nodes just as we don't for start tags

2004-04-29  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - some tweaks on image

        * khtml/html/html_imageimpl.h: Remove unused noref bit and unneeded override of isURLAttribute.
        * khtml/html/html_imageimpl.cpp:
        (HTMLAreaElementImpl::HTMLAreaElementImpl): Remove unused noref bit.
        (HTMLAreaElementImpl::parseHTMLAttribute): Remove parsing of noref; no need to store the
        bit since it has no meaning.

2004-04-29  David Hyatt  <hyatt@apple.com>

	1. Change the role of links from AXButton to AXLink.
	2. Add support for list markers using a new role, AXListMarker.
	
        Reviewed by kocienda

        * khtml/rendering/render_list.h:
        (khtml::RenderListMarker::text):
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject role]):
        (-[KWQAccObject roleDescription]):
        (-[KWQAccObject value]):
        (-[KWQAccObject accessibilityIsIgnored]):

2004-04-29  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3636566>: "space bar on a form button hits default button instead (autorestore.apple.com)"

        * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::defaultEventHandler):
        Remove special handling for space, falling back to default AppKit behavior. Change enter handling to
        click the form element itself in the case of elements other than text input ones.

2004-04-29  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3636673>: "unrepro nil-deref crash in KHTMLPart::frameDetached() (espn.com)"

        * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Check for nil.

2004-04-28  Chris Blumenberg  <cblu@apple.com>

	- Implemented DOMHTMLElementExtensions.
	- Added stubs for the rest of the DOM API.

        Reviewed by dave.

        * WebCore.pbproj/project.pbxproj:
        * khtml/dom/html_element.cpp:
        (HTMLElement::setContentEditable): moved implementation from here to HTMLElementImpl
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::setContentEditable): new, moved from HTMLElement
        * khtml/html/html_elementimpl.h:
        * kwq/DOM-CSS.mm:
        (-[DOMObject sheet]):
        (-[DOMDocument getComputedStyle::]):
        * kwq/DOM.mm:
        (-[DOMAbstractView document]):
        (-[DOMDocumentView defaultView]):
        (-[DOMDocument createNodeIterator::::]):
        (-[DOMDocument createTreeWalker::::]):
        (-[DOMNodeFilter acceptNode:]):
        (-[DOMNodeIterator root]):
        (-[DOMNodeIterator whatToShow]):
        (-[DOMNodeIterator filter]):
        (-[DOMNodeIterator expandEntityReferences]):
        (-[DOMNodeIterator nextNode]):
        (-[DOMNodeIterator previousNode]):
        (-[DOMNodeIterator detach]):
        (-[DOMTreeWalker root]):
        (-[DOMTreeWalker whatToShow]):
        (-[DOMTreeWalker filter]):
        (-[DOMTreeWalker expandEntityReferences]):
        (-[DOMTreeWalker currentNode]):
        (-[DOMTreeWalker setCurrentNode:]):
        (-[DOMTreeWalker parentNode]):
        (-[DOMTreeWalker firstChild]):
        (-[DOMTreeWalker lastChild]):
        (-[DOMTreeWalker previousSibling]):
        (-[DOMTreeWalker nextSibling]):
        (-[DOMTreeWalker previousNode]):
        (-[DOMTreeWalker nextNode]):
        * kwq/DOMEvents.mm: Added.
        (-[DOMEvent type]):
        (-[DOMEvent target]):
        (-[DOMEvent currentTarget]):
        (-[DOMEvent eventPhase]):
        (-[DOMEvent bubbles]):
        (-[DOMEvent cancelable]):
        (-[DOMEvent timeStamp]):
        (-[DOMEvent stopPropagation]):
        (-[DOMEvent preventDefault]):
        (-[DOMEvent initEvent:::]):
        (-[DOMEventTarget addEventListener:::]):
        (-[DOMEventTarget removeEventListener:::]):
        (-[DOMEventTarget dispatchEvent:]):
        (-[DOMMouseEvent screenX]):
        (-[DOMMouseEvent screenY]):
        (-[DOMMouseEvent clientX]):
        (-[DOMMouseEvent clientY]):
        (-[DOMMouseEvent ctrlKey]):
        (-[DOMMouseEvent shiftKey]):
        (-[DOMMouseEvent altKey]):
        (-[DOMMouseEvent metaKey]):
        (-[DOMMouseEvent button]):
        (-[DOMMouseEvent relatedTarget]):
        (-[DOMMouseEvent initMouseEvent:::::::::::::::]):
        (-[DOMMutationEvent relatedNode]):
        (-[DOMMutationEvent prevValue]):
        (-[DOMMutationEvent newValue]):
        (-[DOMMutationEvent attrName]):
        (-[DOMMutationEvent attrChange]):
        (-[DOMMutationEvent initMutationEvent::::::::]):
        (-[DOMUIEvent view]):
        (-[DOMUIEvent detail]):
        (-[DOMUIEvent initUIEvent:::::]):
        (-[DOMDocument createEvent:]):
        * kwq/DOMHTML.mm:
        (-[DOMHTMLElement innerHTML]): implemented
        (-[DOMHTMLElement setInnerHTML:]): implemented
        (-[DOMHTMLElement innerText]): implemented
        (-[DOMHTMLElement setInnerText:]): implemented
        (-[DOMHTMLElement children]): implemented
        (-[DOMHTMLElement contentEditable]): implemented
        (-[DOMHTMLElement setContentEditable:]): implemented
        (-[DOMHTMLElement isContentEditable]): implemented

2004-04-27  David Hyatt  <hyatt@apple.com>

	Implement sharing of similar style objects. Cuts the # of style objects allocated on the PLT by more
	than half.
	
        Reviewed by kocienda

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::initElementAndPseudoState):
        (khtml::CSSStyleSelector::initForStyleResolve):
        (khtml::cleanpath):
        (khtml::checkPseudoState):
        (khtml::CSSStyleSelector::locateSiblingList):
        (khtml::CSSStyleSelector::canShareStyleWithElement):
        (khtml::CSSStyleSelector::locateSharedStyle):
        (khtml::CSSStyleSelector::styleForElement):
        (khtml::CSSStyleSelector::pseudoStyleForElement):
        (khtml::CSSStyleSelector::checkOneSelector):
        * khtml/css/cssstyleselector.h:
        * khtml/css/html4.css:
        * khtml/css/parser.cpp:
        * khtml/css/parser.y:
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::mapToEntry):
        (HTMLIFrameElementImpl::mapToEntry):
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_blockimpl.cpp:
        (HTMLDivElementImpl::mapToEntry):
        (HTMLHRElementImpl::mapToEntry):
        (HTMLParagraphElementImpl::mapToEntry):
        (HTMLMarqueeElementImpl::mapToEntry):
        * khtml/html/html_blockimpl.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLNamedAttrMapImpl::declCount):
        (HTMLNamedAttrMapImpl::mapsEquivalent):
        (HTMLElementImpl::attributeChanged):
        (HTMLElementImpl::mapToEntry):
        * khtml/html/html_elementimpl.h:
        (DOM::HTMLElementImpl::isMappedAttribute):
        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::mapToEntry):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::mapToEntry):
        * khtml/html/html_imageimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLBRElementImpl::mapToEntry):
        (HTMLFontElementImpl::mapToEntry):
        * khtml/html/html_inlineimpl.h:
        * khtml/html/html_listimpl.cpp:
        (HTMLUListElementImpl::mapToEntry):
        (HTMLOListElementImpl::mapToEntry):
        (HTMLLIElementImpl::mapToEntry):
        * khtml/html/html_listimpl.h:
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::mapToEntry):
        (HTMLEmbedElementImpl::mapToEntry):
        (HTMLObjectElementImpl::mapToEntry):
        * khtml/html/html_objectimpl.h:
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::mapToEntry):
        (HTMLTablePartElementImpl::mapToEntry):
        (HTMLTableCellElementImpl::mapToEntry):
        (HTMLTableColElementImpl::mapToEntry):
        (HTMLTableCaptionElementImpl::mapToEntry):
        * khtml/html/html_tableimpl.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):
        * khtml/rendering/render_style.cpp:
        (m_affectedByAttributeSelectors):
        (RenderStyle::RenderStyle):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::pseudoState):
        (khtml::RenderStyle::setPseudoState):
        (khtml::RenderStyle::affectedByAttributeSelectors):
        (khtml::RenderStyle::setAffectedByAttributeSelectors):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::usesSiblingRules):
        (DOM::DocumentImpl::setUsesSiblingRules):

2004-04-28  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - another step of refinement on the reinterpret_cast stuff; now it's a compile-time
          error if you do it wrong
        - fixed a couple of storage leaks

        * kwq/DOMInternal.h: Added new DOM_cast template function. Like reinterpret_cast, but a
        compile-time error if you use it with the wrong parameters. Also added type-safe versions
        of the wrapper functions that do the DOM_cast automatically.
        * kwq/DOMInternal.mm:
        (getDOMWrapperImpl): Changed name and parameter type as part of above change.
        (addDOMWrapperImpl): Ditto.
        (removeDOMWrapper): Ditto.

        * kwq/DOM.mm: Use the new DOM_cast instead of reinterpret_cast, and the new
        DOM wrapper calls that do the cast automatically.
        * kwq/DOM-CSS.mm: More of the same.
        (-[DOMCSSStyleSheet dealloc]): Added override to deref, fixes leak.
        * kwq/DOMHTML.mm: More of the same.
        (-[DOMHTMLCollection dealloc]): Added override to deref, fixes leak.
        (-[DOMHTMLOptionsCollection dealloc]): Added override to deref, fixes theoretical leak.

2004-04-28  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        - fixed reinterpret_cast mistakes and some style issues in DOM implementation

        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleRule _styleRuleImpl]): Fix broken reinterpret_cast; you must reinterpret_cast back
        to the class you reinterpret_casted from, not to a derived class.
        (-[DOMCSSMediaRule _mediaRuleImpl]): Ditto.
        (-[DOMCSSFontFaceRule _fontFaceRuleImpl]): Ditto.
        (-[DOMCSSPageRule _pageRuleImpl]): Ditto.
        (-[DOMCSSImportRule _importRuleImpl]): Ditto.
        (-[DOMCSSCharsetRule _importRuleImpl]): Ditto.
        * kwq/DOMHTML.mm:
        (-[DOMHTMLOptionsCollection length]): Put in an "unimplemented" version instead of leaving out
        the class implementation altogether.
        (-[DOMHTMLOptionsCollection setLength:]): Ditto.
        (-[DOMHTMLOptionsCollection item:]): Ditto.
        (-[DOMHTMLOptionsCollection namedItem:]): Ditto.
        (+[DOMHTMLElement _elementWithImpl:]): Corrected this implementation. The wrapper must use a
        standard node wrapper, since this is a subclass of DOMNode. Also moved into a separate category
        so it gets checked against the declarations above.
        (-[DOMHTMLElement _HTMLElementImpl]): Fix broken reinterpret_cast.
        (-[DOMHTMLHtmlElement _HTMLHtmlElementImpl]): Ditto.
        (-[DOMHTMLHeadElement _headElementImpl]): Ditto.
        (-[DOMHTMLLinkElement _linkElementImpl]): Ditto.
        (-[DOMHTMLTitleElement _titleElementImpl]): Ditto.
        (-[DOMHTMLMetaElement _metaElementImpl]): Ditto.
        (-[DOMHTMLBaseElement _baseElementImpl]): Ditto.
        (-[DOMHTMLStyleElement _styleElementImpl]): Ditto.
        (-[DOMHTMLBodyElement _bodyElementImpl]): Ditto.
        (-[DOMHTMLFormElement _formElementImpl]): Ditto.
        (+[DOMHTMLFormElement _formElementWithImpl:]): Another DOMNode subclass wrapper fix.
        (-[DOMHTMLIsIndexElement _isIndexElementImpl]): Fix broken reinterpret_cast.
        (-[DOMHTMLSelectElement _selectElementImpl]): Ditto.
        (-[DOMHTMLOptGroupElement _optGroupElementImpl]): Ditto.
        (-[DOMHTMLOptionElement _optionElementImpl]): Ditto.
        (-[DOMHTMLInputElement _inputElementImpl]): Ditto.
        (-[DOMHTMLTextAreaElement _textAreaElementImpl]): Ditto.
        (-[DOMHTMLButtonElement _buttonElementImpl]): Ditto.
        (-[DOMHTMLLabelElement _labelElementImpl]): Ditto.
        (-[DOMHTMLFieldSetElement _fieldSetElementImpl]): Ditto.
        (-[DOMHTMLLegendElement _legendElementImpl]): Ditto.
        (-[DOMHTMLUListElement _uListElementImpl]): Ditto.
        (-[DOMHTMLOListElement _oListElementImpl]): Ditto.
        (-[DOMHTMLDListElement _dListElementImpl]): Ditto.
        (-[DOMHTMLDirectoryElement _directoryListElementImpl]): Ditto.
        (-[DOMHTMLMenuElement _menuListElementImpl]): Ditto.
        (-[DOMHTMLLIElement _liElementImpl]): Ditto.
        (-[DOMHTMLQuoteElement _quoteElementImpl]): Ditto.
        (-[DOMHTMLDivElement _divElementImpl]): Ditto.
        (-[DOMHTMLParagraphElement _paragraphElementImpl]): Ditto.
        (-[DOMHTMLHeadingElement _headingElementImpl]): Ditto.
        (-[DOMHTMLPreElement _preElementImpl]): Ditto.
        (-[DOMHTMLBRElement _BRElementImpl]): Ditto.
        (-[DOMHTMLBaseFontElement _baseFontElementImpl]): Ditto.
        (-[DOMHTMLFontElement _fontElementImpl]): Ditto.
        (-[DOMHTMLHRElement _HRElementImpl]): Ditto.
        (-[DOMHTMLModElement _modElementImpl]): Ditto.
        (-[DOMHTMLAnchorElement _anchorElementImpl]): Ditto.
        (-[DOMHTMLImageElement _imageElementImpl]): Ditto.
        (-[DOMHTMLObjectElement _objectElementImpl]): Ditto.
        (-[DOMHTMLParamElement _paramElementImpl]): Ditto.
        (-[DOMHTMLAppletElement _appletElementImpl]): Ditto.
        (-[DOMHTMLMapElement _mapElementImpl]): Ditto.
        (-[DOMHTMLAreaElement _areaElementImpl]): Ditto.
        (-[DOMHTMLScriptElement _scriptElementImpl]): Ditto.
        (+[DOMHTMLTableCaptionElement _tableCaptionElementWithImpl:]): Another DOMNode subclass wrapper fix.
        (-[DOMHTMLTableCaptionElement _tableCaptionElementImpl]): Fix broken reinterpret_cast.
        (+[DOMHTMLTableSectionElement _tableSectionElementWithImpl:]): Another DOMNode subclass wrapper fix.
        (-[DOMHTMLTableSectionElement _tableSectionElementImpl]): Fix broken reinterpret_cast.
        (+[DOMHTMLTableElement _tableElementWithImpl:]): Another DOMNode subclass wrapper fix.
        (-[DOMHTMLTableElement _tableElementImpl]): Fix broken reinterpret_cast.
        (-[DOMHTMLTableColElement _tableColElementImpl]): Ditto.
        (-[DOMHTMLTableRowElement _tableRowElementImpl]): Ditto.
        (+[DOMHTMLTableCellElement _tableCellElementWithImpl:]): Another DOMNode subclass wrapper fix.
        (-[DOMHTMLTableCellElement _tableCellElementImpl]): Fix broken reinterpret_cast.
        (-[DOMHTMLFrameSetElement _frameSetElementImpl]): Ditto.
        (-[DOMHTMLFrameElement _frameElementImpl]): Ditto.
        (-[DOMHTMLIFrameElement _IFrameElementImpl]): Ditto.
        (-[DOMHTMLEmbedElement _embedElementImpl]): Ditto.

        * kwq/HTMLDOM.mm: Removed.

2004-04-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        * khtml/khtml_part.cpp:
        (KHTMLPart::notifySelectionChanged): Call new postDidChangeSelectionNotification function
        to send Cocoa notification when the selection changes.
        (KHTMLPart::appliedEditing): Call postDidChangeNotification to send Cocoa notification when the document changes
        due to editing.
        (KHTMLPart::unappliedEditing): Ditto.
        (KHTMLPart::reappliedEditing): Ditto.
        * kwq/DOMHTML.mm:
        (-[DOMHTMLDocument _HTMLDocumentImpl]): Fix cast to account for multiple inheritance used by the impl class.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::postDidChangeSelectionNotification): New function. Call the bridge to post the notification.
        (KWQKHTMLPart::postDidChangeNotification): Ditto.
        * kwq/WebCoreBridge.h: Declare new -postDidChangeSelectionNotification and -postDidChangeNotification methods.

2004-04-28  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3636261>: "nil-deref in selectedStylesheetSet iterating through properties in a non-view document"

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::selectedStylesheetSet): Add nil check.
        (DocumentImpl::setSelectedStylesheetSet): Ditto.

2004-04-27  Richard Williamson   <rjw@apple.com>

	<rdar://problem/3564519>: API: please add a way to set the media type for a WebView

        Reviewed by Chris.

        * khtml/khtmlview.cpp:
        (KHTMLView::mediaType):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::overrideMediaType):
        * kwq/WebCoreBridge.h:

2004-04-27  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Make selections draw in a more Cocoa-like way, where
        fully-selected lines draw out to the ends of lines, and
        spaces between lines are drawn with the selection color as well.

        * WebCore-combined.exp: Add _WebCoreInitializeEmptyTextGeometry symbol
        * WebCore.exp: Ditto.
        * khtml/khtml_part.cpp:
        (KHTMLPart::isPointInsideSelection): Marginally-related change. Fix up this function
        so that it works right, given my recent changes to positionForCoordinates. This fix
        "really" fixes the problem. Unlike my attempt to fix yesterday.
        * khtml/rendering/font.cpp:
        (Font::drawHighlightForText): New drawHighlightForText interface which includes extra
        information to draw the selection.
        * khtml/rendering/font.h: Ditto.
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates): Some minor improvements and cleanups to
        make this code work correctly in more cases.
        * khtml/rendering/render_block.h: Remove spurious semi-colon after namespace block.
        * khtml/rendering/render_container.cpp:
        (RenderContainer::positionForCoordinates): Fix typo in comment. Also, clean up
        one unnecessary call to absolutePosition.
        * khtml/rendering/render_image.cpp:
        (RenderImage::paint): Many changes to add the new selection drawing behavior.
        * khtml/rendering/render_inline.cpp:
        (RenderInline::positionForCoordinates): Added to help make selections work right 
        with continuations.
        * khtml/rendering/render_inline.h: Ditto.
        * khtml/rendering/render_object.h: Give zero default argument to inlineBox() helper.
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintSelection): Many changes to add the new selection drawing behavior.
        * kwq/KWQListBox.mm:
        (-[KWQTableView drawRow:clipRect:]): Use new WebCoreTextGeometry struct.
        * kwq/KWQPainter.h: New drawHighlightForText interface which includes extra
        information to draw the selection.
        * kwq/KWQPainter.mm:
        (QPainter::drawText): Use new WebCoreInitializeEmptyTextGeometry struct.
        (QPainter::drawHighlightForText): Use new WebCoreTextGeometry struct.
        * kwq/WebCoreTextRenderer.h: Declare new WebCoreTextGeometry struct.
        * kwq/WebCoreTextRendererFactory.m:
        (WebCoreInitializeEmptyTextGeometry): Initializer for WebCoreTextGeometry struct.

2004-04-27  Richard Williamson   <rjw@apple.com>

	Don't do unnecessary string comparisons when no composite operator is
	specified.  

        Reviewed by Hyatt.

        * kwq/KWQPainter.mm:
        (compositeOperatorFromString):

2004-04-27  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3623694>: "top level <option> and <optgroup> labels look identical in pop-up menus; should not"

        * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
        Call appendGroupLabel instead of appendItem for group labels.

        * kwq/KWQComboBox.h: Added appendGroupLabel, private setControlSize, labelFont, setTitle, _labelFont,
        and make _items a QValueList<KWQListBoxItem> instead of QStringList.
        * kwq/KWQComboBox.mm:
        (QComboBox::QComboBox): Initializes _labelFont to nil.
        (QComboBox::~QComboBox): Release _labelFont.
        (QComboBox::setTitle): Added helper function. Uses an attributed string for group labels, and also sets
        the action to NULL so they are disabled.
        (QComboBox::appendItem): Added isLabel boolean parameter, make KWQListBoxItem, call setTitle.
        (QComboBox::sizeHint): Changed to handle group labels with a separate renderer to measure bolded text.
        (QComboBox::setCurrentItem): Changed to use setTitle helper.
        (QComboBox::setFont): Release _labelFont if control size changed.
        (QComboBox::labelFont): Compute label font lazily.
        (QComboBox::populateMenu): Changed to use setTitle helper.

        * kwq/KWQListBox.h: Removed excess includes, fixed comment.

2004-04-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - follow-on to fix for <rdar://problem/3488892>: "anchor names with non-ASCII characters in them do not work"
        This part fixes anchor names with non-ASCII characters in local files.

        * kwq/KWQKURL.mm: (KURL::KURL): For file and help URLs, force UTF-8 only for the path part of the URL.
        Use the document encoding for the rest of the URL.
        * kwq/KWQTextCodec.h: (operator!=): Added.

2004-04-26  David Hyatt  <hyatt@apple.com>

	Fix for Emerson truncation problem using apple-line-clamp.  Always dirty positioned objects so that they
	will move when the height changes.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::markPositionedObjectsForLayout):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutVerticalBox):

2004-04-26  Richard Williamson   <rjw@apple.com>

	Added support for specifying composite operation on an
	image element.  Attribute name is "composite", possible values
	are:

	clear,
	copy
	source-over
	source-in
	source-out
	source-atop
	destination-over
	destination-in
	destination-out
	destination-atop
	xor
	darker
	highlight
	lighter

	<img composite="source-over" src="triangle.png">
	<img style="position:relative; left:-200px;" composite="destination-in" src="circle.png">

        Reviewed by Ken.

        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::parseHTMLAttribute):
        * khtml/html/html_imageimpl.h:
        (DOM::HTMLImageElementImpl::compositeOperator):
        * khtml/misc/htmlattrs.c:
        (findAttr):
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:
        * khtml/rendering/render_image.cpp:
        (RenderImage::paint):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (compositeOperatorFromString):
        (QPainter::drawPixmap):
        * kwq/WebCoreImageRenderer.h:

2004-04-26  Darin Adler  <darin@apple.com>

        - fixed <rdar://problem/3634145>: "REGRESSION: nil-deref in QTextCodec::toUnicode every time loading page at wiki.wordpress.org"

        * kwq/KWQKURL.mm:
        (KURL::KURL): Simplify check for nil that defaults to UTF-8.
        (KURL::decode_string): Add a similar test here.

2004-04-26  David Hyatt  <hyatt@apple.com>

	Implement the quirk that makes the <body> and <html> size to fill the viewport in quirks mode.  This
	matches WinIE.
	
        Reviewed by john

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcHeight):

2004-04-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Fix for this bug:
        
        <rdar://problem/3633458>: "REGRESSION (125-137): Can't drag a selection unless it starts at beginning of line"

        * khtml/khtml_part.cpp:
        (KHTMLPart::isPointInsideSelection): I flubbed when I converted this
        code to use my new positionForCoordinates helper. I failed to add in
        the passed in values for x and y to the absolute coordinates for the
        clicked node. So, the "unless it starts at beginning of line" behavior 
        is exactly as one would expect.

2004-04-25  David Hyatt  <hyatt@apple.com>

	Eliminate overhangingContents.  This concept was redundant with the overflowHeight mechanism that I
	implemented some time ago, and in fact, it causes us to grovel through much more of the render tree
	than we should when painting.  It turns out that none of the places that used this boolean needed
	to any longer, and so the entire implementation can now be removed from the tree.
	
        Reviewed by mjs, darin

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::addChildToFlow):
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::paint):
        (khtml::RenderBlock::insertPositionedObject):
        * khtml/rendering/render_box.cpp:
        (RenderBox::calcHeight):
        * khtml/rendering/render_image.cpp:
        (RenderImage::setStyle):
        * khtml/rendering/render_inline.cpp:
        (RenderInline::addChildToFlow):
        * khtml/rendering/render_object.cpp:
        (RenderObject::RenderObject):
        (RenderObject::containingBlock):
        (RenderObject::information):
        (RenderObject::dump):
        (RenderObject::nodeAtPoint):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::minMaxKnown):
        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):
        (RenderTable::paint):
        (RenderTableCell::paint):

2004-04-23  David Hyatt  <hyatt@apple.com>

	Fix for 3258403, implement support for min-height and max-height on normal flow elements.  With this patch the
	only min-height/max-height work that remains to be done is for table cells and positioned elements.
	
        Reviewed by darin

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcHeight):
        (RenderBox::calcHeightUsing):
        (RenderBox::calcPercentageHeight):
        * khtml/rendering/render_box.h:
        * layout-tests/fast/block/basic/minheight-expected.txt: Added.
        * layout-tests/fast/block/basic/minheight.html: Added.

2004-04-25  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3633091>: "add overrideMimeType function to XMLHttpRequest"

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty): Add logic to override MIME type if
        OverrideMIMEType was called.
        (KJS::XMLHttpRequestProtoFunc::tryCall): Store the MIME type when overrideMimeType is called.
        * khtml/ecma/xmlhttprequest.h: Add OverrideMIMEType to the XMLHttpRequest property enum,
        and also add a MIMETypeOverride data member to the class.
        * khtml/ecma/xmlhttprequest.lut.h: Regenerated.

2004-04-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3628309>: Fedex tracking page so slow it seems like a hang (site change?)
	<rdar://problem/3608061>: "ATI Developer site so slow it seems like a hang"
	<rdar://problem/3612130>: "Reproducible hang in JavaScript at www.tfl.gov.uk"
	<rdar://problem/3626022>: "Safari was consuming > 100% CPU on dual-G5 Mac, sample shows JavaScript"
	<rdar://problem/3632348>: "www.whatis.com search for "pivot table" leads to JavaScript hang"
	
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::getValueProperty): The "text" property for anchors should be
	innerText, not innerHTML.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::innerText): Make sure not to include all the text after an
	element if it has no children.
        * layout-tests/fast/dom/anchor-text-expected.txt: Added.
        * layout-tests/fast/dom/anchor-text.html: Added.
        * layout-tests/fast/dom/inner-text-expected.txt: Added.
        * layout-tests/fast/dom/inner-text.html: Added.

2004-04-24  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3488892>: "anchor names with non-ASCII characters in them do not work"

        * khtml/khtml_part.h: Add new gotoAnchor helper function, private.
        * khtml/khtml_part.cpp:
        (KHTMLPart::openURL): Call new gotoAnchor helper, since the code is now complex enough
        that I don't want to copy and paste.
        (KHTMLPart::gotoAnchor): Use the pages own encoding when decoding the string for an
        anchor reference when going to an anchor. This matches the behavior of other browsers.
        (KHTMLPart::slotFinishedParsing): Call new gotoAnchor helper.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): Call new gotoAnchor helper.

        * kwq/KWQKURL.h: Removed htmlRef function, and made encodedHtmlRef an inline.
        Removed unused encoding hint parameter from setQuery (it's not a "hint" at all, but we
        don't use it). Added a codec parameter to decode_string.
        * kwq/KWQKURL.mm:
        (hexDigitValue): Added. Helper function.
        (KURL::setQuery): Removed unused parameter.
        (KURL::decode_string): Implemented this function. It needs to use an encoding specified
        by the web page. Also, we wanted to make a version that did not use the
        CFURLCreateStringByReplacingPercentEscapes function anyway.

        * kwq/KWQString.h: Added parameters to copyLatin1. Now you can copy an arbitrary substring.
        * kwq/KWQString.mm: (QString::copyLatin1): Updated implementation to handle the two
        new parameters.

        * WebCore-tests.exp: Updated for change in signature of setQuery and decode_string.
        * WebCore-combined.exp: Regenerated.

2004-04-24  Darin Adler  <darin@apple.com>

        - fixed <rdar://problem/3570953>: "Update "Acknowledgements" to remove expat and possibly include libxml"

        * WebCore.pbproj/project.pbxproj: Removed the part of the copyright notice that was for expat contributors.

2004-04-23  David Hyatt  <hyatt@apple.com>

	Fix the apple-line-clamp values to more closely match what is needed, an even split of the max lines between the possible
	values.

        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutVerticalBox):

2004-04-23  David Hyatt  <hyatt@apple.com>

	Fix to make the containing block percentage height calculation actually work according to the CSS2 spec.
	Percentages other than 100% are now supported, and flexing percentage height blocks inside table cells
	are now supported.

        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcHeight):
        (RenderBox::calcPercentageHeight):
        * khtml/rendering/render_box.h:

2004-04-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        <rdar://problem/3632163>: "REGRESSSION: crash on css home page"

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForRenderer): Add null check.

2004-04-20  David Hyatt  <hyatt@apple.com>

	Fix hiermenu opacity bug.  Make sure to save/restore the graphics state before pushing and popping
	transparency layers, so that alterations to alpha don't accidentally persist.
	
        Reviewed by kocienda

        * kwq/KWQPainter.mm:
        (QPainter::beginTransparencyLayer):
        (QPainter::endTransparencyLayer):

2004-04-20  David Hyatt  <hyatt@apple.com>

	Fix for 3622818, bad rendering on sabernomics.com.  Just eliminate the priority difference between
	4 and 5, and make all of the priority 4 tags the same.  This seems to match other browsers.
	
        Reviewed by kocienda

        * khtml/html/dtd.cpp:

2004-04-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Changed inlineBoxForRenderer(RenderObject *, int) helper that was static 
        in dom_position.cpp into a virtual method on RenderObjects. Function is
        now called inlineBox(int). Functionality unchanged.

        * khtml/rendering/render_br.cpp:
        (RenderBR::inlineBox)
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::caretMaxRenderedOffset)
        (RenderObject::inlineBox)
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::inlineBox)
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_position.cpp:
        (DOM::renderersOnDifferentLine):
        (DOM::nextRenderedEditable)
        (DOM::previousRenderedEditable)
        (DOM::Position::previousLinePosition)
        (DOM::Position::nextLinePosition)
        (DOM::Position::rendersInDifferentPosition)

2004-04-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        * khtml/editing/htmlediting_impl.cpp:
        (DeleteSelectionCommandImpl::doApply): Fix editing test
        regression with deleting whitespace at the end of the line.
        I just made this "improvement" yesterday, and the concept
        of the change is a good one, but instead of short-circuiting
        if the selection after deleting collapsible whitespace is a
        range (which can be confused by "significant" collapsed 
        whitespace at the end of a line), short-circuit if the 
        upstream start position equals the downstream end position.

=== Safari-138 ===

2004-04-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Added some plumbing for applying styles.

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createCSSStyleDeclaration): New factory method.
        * khtml/xml/dom_docimpl.h: Declare the above.
        * kwq/DOM-CSS.mm:
        (-[DOMCSSStyleDeclaration _styleDeclarationImpl]): Expose this in the
        WebCoreInternal category, "promoting" it from being private to the 
        DOM-CSS.mm file.
        * kwq/DOM.mm: Add -(DOMCSSStyleDeclaration *)createCSSStyleDeclaration extension.
        * kwq/DOMExtensions.h: Delcare the above.
        * kwq/DOMInternal.h: Add _styleDeclarationImpl to WebCoreInternal category.

2004-04-23  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3631541>: "repro crash in KHTMLPart::setFocusNodeIfNeeded"

        Reviewed by Maciej.

        * khtml/khtml_part.cpp:
        (KHTMLPart::setFocusNodeIfNeeded):
        added nil check

2004-04-23  Maciej Stachowiak  <mjs@apple.com>

        Back out one of the previous changes, it causes a crash. Whoops!
        
        * kwq/KWQScrollView.mm:
        (QScrollView::addChild):

2004-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	These two tiny changes (made w/ Dave's help) should get us about
	1% or so combined on the HTML iBench.

        * khtml/rendering/render_br.cpp:
        (RenderBR::setStyle): Don't call superclass setStyle, since
	according to Dave we don't need any of the work done in there.
        * kwq/KWQScrollView.mm:
        (QScrollView::addChild): Don't actually move the widget if the x
	coordinate is -500000, since we don't need the initial offscreen
	positioning that KHTML does and it is costly to do.

2004-04-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/editing/htmlediting_impl.cpp:
        (DeleteSelectionCommandImpl::doApply): Short-circuit return if the selection
        is not a range after collapsing whitespace.

2004-04-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        More work to bring code up to date with the latest API proposal.

        * khtml/xml/dom_selection.h: Fix typo in comment.
        * kwq/WebCoreBridge.h: -applyStyle:toElementsInDOMRange: is now applyStyle:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge applyStyle:]): Ditto.

2004-04-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Adds the notion of selection affinity to the editing API, bringing it up to
        date with the latest proposal.

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::Selection): Adds support for selection affinity member variable.
        (DOM::Selection::init): Ditto.
        (DOM::Selection::operator=): Ditto.
        (DOM::Selection::setAffinity): New function.
        (DOM::Selection::layoutCaret): Added comment to indicate that we need to enhance this
        function to handle selection affinity.
        * khtml/xml/dom_selection.h: Added EAffinity enum and m_affinity member variable.
        (DOM::Selection::): Moved the enums above the constructors. No code change.
        (DOM::Selection::affinity): New accessor.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm: Add selection affinity to API declarations as needed.
        (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
        (-[WebCoreBridge selectedDOMRange]): Ditto.
        (-[WebCoreBridge selectionAffinity]): Ditto.

2004-04-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	Preliminary change for conservative GC. Use new "protected"
	subclasses to GC-protect objects when on heap, since we will soon
	remove the built-in refcounting of the normal wrapper classes.
	
        * ForwardingHeaders/kjs/protect.h: Added.
        * khtml/ecma/kjs_binding.h:
        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_traversal.h:
        * khtml/ecma/kjs_window.h:

2004-04-22  Darin Adler  <darin@apple.com>

        * khtml/ecma/kjs_window.cpp: (Window::get): Removed code that gets properties from the parent.
        This was a mistake we inherited from KHTML, and they have long since fixed it.

2004-04-22  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        Ensures caret visibility after making an editing action.

        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::getRepaintRect): Expose this as public.
        * khtml/xml/dom_selection.h: Ditto.
        * kwq/WebCoreBridge.h: Add ensureCaretVisible method.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:]):
        Unrelated crash fix. Null-check baseURLString.
        (-[WebCoreBridge ensureCaretVisible]): Added.

2004-04-21  David Hyatt  <hyatt@apple.com>

	Fix for 3245627, nested tables don't expand vertically.  I actually fixed the basic problem in the
	previous checkin, but this exposed another basic math error where |numVariable| was not being
	decremented properly.  This meant space was mis-allocated when multiple variable height rows both needed
	to expand.

        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):

2004-04-21  David Hyatt  <hyatt@apple.com>

	Fix for 3020449, ensure that the paint order of cells with rowspans matches other browsers.
	
        Reviewed by darin

        * khtml/rendering/render_table.cpp:
        (RenderTableSection::paint):

2004-04-21  David Hyatt  <hyatt@apple.com>

	Remove the (incorrect) restriction on table flexing that required the cell to have a fixed width.  In
	reality, the style on the cell is completely irrelevant.
	
        Reviewed by kocienda

        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):

2004-04-21  David Hyatt  <hyatt@apple.com>

	Make sure cells that get flexed vertically in tables don't check text children when looking for 
	percentage height children.
	
        Reviewed by kocienda

        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):

2004-04-21  David Hyatt  <hyatt@apple.com>

	Fix for hiermenus bug.  Absolutely positioned images should not contribute to their containing block's
	max width.  Make sure to disregard positioned elements when computing min/max width.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::InlineMinMaxIterator::next):

2004-04-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/editing/htmlediting_impl.cpp:
        (DeleteSelectionCommandImpl::doApply): Do not shift ending selection downstream
        when at position zero of a BR. That's just wrong. Simplify code that does
        "onlyWhitespace" delete. No need to handle multiple characters here; we can
        only ever have one thanks to the delete-collapsible-whitespace code.
        (TypingCommandImpl::issueCommandForDeleteKey): Don't do anything if at the
        start of a root editable block. This is a no-op....not an opportunity to crash.
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForRenderer): Return this renderer's element position
        if the passed-in renderer is nil. This helps to make clicking in empty blocks work.
        * khtml/rendering/render_container.cpp:
        (RenderContainer::positionForCoordinates): Fixed typo in comment.
        * khtml/xml/dom_position.cpp:
        (DOM::Position::equivalentLeafPosition): Do not attempt to find a leaf if the
        position's node does not have a renderer, if the renderer has no kids.
        * layout-tests/editing/deleting/delete-br-001-expected.txt: Update expected results for BR fix.
        * layout-tests/editing/deleting/delete-br-003-expected.txt: Ditto.
        * layout-tests/editing/deleting/delete-br-006-expected.txt: Ditto.
        * layout-tests/editing/deleting/delete-br-007.html: Added. New BR test.
        * layout-tests/editing/deleting/delete-br-007-expected.txt: Added.

2004-04-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Added implementations for
        these properties: CSS_PROP_TEXT_DECORATION, CSS_PROP_VERTICAL_ALIGN, CSS_PROP_TEXT_INDENT,
        CSS_PROP_LETTER_SPACING, CSS_PROP_WORD_SPACING, CSS_PROP_LINE_HEIGHT

2004-04-21  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        The Selection class now uses the Position class throughout its public and
        private interface. This replaces the inconsistent use of the Position
        class here and node/offset pairs there. There are no functional changes, only
        updates to the new Selection class API.

        * khtml/ecma/kjs_window.cpp:
        (Selection::get):
        (SelectionFunc::tryCall):
        * khtml/editing/htmlediting_impl.cpp:
        (DeleteCollapsibleWhitespaceCommandImpl::doApply):
        (DeleteSelectionCommandImpl::joinTextNodesWithSameStyle):
        (DeleteSelectionCommandImpl::doApply):
        (InputNewlineCommandImpl::doApply):
        (InputTextCommandImpl::deleteCharacter):
        (InputTextCommandImpl::prepareForTextInsertion):
        (InputTextCommandImpl::execute):
        (PasteMarkupCommandImpl::doApply):
        (TypingCommandImpl::issueCommandForDeleteKey):
        * khtml/khtml_part.cpp:
        (KHTMLPart::findTextNext):
        (KHTMLPart::setFocusNodeIfNeeded):
        (KHTMLPart::notifySelectionChanged):
        (KHTMLPart::isPointInsideSelection):
        (KHTMLPart::handleMouseMoveEventSelection):
        (KHTMLPart::khtmlMouseReleaseEvent):
        (KHTMLPart::selectAll):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection):
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_selection.cpp:
        (DOM::emptyPosition):
        (DOM::Selection::Selection):
        (DOM::Selection::init):
        (DOM::Selection::operator=):
        (DOM::Selection::moveTo):
        (DOM::Selection::modify):
        (DOM::Selection::xPosForVerticalArrowNavigation):
        (DOM::Selection::clear):
        (DOM::Selection::setBase):
        (DOM::Selection::setExtent):
        (DOM::Selection::setBaseAndExtent):
        (DOM::Selection::setStart):
        (DOM::Selection::setEnd):
        (DOM::Selection::setStartAndEnd):
        (DOM::Selection::toRange):
        (DOM::Selection::layoutCaret):
        (DOM::Selection::needsCaretRepaint):
        (DOM::Selection::paintCaret):
        (DOM::Selection::validate):
        (DOM::Selection::moveToRenderedContent):
        (DOM::Selection::nodeIsBeforeNode):
        (DOM::startAndEndLineNodesIncludingNode):
        (DOM::Selection::debugRenderer):
        (DOM::Selection::debugPosition):
        * khtml/xml/dom_selection.h:
        (DOM::Selection::~Selection):
        (DOM::Selection::base):
        (DOM::Selection::extent):
        (DOM::Selection::start):
        (DOM::Selection::end):
        (DOM::Selection::assignBase):
        (DOM::Selection::assignExtent):
        (DOM::Selection::assignBaseAndExtent):
        (DOM::Selection::assignStart):
        (DOM::Selection::assignEnd):
        (DOM::Selection::assignStartAndEnd):
        (DOM::operator==):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::jumpToSelection):
        (KWQKHTMLPart::selectionStartOffset):
        (KWQKHTMLPart::selectionEndOffset):
        (KWQKHTMLPart::selectionStart):
        (KWQKHTMLPart::selectionEnd):
        * kwq/KWQRenderTreeDebug.cpp:
        (writeSelection):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge isSelectionEditable]):
        (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]):
        (-[WebCoreBridge setSelectedDOMRange:]):

2004-04-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Renamed DOMPosition class to Position.
        Renamed KHTMLSelection to Selection and moved to DOM namespace.

        * ForwardingHeaders/xml/dom_selection.h: Added.
        * WebCore.pbproj/project.pbxproj: Go Xcode!
        * khtml/khtml_selection.cpp: Removed.
        * khtml/khtml_selection.h: Removed.
        * khtml/xml/dom_position.cpp: Renamed DOMPosition to Position
        * khtml/xml/dom_position.h: Ditto.
        * khtml/xml/dom_selection.cpp: New home for renamed Selection object.
        * khtml/xml/dom_selection.h: Ditto.

2004-04-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * WebCore.pbproj/project.pbxproj:
        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventDoubleClick): Improved name of expandToElement. Now is expandUsingGranularity.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::handleMouseMoveEventSelection): Ditto.
        * khtml/khtml_selection.cpp:
        (KHTMLSelection::modify): Added support for modifying and extending selection right and left by word.
        Also added support for extending selection up and down.
        (KHTMLSelection::expandUsingGranularity): New name for expandToElement.
        (KHTMLSelection::xPosForVerticalArrowNavigation): Made this function handle cases where we know we
        want to use a particular position for calculating the right x position. We need this to handle
        extending selection up and down, and for setting the caret to the right place when moving up
        and down when a range is already selected.
        (KHTMLSelection::validate): Name tweak. expandTo variable now granularity.
        * khtml/khtml_selection.h: Make declaration changes for changes to cpp file.
        * khtml/misc/helper.cpp:
        (khtml::findWordBoundary): Added this hook for KDE to do their version of KWQFindWordBoundary
        * khtml/misc/helper.h:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates): Factor out closest box finder code to its own function
        * khtml/rendering/render_line.cpp:
        (InlineFlowBox::closestChildForXPos): New function. This is the factored code that was taken out of 
        render_block.cpp.
        (InlineBox::closestLeafChildForXPos): Ditto.
        * khtml/rendering/render_line.h: Ditto.
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::positionForCoordinates): I think I am starting to get how the coordinate transforms work.
        Made some fixups based on this greater sense of enlightenment.
        * khtml/rendering/render_text.cpp:
        (RenderText::positionForCoordinates): Ditto. Fix lastTextBox/firstTextBox code mistake.
        * khtml/xml/dom_position.cpp:
        (DOMPosition::previousWordPosition): Added.
        (DOMPosition::nextWordPosition): Added.
        (DOMPosition::previousLinePosition): No longer use nodeAtPoint. Use new closestLeafChildForXPos instead.
        (DOMPosition::nextLinePosition): Ditto.
        (DOMPosition::inLastEditableInContainingEditableBlock):
        * khtml/xml/dom_position.h:
        * kwq/KWQTextUtilities.cpp: Added.
        (KWQFindWordBoundary): Factored out code that was in a static function in khtml_selection.cpp so 
        that DOMPosition can use it too.
        * kwq/KWQTextUtilities.h: Added.

2004-04-19  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/khtml_part.cpp:
        (KHTMLPart::notifySelectionChanged): Clear the value
        used for maintaining x position when doing vertical arrow
        navigation. WebCoreBridge restores this value when needed. 
        (KHTMLPart::setXPosForVerticalArrowNavigation): New accessor.
        (KHTMLPart::xPosForVerticalArrowNavigation): New accessor.
        * khtml/khtml_part.h:
        (KHTMLPart::): Add NoXPosForVerticalArrowNavigation constant.
        * khtml/khtml_selection.cpp:
        (KHTMLSelection::modify): Add cases for UP and DOWN navigation
        (KHTMLSelection::xPosForVerticalArrowNavigation): New helper.
        * khtml/khtml_selection.h: Add UP and DOWN constants to EDirection enum.
        (KHTMLSelection::):
        * khtml/khtmlpart_p.h: Declare storage for m_xPosForVerticalArrowNavigation, 
        the value used for maintaining x position when doing vertical arrow
        navigation. 
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates): Improved this function to
        handle deficiencies exposed when trying to implement new behavior.
        * khtml/rendering/render_br.cpp:
        (RenderBR::positionForCoordinates): Added implementation of this virtual function.
        * khtml/rendering/render_br.h: Declare implementation for positionForCoordinates virtual function.
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::positionForCoordinates): Improved this function to
        handle deficiencies exposed when trying to implement new behavior.
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::offsetForPosition): Remove left/right "bounds" check here.
        (RenderText::positionForCoordinates): Improved this function to
        handle deficiencies exposed when trying to implement new behavior.
        * khtml/xml/dom_position.cpp:
        (inlineBoxForRenderer): Moved to top of file so all code in the file can see this static function.
        (renderersOnDifferentLine): Ditto.
        (nextRenderedEditable): Ditto.
        (previousRenderedEditable): Ditto.
        (DOMPosition::previousLinePosition): New function. Implements the guts of up/down navigation.
        (DOMPosition::nextLinePosition): Ditto.
        * khtml/xml/dom_position.h: Added declarations for nextLinePosition and previousLinePosition.
        * kwq/WebCoreBridge.h: Add WebSelectUp and WebSelectDown constants.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Handles saving and restoring the 
        x position used for doing vertical arrow navigation.

2004-04-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Added implementations for
        these four properties: CSS_PROP_WHITE_SPACE, CSS_PROP_DISPLAY, CSS_PROP_FLOAT, and CSS_PROP_COLOR.

2004-04-16  Chris Blumenberg  <cblu@apple.com>

	Subresources weren't being archived for LINK tags.

        Reviewed by kocienda.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithOptions): indent tweak
        * kwq/DOMHTML.mm:
        (-[DOMHTMLLinkElement _linkElementImpl]): C+casting voodoo to make methods like rel and href work correctly

2004-04-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::isContentEditable): Call getDocument()->updateRendering() to make sure 
        outstanding changes for this attribute are applied.
        (HTMLElementImpl::contentEditable): Call getDocument()->updateRendering() to make sure 
        outstanding changes for this attribute are applied.
        (HTMLElementImpl::setContentEditable): Call enabled.isEmpty() before strcasecmp(enabled, "true").
        It's cheaper.

2004-04-16  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/editing/htmlediting_impl.cpp: New helper.
        (DeleteSelectionCommandImpl::containsOnlyWhitespace): Fix deleting collapsed whitespace 
        at the end of a line where text has flowed to the next line and the caret is at the 
        beginning of the next line. 
        (DeleteSelectionCommandImpl::doApply): Updated for new helper.
        * khtml/editing/htmlediting_impl.h:
        * layout-tests/editing/deleting/delete-line-end-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-end-ws-001.html: Added.
        * layout-tests/editing/deleting/delete-line-end-ws-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-line-end-ws-002.html: Added.

=== Safari-137 ===

2004-04-16  Richard Williamson   <rjw@apple.com>

	Added an SPI to allow ObjC instances to be easily bound to 
	JS.  This is needed by the dashboard guys for their prototyping.
	Eventually they will use new API.

        Reviewed by Chris.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::bindObject):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge bindObject:withName:]):

2004-04-16  Chris Blumenberg  <cblu@apple.com>

	Added DOMHTMLEmbedElement as a DOM extension since EMBED is represented in our DOM even though its not part of the spec.
	Added all DOMCore and DOMHTML symbols to WebCore's symbols file.
	Removed isSubresourceURLAttribute from dom node. This was only used for the WebArchive feature and all that work is now done in WebKit.

        Reviewed by kocienda.

        * WebCore-combined.exp:
        * WebCore.exp:
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::isURLAttribute): renamed from isSubresourceURLAttribute. As a convenience to subclasses, dom_elementimpl would call isSubresourceURLAttribute in isURLAttribute, but this is no longer done
        (HTMLFrameElementImpl::isURLAttribute): ditto
        (HTMLIFrameElementImpl::isURLAttribute): ditto
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::isURLAttribute): ditto
        * khtml/html/html_formimpl.h:
        * khtml/html/html_headimpl.cpp:
        (HTMLScriptElementImpl::isURLAttribute): ditto
        * khtml/html/html_headimpl.h:
        * khtml/html/html_imageimpl.cpp: 
        (HTMLImageElementImpl::isURLAttribute): ditto
        * khtml/html/html_imageimpl.h:
        * khtml/html/html_objectimpl.cpp:
        (HTMLEmbedElementImpl::isURLAttribute): ditto
        (HTMLObjectElementImpl::isURLAttribute): ditto
        (HTMLParamElementImpl::isURLAttribute): ditto
        * khtml/html/html_objectimpl.h:
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::isURLAttribute): ditto
        (HTMLTableCellElementImpl::isURLAttribute): ditto
        * khtml/html/html_tableimpl.h:
        * khtml/xml/dom2_rangeimpl.cpp:
        (RangeImpl::toHTMLWithOptions): take a node list (see below)
        * khtml/xml/dom2_rangeimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::isURLAttribute):
        * khtml/xml/dom_elementimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithOptions): append copied nodes to a list of nodes so that WebKit can operate on them
        * khtml/xml/dom_nodeimpl.h:
        * kwq/DOM.mm:
        (+[DOMNode _nodeWithImpl:]): added support for HTML types
        * kwq/DOMExtensions.h:
        * kwq/DOMHTML.mm:
        (-[DOMHTMLPreElement setWidth:]):
        (-[DOMHTMLEmbedElement _embedElementImpl]):
        (-[DOMHTMLEmbedElement align]):
        (-[DOMHTMLEmbedElement setAlign:]):
        (-[DOMHTMLEmbedElement height]):
        (-[DOMHTMLEmbedElement setHeight:]):
        (-[DOMHTMLEmbedElement name]):
        (-[DOMHTMLEmbedElement setName:]):
        (-[DOMHTMLEmbedElement src]):
        (-[DOMHTMLEmbedElement setSrc:]):
        (-[DOMHTMLEmbedElement type]):
        (-[DOMHTMLEmbedElement setType:]):
        (-[DOMHTMLEmbedElement width]):
        (-[DOMHTMLEmbedElement setWidth:]):
        (-[DOMHTMLTableElement background]):
        (-[DOMHTMLTableElement setBackground:]):
        (-[DOMHTMLTableCellElement background]): new extension 
        (-[DOMHTMLTableCellElement setBackground:]): ditto
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge nodesFromList:]): new
        (-[WebCoreBridge markupStringFromNode:nodes:]): return a list of nodes instead of subresource URLs so WebKit can operate on the nodes
        (-[WebCoreBridge markupStringFromRange:nodes:]): ditto

2004-04-15  David Hyatt  <hyatt@apple.com>

	Fix for 3624335, bugs with overflow and positioned objects.  The scrollbar didn't properly update
	as you changed the sizes of positioned objects inside an overflow block.
	
        Reviewed by rjw

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutBlock):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateScrollInfoAfterLayout):

2004-04-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave
        
        Improved selection behavior. As part of this work, I removed
        almost all of the checkSelectionPoint() functions, leaving
        only those associated with fonts, and all of the 
        checkSelectionPointIgnoringContinuations() functions. Each
        of these has been replaced by a new function called
        positionForCoordinates(), which returns a DOMPosition.
        
        * WebCore.pbproj/project.pbxproj:
        * khtml/khtml_events.cpp:
        (khtml::MouseEvent::offset): Converted to use positionForCoordinates.
        * khtml/khtml_part.cpp: Ditto.
        (KHTMLPart::isPointInsideSelection):
        (KHTMLPart::handleMousePressEventDoubleClick): Ditto.
        (KHTMLPart::handleMousePressEventTripleClick): Ditto.
        (KHTMLPart::handleMousePressEventSingleClick): Ditto.
        (KHTMLPart::handleMouseMoveEventSelection): Ditto.
        (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
        * khtml/khtml_part.h:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForBox): New helper.
        (khtml::RenderBlock::positionForRenderer): New helper.
        (khtml::RenderBlock::positionForCoordinates): New selection-node-offset-finder method.
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_br.cpp: Removed checkSelectionPointIgnoringContinuations.
        No special behavior is needed for this class anymore.
        * khtml/rendering/render_br.h: Ditoo.
        * khtml/rendering/render_container.cpp:
        (RenderContainer::positionForCoordinates): New selection-node-offset-finder method.
        * khtml/rendering/render_container.h:
        * khtml/rendering/render_line.cpp:
        (InlineBox::firstLeafChild): New helper.
        (InlineBox::lastLeafChild): New helper.
        (InlineFlowBox::firstLeafChild): New helper.
        (InlineFlowBox::lastLeafChild): New helper.
        * khtml/rendering/render_line.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::firstLeafChild): New helper.
        (RenderObject::lastLeafChild): New helper.
        (RenderObject::positionForCoordinates):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::positionForCoordinates): New selection-node-offset-finder method.
        * khtml/rendering/render_replaced.h:
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::offsetForPosition): New helper, replaces checkSelectionPoint()
        (RenderText::positionForCoordinates): New selection-node-offset-finder method.
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_nodeimpl.cpp: Added positionForCoordinates() convenience here. This
        checks to see if the node has a renderer before doing the position check.
        * khtml/xml/dom_nodeimpl.h: Ditto.
        * kwq/DOM.mm:
        (-[DOMNode isContentEditable]): Added this unrelated method, since without it, I crash when dragging an image.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge moveCaretToPoint:]): Converted to use positionForCoordinates.

2004-04-15  David Hyatt  <hyatt@apple.com>

	Fix for 3603455, block truncation support.
	
        Reviewed by kocienda

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/ecma/kjs_css.cpp:
        (cssPropertyName):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::lineCount):
        (khtml::RenderBlock::heightForLineCount):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutHorizontalBox):
        (khtml::RenderFlexibleBox::layoutVerticalBox):
        * khtml/rendering/render_style.cpp:
        (marquee):
        (StyleCSS3NonInheritedData::operator==):
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::lineClamp):
        (khtml::RenderStyle::setLineClamp):
        (khtml::RenderStyle::initialLineClamp):

2004-04-13  Chris Blumenberg  <cblu@apple.com>

	- Removed WebCoreElementIsEditableKey. This functionality is available via [DOMNode isContentEditable].

        Reviewed by rjw.

        * WebCore-combined.exp:
        * WebCore.exp:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]): removed use of WebCoreElementIsEditableKey
        (-[WebCoreBridge URLWithRelativeString:]): new method for WebKit API

2004-04-13  David Hyatt  <hyatt@apple.com>

	Fix for 3559764, make sure overflow is applied consistently using a separate bit on render objects, so that
	the body scroll quirk can easily disable overflow even when it is present on the style.
	
        Reviewed by kocienda

        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::putValue):
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::setStyle):
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::paintObject):
        (khtml::RenderBlock::rightOffset):
        (khtml::RenderBlock::lowestPosition):
        (khtml::RenderBlock::rightmostPosition):
        (khtml::RenderBlock::leftmostPosition):
        (khtml::RenderBlock::isPointInScrollbar):
        (khtml::RenderBlock::nodeAtPoint):
        (khtml::RenderBlock::inRootBlockContext):
        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::overflowHeight):
        (khtml::RenderBlock::overflowWidth):
        * khtml/rendering/render_box.cpp:
        (RenderBox::setStyle):
        (RenderBox::contentWidth):
        (RenderBox::contentHeight):
        (RenderBox::absolutePosition):
        (RenderBox::computeAbsoluteRepaintRect):
        (RenderBox::calcAbsoluteVertical):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutBlock):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::lowestPosition):
        (RenderFlow::rightmostPosition):
        (RenderFlow::leftmostPosition):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateLayerPosition):
        (RenderLayer::updateScrollInfoAfterLayout):
        (RenderLayer::intersectsDamageRect):
        (RenderLayer::containsPoint):
        * khtml/rendering/render_object.cpp:
        (RenderObject::RenderObject):
        (RenderObject::requiresLayer):
        (RenderObject::clientWidth):
        (RenderObject::clientHeight):
        (RenderObject::scrollWidth):
        (RenderObject::scrollHeight):
        (RenderObject::setStyle):
        (RenderObject::absolutePosition):
        (RenderObject::nodeAtPoint):
        (RenderObject::avoidsFloats):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::hasOverflowClip):
        (khtml::RenderObject::hasAutoScrollbars):
        (khtml::RenderObject::scrollsOverflow):
        (khtml::RenderObject::includeScrollbarSize):
        (khtml::RenderObject::setHasOverflowClip):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::overflow):
        (khtml::RenderStyle::isDisplayReplacedType):
        (khtml::RenderStyle::isDisplayInlineType):
        * khtml/rendering/render_table.cpp:
        (RenderTable::setStyle):
        (RenderTableCell::setStyle):
        (RenderTableCell::requiresLayer):
        * khtml/rendering/render_table.h:

2004-04-12  David Hyatt  <hyatt@apple.com>

	Fix for 3556036, make sure that when the position changes via style that all render layer
	descendants simply immediately repaint.
	
        Reviewed by kocienda
	
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::repaintIncludingDescendants):
        * khtml/rendering/render_layer.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):

2004-04-12  Chris Blumenberg  <cblu@apple.com>

	- Fixed build failure by removing references to WebArchive in WebCore.
	- For HTML copy/paste, relative URLs are now made absolute at paste time instead of at copy time. This allows relative URLs to be kept relative if the destination page has the same base URL as the source page.

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (PasteMarkupCommand::PasteMarkupCommand): take the base URL of the clipping
        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting_impl.cpp:
        (PasteMarkupCommandImpl::PasteMarkupCommandImpl): take the base URL of the clipping
        (PasteMarkupCommandImpl::doApply): if we have a base URL and it is different than the base URL of the document, fix the URLs in the new DOM tree
        * khtml/editing/htmlediting_impl.h:
        * khtml/xml/dom2_rangeimpl.cpp:
        (RangeImpl::toHTMLWithOptions): removed completeURLs param
        * khtml/xml/dom2_rangeimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithOptions): removed completeURLs param
        (NodeImpl::recursive_toHTML): ditto
        (NodeImpl::recursive_completeURLs): new
        * khtml/xml/dom_nodeimpl.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge markupStringFromNode:subresourceURLStrings:]): call recursive_toHTML with less params
        (-[WebCoreBridge markupStringFromRange:subresourceURLStrings:]): ditto
        (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:]): take a base URL

2004-04-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave

        Added execCommand support for cut/copy/paste.
        
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::execCommand): Added cut/copy/paste atoms and added else if cases
        for the commands.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::issueCutCommand): Glue for calling from WebCore to do a cut in Cocoa.
        (KWQKHTMLPart::issueCopyCommand): Same as above, but for copy.
        (KWQKHTMLPart::issuePasteCommand): Same as above, but for paste.
        * kwq/WebCoreBridge.h: Declared issueCutCommand, issueCopyCommand, and issuePasteCommand
        to be implemented on the WebKit side of the bridge.
        * layout-tests/editing/editing.js: Added cut/copy/paste support to js library to support
        making layout tests.
        * layout-tests/editing/pasteboard/copy-paste-text-001-expected.txt: Added.
        * layout-tests/editing/pasteboard/copy-paste-text-001.html: Added.
        * layout-tests/editing/pasteboard/cut-paste-text-002-expected.txt: Added.
        * layout-tests/editing/pasteboard/cut-paste-text-002.html: Added.
        * layout-tests/editing/pasteboard/cut-text-001-expected.txt: Added.
        * layout-tests/editing/pasteboard/cut-text-001.html: Added.

2004-04-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Some delete and insert cleanups.

        * khtml/editing/htmlediting_impl.cpp:
        (DeleteSelectionCommandImpl::doApply): For ending position case 1,
        the caret should be placed before the first child of the containing block, 
        not before the containing block itself. Also, add some code to handle
        converting nbsp's back to regular spaces. This will need to be improved
        some day to convert only nbsp's added by the editor to make rendering come out right.
        (InputTextCommandImpl::execute): 
        (TypingCommandImpl::issueCommandForDeleteKey): Make deleting collapsible whitespace part 
        of the work of deleting a selection, rather than something that needs to be done by a 
        user of DeleteSelectionCommandImpl. This makes it impossible to leave out
        this essential step.
        (TypingCommandImpl::deleteKeyPressed): We can't use a possible optimization here until 
        the code to do deletions properly has been factored better. Big FIXME added.
        * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Updated for
        ending position case 1 behavior change.
        * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Ditto. 
        * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Ditto.

2004-04-09  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Added support for methods added to flesh out the WebKit 
        editing API.

        * khtml/khtml_part.h: Removed pasteMarkupString and deleteSelection functions.
        All this work is now done in WebCoreBridge.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge isSelectionEditable]): Added a FIXME.
        (-[WebCoreBridge setDrawsBackground:]): Moved this since CVS merged this in the
        middle of editing code.
        (-[WebCoreBridge replaceSelectionWithNode:]): New method.
        (-[WebCoreBridge replaceSelectionWithText:]): Replaces insertText:
        (-[WebCoreBridge replaceSelectionWithMarkupString:]): New method.
        (-[WebCoreBridge replaceSelectionWithWebArchive:]): New method.
        (-[WebCoreBridge replaceSelectionWithNewline]): Replaces insertNewline:
        (-[WebCoreBridge deleteSelection]): New method.
        (-[WebCoreBridge applyStyle:toElementsInDOMRange:]): New method.

2004-04-09  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - added "transparent mode"

        * khtml/khtmlview.h: Added isTransparent and setTransparent functions.
        * khtml/khtmlview.cpp:
        (KHTMLViewPrivate::KHTMLViewPrivate): Initialize isTransparent to false.
        (KHTMLView::isTransparent): Return isTransparent.
        (KHTMLView::setTransparent): Set isTransparent.

        * khtml/rendering/render_box.cpp:
        (RenderBox::paintRootBoxDecorations): Use slow repaints for the top frame when the view
        is transparent; also don't draw a background. This is the same thing we do for subframes.
        (RenderBox::paintBackgroundExtended): Don't do the extra draw so we can blend with the
        background color for the top frame when the view is transparent.
        * khtml/rendering/render_canvas.cpp: (RenderCanvas::paintBoxDecorations): More of the same.

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::paint): Make "fill with red" debug mode work only
        when the view is not transparent.

        * kwq/WebCoreBridge.h: Added setDrawsBackground: method.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge setDrawsBackground:]): If told NO
        (don't draw background), then set isTransparent to true on the KHTMLView.

2004-04-09  Ken Kocienda  <kocienda@apple.com>

        Added one more layout test for editing.

        * layout-tests/editing/deleting/delete-3608445-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3608445-fix.html: Added.

2004-04-08  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	Changed things so that newly created objects get a prototype based
	on the scope chain of the current function, rather than the
	interpreter that started execution. This fixes the following bugs:
	
	<rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
        <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)

	* khtml/ecma/kjs_binding.h:
        (KJS::cacheDOMObject):
        (KJS::cacheGlobalObject):
        * khtml/ecma/kjs_css.cpp:
        (KJS::getDOMStyleSheet):
        (KJS::getDOMStyleSheetList):
        (KJS::getDOMCSSValue):
        * khtml/ecma/kjs_dom.cpp:
        (KJS::getDOMDocumentNode):
        (KJS::getDOMNode):
        * khtml/ecma/kjs_events.cpp:
        (KJS::getDOMEvent):
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):
        (KJS::HTMLDocument::putValue):
        (KJS::getSelectHTMLCollection):
        * khtml/ecma/kjs_navigator.cpp:
        (Navigator::Navigator):
        (PluginBase::PluginBase):
        * khtml/ecma/kjs_window.cpp:
        (KJS::History::History):
        (KJS::FrameArray::FrameArray):
        (Screen::Screen):
        (Window::retrieveActive):
        (Window::put):
        (Window::isSafeScript):
        (WindowFunc::tryCall):
        (Location::put):
        (LocationFunc::tryCall):

2004-04-09  David Hyatt  <hyatt@apple.com>

	Fix for 3613081, repaint glitches when using overflow:auto/overlay.
	
        Reviewed by john

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateScrollInfoAfterLayout):

2004-04-09  David Hyatt  <hyatt@apple.com>

	Fix for 3608445, garbage characters rendered after doing delete.  Delta was unsigned when it was supposed to
	be signed, since deletion involves a negative delta.  Also had an off-by-one error in the line break end check.
	
        Reviewed by john

        * khtml/rendering/render_text.cpp:
        (RenderText::setTextWithOffset):

2004-04-09  Ken Kocienda  <kocienda@apple.com>

        Added two more layout tests for editing.

        * layout-tests/editing/selection/move-between-blocks-no-001-expected.txt: Added.
        * layout-tests/editing/selection/move-between-blocks-no-001.html: Added.
        * layout-tests/editing/selection/move-between-blocks-yes-001-expected.txt: Added.
        * layout-tests/editing/selection/move-between-blocks-yes-001.html: Added.

2004-04-09  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave
        
        Small collection of editing improvements.

        * ChangeLog:
        * khtml/editing/htmlediting_impl.cpp:
        (shouldDeleteUpstreamPosition): This was deleting significant spaces on preceding
        lines when the caret was at the start of a line. Fixed. 
        (DeleteSelectionCommandImpl::doApply): Fixed a case where caret jumped to previous
        line when deleting a character at the start of a line after a BR.
        (InputNewlineCommandImpl::doApply): Handle more cases correctly. Previously, this
        only handled inserting a newline when the caret was already in a text node.
        (InputTextCommandImpl::prepareForTextInsertion): Ditto.
        (InputTextCommandImpl::execute): Ditto.
        * khtml/editing/htmlediting_impl.h:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::checkSelectionPointIgnoringContinuations): Now can place caret
        with a click in an empty block.
        * khtml/rendering/render_block.h: Added checkSelectionPointIgnoringContinuations declaration.
        * khtml/rendering/render_replaced.cpp: 
        (RenderReplaced::checkSelectionPointIgnoringContinuations): Now can place caret with a click 
        on a replaced element.
        * khtml/rendering/render_replaced.h: Added checkSelectionPointIgnoringContinuations declaration.
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::checkSelectionPoint): Now can place caret with a click in text on a line made "tall"
        by an image on the same line.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createEditingTextNode): This creates a text node subclass that whill always create
        a renderer for itself.
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_position.cpp:
        (DOMPosition::isLastRenderedPositionInEditableBlock): Improved code to handle more cases.
        * khtml/xml/dom_textimpl.cpp:
        (TextImpl::TextImpl): Rolled out m_rendererIsNeeded flag.
        (TextImpl::rendererIsNeeded): Ditto.
        (EditingTextImpl::EditingTextImpl): New class.
        (EditingTextImpl::~EditingTextImpl): New.
        (EditingTextImpl::rendererIsNeeded): New. Always returns true.
        * khtml/xml/dom_textimpl.h: New EditingTextImpl class.
        * layout-tests/editing/deleting/delete-3608430-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3608430-fix.html: Added.
        * layout-tests/editing/deleting/delete-3608462-fix-expected.txt: Added.
        * layout-tests/editing/deleting/delete-3608462-fix.html: Added.
        * layout-tests/editing/deleting/delete-trailing-ws-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-trailing-ws-002.html: Added.

2004-04-08  Chris Blumenberg  <cblu@apple.com>

	Renamed the PasteHTMLCommand to PasteMarkupCommand. Removed PasteImageCommand because we will use PasteMarkupCommand for pasting images.

        Reviewed by kocienda.

        * ChangeLog:
        * khtml/editing/htmlediting.cpp:
        (PasteMarkupCommand::PasteMarkupCommand):
        (PasteMarkupCommand::~PasteMarkupCommand):
        (PasteMarkupCommand::impl):
        (PasteMarkupCommand::markupString):
        * khtml/editing/htmlediting.h:
        (khtml::):
        * khtml/editing/htmlediting_impl.cpp:
        (PasteMarkupCommandImpl::PasteMarkupCommandImpl):
        (PasteMarkupCommandImpl::~PasteMarkupCommandImpl):
        (PasteMarkupCommandImpl::commandID):
        (PasteMarkupCommandImpl::doApply):
        * khtml/editing/htmlediting_impl.h:
        (khtml::PasteMarkupCommandImpl::markupString):
        * khtml/khtml_part.cpp:
        (KHTMLPart::pasteMarkupString):
        * khtml/khtml_part.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge pasteMarkupString:]):


2004-04-08  David Hyatt  <hyatt@apple.com>

	Fix for 3608430 and 3608462, crashes in findNextLineBreak when deleting.  Make sure that the removal of line boxes
	always checks the previous root line box's line break information and dirties the line if it is pointing
	to the deleted object.
	
        Reviewed by kocienda

        * khtml/rendering/render_line.cpp:
        (InlineFlowBox::removeChild):

2004-04-08  Chris Blumenberg  <cblu@apple.com>

	Removed DOMExtensions.h from DOM.h until it is public.

        Reviewed by koicienda.

        * kwq/DOM.h:

2004-04-07  Chris Blumenberg  <cblu@apple.com>

	WebCore side for supporting WebDOMOperations.	

        Reviewed by rjw.

        * WebCore-combined.exp:
        * WebCore.exp:
        * kwq/DOM.mm:
        * kwq/DOMExtensions.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (+[WebCoreBridge bridgeForDOMDocument:]): new
        (-[WebCoreBridge imageForImageElement:]): new

2004-04-07  Darin Adler  <darin@apple.com>

        Reviewed by Chris.

        * kwq/DOMCSS.h: Changed DOMCSS2Properties to be a category on DOMCSSStyleDeclaration
        (after API review, oops!, but I doubt anyone will even notice).
        * kwq/DOM-CSS.mm: Implemented the entire DOMCSS2Properties category.

2004-04-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge _stringWithDocumentTypeStringAndMarkupString:]): Do not add a newline in between
        the doctype and the content. The newline was showing up when the content was pasted.

2004-04-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Removed concept of currentSelection from EditCommands and refined concept of
        startingSelection and endingSelection, making them work more sensibly in the 
        system of composed editing commands.

        * khtml/editing/htmlediting.cpp: Removed currentSelection().
        * khtml/editing/htmlediting.h: Ditto.
        * khtml/editing/htmlediting_impl.cpp: currentSelection().
        (CompositeEditCommandImpl::applyCommandToComposite): Set the startingSelection 
        and endingSelection for the command being applied to the endingSelection of
        its new parent. This is the proper starting and ending point.
        (CompositeEditCommandImpl::deleteSelection): Changed call to currentSelection
        to endingSelection.
        (DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl): Ditto.
        (DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): Changed call from startingSelection
        to endingSelection.
        (DeleteSelectionCommandImpl::joinTextNodesWithSameStyle): Changed call to currentSelection
        to endingSelection.
        (InputNewlineCommandImpl::doApply): Ditto.
        (InputTextCommandImpl::deleteCharacter): Ditto.
        (InputTextCommandImpl::prepareForTextInsertion): Ditto.
        (InputTextCommandImpl::execute): Ditto.
        (PasteHTMLCommandImpl::doApply): Ditto.
        (TypingCommandImpl::insertText): Remove extraneous call to reset endingSelection. This has
        already been done by the helpers this command uses to do its work.
        (TypingCommandImpl::issueCommandForDeleteKey): Changed call to currentSelection
        to endingSelection.
        (TypingCommandImpl::deleteKeyPressed): Remove extraneous call to reset endingSelection. This has
        already been done by the helpers this command uses to do its work.
        * khtml/editing/htmlediting_impl.h:
        (khtml::EditCommandImpl::endingSelection): Remove extraneous call to reset endingSelection. This has
        already been done by the helpers this command uses to do its work.

2004-04-07  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
        
        Make paste work again. It has been broken for some undetermined
        period of time.

        * khtml/editing/htmlediting_impl.cpp:
        (CompositeEditCommandImpl::insertNodeAt): Handle inserting a node when
        the reference node has children, or is an empty block.
        (CompositeEditCommandImpl::inputText): New convenience to create and
        apply an InputTextCommand.
        (InputTextCommandImpl::execute): Collapse whitespace when selection is
        not a range. Deleting the selection when it is a range already does that, 
        so no need to make special accommodation for it.
        (PasteHTMLCommandImpl::PasteHTMLCommandImpl): Initialize m_HTMLString using 
        an initialization list.
        (PasteHTMLCommandImpl::doApply): Collapse whitespace.... as above for 
        InputTextCommandImpl::execute. Don't need to qualify NodeImpl's with DOM 
        namespace. Clean up selection access; no need to grep around for it, the
        desired selection is returned by calling currentSelection(). Treat "simple
        text paste" like typing. Tighten up and simplify HTML fragment paste; no
        real change in algorithm. 
        (SplitTextNodeCommandImpl::SplitTextNodeCommandImpl): m_text1 member variable
        not initialized. This bug was introduced by a recent change by me. Fixing now.
        * khtml/editing/htmlediting_impl.h: Add inputText() declaration.

2004-04-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): Now calls setFocusNodeIfNeeded.
        (KHTMLPart::takeSelectionFrom): Now calls setFocusNodeIfNeeded.
        (KHTMLPart::clearSelection): Now calls setFocusNodeIfNeeded.
        (KHTMLPart::invalidateSelection): Now calls setFocusNodeIfNeeded.
        (KHTMLPart::setSelectionVisible): Now calls setFocusNodeIfNeeded.
        (KHTMLPart::setFocusNodeIfNeeded): New function focuses first element 
        of a selection that is contenteditable, if any of the nodes are. The "first"
        determination is made by doing a document-order search.
        * khtml/khtml_part.h:
        * khtml/xml/dom_nodeimpl.cpp: Remove debug spam.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setSelectedDOMRange:]): Now updates document layout before
        setting the selection. This was needed for Blot, so that setting the 
        contenteditable attribute on the body is "seen" when the attempt is made
        to set the selection right immediately after.

2004-04-06  David Hyatt  <hyatt@apple.com>

	After columns have been expanded to their preferred sizes, if space is left over in the table, then
	fixed columns should expand to fill space before percentage width columns do.  The old code had it
	backwards.
	
        Reviewed by john

        * khtml/rendering/table_layout.cpp:
        (AutoTableLayout::layout):

2004-04-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave

        * khtml/dom/dom_node.cpp:
        (Node::isContentEditable): Added. Calls through to impl function of same name.
        * khtml/dom/dom_node.h: Added isContentEditable declaration.
        * khtml/khtmlview.cpp:
        (KHTMLView::viewportMouseMoveEvent): Now, the cursor will change
        to an i-beam whenever it is over a node that is contenteditable, and nothing, 
        like a link, takes precedence.

2004-04-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave

        * khtml/css/html4.css: Refine focus rules so that HTML and BODY
        elements do not draw a focus ring around themselves when focused.
        This prevents a silly-looking focus ring from drawing around a 
        document's entire contents when a body element is contenteditable.

2004-04-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave

        Caret height is now the height of the tallest element on the line,
        mimicking NSText behavior.

        * khtml/rendering/render_box.cpp:
        (RenderBox::caretPos): Use root line box topOverflow and bottomOverflow 
        for the calculation of caret height.
        * khtml/rendering/render_text.cpp:
        (RenderText::caretPos): Ditto.

2004-04-06  Ken Kocienda  <kocienda@apple.com>

        Added a new suite of layout tests for editing, all added
        in the new layout-tests/editing subtree.

        * layout-tests/editing/abe.jpg: Added.
        * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-contents-001.html: Added.
        * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-contents-002.html: Added.
        * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-contents-003.html: Added.
        * layout-tests/editing/deleting/delete-br-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-001.html: Added.
        * layout-tests/editing/deleting/delete-br-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-002.html: Added.
        * layout-tests/editing/deleting/delete-br-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-003.html: Added.
        * layout-tests/editing/deleting/delete-br-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-004.html: Added.
        * layout-tests/editing/deleting/delete-br-005-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-005.html: Added.
        * layout-tests/editing/deleting/delete-br-006-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-006.html: Added.
        * layout-tests/editing/deleting/delete-character-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-character-001.html: Added.
        * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-contiguous-ws-001.html: Added.
        * layout-tests/editing/deleting/delete-image-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-image-001.html: Added.
        * layout-tests/editing/deleting/delete-image-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-image-002.html: Added.
        * layout-tests/editing/deleting/delete-image-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-image-003.html: Added.
        * layout-tests/editing/deleting/delete-leading-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-leading-ws-001.html: Added.
        * layout-tests/editing/deleting/delete-selection-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-selection-001.html: Added.
        * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-trailing-ws-001.html: Added.
        * layout-tests/editing/editing.js: Added.
        * layout-tests/editing/inserting/typing-001-expected.txt: Added.
        * layout-tests/editing/inserting/typing-001.html: Added.
        * layout-tests/editing/inserting/typing-002-expected.txt: Added.
        * layout-tests/editing/inserting/typing-002.html: Added.
        * layout-tests/editing/inserting/typing-around-br-001-expected.txt: Added.
        * layout-tests/editing/inserting/typing-around-br-001.html: Added.
        * layout-tests/editing/inserting/typing-around-image-001-expected.txt: Added.
        * layout-tests/editing/inserting/typing-around-image-001.html: Added.
        * layout-tests/editing/selection/extend-by-character-001-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-001.html: Added.
        * layout-tests/editing/selection/extend-by-character-002-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-002.html: Added.
        * layout-tests/editing/selection/extend-by-character-003-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-003.html: Added.
        * layout-tests/editing/selection/extend-by-character-004-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-004.html: Added.
        * layout-tests/editing/selection/extend-by-character-005-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-005.html: Added.
        * layout-tests/editing/selection/move-by-character-001-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-001.html: Added.
        * layout-tests/editing/selection/move-by-character-002-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-002.html: Added.
        * layout-tests/editing/selection/move-by-character-003-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-003.html: Added.
        * layout-tests/editing/selection/move-by-character-004-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-004.html: Added.
        * layout-tests/editing/selection/move-by-character-005-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-005.html: Added.
        * layout-tests/editing/undo/redo-typing-001-expected.txt: Added.
        * layout-tests/editing/undo/redo-typing-001.html: Added.
        * layout-tests/editing/undo/undo-typing-001-expected.txt: Added.
        * layout-tests/editing/undo/undo-typing-001.html: Added.

2004-04-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave

        Added execCommand feature. 
        Added Javascript selection object.
        This lays the groundwork for layout tests for editing.

        * khtml/dom/dom_doc.cpp:
        (DOM::Document::execCommand): Added. Calls through to impl's execCommand.
        * khtml/dom/dom_doc.h: Added execCommand declaration.
        * khtml/ecma/kjs_dom.cpp:
        (DOMDocumentProtoFunc::tryCall): Switch on new ExecCommand constant and call through to the document.
        * khtml/ecma/kjs_dom.h: Added ExecCommand constant.
        (KJS::DOMDocument::):
        * khtml/ecma/kjs_dom.lut.h: Generated file.
        * khtml/ecma/kjs_window.cpp:
        (Window::Window): Initialize selection object.
        (Window::selection): Return window's selection object.
        (Window::mark): Mark selection object.
        (WindowFunc::tryCall): Return selection object on GetSelection.
        (LocationFunc::tryCall): Added.
        (Selection::Selection): Added.
        (Selection::~Selection): Added.
        (Selection::get): Added.
        (Selection::put): Added.
        (Selection::toPrimitive): Added.
        (Selection::toString): Added.
        (SelectionFunc::tryCall): Added.
        * khtml/ecma/kjs_window.h:
        (KJS::Selection::): Added.
        (KJS::Selection::part): Added.
        (KJS::Selection::classInfo): Added.
        * khtml/ecma/kjs_window.lut.h: Generated file.
        * khtml/editing/htmlediting_impl.cpp:
        (debugPosition): Debugging aid.
        (DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Move the ending position
        if you are about to delete it. Fixes a crasher I discovered while writing tests.
        (DeleteSelectionCommandImpl::doApply): Move to containing editable block position 0
        instead of 1 in a block in delete case 1.
        (InputTextCommandImpl::prepareForTextInsertion):
        (TypingCommandImpl::issueCommandForDeleteKey):
        * khtml/khtml_part.h:
        * khtml/khtml_selection.cpp:
        (KHTMLSelection::validate): Now adjusts the selection down to leaf nodes if needed.
        (KHTMLSelection::debugPosition): Debugging aid.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::execCommand): Added. Supports five different commands.
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::previousEditable): Use false instead of 0 for equality check.
        (NodeImpl::nextEditable): Ditto.
        * khtml/xml/dom_position.cpp:
        (DOMPosition::equivalentLeafPosition): New function
        (DOMPosition::previousRenderedEditablePosition): New function
        (DOMPosition::nextRenderedEditablePosition): New function
        (DOMPosition::equivalentUpstreamPosition): Refined behavior to handle more cases correctly.
        (DOMPosition::equivalentDownstreamPosition): Ditto.
        (DOMPosition::atStartOfContainingEditableBlock):New function
        (DOMPosition::atStartOfRootEditableBlock):New function
        * khtml/xml/dom_position.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::issueUndoCommand): New function for calling undo programatically.
        (KWQKHTMLPart::issueRedoCommand): Ditto, but for redo.
        * kwq/KWQRenderTreeDebug.cpp:
        (nodePositionRelativeToRoot): New function to generate log information for the selection.
        (writeSelection): Writes the selection if there is one.
        (externalRepresentation): Calls writeSelection
        * kwq/WebCoreBridge.h: New declarations for issueUndoCommand and issueRedoCommand.

2004-04-05  Darin Adler  <darin@apple.com>

        * khtml/html/kentities.gperf: Added &COPY; and &REG;, both supported by Gecko
        (and presumably by WinIE). Also re-sorted the list.
        * khtml/html/kentities.c: Regenerated.

2004-04-05  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - rolled over fix from KHTML tree; anchor inside another anchor

        * khtml/rendering/render_layer.cpp: (RenderLayer::nodeAtPoint):
        Make sure the URL element is the innermost one, by not setting it once
        it's already set.

2004-04-05  David Hyatt  <hyatt@apple.com>

	Implement overflow: overlay so that a scrollbar can show/hide without causing a layout.
	
        Reviewed by darin

        * ChangeLog:
        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::rightOffset):
        * khtml/rendering/render_box.cpp:
        (RenderBox::contentWidth):
        (RenderBox::contentHeight):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateScrollInfoAfterLayout):
        * khtml/rendering/render_object.cpp:
        (RenderObject::clientWidth):
        (RenderObject::clientHeight):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::hasAutoScrollbars):
        (khtml::RenderStyle::scrollsOverflow):
        (khtml::RenderStyle::includeScrollbarSize):

2004-04-03  David Hyatt  <hyatt@apple.com>

	Implementation of <input type=range>, which makes sliders available in Web pages.
	
        Reviewed by john

        * WebCore.pbproj/project.pbxproj:
        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty):
        (DOMNode::putValue):
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMNode::):
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::):
        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::setType):
        (HTMLInputElementImpl::type):
        (HTMLInputElementImpl::click):
        (HTMLInputElementImpl::accessKeyAction):
        (HTMLInputElementImpl::parseHTMLAttribute):
        (HTMLInputElementImpl::rendererIsNeeded):
        (HTMLInputElementImpl::createRenderer):
        (HTMLInputElementImpl::encoding):
        * khtml/html/html_formimpl.h:
        (DOM::HTMLInputElementImpl::):
        * khtml/misc/htmlattrs.c:
        (hash_attr):
        (findAttr):
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::slotTextChanged):
        (:RenderFormElement):
        (RenderSlider::calcMinMaxWidth):
        (RenderSlider::updateFromElement):
        (RenderSlider::slotSliderValueChanged):
        * khtml/rendering/render_form.h:
        (khtml::RenderSlider::element):
        (khtml::RenderSlider::renderName):
        (khtml::RenderSlider::canHaveIntrinsicMargins):
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId):
        (EventImpl::idToType):
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::):
        * kwq/KWQSlider.h: Added.
        * kwq/KWQSlider.mm: Added.
        (-[KWQSlider initWithQSlider:]):
        (-[KWQSlider slide:]):
        (m_val):
        (QSlider::setFont):
        (QSlider::sizeHint):
        (QSlider::setValue):
        (QSlider::setMinValue):
        (QSlider::setMaxValue):
        (QSlider::value):
        (QSlider::minValue):
        (QSlider::maxValue):
        (QSlider::sliderValueChanged):
        (QSlider::dimensions):
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot):
        (KWQSlot::call):

2004-04-05  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3612580>: SPI: WebPlugin selection

        Reviewed by kocienda.

        * WebCore.pbproj/project.pbxproj:
        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::setSelectionState): new override, calls QWidget::setIsSelected
        * khtml/rendering/render_replaced.h:
        (khtml::RenderWidget::selectionState): new override
        * kwq/KWQWidget.h:
        * kwq/KWQWidget.mm:
        (QWidget::setIsSelected): new, calls [WebCoreBridge setIsSelected:forView:]
        (QWidget::isSelected): new, calls [WebCoreBridge isViewSelected:]
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge selectionColor]): new

2004-04-03  David Hyatt  <hyatt@apple.com>

	Fix for 3601728, text overlaps borders at ejai.org.  Remove all the code in addForbidden for
	dir, menu, nobr, and pre that made them too restrictive regarding what child tags they could
	contain.
	
        Reviewed by kocienda

        * khtml/html/dtd.cpp:
        (DOM::addForbidden):
        (DOM::removeForbidden):

2004-04-02  Chris Blumenberg  <cblu@apple.com>

	Moved the DOM extensions to their own headers

        Reviewed by kocienda.

        * WebCore.pbproj/project.pbxproj:
        * kwq/DOM.h: include DOMExtensions.h
        * kwq/DOMExtensions.h: Added.
        * kwq/DOMHTML.h: moved extensions to DOMExtensions.h
        * kwq/DOMHTML.mm: Renamed to match header

2004-04-02  David Hyatt  <hyatt@apple.com>

	Fix for 3610662, rendering sometimes doesn't update in response to mouse events that change style.
	The document changed list was getting messed up.
	
        Reviewed by darin

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateDocumentsRendering):
        * khtml/xml/dom_docimpl.h:

=== Safari-135 ===

2004-04-01  Darin Adler  <darin@apple.com>

        Based on a fix by Eric Albert.

        - fixed <rdar://problem/3594247>: Safari crashes when a background image has a height or width of 0

        * khtml/rendering/render_box.cpp: (RenderBox::paintBackgroundExtended):
        Change code path so we don't mod with 0.

2004-04-01  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3608305>: DEMO: menu in search field has one disabled item: localized string not found

        * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::HTMLInputElementImpl):
        Initialize m_maxResults to 0.

2004-04-01  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - cleaned up image map code and made it work with XML documents

        * khtml/html/html_documentimpl.h: Removed getMap and mapMap.
        * khtml/html/html_documentimpl.cpp: Removed getMap; moved to base class.

        * khtml/html/html_imageimpl.cpp:
        (HTMLMapElementImpl::~HTMLMapElementImpl): Call new removeImageMap function instead
        of manipulating the mapMap field directly.
        (HTMLMapElementImpl::parseHTMLAttribute): Rewrite name changing code for simplicity
        and to avoid running off the end of the bufffer.
        Also remove image map before changing name so it doesn't end up in the map twice
        under both the old and new names.
        * khtml/html/html_imageimpl.h: Use a DOMString instead of QString for the name, since
        the public API already uses a DOMString.

        * khtml/rendering/render_image.cpp: (RenderImage::nodeAtPoint): Call the new
        getImageMap instead of the old getMap.

        * khtml/xml/dom_docimpl.h: Added addImageMap, removeImageMap, getImageMap, and m_imageMapsByName.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::addImageMap): Added. Stores the image map under its name, unless there's
        already another map of the same.
        (DocumentImpl::removeImageMap): Added. Removes the image map if it's already filed by
        name. Avoid pitfall of removing another image map that has the same name.
        (DocumentImpl::getImageMap): Added. Simplified version of logic from getMap in HTMLDocumentImpl.

2004-04-01  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3608978>: dual <map> means you can't select the enter site button at jurassicpark.com (same problem in MacIE, works in Netscape)

        * khtml/html/html_imageimpl.cpp: (HTMLMapElementImpl::parseHTMLAttribute):
        Make the first <map> seen win, as in other browsers. The old code made the last <map> seen win.

2004-04-01  Ken Kocienda  <kocienda@apple.com>

        Missing file broke build after my last checkin

        * ForwardingHeaders/rendering/render_line.h: Added.

2004-03-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave.
        
        Many, many editing improvements, with a concentration on getting
        caret navigation and deleting selections working correctly.

        * WebCore.pbproj/project.pbxproj:
        * khtml/dom/dom_position.cpp: Removed.
        * khtml/dom/dom_position.h: Removed.
        * khtml/editing/htmlediting.cpp:
        (EditCommand::isNull): Inlined.
        (EditCommand::notNull): New function.
        (EditCommand::parent): Commands now have parents. Allows for walking the tree of composite commands.
        (EditCommand::setParent): Ditto.
        (EditCommand::emptyCommand): Returns a static empty command.
        (AppendNodeCommand::AppendNodeCommand): 
        (AppendNodeCommand::parentNode): Member variable name change only. parent -> parentNode.
        (DeleteCollapsibleWhitespaceCommand::DeleteCollapsibleWhitespaceCommand): New command.
        (InputTextCommand::InputTextCommand):
        (InputTextCommand::input):
        (InputTextCommand::charactersAdded):
        (JoinTextNodesCommand::JoinTextNodesCommand): Now derives directly from EditCommand.
        (RemoveNodeAndPruneCommand::RemoveNodeAndPruneCommand): New command.
        (SplitTextNodeCommand::SplitTextNodeCommand): Now derives directly from EditCommand.
        * khtml/editing/htmlediting.h:
        * khtml/editing/htmlediting_impl.cpp:
        (isNBSP): New helper.
        (isWS): New helper.
        (shouldPruneNode): New helper.
        (leadingWhitespacePosition): New helper.
        (trailingWhitespacePosition): New helper.
        (textNodesAreJoinable): New helper.
        (nonBreakingSpaceString): Returns a static DOMString containing a non-breaking space.
        (EditCommandImpl::EditCommandImpl):
        (EditCommandImpl::setStartingSelection): Now recursively sets starting selection on parents.
        (EditCommandImpl::setEndingSelection): As above, for ending selection.
        (EditCommandImpl::parent): New accessor.
        (EditCommandImpl::setParent): New accessor.
        (CompositeEditCommandImpl::doUnapply): Removed some logging.
        (CompositeEditCommandImpl::doReapply): Removed some logging.
        (CompositeEditCommandImpl::applyCommandToComposite): Sets parent.
        (CompositeEditCommandImpl::removeNodeAndPrune): New comvenience.
        (CompositeEditCommandImpl::replaceText): New comvenience.
        (CompositeEditCommandImpl::deleteSelection): New comvenience.
        (CompositeEditCommandImpl::deleteCollapsibleWhitespace): New comvenience.
        (AppendNodeCommandImpl::AppendNodeCommandImpl): Member variable name change only. parent -> parentNode.
        (AppendNodeCommandImpl::~AppendNodeCommandImpl): Ditto.
        (AppendNodeCommandImpl::doApply): Ditto.
        (AppendNodeCommandImpl::doUnapply): Ditto.
        (DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl): New command
        (debugPosition): New debugging aid.
        (DeleteSelectionCommandImpl::doApply): Major reworking to handle more cases correctly.
        (InputNewlineCommandImpl::doApply): Position and selection tweaks.
        (InputTextCommandImpl::InputTextCommandImpl): Handles more cases now, like typing after an image.
        (JoinTextNodesCommandImpl::JoinTextNodesCommandImpl): Now derives directly from EditCommand.
        Implements the guts of the command itself now, rather than replying on its former base class.
        (RemoveNodeAndPruneCommandImpl::RemoveNodeAndPruneCommandImpl): New command.
        (SplitTextNodeCommandImpl::SplitTextNodeCommandImpl): Now derives directly from EditCommand.
        Implements the guts of the command itself now, rather than replying on its former base class.
        (TypingCommandImpl::TypingCommandImpl): Major rework to handle more cases correctly.
        * khtml/editing/htmlediting_impl.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::isContentEditable): More efficient use of the style system to answer the question.
        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelection): Fixes an issue where the caret would not repaint after being moved when undoing.
        (KHTMLPart::takeSelectionFrom): Ditto.
        (KHTMLPart::clearSelection): Ditto.
        (KHTMLPart::invalidateSelection): Ditto.
        (KHTMLPart::setSelectionVisible): Ditto.
        (KHTMLPart::slotClearSelection): Ditto.
        (KHTMLPart::clearCaretRectIfNeeded):  Ditto.
        (KHTMLPart::notifySelectionChanged): Ditto.
        (KHTMLPart::unappliedEditing): Now uses EditCommand::emptyCommand().
        (KHTMLPart::reappliedEditing): Ditto.
        * khtml/khtml_part.h:
        * khtml/khtml_selection.cpp:
        (KHTMLSelection::KHTMLSelection):
        (KHTMLSelection::modify): Updated to work with new DOMPosition API.
        (KHTMLSelection::paintCaret): Ditto.
        (KHTMLSelection::moveToRenderedContent): Ditto.
        (KHTMLSelection::basePosition): New convenience.
        (KHTMLSelection::extentPosition): New convenience.
        (KHTMLSelection::startPosition): New convenience.
        (KHTMLSelection::endPosition): New convenience.
        (KHTMLSelection::debugPosition): Modified debug output.
        * khtml/khtml_selection.h:
        (KHTMLSelection::isEmpty):
        (KHTMLSelection::notEmpty):
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren): Fixed a crasher that happened when deleting content at the start of a line.
        * khtml/rendering/render_br.cpp:
        (RenderBR::caretMaxRenderedOffset): New function.
        (RenderBR::caretPos): Now draws the caret in the right place when a block is empty.
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::caretPos): Now draws the caret in the right place when a flow is empty.
        * khtml/rendering/render_line.cpp:
        (InlineBox::caretMaxRenderedOffset): New function.
        * khtml/rendering/render_line.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::isEditable):
        (RenderObject::caretMaxRenderedOffset): New function.
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::caretMaxRenderedOffset): New function.
        * khtml/rendering/render_replaced.h:
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::caretMaxRenderedOffset): New function.
        (RenderText::detach):
        (RenderText::caretMaxOffset):
        (RenderText::caretMaxRenderedOffset): New function.
        * khtml/rendering/render_text.h:
        (khtml::InlineTextBox::len):
        * khtml/xml/dom_edititerator.cpp: Added.
        * khtml/xml/dom_edititerator.h: Added.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::previousEditable): Improved the correctness of this function.
        (NodeImpl::nextEditable): Ditto.
        * khtml/xml/dom_nodeimpl.h:
        * khtml/xml/dom_position.cpp: Added.
        (DOMPosition::renderedOffset): New function.
        (DOMPosition::previousCharacterPosition): New function.
        (DOMPosition::nextCharacterPosition): New function.
        (DOMPosition::equivalentUpstreamPosition): New function.
        (DOMPosition::equivalentDownstreamPosition): New function.
        (DOMPosition::validUpstreamDownstreamPosition): New function.
        (DOMPosition::inRenderedContent): New function.
        (inlineBoxForRenderer): New function.
        (renderersOnDifferentLine): New function.
        (nextRenderedEditable): New function.
        (previousRenderedEditable): New function.
        (DOMPosition::inRenderedText): New function.
        (DOMPosition::rendersOnSameLine): New function.
        (DOMPosition::rendersInDifferentPosition): New function.
        (DOMPosition::isFirstRenderedPositionOnLine): New function.
        (DOMPosition::isLastRenderedPositionOnLine): New function.
        (DOMPosition::isLastRenderedPositionInEditableBlock): New function.
        (DOMPosition::inFirstEditableInRootEditableBlock): New function.
        (DOMPosition::inLastEditableInRootEditableBlock): New function.
        (DOMPosition::inFirstEditableInContainingEditableBlock): New function.
        (DOMPosition::inLastEditableInContainingEditableBlock): New function.
        * khtml/xml/dom_position.h: Added.
        (DOM::DOMPosition::notEmpty): New function.
        * khtml/xml/dom_stringimpl.cpp:
        (DOM::DOMStringImpl::containsOnlyWhitespace): Added a version which takes an offset and length.
        * khtml/xml/dom_stringimpl.h:
        * khtml/xml/dom_textimpl.cpp:
        (CharacterDataImpl::containsOnlyWhitespace): As above
        (CharacterDataImpl::maxOffset): New function.
        (CharacterDataImpl::caretMaxRenderedOffset): New function.
        (TextImpl::TextImpl):
        (TextImpl::rendererIsNeeded): A new bit. When set, makes a text renderer unconditionally.
        * khtml/xml/dom_textimpl.h:
        (DOM::TextImpl::setRendererIsNeeded): Sets the bit.
        * kwq/KWQAssertions.m:
        (KWQLog): Change to decrease the amount of output for the Editing log level. (my preference)

2004-03-31  David Hyatt  <hyatt@apple.com>

	Fix for 3601834, make sure that textareas do a layout when their rows/cols/wrap attributes are dynamically
	changed.
	
        Reviewed by darin.

        * khtml/html/html_formimpl.cpp:
        (HTMLTextAreaElementImpl::parseHTMLAttribute):

2004-03-30  David Hyatt  <hyatt@apple.com>

	Fix for 3604241, simple space collapsing results in a doubled character.  Simplify the ignoring of
	whitespace and make sure it works across absolutely positioned spans.
	
        Reviewed by darin

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::findNextLineBreak):

2004-03-30  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3570877>: REGRESSION: onfocus handler not working at weather.com

        * khtml/ecma/kjs_binding.cpp:
        (UString::string): Turn a null UString into a null DOMString, but a non-null empty UString into a
        non-null empty DOMString.
        (UString::qstring): Ditto, for QString.
        (Identifier::string): Ditto, for Identifier.
        (Identifier::qstring): Ditto.

        * kwq/KWQLineEdit.h: Override focusPolicy.
        * kwq/KWQLineEdit.mm: (QLineEdit::focusPolicy): Return StrongFocus instead of TabFocus, since
        we allow clicking to focus on these widgets.
        * kwq/KWQTextEdit.h: More of the same.
        * kwq/KWQTextEdit.mm: (QTextEdit::focusPolicy): And still more.

        - fixed <rdar://problem/3605919>: text fields in web pages are too tall

        * kwq/KWQTextField.mm:
        (-[KWQTextFieldCell _typesetterBehavior]): Ignore the per-application typesetter setting and
        instead always use the latest behavior for text fields in web pages.
        (-[KWQSecureTextFieldCell _typesetterBehavior]): Ditto.
        (-[KWQSearchFieldCell _typesetterBehavior]): Ditto.

        - additional cleanup

        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::isKeyboardFocusable): Check tab focus bit instead of different modes.
        (HTMLGenericFormElementImpl::isMouseFocusable): Check click focus bit instead of different modes.

2004-03-30  David Hyatt  <hyatt@apple.com>

	Fix for 3603326, spurious line breaks in encyclopedia articles.  Make sure makeChildrenNonInline knows to
	skip over floating/positioned elements so that they remain part of contiguous inline runs for static positioning
	purposes.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::getInlineRun):

2004-03-30  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed garbage characters seen while I was rigging up the Mozilla JavaScript tests

        * kwq/KWQString.h: Add a "move constructor" for KWQStringData that extracts the data
        from an existing KWQStringData.
        * kwq/KWQString.mm:
        (KWQStringData::KWQStringData): Implement the move constructor.
        (QString::detachInternal): Use the move constructor rather than making a copy of the
        data. Should be both more efficient and preserves both the Unicode and the ASCII. The
        bug here is that TokenizerSubstring relies on the Unicode staying around. We still
        have a problem in the case where the Unicode is inside the KWQStringData. To deal with
        that we'll have to add a new QString call that TokenizerSubstring can use. The new call
        will force QString to keep the Unicode outside the internal KWQStringData.

2004-03-30  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3606146>: repro nil-deref in QWidget::move (www.stoltoffshore.com)

        * khtml/khtml_part.cpp:
        (KHTMLPart::requestObject): Add check for NULL widget.
        (KHTMLPart::processObjectRequest): Add check for NULL widget.

2004-03-29  David Hyatt  <hyatt@apple.com>

	Make sure "auto" is allowed as a valid value when parsing rect shapes (e.g., for the clip property).
	
        Reviewed by rjw

        * khtml/css/cssparser.cpp:
        (CSSParser::parseShape):

2004-03-29  David Hyatt  <hyatt@apple.com>

	Followup fix.  Handle the case where a hard line break occurs right after a soft hyphen.  In this
	case we were losing a letter of the word in addition to not rendering the soft hyphen.
	
        Reviewed by kocienda

        * khtml/rendering/bidi.cpp:
        (khtml::checkMidpoints):

2004-03-29  David Hyatt  <hyatt@apple.com>

	Fix for 3604154, support soft hyphens when rendering.  This patch implements soft hyphen support that
	matches IE6 on Windows and Opera 7.  Soft hyphens that don't break lines end up getting collapsed away.
	Only if the hyphen breaks a line does it render.
	
        Reviewed by kocienda

        * khtml/rendering/bidi.cpp:
        (khtml::chopMidpointsAt):
        (khtml::appendRunsForObject):
        (khtml::RenderBlock::findNextLineBreak):
        * khtml/rendering/render_text.cpp:
        (RenderText::calcMinMaxWidth):

2004-03-29  John Sullivan  <sullivan@apple.com>

        Made menu shortcuts work again when editing HTML

        Reviewed by Darin.

        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::defaultEventHandler):
        Don't treat key events with command key down as
        editing events.

2004-03-28  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3602202>: "feed:uuid:...." links in Emerson content are being changed into "feed:uuuid:...."

        * kwq/KWQKURL.mm: (copyPathRemovingDots): Add special case for empty path. The old code had an
        assertion that explicitly allowed this case, but it copied a character from the src buffer,
        which was incorrect.

2004-03-26  David Hyatt  <hyatt@apple.com>

	Fix for 3600642, letter magnet demo doesn't update until mouse move.  This patch also fixes problems
	with the animated text Gecko DOM demos on developer.netscape.com.  Make sure that timer callbacks via
	setTimeout always updateRendering after executing the JS code.
	
        Reviewed by darin

        * khtml/ecma/kjs_window.cpp:
        (ScheduledAction::execute):

=== Safari-134 ===

2004-03-25  David Hyatt  <hyatt@apple.com>

	Implement the rest of the search field.  Make it work with form submission.  Implement onscroll at
	the document level.
	
        Reviewed by darin

        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::submit):
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::addSearchResult):
        * khtml/rendering/render_form.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendScrollEvent):
        * kwq/KWQLineEdit.h:
        * kwq/KWQLineEdit.mm:
        (QLineEdit::setMaxResults):
        (QLineEdit::setPlaceholderString):
        (QLineEdit::addSearchResult):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge sendScrollEvent]):
        * kwq/WebCoreViewFactory.h:

2004-03-25  David Hyatt  <hyatt@apple.com>

	Fix for 3570700, crash in inlineBox::isDirty.  Make sure line boxes null out parent pointers when those
	parents get deleted.  r=john

	Fix for .value not being settable on selects.  r=darin
	
        * khtml/html/html_formimpl.cpp:
        (HTMLSelectElementImpl::setValue):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::removeChildrenFromLineBoxes):
        (khtml::RenderBlock::removeChild):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_line.cpp:
        (InlineFlowBox::removeChild):
        
2004-03-25  Darin Adler  <darin@apple.com>

        Fix by Kristin Webster, reviewed by me.

        - fixed <rdar://problem/3582431>: HiDPI - Form elements not working when scaling factor != 1.0

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Pass nil for fromView
        rather than passing the top level view.

2004-03-24  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3566805>: REGRESSION: When the subject of mailto is 2 byte Safari failed to send mail address and subject to Mail.app

        * kwq/KWQKURL.mm: (KURL::findHostnamesInMailToURL): Update to handle hostnames that end just before
        a '?' since a '?' ends the entire part of the URL that can contain hostnames. Also change the logic so
        that the '?' will successfully end the search.

2004-03-24  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/3599650>: main image missing due to incorrect relative URL resolution at www.brother.com

        * kwq/KWQKURL.mm: (KURL::KURL): Implement compatibility rule from the URI RFC.
        If a URL has a scheme, but does not start with the "/" character, and the scheme
        matches the base URL, then treat it as a relative URL.

2004-03-24  Ken Kocienda  <kocienda@apple.com>

	I neglected to check in these required changes when I landed previously.
	This is what I get for trying to commit when I had other changes in
	my tree.

        * khtml/dom/html_form.cpp:
        (HTMLSelectElement::add): Uses new-style call.
        * khtml/html/html_formimpl.cpp:
        (HTMLSelectElementImpl::add): Change the interface for this call to use
	impl objects instead of API objects. This works around the fact that the
	API object's constructor that takes an impl is protected.
        * khtml/html/html_formimpl.h: Uses new-style call.

2004-03-24  Ken Kocienda <kocienda@apple.com>

        Implemented the remainder of the HTML DOM API.
    
        Reviewed by Chris.
    
        * kwq/DOMHTML.h
        * kwq/HTMLDOM.mm

2004-03-23  David Hyatt  <hyatt@apple.com>

	Fix for 3487207, implement onscroll DOM event for elements with overflow:auto/scroll/hidden.  This does
	not handle firing onscroll on the window when the document scrolls, nor does it handle firing onscroll
	on textareas.  These are two separate bugs.

	This patch finishes stubbing out the onscroll event and adds support for it to the DOM.  It also supports
	the firing of the event when overflow blocks scroll.
	
        Reviewed by darin

        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty):
        (DOMNode::putValue):
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMNode::):
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::):
        * khtml/ecma/kjs_window.cpp:
        (Window::get):
        (Window::put):
        * khtml/ecma/kjs_window.h:
        (KJS::Window::):
        * khtml/ecma/kjs_window.lut.h:
        (KJS::):
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::parseHTMLAttribute):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseHTMLAttribute):
        * khtml/misc/htmlattrs.c:
        (hash_attr):
        (findAttr):
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::scrollToOffset):

2004-03-23  David Hyatt  <hyatt@apple.com>

	Fix for 3513627, HTML mail prints upside down occasionally.  Change printing so that it never resizes the
        WebHTMLView when formatting for printing.  When computing page rects, instead of using the view's bounds,
        use the root layer's width instead.

        Reviewed by darin

        * khtml/khtmlview.cpp:
        (KHTMLView::layout):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):

2004-03-23  David Hyatt  <hyatt@apple.com>

	Fix for crasher 3598204, previousKeyView was calling nextKeyView instead.
	
        Reviewed by darin

        * kwq/KWQTextField.mm:
        (-[KWQTextField previousKeyView]):
        (-[KWQSecureTextField previousKeyView]):
        (-[KWQSearchField previousKeyView]):

2004-03-23  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        - fixed deployment build

2004-03-22  David Hyatt  <hyatt@apple.com>

	Wire up NSSearchField to WebCore.  Add support for placeholder strings, autosaving of recent items, the ability to show/hide
	the magnifying glass search button, the ability to specify the maximum number of results, the ability to specify an incremental
	search or not, etc.  Added a DOM event that fires when the search field indicates that search results should be updated.
	
        Reviewed by darin

        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty):
        (DOMNode::putValue):
        * khtml/ecma/kjs_dom.h:
        (KJS::DOMNode::):
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::):
        * khtml/ecma/kjs_window.cpp:
        (Window::get):
        (Window::put):
        * khtml/ecma/kjs_window.h:
        (KJS::Window::):
        * khtml/ecma/kjs_window.lut.h:
        (KJS::):
        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::parseHTMLAttribute):
        * khtml/html/html_formimpl.h:
        (DOM::HTMLInputElementImpl::maxResults):
        * khtml/misc/htmlattrs.c:
        (hash_attr):
        (findAttr):
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::RenderLineEdit):
        (RenderLineEdit::slotPerformSearch):
        (RenderLineEdit::updateFromElement):
        * khtml/rendering/render_form.h:
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId):
        (EventImpl::idToType):
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::):
        * kwq/KWQLineEdit.h:
        (QLineEdit::performSearch):
        (QLineEdit::type):
        * kwq/KWQLineEdit.mm:
        (QLineEdit::QLineEdit):
        (QLineEdit::setLiveSearch):
        (QLineEdit::setAutoSaveName):
        (QLineEdit::setMaxResults):
        (QLineEdit::setPlaceholderString):
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot):
        (KWQSlot::call):
        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController initWithTextField:QLineEdit:]):
        (-[KWQTextFieldController invalidate]):
        (-[KWQTextFieldController action:]):
        (-[KWQTextFieldController controlTextDidBeginEditing:]):
        (-[KWQTextFieldController controlTextDidEndEditing:]):
        (-[KWQTextFieldController controlTextDidChange:]):
        (-[KWQTextFieldController control:textShouldBeginEditing:]):
        (-[KWQTextFieldController control:textShouldEndEditing:]):
        (-[KWQTextFieldController control:didFailToFormatString:errorDescription:]):
        (-[KWQTextFieldController control:didFailToValidatePartialString:errorDescription:]):
        (-[KWQTextFieldController control:isValidObject:]):
        (-[KWQTextFieldController control:textView:doCommandBySelector:]):
        (-[KWQTextFieldController textChanged]):

2004-03-22  David Hyatt  <hyatt@apple.com>

	Factoring of form control code to enable sharing between three types of text fields: normal, password, and
	the new search field.  Also made search field creatable using <input type="search">.  There are still many
	bugs with the field, but you can at least type in it and submit it with a form.
	
        Reviewed by darin

        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::setType):
        (HTMLInputElementImpl::type):
        (HTMLInputElementImpl::click):
        (HTMLInputElementImpl::accessKeyAction):
        (HTMLInputElementImpl::rendererIsNeeded):
        (HTMLInputElementImpl::createRenderer):
        (HTMLInputElementImpl::encoding):
        (HTMLInputElementImpl::defaultEventHandler):
        (HTMLInputElementImpl::isEditable):
        * khtml/html/html_formimpl.h:
        (DOM::HTMLInputElementImpl::):
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::RenderLineEdit):
        * kwq/KWQKLineEdit.h:
        (KLineEdit::KLineEdit):
        * kwq/KWQLineEdit.h:
        (QLineEdit::):
        * kwq/KWQLineEdit.mm:
        (QLineEdit::QLineEdit):
        (QLineEdit::~QLineEdit):
        (QLineEdit::setFont):
        (QLineEdit::setText):
        (QLineEdit::text):
        (QLineEdit::setMaxLength):
        (QLineEdit::isReadOnly):
        (QLineEdit::setReadOnly):
        (QLineEdit::maxLength):
        (QLineEdit::selectAll):
        (QLineEdit::edited):
        (QLineEdit::setEdited):
        (QLineEdit::sizeForCharacterWidth):
        (QLineEdit::baselinePosition):
        (QLineEdit::setAlignment):
        (QLineEdit::setWritingDirection):
        (KWQNSTextAlignmentForAlignmentFlags):
        (QLineEdit::setLiveSearch):
        * kwq/KWQTextField.h:
        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController initWithTextField:QLineEdit:]):
        (-[KWQTextFieldController action:]):
        (-[KWQTextFieldController dealloc]):
        (-[KWQTextFieldController widget]):
        (-[KWQTextFieldController setMaximumLength:]):
        (-[KWQTextFieldController controlTextDidBeginEditing:]):
        (-[KWQTextFieldController controlTextDidEndEditing:]):
        (-[KWQTextFieldController controlTextDidChange:]):
        (-[KWQTextFieldController control:textShouldBeginEditing:]):
        (-[KWQTextFieldController control:textShouldEndEditing:]):
        (-[KWQTextFieldController control:didFailToFormatString:errorDescription:]):
        (-[KWQTextFieldController control:didFailToValidatePartialString:errorDescription:]):
        (-[KWQTextFieldController control:isValidObject:]):
        (-[KWQTextFieldController control:textView:doCommandBySelector:]):
        (-[KWQTextFieldController textChanged]):
        (-[KWQTextFieldController setInDrawingMachinery:]):
        (-[KWQTextFieldController textView:shouldDrawInsertionPointInRect:color:turnedOn:]):
        (-[KWQTextFieldController textView:shouldHandleEvent:]):
        (-[KWQTextFieldController textView:didHandleEvent:]):
        (-[KWQTextFieldController setBaseWritingDirection:]):
        (-[KWQTextFieldController baseWritingDirection]):
        (-[KWQTextFieldController selectedRange]):
        (-[KWQTextFieldController setSelectedRange:]):
        (-[KWQTextFieldController setHasFocus:]):
        (-[KWQTextFieldController updateTextAttributes:]):
        (+[KWQTextField cellClass]):
        (-[KWQTextField initWithQLineEdit:]):
        (-[KWQTextField dealloc]):
        (-[KWQTextField controller]):
        (-[KWQTextField widget]):
        (-[KWQTextField selectText:]):
        (-[KWQTextField setStringValue:]):
        (-[KWQTextField nextKeyView]):
        (-[KWQTextField previousKeyView]):
        (-[KWQTextField nextValidKeyView]):
        (-[KWQTextField previousValidKeyView]):
        (-[KWQTextField acceptsFirstResponder]):
        (-[KWQTextField display]):
        (-[KWQTextField displayRectIgnoringOpacity:]):
        (-[KWQTextField textView:shouldDrawInsertionPointInRect:color:turnedOn:]):
        (-[KWQTextField textView:shouldHandleEvent:]):
        (-[KWQTextField textView:didHandleEvent:]):
        (-[KWQTextFieldCell editWithFrame:inView:editor:delegate:event:]):
        (-[KWQTextFieldCell selectWithFrame:inView:editor:delegate:start:length:]):
        (-[KWQTextFieldCell _textAttributes]):
        (-[KWQSecureTextField initWithQLineEdit:]):
        (-[KWQSecureTextField dealloc]):
        (-[KWQSecureTextField controller]):
        (-[KWQSecureTextField widget]):
        (-[KWQSecureTextField setStringValue:]):
        (-[KWQSecureTextField nextKeyView]):
        (-[KWQSecureTextField previousKeyView]):
        (-[KWQSecureTextField acceptsFirstResponder]):
        (-[KWQSecureTextField display]):
        (-[KWQSecureTextField displayRectIgnoringOpacity:]):
        (-[KWQSecureTextField textView:shouldDrawInsertionPointInRect:color:turnedOn:]):
        (-[KWQSecureTextField textView:shouldHandleEvent:]):
        (-[KWQSecureTextField textView:didHandleEvent:]):
        (-[KWQSecureTextField selectText:]):
        (-[KWQSecureTextFieldCell editWithFrame:inView:editor:delegate:event:]):
        (-[KWQSecureTextFieldCell selectWithFrame:inView:editor:delegate:start:length:]):
        (-[KWQSecureTextFieldCell _textAttributes]):
        (+[KWQSearchField cellClass]):
        (-[KWQSearchField initWithQLineEdit:]):
        (-[KWQSearchField dealloc]):
        (-[KWQSearchField controller]):
        (-[KWQSearchField widget]):
        (-[KWQSearchField selectText:]):
        (-[KWQSearchField setStringValue:]):
        (-[KWQSearchField nextKeyView]):
        (-[KWQSearchField previousKeyView]):
        (-[KWQSearchField nextValidKeyView]):
        (-[KWQSearchField previousValidKeyView]):
        (-[KWQSearchField acceptsFirstResponder]):
        (-[KWQSearchField display]):
        (-[KWQSearchField displayRectIgnoringOpacity:]):
        (-[KWQSearchField textView:shouldDrawInsertionPointInRect:color:turnedOn:]):
        (-[KWQSearchField textView:shouldHandleEvent:]):
        (-[KWQSearchField textView:didHandleEvent:]):
        (-[KWQSearchFieldCell editWithFrame:inView:editor:delegate:event:]):
        (-[KWQSearchFieldCell selectWithFrame:inView:editor:delegate:start:length:]):
        (-[KWQSearchFieldCell _textAttributes]):
        (-[KWQTextFieldFormatter init]):
        (-[KWQTextFieldFormatter setMaximumLength:]):
        (-[KWQTextFieldFormatter maximumLength]):
        (-[KWQTextFieldFormatter stringForObjectValue:]):
        (-[KWQTextFieldFormatter getObjectValue:forString:errorDescription:]):
        (-[KWQTextFieldFormatter isPartialStringValid:newEditingString:errorDescription:]):
        (-[KWQTextFieldFormatter attributedStringForObjectValue:withDefaultAttributes:]):
        (-[NSString _KWQ_truncateToNumComposedCharacterSequences:]):
        (-[NSTextField _KWQ_currentEditor]):

=== Safari-133 ===

2004-03-19  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3583945>: crash when choosing a file to upload

        * kwq/KWQFileButton.mm:
        (-[KWQFileButtonAdapter dealloc]): Removed unneeded method.
        (-[KWQFileButtonAdapter filenameChanged:]): Check for nil.
        (-[KWQFileButtonAdapter focusChanged:]): Ditto.
        (-[KWQFileButtonAdapter clicked]): Ditto.

2004-03-17  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed rdar://problem/3312803>: extra space in copied text (3g.co.uk)

        * khtml/khtml_part.cpp: (KHTMLPart::text): Explicitly set neededSpace to false after
        processing a line break. Doesn't really have an effect here, but matches the change
        to the styled text version.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::attributedString): Same change in the styled
        text version.

2004-03-16  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - a little more DOM cleanup

        * kwq/DOM-CSS.mm: Added DOMCSSUnknownRule.
        * kwq/DOM.mm: Split category implementations out to match category interfaces.
        * kwq/DOMHTML.h: Removed lowSrc, not in DOM Level 2. Added a category for some
        extensions we'll want on DOMElement.
        * kwq/DOMInternal.h: Moved _documentImpl method here so it can be used from
        separate categories.
        * kwq/DOMRange.h: Changed DOMDocumentRange to a category from a protocol.
        * kwq/HTMLDOM.mm: Removed unneeded methods.

        * WebCore.pbproj/project.pbxproj: Sort DOM header files alphabetically.

2004-03-16  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - update for new DOM namespacing and header organization

        * WebCore.pbproj/project.pbxproj:
        * kwq/DOM-CSS.h: Removed.
        * kwq/DOM-CSS.mm: Update for name changes.
        * kwq/DOM.h: Changed to include the other DOM headers.
        * kwq/DOM.mm: Update for name changes.
        * kwq/DOMCSS.h: Added.
        * kwq/DOMCore.h: Added.
        * kwq/DOMEvents.h: Added.
        * kwq/DOMHTML.h: Added.
        * kwq/DOMInternal.h: Update for name changes.
        * kwq/DOMRange.h: Added.
        * kwq/DOMStylesheets.h: Added.
        * kwq/DOMTraversal.h: Added.
        * kwq/DOMViews.h: Added.
        * kwq/HTMLDOM.h: Removed.
        * kwq/HTMLDOM.mm: Update for name changes; add some missing setters.

2004-03-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- max out our iBench cheat. Don't even paint or lay out a quarter
	of the pages.
	
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::close):

2004-03-15  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:
        
        <rdar://problem/3588717>: REGRESSION (125-131u): Tabbing to links and tabbing in bookmarks view no longer works

        Change some support methods which feed editing key events to 
        WebKit. The real fix is on the WebKit side.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::editingKeyEvent): Call new -editingKeyDown:
        on WebCoreBridge, as described below.
        * kwq/WebCoreBridge.h: Changed -keyDown: to -editingKeyDown:
        since we want to tell WebView about editing key events
        in a way that does not interfere with other key down
        events the WebView processes. This is not necessary in the
        strictest sense, but it seems reasonable to keep the
        terminology clear.

=== Safari-132 ===

2004-03-12  Chris Blumenberg  <cblu@apple.com>

	Implemented ~25% of the HTML DOM API.

        Reviewed by kocienda.

        (DOM::HTMLElement::HTMLElement):
        * kwq/DOM.mm:
        * kwq/DOMInternal.h:
        * kwq/HTMLDOM.h:
        * kwq/HTMLDOM.mm:
        (-[HTMLCollection _initWithCollectionImpl:]):
        (+[HTMLCollection _collectionWithImpl:]):
        (-[HTMLCollection _collectionImpl]):
        (-[HTMLCollection length]):
        (-[HTMLCollection item:]):
        (-[HTMLCollection namedItem:]):
        (-[HTMLElement _initWithElementImpl:]):
        (+[HTMLElement _elementWithImpl:]):
        (-[HTMLElement _HTMLElementImpl]):
        (-[HTMLElement idName]):
        (-[HTMLElement setIdName:]):
        (-[HTMLElement title]):
        (-[HTMLElement setTitle:]):
        (-[HTMLElement lang]):
        (-[HTMLElement setLang:]):
        (-[HTMLElement dir]):
        (-[HTMLElement setDir:]):
        (-[HTMLElement className]):
        (-[HTMLElement setClassName:]):
        (-[HTMLDocument _HTMLDocumentImpl]):
        (-[HTMLDocument title]):
        (-[HTMLDocument setTitle:]):
        (-[HTMLDocument referrer]):
        (-[HTMLDocument domain]):
        (-[HTMLDocument URL]):
        (-[HTMLDocument body]):
        (-[HTMLDocument images]):
        (-[HTMLDocument applets]):
        (-[HTMLDocument links]):
        (-[HTMLDocument forms]):
        (-[HTMLDocument anchors]):
        (-[HTMLDocument setBody:]):
        (-[HTMLDocument cookie]):
        (-[HTMLDocument setCookie:]):
        (-[HTMLDocument open]):
        (-[HTMLDocument close]):
        (-[HTMLDocument write:]):
        (-[HTMLDocument writeln:]):
        (-[HTMLDocument getElementById:]):
        (-[HTMLDocument getElementsByName:]):
        (-[HTMLHtmlElement _HTMLHtmlElementImpl]):
        (-[HTMLHtmlElement version]):
        (-[HTMLHtmlElement setVersion:]):
        (-[HTMLHeadElement _headElementImpl]):
        (-[HTMLHeadElement profile]):
        (-[HTMLHeadElement setProfile:]):
        (-[HTMLLinkElement _linkElementImpl]):
        (-[HTMLLinkElement disabled]):
        (-[HTMLLinkElement setDisabled:]):
        (-[HTMLLinkElement charset]):
        (-[HTMLLinkElement setCharset:]):
        (-[HTMLLinkElement href]):
        (-[HTMLLinkElement setHref:]):
        (-[HTMLLinkElement hreflang]):
        (-[HTMLLinkElement setHreflang:]):
        (-[HTMLLinkElement media]):
        (-[HTMLLinkElement setMedia:]):
        (-[HTMLLinkElement rel]):
        (-[HTMLLinkElement setRel:]):
        (-[HTMLLinkElement rev]):
        (-[HTMLLinkElement setRev:]):
        (-[HTMLLinkElement target]):
        (-[HTMLLinkElement setTarget:]):
        (-[HTMLLinkElement type]):
        (-[HTMLLinkElement setType:]):
        (-[HTMLTitleElement _titleElementImpl]):
        (-[HTMLTitleElement text]):
        (-[HTMLTitleElement setText:]):
        (-[HTMLMetaElement _metaElementImpl]):
        (-[HTMLMetaElement content]):
        (-[HTMLMetaElement setContent:]):
        (-[HTMLMetaElement httpEquiv]):
        (-[HTMLMetaElement setHttpEquiv:]):
        (-[HTMLMetaElement name]):
        (-[HTMLMetaElement setName:]):
        (-[HTMLMetaElement scheme]):
        (-[HTMLMetaElement setScheme:]):
        (-[HTMLBaseElement _baseElementImpl]):
        (-[HTMLBaseElement href]):
        (-[HTMLBaseElement setHref:]):
        (-[HTMLBaseElement target]):
        (-[HTMLBaseElement setTarget:]):
        (-[HTMLStyleElement _styleElementImpl]):
        (-[HTMLStyleElement disabled]):
        (-[HTMLStyleElement setDisabled:]):
        (-[HTMLStyleElement media]):
        (-[HTMLStyleElement setMedia:]):
        (-[HTMLStyleElement type]):
        (-[HTMLStyleElement setType:]):
        (-[HTMLBodyElement _bodyElementImpl]):
        (-[HTMLBodyElement aLink]):
        (-[HTMLBodyElement setALink:]):
        (-[HTMLBodyElement background]):
        (-[HTMLBodyElement setBackground:]):
        (-[HTMLBodyElement bgColor]):
        (-[HTMLBodyElement setBgColor:]):
        (-[HTMLBodyElement link]):
        (-[HTMLBodyElement setLink:]):
        (-[HTMLBodyElement text]):
        (-[HTMLBodyElement setText:]):
        (-[HTMLBodyElement vLink]):
        (-[HTMLBodyElement setVLink:]):

2004-03-12  David Hyatt  <hyatt@apple.com>

	Fix for problem when undoing the deletion of a word in edit mode.
	
        Reviewed by kocienda

        * khtml/rendering/render_text.cpp:
        (RenderText::setTextWithOffset):

2004-03-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMouseMoveEventSelection): Clear the selection's
        "modify bias" since the user clicked, and is therefore no longer
        extending the selection with arrow keys.
        * khtml/khtml_selection.cpp:
        (KHTMLSelection::KHTMLSelection): Add new m_modifyBiasSet flag.
        (KHTMLSelection::init): Set the flag to false by default.
        (KHTMLSelection::operator=): Copy over the value of the new m_modifyBiasSet flag.
        (KHTMLSelection::modify): Set the flag if extending the selection and set the 
        base and extent nodes based on the movement direction requested.
        * khtml/khtml_selection.h:
        * kwq/WebCoreBridge.h: See below.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]): This
        method is used by the WebKit side in response to requests to change the selection
        using the arrow keys. It used to be called rangeByModifyingRange:alteration:direction:granularity:
        but I changed it to this new format since I explicitly want to use the current selection, and
        not some arbitrarily passed in selection. This helps to maintain the "modify bias" correctly.
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): New method. A command to alter
        the current selection as given. Again, applying the command to the current selection, rather
        than just setting the selection to a new one, helps to maintain the "modify bias" correctly.

2004-03-11  Chris Blumenberg  <cblu@apple.com>

	Added stubs for the HTML DOM API.

        Reviewed by rjw.

        * WebCore.pbproj/project.pbxproj:
        * kwq/HTMLDOM.h: Added.
        * kwq/HTMLDOM.mm: Added.
        (-[HTMLCollection length]):
        (-[HTMLCollection item:]):
        (-[HTMLCollection namedItem:]):
        (-[HTMLElement idName]):
        (-[HTMLElement setIdName:]):
        (-[HTMLElement title]):
        (-[HTMLElement setTitle:]):
        (-[HTMLElement lang]):
        (-[HTMLElement setLang:]):
        (-[HTMLElement dir]):
        (-[HTMLElement setDir:]):
        (-[HTMLElement className]):
        (-[HTMLElement setClassName:]):
        (-[HTMLDocument title]):
        (-[HTMLDocument setTitle:]):
        (-[HTMLDocument referrer]):
        (-[HTMLDocument domain]):
        (-[HTMLDocument URL]):
        (-[HTMLDocument body]):
        (-[HTMLDocument images]):
        (-[HTMLDocument applets]):
        (-[HTMLDocument links]):
        (-[HTMLDocument forms]):
        (-[HTMLDocument anchors]):
        (-[HTMLDocument setBody:]):
        (-[HTMLDocument cookie]):
        (-[HTMLDocument setCookie:]):
        (-[HTMLDocument open]):
        (-[HTMLDocument close]):
        (-[HTMLDocument write:]):
        (-[HTMLDocument writeln:]):
        (-[HTMLDocument getElementById:]):
        (-[HTMLDocument getElementsByName:]):
        (-[HTMLHtmlElement version]):
        (-[HTMLHtmlElement setVersion:]):
        (-[HTMLHeadElement profile]):
        (-[HTMLHeadElement setProfile:]):
        (-[HTMLLinkElement disabled]):
        (-[HTMLLinkElement setDisabled:]):
        (-[HTMLLinkElement charset]):
        (-[HTMLLinkElement setCharset:]):
        (-[HTMLLinkElement href]):
        (-[HTMLLinkElement setHref:]):
        (-[HTMLLinkElement hreflang]):
        (-[HTMLLinkElement setHreflang:]):
        (-[HTMLLinkElement media]):
        (-[HTMLLinkElement setMedia:]):
        (-[HTMLLinkElement rel]):
        (-[HTMLLinkElement setRrevel:]):
        (-[HTMLLinkElement rev]):
        (-[HTMLLinkElement setRev:]):
        (-[HTMLLinkElement target]):
        (-[HTMLLinkElement setTarget:]):
        (-[HTMLLinkElement type]):
        (-[HTMLLinkElement setType:]):
        (-[HTMLTitleElement text]):
        (-[HTMLTitleElement setText:]):
        (-[HTMLMetaElement content]):
        (-[HTMLMetaElement setContent:]):
        (-[HTMLMetaElement httpEquiv]):
        (-[HTMLMetaElement setHttpEquiv:]):
        (-[HTMLMetaElement name]):
        (-[HTMLMetaElement setName:]):
        (-[HTMLMetaElement scheme]):
        (-[HTMLMetaElement setScheme:]):
        (-[HTMLBaseElement href]):
        (-[HTMLBaseElement setHref:]):
        (-[HTMLBaseElement target]):
        (-[HTMLBaseElement setTarget:]):
        (-[HTMLStyleElement disabled]):
        (-[HTMLStyleElement setDisabled:]):
        (-[HTMLStyleElement media]):
        (-[HTMLStyleElement setMedia:]):
        (-[HTMLStyleElement type]):
        (-[HTMLStyleElement setType:]):
        (-[HTMLBodyElement aLink]):
        (-[HTMLBodyElement setALink:]):
        (-[HTMLBodyElement background]):
        (-[HTMLBodyElement setBackground:]):
        (-[HTMLBodyElement bgColor]):
        (-[HTMLBodyElement setBgColor:]):
        (-[HTMLBodyElement link]):
        (-[HTMLBodyElement setLink:]):
        (-[HTMLBodyElement text]):
        (-[HTMLBodyElement setText:]):
        (-[HTMLBodyElement vLink]):
        (-[HTMLBodyElement setVLink:]):
        (-[HTMLFormElement elements]):
        (-[HTMLFormElement length]):
        (-[HTMLFormElement name]):
        (-[HTMLFormElement setName:]):
        (-[HTMLFormElement acceptCharset]):
        (-[HTMLFormElement setAcceptCharset:]):
        (-[HTMLFormElement action]):
        (-[HTMLFormElement setAction:]):
        (-[HTMLFormElement enctype]):
        (-[HTMLFormElement setEnctype:]):
        (-[HTMLFormElement method]):
        (-[HTMLFormElement setMethod:]):
        (-[HTMLFormElement target]):
        (-[HTMLFormElement setTarget:]):
        (-[HTMLFormElement submit]):
        (-[HTMLFormElement reset]):
        (-[HTMLIsIndexElement form]):
        (-[HTMLIsIndexElement prompt]):
        (-[HTMLIsIndexElement setPrompt:]):
        (-[HTMLSelectElement type]):
        (-[HTMLSelectElement selectedIndex]):
        (-[HTMLSelectElement setSelectedIndex:]):
        (-[HTMLSelectElement value]):
        (-[HTMLSelectElement setValue:]):
        (-[HTMLSelectElement length]):
        (-[HTMLSelectElement form]):
        (-[HTMLSelectElement options]):
        (-[HTMLSelectElement disabled]):
        (-[HTMLSelectElement multiple]):
        (-[HTMLSelectElement name]):
        (-[HTMLSelectElement setName:]):
        (-[HTMLSelectElement size]):
        (-[HTMLSelectElement tabIndex]):
        (-[HTMLSelectElement add::]):
        (-[HTMLSelectElement remove:]):
        (-[HTMLSelectElement blur]):
        (-[HTMLSelectElement focus]):
        (-[HTMLOptGroupElement disabled]):
        (-[HTMLOptGroupElement setDisabled:]):
        (-[HTMLOptGroupElement label]):
        (-[HTMLOptGroupElement setLabel:]):
        (-[HTMLOptionElement form]):
        (-[HTMLOptionElement defaultSelected]):
        (-[HTMLOptionElement setDefaultSelected:]):
        (-[HTMLOptionElement text]):
        (-[HTMLOptionElement index]):
        (-[HTMLOptionElement setIndex:]):
        (-[HTMLOptionElement disabled]):
        (-[HTMLOptionElement setDisabled:]):
        (-[HTMLOptionElement label]):
        (-[HTMLOptionElement setLabel:]):
        (-[HTMLOptionElement selected]):
        (-[HTMLOptionElement value]):
        (-[HTMLOptionElement setValue:]):
        (-[HTMLInputElement defaultValue]):
        (-[HTMLInputElement setDefaultValue:]):
        (-[HTMLInputElement defaultChecked]):
        (-[HTMLInputElement setDefaultChecked:]):
        (-[HTMLInputElement form]):
        (-[HTMLInputElement accept]):
        (-[HTMLInputElement setAccept:]):
        (-[HTMLInputElement accessKey]):
        (-[HTMLInputElement setAccessKey:]):
        (-[HTMLInputElement align]):
        (-[HTMLInputElement setAlign:]):
        (-[HTMLInputElement alt]):
        (-[HTMLInputElement setAlt:]):
        (-[HTMLInputElement checked]):
        (-[HTMLInputElement setChecked:]):
        (-[HTMLInputElement disabled]):
        (-[HTMLInputElement setDisabled:]):
        (-[HTMLInputElement maxLength]):
        (-[HTMLInputElement setMaxLength:]):
        (-[HTMLInputElement name]):
        (-[HTMLInputElement setName:]):
        (-[HTMLInputElement readOnly]):
        (-[HTMLInputElement setReadOnly:]):
        (-[HTMLInputElement size]):
        (-[HTMLInputElement setSize:]):
        (-[HTMLInputElement src]):
        (-[HTMLInputElement setSrc:]):
        (-[HTMLInputElement tabIndex]):
        (-[HTMLInputElement setTabIndex:]):
        (-[HTMLInputElement type]):
        (-[HTMLInputElement useMap]):
        (-[HTMLInputElement setUseMap:]):
        (-[HTMLInputElement value]):
        (-[HTMLInputElement setValue:]):
        (-[HTMLInputElement blur]):
        (-[HTMLInputElement focus]):
        (-[HTMLInputElement select]):
        (-[HTMLInputElement click]):
        (-[HTMLTextAreaElement defaultValue]):
        (-[HTMLTextAreaElement setDefaultValue:]):
        (-[HTMLTextAreaElement form]):
        (-[HTMLTextAreaElement accessKey]):
        (-[HTMLTextAreaElement setAccessKey:]):
        (-[HTMLTextAreaElement cols]):
        (-[HTMLTextAreaElement setCols:]):
        (-[HTMLTextAreaElement disabled]):
        (-[HTMLTextAreaElement setDisabled:]):
        (-[HTMLTextAreaElement name]):
        (-[HTMLTextAreaElement setName:]):
        (-[HTMLTextAreaElement readOnly]):
        (-[HTMLTextAreaElement setReadOnly:]):
        (-[HTMLTextAreaElement rows]):
        (-[HTMLTextAreaElement setRows:]):
        (-[HTMLTextAreaElement tabIndex]):
        (-[HTMLTextAreaElement setTabIndex:]):
        (-[HTMLTextAreaElement type]):
        (-[HTMLTextAreaElement value]):
        (-[HTMLTextAreaElement setValue:]):
        (-[HTMLTextAreaElement blur]):
        (-[HTMLTextAreaElement focus]):
        (-[HTMLTextAreaElement select]):
        (-[HTMLButtonElement form]):
        (-[HTMLButtonElement accessKey]):
        (-[HTMLButtonElement setAccessKey:]):
        (-[HTMLButtonElement disabled]):
        (-[HTMLButtonElement setDisabled:]):
        (-[HTMLButtonElement name]):
        (-[HTMLButtonElement setName:]):
        (-[HTMLButtonElement tabIndex]):
        (-[HTMLButtonElement setTabIndex:]):
        (-[HTMLButtonElement type]):
        (-[HTMLButtonElement value]):
        (-[HTMLButtonElement setValue:]):
        (-[HTMLLabelElement form]):
        (-[HTMLLabelElement accessKey]):
        (-[HTMLLabelElement setAccessKey:]):
        (-[HTMLLabelElement htmlFor]):
        (-[HTMLLabelElement setHtmlFor:]):
        (-[HTMLFieldSetElement form]):
        (-[HTMLLegendElement form]):
        (-[HTMLLegendElement accessKey]):
        (-[HTMLLegendElement setAccessKey:]):
        (-[HTMLLegendElement align]):
        (-[HTMLLegendElement setAlign:]):
        (-[HTMLUListElement compact]):
        (-[HTMLUListElement setCompact:]):
        (-[HTMLUListElement type]):
        (-[HTMLUListElement setType:]):
        (-[HTMLOListElement compact]):
        (-[HTMLOListElement setCompact:]):
        (-[HTMLOListElement start]):
        (-[HTMLOListElement setStart:]):
        (-[HTMLOListElement type]):
        (-[HTMLOListElement setType:]):
        (-[HTMLDListElement compact]):
        (-[HTMLDListElement setCompact:]):
        (-[HTMLDirectoryElement compact]):
        (-[HTMLDirectoryElement setCompact:]):
        (-[HTMLMenuElement compact]):
        (-[HTMLMenuElement setCompact:]):
        (-[HTMLLIElement type]):
        (-[HTMLLIElement setType:]):
        (-[HTMLLIElement value]):
        (-[HTMLLIElement setValue:]):
        (-[HTMLBlockquoteElement cite]):
        (-[HTMLBlockquoteElement setCite:]):
        (-[HTMLDivElement align]):
        (-[HTMLDivElement setAlign:]):
        (-[HTMLParagraphElement align]):
        (-[HTMLParagraphElement setAlign:]):
        (-[HTMLHeadingElement align]):
        (-[HTMLHeadingElement setAlign:]):
        (-[HTMLQuoteElement cite]):
        (-[HTMLQuoteElement setCite:]):
        (-[HTMLPreElement width]):
        (-[HTMLPreElement setWidth:]):
        (-[HTMLBRElement clear]):
        (-[HTMLBRElement setClear:]):
        (-[HTMLBaseFontElement color]):
        (-[HTMLBaseFontElement setColor:]):
        (-[HTMLBaseFontElement face]):
        (-[HTMLBaseFontElement setFace:]):
        (-[HTMLBaseFontElement size]):
        (-[HTMLBaseFontElement setSize:]):
        (-[HTMLFontElement color]):
        (-[HTMLFontElement setColor:]):
        (-[HTMLFontElement face]):
        (-[HTMLFontElement setFace:]):
        (-[HTMLFontElement size]):
        (-[HTMLFontElement setSize:]):
        (-[HTMLHRElement align]):
        (-[HTMLHRElement setAlign:]):
        (-[HTMLHRElement noShade]):
        (-[HTMLHRElement setNoShade:]):
        (-[HTMLHRElement size]):
        (-[HTMLHRElement setSize:]):
        (-[HTMLHRElement width]):
        (-[HTMLHRElement setWidth:]):
        (-[HTMLModElement cite]):
        (-[HTMLModElement setCite:]):
        (-[HTMLModElement dateTime]):
        (-[HTMLModElement setDateTime:]):
        (-[HTMLAnchorElement accessKey]):
        (-[HTMLAnchorElement setAccessKey:]):
        (-[HTMLAnchorElement charset]):
        (-[HTMLAnchorElement setCharset:]):
        (-[HTMLAnchorElement coords]):
        (-[HTMLAnchorElement setCoords:]):
        (-[HTMLAnchorElement href]):
        (-[HTMLAnchorElement setHref:]):
        (-[HTMLAnchorElement hreflang]):
        (-[HTMLAnchorElement setHreflang:]):
        (-[HTMLAnchorElement name]):
        (-[HTMLAnchorElement setName:]):
        (-[HTMLAnchorElement rel]):
        (-[HTMLAnchorElement setRel:]):
        (-[HTMLAnchorElement rev]):
        (-[HTMLAnchorElement setRev:]):
        (-[HTMLAnchorElement shape]):
        (-[HTMLAnchorElement setShape:]):
        (-[HTMLAnchorElement tabIndex]):
        (-[HTMLAnchorElement setTabIndex:]):
        (-[HTMLAnchorElement target]):
        (-[HTMLAnchorElement setTarget:]):
        (-[HTMLAnchorElement type]):
        (-[HTMLAnchorElement setType:]):
        (-[HTMLAnchorElement blur]):
        (-[HTMLAnchorElement focus]):
        (-[HTMLImageElement lowSrc]):
        (-[HTMLImageElement setLowSrc:]):
        (-[HTMLImageElement name]):
        (-[HTMLImageElement setName:]):
        (-[HTMLImageElement align]):
        (-[HTMLImageElement setAlign:]):
        (-[HTMLImageElement alt]):
        (-[HTMLImageElement setAlt:]):
        (-[HTMLImageElement border]):
        (-[HTMLImageElement setBorder:]):
        (-[HTMLImageElement height]):
        (-[HTMLImageElement setHeight:]):
        (-[HTMLImageElement hspace]):
        (-[HTMLImageElement setHspace:]):
        (-[HTMLImageElement isMap]):
        (-[HTMLImageElement setIsMap:]):
        (-[HTMLImageElement longDesc]):
        (-[HTMLImageElement setLongDesc:]):
        (-[HTMLImageElement src]):
        (-[HTMLImageElement setSrc:]):
        (-[HTMLImageElement useMap]):
        (-[HTMLImageElement setUseMap:]):
        (-[HTMLImageElement vspace]):
        (-[HTMLImageElement setVspace:]):
        (-[HTMLImageElement width]):
        (-[HTMLImageElement setWidth:]):
        (-[HTMLObjectElement form]):
        (-[HTMLObjectElement code]):
        (-[HTMLObjectElement setCode:]):
        (-[HTMLObjectElement align]):
        (-[HTMLObjectElement setAlign:]):
        (-[HTMLObjectElement archive]):
        (-[HTMLObjectElement setArchive:]):
        (-[HTMLObjectElement border]):
        (-[HTMLObjectElement setBorder:]):
        (-[HTMLObjectElement codeBase]):
        (-[HTMLObjectElement setCodeBase:]):
        (-[HTMLObjectElement codeType]):
        (-[HTMLObjectElement setCodeType:]):
        (-[HTMLObjectElement data]):
        (-[HTMLObjectElement setData:]):
        (-[HTMLObjectElement declare]):
        (-[HTMLObjectElement setDeclare:]):
        (-[HTMLObjectElement height]):
        (-[HTMLObjectElement setHeight:]):
        (-[HTMLObjectElement hspace]):
        (-[HTMLObjectElement setHspace:]):
        (-[HTMLObjectElement name]):
        (-[HTMLObjectElement setName:]):
        (-[HTMLObjectElement standby]):
        (-[HTMLObjectElement setStandby:]):
        (-[HTMLObjectElement tabIndex]):
        (-[HTMLObjectElement setTabIndex:]):
        (-[HTMLObjectElement type]):
        (-[HTMLObjectElement setType:]):
        (-[HTMLObjectElement useMap]):
        (-[HTMLObjectElement setUseMap:]):
        (-[HTMLObjectElement vspace]):
        (-[HTMLObjectElement setVspace:]):
        (-[HTMLObjectElement width]):
        (-[HTMLObjectElement setWidth:]):
        (-[HTMLParamElement name]):
        (-[HTMLParamElement setName:]):
        (-[HTMLParamElement type]):
        (-[HTMLParamElement setType:]):
        (-[HTMLParamElement value]):
        (-[HTMLParamElement setValue:]):
        (-[HTMLParamElement valueType]):
        (-[HTMLParamElement setValueType:]):
        (-[HTMLAppletElement align]):
        (-[HTMLAppletElement setAlign:]):
        (-[HTMLAppletElement alt]):
        (-[HTMLAppletElement setAlt:]):
        (-[HTMLAppletElement archive]):
        (-[HTMLAppletElement setArchive:]):
        (-[HTMLAppletElement code]):
        (-[HTMLAppletElement setCode:]):
        (-[HTMLAppletElement codeBase]):
        (-[HTMLAppletElement setCodeBase:]):
        (-[HTMLAppletElement codeType]):
        (-[HTMLAppletElement setCodeType:]):
        (-[HTMLAppletElement height]):
        (-[HTMLAppletElement setHeight:]):
        (-[HTMLAppletElement hspace]):
        (-[HTMLAppletElement setHspace:]):
        (-[HTMLAppletElement name]):
        (-[HTMLAppletElement setName:]):
        (-[HTMLAppletElement object]):
        (-[HTMLAppletElement setObject:]):
        (-[HTMLAppletElement vspace]):
        (-[HTMLAppletElement setVspace:]):
        (-[HTMLAppletElement width]):
        (-[HTMLAppletElement setWidth:]):
        (-[HTMLMapElement areas]):
        (-[HTMLMapElement name]):
        (-[HTMLMapElement setName:]):
        (-[HTMLAreaElement accessKey]):
        (-[HTMLAreaElement setAccessKey:]):
        (-[HTMLAreaElement alt]):
        (-[HTMLAreaElement setAlt:]):
        (-[HTMLAreaElement coords]):
        (-[HTMLAreaElement setCoords:]):
        (-[HTMLAreaElement href]):
        (-[HTMLAreaElement setHref:]):
        (-[HTMLAreaElement noHref]):
        (-[HTMLAreaElement setNoHref:]):
        (-[HTMLAreaElement shape]):
        (-[HTMLAreaElement setShape:]):
        (-[HTMLAreaElement tabIndex]):
        (-[HTMLAreaElement setTabIndex:]):
        (-[HTMLAreaElement target]):
        (-[HTMLAreaElement setTarget:]):
        (-[HTMLScriptElement text]):
        (-[HTMLScriptElement setText:]):
        (-[HTMLScriptElement htmlFor]):
        (-[HTMLScriptElement setHtmlFor:]):
        (-[HTMLScriptElement event]):
        (-[HTMLScriptElement setEvent:]):
        (-[HTMLScriptElement charset]):
        (-[HTMLScriptElement setCharset:]):
        (-[HTMLScriptElement defer]):
        (-[HTMLScriptElement setDefer:]):
        (-[HTMLScriptElement src]):
        (-[HTMLScriptElement setSrc:]):
        (-[HTMLScriptElement type]):
        (-[HTMLScriptElement setType:]):
        (-[HTMLTableCaptionElement align]):
        (-[HTMLTableCaptionElement setAlign:]):
        (-[HTMLTableSectionElement align]):
        (-[HTMLTableSectionElement setAlign:]):
        (-[HTMLTableSectionElement ch]):
        (-[HTMLTableSectionElement setCh:]):
        (-[HTMLTableSectionElement chOff]):
        (-[HTMLTableSectionElement setChOff:]):
        (-[HTMLTableSectionElement vAlign]):
        (-[HTMLTableSectionElement setVAlign:]):
        (-[HTMLTableSectionElement rows]):
        (-[HTMLTableSectionElement insertRow:]):
        (-[HTMLTableSectionElement deleteRow:]):
        (-[HTMLTableElement caption]):
        (-[HTMLTableElement tHead]):
        (-[HTMLTableElement tFoot]):
        (-[HTMLTableElement rows]):
        (-[HTMLTableElement tBodies]):
        (-[HTMLTableElement align]):
        (-[HTMLTableElement setAlign:]):
        (-[HTMLTableElement bgColor]):
        (-[HTMLTableElement setBgColor:]):
        (-[HTMLTableElement border]):
        (-[HTMLTableElement setBorder:]):
        (-[HTMLTableElement cellPadding]):
        (-[HTMLTableElement setCellPadding:]):
        (-[HTMLTableElement cellSpacing]):
        (-[HTMLTableElement setCellSpacing:]):
        (-[HTMLTableElement frame]):
        (-[HTMLTableElement setFrame:]):
        (-[HTMLTableElement rules]):
        (-[HTMLTableElement setRules:]):
        (-[HTMLTableElement summary]):
        (-[HTMLTableElement setSummary:]):
        (-[HTMLTableElement width]):
        (-[HTMLTableElement setWidth:]):
        (-[HTMLTableElement createTHead]):
        (-[HTMLTableElement deleteTHead]):
        (-[HTMLTableElement createTFoot]):
        (-[HTMLTableElement deleteTFoot]):
        (-[HTMLTableElement createCaption]):
        (-[HTMLTableElement deleteCaption]):
        (-[HTMLTableElement deleteRow:]):
        (-[HTMLTableColElement align]):
        (-[HTMLTableColElement setAlign:]):
        (-[HTMLTableColElement ch]):
        (-[HTMLTableColElement setCh:]):
        (-[HTMLTableColElement chOff]):
        (-[HTMLTableColElement setChOff:]):
        (-[HTMLTableColElement span]):
        (-[HTMLTableColElement setSpan:]):
        (-[HTMLTableColElement vAlign]):
        (-[HTMLTableColElement setVAlign:]):
        (-[HTMLTableColElement width]):
        (-[HTMLTableColElement setWidth:]):
        (-[HTMLTableRowElement rowIndex]):
        (-[HTMLTableRowElement setRowIndex:]):
        (-[HTMLTableRowElement sectionRowIndex]):
        (-[HTMLTableRowElement setSectionRowIndex:]):
        (-[HTMLTableRowElement cells]):
        (-[HTMLTableRowElement setCells:]):
        (-[HTMLTableRowElement align]):
        (-[HTMLTableRowElement setAlign:]):
        (-[HTMLTableRowElement bgColor]):
        (-[HTMLTableRowElement setBgColor:]):
        (-[HTMLTableRowElement ch]):
        (-[HTMLTableRowElement setCh:]):
        (-[HTMLTableRowElement chOff]):
        (-[HTMLTableRowElement setChOff:]):
        (-[HTMLTableRowElement vAlign]):
        (-[HTMLTableRowElement setVAlign:]):
        (-[HTMLTableRowElement insertCell:]):
        (-[HTMLTableRowElement deleteCell:]):
        (-[HTMLTableCellElement cellIndex]):
        (-[HTMLTableCellElement setCellIndex:]):
        (-[HTMLTableCellElement abbr]):
        (-[HTMLTableCellElement setAbbr:]):
        (-[HTMLTableCellElement align]):
        (-[HTMLTableCellElement setAlign:]):
        (-[HTMLTableCellElement axis]):
        (-[HTMLTableCellElement setAxis:]):
        (-[HTMLTableCellElement bgColor]):
        (-[HTMLTableCellElement setBgColor:]):
        (-[HTMLTableCellElement ch]):
        (-[HTMLTableCellElement setCh:]):
        (-[HTMLTableCellElement chOff]):
        (-[HTMLTableCellElement setChOff:]):
        (-[HTMLTableCellElement colSpan]):
        (-[HTMLTableCellElement setColSpan:]):
        (-[HTMLTableCellElement headers]):
        (-[HTMLTableCellElement setHeaders:]):
        (-[HTMLTableCellElement height]):
        (-[HTMLTableCellElement setHeight:]):
        (-[HTMLTableCellElement noWrap]):
        (-[HTMLTableCellElement setNoWrap:]):
        (-[HTMLTableCellElement rowSpan]):
        (-[HTMLTableCellElement setRowSpan:]):
        (-[HTMLTableCellElement scope]):
        (-[HTMLTableCellElement setScope:]):
        (-[HTMLTableCellElement vAlign]):
        (-[HTMLTableCellElement setVAlign:]):
        (-[HTMLTableCellElement width]):
        (-[HTMLTableCellElement setWidth:]):
        (-[HTMLFrameSetElement cols]):
        (-[HTMLFrameSetElement setCols:]):
        (-[HTMLFrameSetElement rows]):
        (-[HTMLFrameSetElement setRows:]):
        (-[HTMLFrameElement frameBorder]):
        (-[HTMLFrameElement setFrameBorder:]):
        (-[HTMLFrameElement longDesc]):
        (-[HTMLFrameElement setLongDesc:]):
        (-[HTMLFrameElement marginHeight]):
        (-[HTMLFrameElement setMarginHeight:]):
        (-[HTMLFrameElement marginWidth]):
        (-[HTMLFrameElement setMarginWidth:]):
        (-[HTMLFrameElement name]):
        (-[HTMLFrameElement setName:]):
        (-[HTMLFrameElement noResize]):
        (-[HTMLFrameElement setNoResize:]):
        (-[HTMLFrameElement scrolling]):
        (-[HTMLFrameElement setScrolling:]):
        (-[HTMLFrameElement src]):
        (-[HTMLFrameElement setSrc:]):
        (-[HTMLIFrameElement align]):
        (-[HTMLIFrameElement setAlign:]):
        (-[HTMLIFrameElement frameBorder]):
        (-[HTMLIFrameElement setFrameBorder:]):
        (-[HTMLIFrameElement height]):
        (-[HTMLIFrameElement setHeight:]):
        (-[HTMLIFrameElement longDesc]):
        (-[HTMLIFrameElement setLongDesc:]):
        (-[HTMLIFrameElement marginHeight]):
        (-[HTMLIFrameElement setMarginHeight:]):
        (-[HTMLIFrameElement marginWidth]):
        (-[HTMLIFrameElement setMarginWidth:]):
        (-[HTMLIFrameElement name]):
        (-[HTMLIFrameElement setName:]):
        (-[HTMLIFrameElement scrolling]):
        (-[HTMLIFrameElement setScrolling:]):
        (-[HTMLIFrameElement src]):
        (-[HTMLIFrameElement setSrc:]):
        (-[HTMLIFrameElement width]):
        (-[HTMLIFrameElement setWidth:]):

2004-03-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave

        I have clarified the concept (at least in my head) 
        that each edit command has an obligation to put the
        selection in the right place after it is applied, 
        unapplied, or reapplied. Right now, each edit command 
        calls setStartingSelection and setEndingSelection to do
        this, I made these function move the selection on 
        setting.

        * khtml/editing/htmlediting_impl.cpp:
        (EditCommandImpl::setStartingSelection)
        (EditCommandImpl::setEndingSelection)
        (InputTextCommandImpl::coalesce)
        (InputTextCommandImpl::deleteCharacter)
        (InputTextCommandImpl::execute)
        * khtml/editing/htmlediting_impl.h:

2004-03-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave
    
        Various changes to move us forward on editing.
        
        1. I reorganized the concrete EditCommand interface and
        implementation classes alphabetically in their 
        respective files, to make it easier to find things.
        
        2. I added a TypingCommand composite class to gang 
        up all keystrokes and make it possible to pass a 
        single command over to the Cocoa undo system in all cases.
        
        3. I now send all keystrokes back over to WebKit
        to be interpreted by the text input system. In concert
        with the many new NSResponder method implementations I
        added to WebView, we now respond to keystrokes in a much
        more Cocoa-like way that sets us down the path to
        integrating with the Cocoa text input system some day.

        4. I fixed up our integration with the Cocoa undo
        system. I also removed much of the undo support code
        from the KHTMPart class. As a replacement, I implemented
        reporting of undoable commands to KHTMLPart so that 
        a KDE hookup is quite feasible. As a result, undo 
        should "just work" in Blot (Chris has reported that 
        it has been busted).

        5. I added the DOM CSS bindings for Objective-C. This
        required some rearranging of the existing DOM bindings
        code, and while I was there, I did various cleanups in the
        existing DOM bindings.

        * About 400 lines of changed files and functions elided.
        
2004-03-11  Chris Blumenberg  <cblu@apple.com>

	Fixed some spacing issues in reconstructed source and web archives that were caused by a malformed doc type string that we were constructing.

        Reviewed by darin.

        * khtml/html/html_documentimpl.cpp:
        (HTMLDocumentImpl::determineParseMode): set the public ID and system ID on the doc type
        * khtml/xml/dom_docimpl.cpp:
        (DocumentTypeImpl::toString): put a space between DOCTYPE and the name
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentTypeImpl::setPublicId): new
        (DOM::DocumentTypeImpl::setSystemId): new

2004-03-10  David Hyatt  <hyatt@apple.com>

	Fix for 3584646, AxWebArea should encompass all children (its AxSize should).
	
        Reviewed by mjs

        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::absoluteRects):
        * khtml/rendering/render_canvas.h:

2004-03-10  Chris Blumenberg  <cblu@apple.com>

	Fixed: INPUT images are not part of web archives.

        Reviewed by rjw.

        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::isSubresourceURLAttribute):
        * khtml/html/html_formimpl.h:

2004-03-09  Chris Blumenberg  <cblu@apple.com>

	Implemented WebCore side of: <rdar://problem/3577508>: API: web archive related API's

        Reviewed by rjw.

        * WebCore-combined.exp:
        * WebCore.exp:
        * kwq/DOM.mm:
        (+[DOMRange _rangeWithImpl:]): made internally accessible
        (-[DOMRange _rangeImpl]): ditto
        * kwq/DOMInternal.h:
        * kwq/KWQStringList.h:
        * kwq/KWQStringList.mm:
        (QStringList::getNSArray): new
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge pasteMarkupString:]): renamed from pasteHTMLString since XML pasting may be possible
        (-[WebCoreBridge selectedRange]): new
        (-[WebCoreBridge _documentTypeString]): new
        (-[WebCoreBridge _stringWithDocumentTypeStringAndMarkupString:]): new
        (-[WebCoreBridge markupStringFromNode:subresourceURLStrings:]): new, needed for WebKit API's
        (-[WebCoreBridge markupStringFromRange:subresourceURLStrings:]): new, needed for WebKit API's

2004-03-09  David Hyatt  <hyatt@apple.com>

	Make the AXLinkUIElements attribute always return an array (never return nil).
	
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityAttributeValue:]):

2004-03-09  David Hyatt  <hyatt@apple.com>

	(1) Change root element in a document to have a role of AXWebArea.
	(2) Add support for AXURL to links and children of links.
	(3) Add support for AXLinkUIElements to the AXWebArea
	
        Reviewed by john

        * khtml/dom/html_misc.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject role]):
        (-[KWQAccObject roleDescription]):
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityAttributeValue:]):

2004-03-09  John Sullivan  <sullivan@apple.com>

        Reviewed by nobody.

        * kwq/KWQKURL.mm:
        (KURL::KURL):
        Fixed broken build by removing wayward "break" statement.

2004-03-08  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3554876>: REGRESSION (100-125): cannot upload file if path contains non-ASCII characters

        * kwq/KWQKURL.mm: Remove Colon constant so we can fit in 8 bits again.
        (KURL::KURL): Rewrite so we don't need isSchemeCharOrColon.

=== Safari-131 ===

2004-03-08  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        * WebCore.pbproj/project.pbxproj: Added CFBundleName to Info.plist.

2004-03-05  David Hyatt  <hyatt@apple.com>

	Fix for first-line inheritance problem caused by incorrectly inheriting first-line into floating
	blocks.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::firstLineBlock):

2004-03-05  Ken Kocienda  <kocienda@apple.com>

	Forgot to add this when I checked in last time.

        * ForwardingHeaders/css/css_computedstyle.h: Added.

2004-03-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Dave.

        Added initial support for retrieving the computed 
        style of document elements.

        * WebCore.pbproj/project.pbxproj:
        * khtml/css/css_computedstyle.cpp: Added.
        (DOM::valueForLength): Helper to turn a khtml::Length into a computed value string.
        (DOM::stringForBorderStyle): Helper to turn an EBorderStyle into a computed value string.
        (DOM::stringForTextAlign): Helper to turn an ETextAlign into a computed value string.
        (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): New function.
        (DOM::CSSComputedStyleDeclarationImpl::~CSSComputedStyleDeclarationImpl): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::cssText): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::setCssText): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyPriority): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::setLengthProperty): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::item): Ditto.
        (DOM::CSSComputedStyleDeclarationImpl::property): Ditto.
        * khtml/css/css_computedstyle.h: Added.
        * khtml/css/css_valueimpl.cpp:
        (CSSPrimitiveValueImpl::cssText): Fixed some formatting of Rect. Added
        suppoprt for rgba colors.
        * khtml/css/css_valueimpl.h:
        (DOM::CSSStyleDeclarationImpl::node):
        * khtml/ecma/kjs_css.cpp:
        (KJS::getDOMCSSStyleDeclaration):
        * khtml/ecma/kjs_dom.cpp:
        (DOMDocument::getValueProperty): defaultView is a property, used to be a function, 
        which was wrong. Fixed.
        (DOMDocumentProtoFunc::tryCall): Ditto.
        * khtml/ecma/kjs_dom.lut.h:
        (KJS::): Regenerated file.
        * khtml/misc/khtmllayout.h:
        (khtml::Length::length): Added an accessor to the value, to promote better coding
        style, rather than peeking and poking the value directly.
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::borderLeftWidth): BHIDDEN also should be treated like BNONE when it comes
        to returning a zero value. Now it is.
        (khtml::RenderStyle::borderRightWidth): Ditto.
        (khtml::RenderStyle::borderTopWidth): Ditto.
        (khtml::RenderStyle::borderBottomWidth): Ditto.
        (khtml::RenderStyle::outlineWidth): Ditto.
        (khtml::RenderStyle::outlineOffset): Ditto.
        * khtml/xml/dom2_viewsimpl.cpp:
        (AbstractViewImpl::getComputedStyle): Added an implementation for this formerly stubbed out function.

2004-03-05  Ken Kocienda  <kocienda@apple.com>

        Change by Darin. Reviewed by me.

        * kwq/DOM.mm: Fixed the following functions to deal with
        casting objects derived from NodeImpl back and forth to
        NodeImpl given that the derived classes use multiple
        inheritance.
        (-[DOMDocument _documentImpl]):
        (-[DOMCharacterData _characterDataImpl]):
        (-[DOMAttr _attrImpl]):
        (-[DOMElement _elementImpl]):
        (-[DOMText _textImpl]):
        (-[DOMDocumentType _documentTypeImpl]):
        (-[DOMNotation _notationImpl]):
        (-[DOMEntity _entityImpl]):
        (-[DOMProcessingInstruction _processingInstructionImpl]):

2004-03-03  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
        copyright string, and that's all that was in here.
        * WebCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.

2004-03-03  David Hyatt  <hyatt@apple.com>

	Speed up access to the children arrays of accessibility objects by caching mutable arrays of children
	and nulling them out only when the children change.
	
        Reviewed by john

        * khtml/rendering/render_container.cpp:
        (RenderContainer::removeChildNode):
        (RenderContainer::appendChildNode):
        (RenderContainer::insertChildNode):
        * kwq/KWQAccObject.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject detach]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        (-[KWQAccObject childrenChanged]):
        (-[KWQAccObject clearChildren]):
        * kwq/KWQAccObjectCache.h:
        * kwq/KWQAccObjectCache.mm:
        (KWQAccObjectCache::childrenChanged):

2004-03-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin and me. Coding by Darin and me.
        
        1) Fix some places that were calling [self class], in at
        least one case calling a method not defined on the class
        (not gonna work).
        2) Add underscore prefix for all non-API method names.
        3) Make DOMObject refuse to init, which might prevent
        problems where people get confused and think they can
        subclass or instantiate it or its subclasses.
        4) Use some C+mojo to replace NSStringToDOMString and
        DOMStringToNSString with type conversions built into the
        DOMString class.
        5) Removed NSError out parameters from the API. Methods
        now throw NSExceptions.
        6) Exception code local variables now initialized before
        passing to khtml DOM impl calls.
        7) Various other cleanups and tweaks.

        * khtml/dom/dom_string.h
        * khtml/xml/dom_atomicstring.h
        * kwq/DOM.h
        * kwq/DOM.mm
        * kwq/DOMInternal.h
        * kwq/KWQKHTMLPart.mm
        * kwq/WebCoreBridge.mm

2004-03-02  Richard Williamson   <rjw@apple.com>

	Added NP_SAP API.  This API includes the new entry points
	used to bind native interfaces to JavaScript.  It's final location
	may change.

	Made changes to KWQKHTMLPart.mm to reflect changes in names
	on RootObject.
	
        Reviewed by Chris.

        * WebCore.pbproj/project.pbxproj:
        * khtml/ecma/NP_SAP.h: Added.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::cleanupPluginRootObjects):
        * kwq/WebCoreBridge.mm:

2004-03-01  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3549201>: repro crash in KHTMLPart::begin inside JavaScript code (gmpartsdirect.com)

	Added some null checks. I am not sure why this page attaches a
	document that has no view, but these changes make it work
	perfectly.
        
	* khtml/khtml_part.cpp:
        (KHTMLPart::begin): Add check for null view before use.  *
	khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::close): ditto
        (DocumentImpl::recalcStyle): Add check for null paint device.

=== Safari-130 ===

2004-03-01  Ken Kocienda  <kocienda@apple.com>

        Rollout last night's checkin. The tree was closed.

        * kwq/DOM.h
        * kwq/DOM.mm
        * kwq/DOMInternal.h
        * kwq/KWQKHTMLPart.mm
        * kwq/WebCoreBridge.mm

2004-03-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me, changes by Darin.
        
        Yet another pass at the DOM API, this one by 
        Darin to simplify the internal structure of the
        implementation. Little has changed in the API;
        much has changed in the implementation, particularly
        with regard to object creation and data storage and
        the class hierarchy.

        * kwq/DOM.h
        * kwq/DOM.mm
        * kwq/DOMInternal.h
        * kwq/KWQKHTMLPart.mm
        * kwq/WebCoreBridge.mm

2004-03-01  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by NOBODY (OOPS!).

	- fixed <rdar://problem/3567047>: REGRESSION: repro crash inside KJS (dispatchToBoolean) at www.thedonnas.com
	- fixed <rdar://problem/3550461>: REGRESSION: repro crash in JavaScript at www.alaska.com
        
	* khtml/ecma/kjs_window.cpp:
        (Window::getListener): Return Null() when the listener object is
	null, indicating the code failed to parse. Otherwise we return a
	bad value which can later crash the JS interpreter.

2004-03-01  Darin Adler  <darin@apple.com>

        Reviewed by Vicki.

        - fixed Tiger build

        * kwq/KWQXmlSimpleReader.mm: (QXmlSimpleReader::parse):
        Changed SAX structure initialization code so it compiles with both the newer
        and older libxml. Not sure this will work right with namespaces with the new
        libxml; we'll have to test.

2004-03-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by me, as suggested by Darin

        * khtml/misc/htmlattrs.c:
        (getAttrName): Generated code no longer has extraneous semicolon.
        * khtml/misc/htmltags.c: Generated code no longer has extraneous semicolon.
        (getTagName):
        * khtml/misc/makeattrs: Removed extraneous semicolon from end of file.
        * khtml/misc/maketags: Ditto.

2004-03-01  Ken Kocienda  <kocienda@apple.com>

        * kwq/DOMInternal.h: Replaced tabs with spaces.

2004-03-01  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

        Changed all Objective-C DOM classes from protocols to classes, using
        a class cluster-like approach.

        * WebCore.pbproj/project.pbxproj:
        * khtml/dom/html_object.cpp: Put code in DOM namespace.
        * khtml/html/html_headimpl.cpp: Pull in entire DOM namespace in using directive to
        make up for the removal of it from htmlattrs.
        * khtml/html/htmltokenizer.cpp: Add using directives for the DOM classes used.
        * khtml/misc/htmlattrs.c:
        (getAttrName):
        * khtml/misc/htmlattrs.h: 
        * khtml/misc/htmltags.c:
        (getTagName):
        * khtml/misc/makeattrs: Some changes here to avoid pulling in the entire DOM namespace.
        Explicitly use DOM namespace scoping for DOMString.
        * khtml/misc/maketags: Explicitly use DOM namespace scoping for DOMString.
        * khtml/rendering/render_form.cpp: Pull in entire DOM namespace in using directive to
        make up for the removal of it from htmlattrs.
        * kwq/DOM-compat.h:
        * kwq/DOM.h:
        * kwq/DOM.mm: Added.
        * kwq/WebCoreDOM.h: Removed.
        * kwq/WebCoreDOM.mm: Removed.

2004-02-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3514733>: nil-deref in createHTMLEventListener at skiset.com
	<rdar://problem/3510676>: nil-deref of view in DocumentImpl::createHTMLEventListener at kirotv.com
	
	* khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLEventListener): Don't create the listener if there is no
	part. Also, get the part when going through the view. This prevents problems when
	handlers are set or removed from the onUnload handler.

2004-02-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- fixed <rdar://problem/3571356>: REGRESSION: Crash in isPointInsideSelection clicking on link in Apple web directory frame
	
        * khtml/khtml_part.cpp:
        (KHTMLPart::isPointInsideSelection): Don't crash if innerNode is
	NULL, as this can happen mousing over a frame that's in the
	process of loading and currently empty. Since such a frame
	obviously can't be inside the selection, this seems like a good
	enough fix.
	
2004-02-26  David Hyatt  <hyatt@apple.com>

	Fix for 3528839, wide table cut off because of shorts being used instead of ints.
	
        Reviewed by darin

        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):
        (RenderTableCell::setWidth):
        * khtml/rendering/table_layout.cpp:
        (FixedTableLayout::calcWidthArray):
        (FixedTableLayout::calcMinMaxWidth):
        (AutoTableLayout::calcMinMaxWidth):

2004-02-26  Chris Blumenberg  <cblu@apple.com>

	Fixed a few problems I found with reconstructed source while on my way to implementing "Mail Page".

        Reviewed by hyatt.

        * khtml/html/html_headimpl.cpp:
        (HTMLLinkElementImpl::isSubresourceURLAttribute): only true for stylesheet and icon
        * khtml/html/html_imageimpl.cpp:
        (HTMLAreaElementImpl::isURLAttribute): implement isURLAttribute not isSubresourceURLAttribute
        * khtml/html/html_imageimpl.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::dirtyLineBoxes): crasher fix that I found using libgmalloc
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithOptions): don't escape SCRIPT and TEXTAREA text, write close tags for tags that need them instead of relying on the children check 
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge HTMLString:]): call recursive_toHTMLWithOptions on the first child of the document so <#document /> isn't part of the source

2004-02-26  David Hyatt  <hyatt@apple.com>

	Convert render object widths from short to int.  There was a bug on this, but I can't find it in Radar.
	
        Reviewed by john

        * khtml/rendering/render_applet.cpp:
        (RenderApplet::intrinsicWidth):
        (RenderEmptyApplet::intrinsicWidth):
        * khtml/rendering/render_applet.h:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::calcMinMaxWidth):
        (khtml::RenderBlock::calcInlineMinMaxWidth):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::contentWidth):
        (RenderBox::width):
        (RenderBox::containingBlockWidth):
        (RenderBox::calcReplacedWidth):
        (RenderBox::setStaticX):
        * khtml/rendering/render_box.h:
        (khtml::RenderBox::minWidth):
        (khtml::RenderBox::maxWidth):
        * khtml/rendering/render_br.h:
        (khtml::RenderBR::minWidth):
        (khtml::RenderBR::maxWidth):
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::layout):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::calcMinMaxWidth):
        * khtml/rendering/render_frames.cpp:
        (RenderPart::intrinsicWidth):
        (RenderPartObject::layout):
        * khtml/rendering/render_frames.h:
        * khtml/rendering/render_image.cpp:
        (RenderImage::layout):
        (RenderImage::calcReplacedWidth):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::width):
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::scrollWidth):
        * khtml/rendering/render_layer.h:
        (khtml::RenderLayer::width):
        (khtml::RenderLayer::setWidth):
        (khtml::RenderLayer::scrollXOffset):
        * khtml/rendering/render_line.h:
        (khtml::InlineBox::setWidth):
        (khtml::InlineBox::width):
        (khtml::InlineBox::setXPos):
        (khtml::InlineBox::xPos):
        * khtml/rendering/render_object.cpp:
        (RenderObject::containingBlockWidth):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::setStaticX):
        (khtml::RenderObject::contentWidth):
        (khtml::RenderObject::intrinsicWidth):
        (khtml::RenderObject::width):
        (khtml::RenderObject::offsetWidth):
        (khtml::RenderObject::minWidth):
        (khtml::RenderObject::maxWidth):
        * khtml/rendering/render_replaced.h:
        (khtml::RenderReplaced::intrinsicWidth):
        * khtml/rendering/render_table.cpp:
        (RenderTable::calcWidth):
        * khtml/rendering/render_table.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::trimmedMinMaxWidth):
        (RenderText::width):
        * khtml/rendering/render_text.h:
        (khtml::RenderText::minWidth):
        (khtml::RenderText::maxWidth):
        * khtml/rendering/table_layout.cpp:

2004-02-26  Trey Matteson  <trey@apple.com>

	3566668 - REGRESSION (125-128): autofill of popup lists is broken
	3571271 - autofill parsing of field names should treat _ as a word separator

        Reviewed by Chris, Darin

        * kwq/KWQComboBox.h:
        * kwq/KWQComboBox.mm:
        (QComboBox::populate):   New virtual method to force any lazy field population to happen.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::matchLabelsAgainstElement):  Change _ to ' ', to make it a word separator.
        * kwq/KWQWidget.h:
        (QWidget::populate):  Implement populate to fill out the menu's data.
        * kwq/WebCoreBridge.mm:
        (viewForElement):    Make sure widget is populated before handing it out.

2004-02-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

        * WebCore.pbproj/project.pbxproj:
        * khtml/xml/dom2_rangeimpl.h: Now includes createInstance glue function as do the other
        khtml DOM objects that we reflect into ObjC.
        * kwq/DOM-compat.h: Added. Compatibility declarations for DOM SPI. Note that this file 
        is copied into WebKit by the build system as needed.
        * kwq/DOM.h: Added. New home for DOM SPI. Note that this file is copied into WebKit by the build 
        system as needed.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::recordFormValue): Updated usage to new DOM SPI.
        * kwq/WebCoreBridge.h: Updated usage to new DOM SPI.
        * kwq/WebCoreBridge.mm: Updated usage to new DOM SPI. Needed to add DOM range impl include since
        includes jiggered around and this needed header was no longer included indirectly.
        (-[WebCoreBridge elementForView:]): Ditto.
        (inputElementFromDOMElement): Ditto.
        (formElementFromDOMElement): Ditto.
        (-[WebCoreBridge elementWithName:inForm:]): Ditto.
        (-[WebCoreBridge elementDoesAutoComplete:]): Ditto.
        (-[WebCoreBridge elementIsPassword:]): Ditto.
        (-[WebCoreBridge currentForm]): Ditto.
        (-[WebCoreBridge controlsInForm:]): Ditto.
        (-[WebCoreBridge searchForLabels:beforeElement:]): Ditto.
        (-[WebCoreBridge matchLabels:againstElement:]): Ditto.
        (-[WebCoreBridge elementAtPoint:]): Ditto.
        (-[WebCoreBridge DOMDocument]): Ditto.
        (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]): Ditto.
        (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
        (-[WebCoreBridge selectionStart]): Ditto.
        (-[WebCoreBridge selectionEnd]): Ditto.
        * kwq/WebCoreDOM.h: New home for all private declarations needed for reflecting DOM into ObjC.
        * kwq/WebCoreDOM.mm: Added. New home for all implementations needed for reflecting DOM into ObjC.
        * kwq/WebCoreDOMDocument.mm: Removed. All ObjC DOM implementation now in WebCoreDOM.mm.
        * kwq/WebCoreDOMNode.mm: Removed. All ObjC DOM implementation now in WebCoreDOM.mm.
        * kwq/WebCoreDOMPrivate.h: Removed.
        * kwq/WebDOMDocument.h: Removed.
        * kwq/WebDOMElement.h: Removed.
        * kwq/WebDOMNode.h: Removed.

2004-02-25  John Sullivan  <sullivan@apple.com>

        WebCore part of fix for <rdar://problem/3546370>: add a way to tab to menus, 
        checkmarks, and buttons without turning on Full Keyboard Acceess

        Reviewed by Ken.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::tabsToAllControls):
        now checks for option-tab like tabsToLinks
        (KWQKHTMLPart::partForWidget):
        new method, extracted from bridgeForWidget
        (KWQKHTMLPart::bridgeForWidget):
        now calls extracted method

        * kwq/KWQButton.mm:
        (-[KWQButton canBecomeKeyView]):
        overridden to handle our rules about full keyboard access, different
        than NSView's rules
        * kwq/KWQComboBox.mm:
        (-[KWQPopUpButton canBecomeKeyView]):
        ditto
        * kwq/KWQListBox.mm:
        (-[KWQTableView canBecomeKeyView]):
        ditto
        
2004-02-24  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        * kwq/KWQString.mm: (QString::endsWith): Fixed broken end of string test, to get rid
        of false positives.

        * WebCore-tests.exp: Added endsWith so it can be tested.
        * WebCore-combined.exp: Regenerated.

2004-02-23  David Hyatt  <hyatt@apple.com>

	Fix for 3549772, hangs on border collapsing.
	
        Reviewed by darin

        * khtml/rendering/render_object.cpp:
        (RenderObject::collectBorders):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_table.cpp:
        (RenderTable::paint):
        (compareBorders):
        (RenderTableCell::paint):
        (addBorderStyle):
        (RenderTableCell::collectBorders):
        * khtml/rendering/render_table.h:

2004-02-23  David Hyatt  <hyatt@apple.com>

	Fix for 3558717, make sure that form elements that are removed from a document also remove themselves
	from the form.

	Reviewed by darin.
	
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::removedFromDocument):
        * khtml/html/html_formimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_nodeimpl.h:

	Implement smarter line layout for faster typing and repainting when individual lines change.

	Reviewed by kocienda.
	
	* khtml/khtmlview.cpp:
        (KHTMLViewPrivate::KHTMLViewPrivate):
        (KHTMLViewPrivate::~KHTMLViewPrivate):
        (KHTMLViewPrivate::reset):
        (KHTMLView::addRepaintInfo):
        (KHTMLView::layout):
        * khtml/khtmlview.h:
        * khtml/rendering/bidi.cpp:
        (khtml::Bidinext):
        (khtml::appendRun):
        (khtml::embed):
        (khtml::RenderBlock::constructLine):
        (khtml::RenderBlock::computeHorizontalPositionsForLine):
        (khtml::RenderBlock::computeVerticalPositionsForLine):
        (khtml::RenderBlock::bidiReorderLine):
        (khtml::buildCompactRuns):
        (khtml::RenderBlock::layoutInlineChildren):
        (khtml::RenderBlock::determineStartPosition):
        (khtml::RenderBlock::determineEndPosition):
        (khtml::RenderBlock::matchedEndLine):
        (khtml::RenderBlock::findNextLineBreak):
        * khtml/rendering/render_block.cpp:
        (khtml:::RenderFlow):
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::positionNewFloats):
        (khtml::RenderBlock::lowestPosition):
        (khtml::RenderBlock::rightmostPosition):
        (khtml::RenderBlock::leftmostPosition):
        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::firstRootBox):
        (khtml::RenderBlock::lastRootBox):
        (khtml::RenderBlock::setLinesAppended):
        (khtml::RenderBlock::linesAppended):
        * khtml/rendering/render_box.cpp:
        (RenderBox::dirtyLineBoxes):
        (RenderBox::deleteLineBoxWrapper):
        (RenderBox::setInlineBoxWrapper):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::createInlineBox):
        (RenderBR::position):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::appendChildNode):
        (RenderContainer::insertChildNode):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::placeChild):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::extractLineBox):
        (RenderFlow::attachLineBox):
        (RenderFlow::removeLineBox):
        (RenderFlow::dirtyLinesFromChangedChild):
        (RenderFlow::dirtyLineBoxes):
        (RenderFlow::createInlineBox):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_line.cpp:
        (InlineBox::dirtyLineBoxes):
        (InlineBox::deleteLine):
        (InlineBox::extractLine):
        (InlineBox::attachLine):
        (InlineBox::adjustVerticalPosition):
        (InlineBox::root):
        (InlineBox::nextOnLineExists):
        (InlineBox::prevOnLineExists):
        (InlineFlowBox::removeChild):
        (InlineFlowBox::deleteLine):
        (InlineFlowBox::extractLine):
        (InlineFlowBox::attachLine):
        (InlineFlowBox::adjustVerticalPosition):
        (InlineFlowBox::verticallyAlignBoxes):
        (InlineFlowBox::adjustMaxAscentAndDescent):
        (RootInlineBox::adjustVerticalPosition):
        (RootInlineBox::childRemoved):
        * khtml/rendering/render_line.h:
        (khtml::InlineBox::m_extracted):
        (khtml::InlineBox::setExtracted):
        (khtml::InlineBox::object):
        (khtml::InlineBox::parent):
        (khtml::InlineBox::isDirty):
        (khtml::InlineBox::markDirty):
        (khtml::InlineFlowBox::prevFlowBox):
        (khtml::InlineFlowBox::nextFlowBox):
        (khtml::RootInlineBox::RootInlineBox):
        (khtml::RootInlineBox::nextRootBox):
        (khtml::RootInlineBox::prevRootBox):
        (khtml::RootInlineBox::setLineBreakInfo):
        (khtml::RootInlineBox::setLineBreakPos):
        (khtml::RootInlineBox::setBlockHeight):
        (khtml::RootInlineBox::setEndsWithBreak):
        (khtml::RootInlineBox::blockHeight):
        (khtml::RootInlineBox::endsWithBreak):
        (khtml::RootInlineBox::lineBreakObj):
        (khtml::RootInlineBox::lineBreakPos):
        * khtml/rendering/render_object.cpp:
        (RenderObject::repaintAfterLayoutIfNeeded):
        (RenderObject::repaintObjectsBeforeLayout):
        (RenderObject::dirtyLinesFromChangedChild):
        (RenderObject::createInlineBox):
        (RenderObject::dirtyLineBoxes):
        (RenderObject::setInlineBoxWrapper):
        (RenderObject::deleteLineBoxWrapper):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::RepaintInfo::m_repaintRect):
        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::deleteLine):
        (InlineTextBox::extractLine):
        (InlineTextBox::attachLine):
        (RenderText::RenderText):
        (RenderText::detach):
        (RenderText::extractTextBox):
        (RenderText::attachTextBox):
        (RenderText::removeTextBox):
        (RenderText::setTextWithOffset):
        (RenderText::setText):
        (RenderText::dirtyLineBoxes):
        (RenderText::createInlineBox):
        * khtml/rendering/render_text.h:
        (khtml::InlineTextBox::start):
        (khtml::InlineTextBox::end):
        (khtml::InlineTextBox::offsetRun):
        * khtml/xml/dom_textimpl.cpp:
        (CharacterDataImpl::setData):
        (CharacterDataImpl::appendData):
        (CharacterDataImpl::insertData):
        (CharacterDataImpl::deleteData):
        (CharacterDataImpl::replaceData):
        (TextImpl::splitText):
        * kwq/KWQRenderTreeDebug.cpp:
        (write):

	RenderBlock contains two other fixes.  The first is a fix to rightmost/lowestPosition to properly add in
	margins to floats.

	Reviewed by mjs

	The second fix is to repair a bug in block-level replaced elements with margins.  If the floats they moved to
	dodge can fit in their margins, then they don't technically have to move at all.

	Reviewed by john

2004-02-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3552346>: REGRESSION 100-125: nil-dereference in KHTMLPart::isPointInsideSelection (progz.ru, many other sites)
	
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::nodeAtPointForLayer): To cover the case of
	positioned generated content, make sure to find an element if we
	don't have one yet when we get to the layer level.

=== Safari-129 ===

2004-02-19  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3563402>: when copying HTML, relative URLs should be made absolute

	- Added isSubresourceURLAttribute to ElementImpl which is overridden by subclasses determine if an attribute refers to a subresource.
	- Added isURLAttribute to ElementImpl which is overridden by subclasses determine if an attribute refers to any kind of URL.

        Reviewed by Dave.

        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::isSubresourceURLAttribute):
        (HTMLFrameElementImpl::isSubresourceURLAttribute):
        (HTMLIFrameElementImpl::openURL):
        (HTMLIFrameElementImpl::isSubresourceURLAttribute):
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::isURLAttribute):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_headimpl.cpp:
        (HTMLLinkElementImpl::isSubresourceURLAttribute):
        (HTMLScriptElementImpl::id):
        (HTMLScriptElementImpl::isSubresourceURLAttribute):
        * khtml/html/html_headimpl.h:
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::isSubresourceURLAttribute):
        (HTMLAreaElementImpl::getRegion):
        (HTMLAreaElementImpl::isSubresourceURLAttribute):
        * khtml/html/html_imageimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isURLAttribute):
        * khtml/html/html_inlineimpl.h:
        * khtml/html/html_objectimpl.cpp:
        (HTMLEmbedElementImpl::isSubresourceURLAttribute):
        (HTMLObjectElementImpl::isSubresourceURLAttribute):
        (HTMLParamElementImpl::parseHTMLAttribute):
        (HTMLParamElementImpl::isSubresourceURLAttribute):
        * khtml/html/html_objectimpl.h:
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::isSubresourceURLAttribute):
        (HTMLTableCellElementImpl::attach):
        (HTMLTableCellElementImpl::isSubresourceURLAttribute):
        * khtml/html/html_tableimpl.h:
        * khtml/xml/dom2_rangeimpl.cpp:
        (RangeImpl::toHTMLWithOptions): take completeURLs and subresourceURLs arguments
        (RangeImpl::toHTML): call toHTMLWithOptions with default options
        * khtml/xml/dom2_rangeimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::isURLAttribute):
        (ElementImpl::isSubresourceURLAttribute):
        * khtml/xml/dom_elementimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithOptions): take completeURLs and subresourceURLs arguments
        (NodeImpl::recursive_toHTML): call recursive_toHTML with default options
        * khtml/xml/dom_nodeimpl.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge selectedHTML:]): renamed to return subresource URL strings

2004-02-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3537397>: REGRESSION (100-114): Return doesn't work in Japanese input method for some HomePage fields
        
        * kwq/KWQTextArea.mm:
        (-[KWQTextAreaTextView keyDown:]): Don't send events through DOM when there is marked
	text.
        (-[KWQTextAreaTextView keyUp:]): Ditto.
        * kwq/KWQTextField.mm:
        (-[KWQTextField textView:shouldHandleEvent:]): Ditto.
        (-[KWQSecureTextField textView:shouldHandleEvent:]): Ditto.
	* khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::defaultEventHandler): No need to check for
	marked text on "return" any more, because we won't send key events
	through the DOM at all when there is marked text.
        * kwq/KWQLineEdit.h:
        * kwq/KWQLineEdit.mm: Removed haveMarkedText method, no longer
	used by anything.

2004-02-16  Chris Blumenberg  <cblu@apple.com>

	WebCore side of pasting image data.

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (PasteImageCommand::PasteImageCommand): new
        (PasteImageCommand::~PasteImageCommand): new
        (PasteImageCommand::impl): new
        * khtml/editing/htmlediting.h:
        (khtml::):
        * khtml/editing/htmlediting_impl.cpp:
        (EditCommandImpl::name): added support for PasteImageCommandID
        (CompositeEditCommandImpl::insertNodeAt): new, factored out from PasteHTMLCommandImpl::apply
        (PasteHTMLCommandImpl::apply): call insertNodeAt
        (PasteImageCommandImpl::PasteImageCommandImpl): new
        (PasteImageCommandImpl::~PasteImageCommandImpl): new
        (PasteImageCommandImpl::apply): new
        * khtml/editing/htmlediting_impl.h:
        * khtml/khtml_part.cpp:
        (KHTMLPart::pasteHTMLString): unchanged
        (KHTMLPart::pasteImage): new
        * khtml/khtml_part.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge pasteImageWithURL:]): new

2004-02-16  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - Fixed some dynamic casts that Dirk complained about to use virtual functions instead.
          Since the virtual functions were already there, this is faster and better in most
          ways anyway.

        * khtml/dom/dom2_events.cpp:
        (UIEvent::keyCode): Use virtual function instead of dynamic_cast.
        (UIEvent::charCode): Ditto.
        (UIEvent::pageX): Ditto.
        (UIEvent::pageY): Ditto.
        (UIEvent::layerX): Ditto.
        (UIEvent::layerY): Ditto.
        (UIEvent::which): Ditto.

2004-02-15  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        * WebCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
        and removing redundant settings of things that match defaults in other build styles.

2004-02-15  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3548533: crash in XMLHttpRequest::slotData using Orkut's rating system

        * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::~XMLHttpRequest):
        Delete the QObject side, which has a side effect of disconnecting the
        signals which seem to be firing after the request is gone. There may be
        another way of addressing the crash by correcting some other problem with
        killing the job, but this demonstrably works and fixes a storage leak.

2004-02-12  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- redo visited link history checking for a 2% speed improvement

        * kwq/KWQKHistoryProvider.mm:
        (KParts::HistoryProvider::contains): Don't make a KURL or an
	NSString. Punt on canonicalization and directly pass the internal
	Latin1 or unicode buffer.
        * kwq/KWQString.h:
        * kwq/KWQString.mm:
        (QString::hasFastLatin1): New method to check whether getting the
	latin1 buffer is fast (doesn't allocate).
        * kwq/WebCoreHistory.h: add new methods to look up by raw latin1
	or unicode buffer instead of NSString.

=== Safari-128 ===

2004-02-12  David Hyatt  <hyatt@apple.com>

	Fix for 3557850 and 3557607.  Make sure to setParent(0) on the body's link declaration, so that TreeShared
	will delete it.
	
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::~HTMLBodyElementImpl):

2004-02-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

	Refactored object design for edit commands into something that's
	starting to feel more solid. Added some accessors to edit 
	commands.

        * WebCore.pbproj/project.pbxproj:
        * khtml/editing/htmlediting_impl.h: Added.
        * khtml/editing/htmlediting_impl.m: Added.

2004-02-11  David Hyatt  <hyatt@apple.com>

	Fix for 3550005, 936 leaks when loading checkbox page of pain.  Make sure to nuke the inline box
	wrapper when detaching the RenderWidget.

        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::detach):

2004-02-11  David Hyatt  <hyatt@apple.com>

	Add some more polish to ensure the ypos estimate is right.  Correct the clearing of images so that
	their top margins do not get added in when they clear the float because of having a large width.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):
        * layout-tests/fast/block/margin-collapse/101-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/101.html: Added.
        * layout-tests/fast/block/margin-collapse/102-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/102.html: Added.

2004-02-11  David Hyatt  <hyatt@apple.com>

	Fix for 3556702, margin collapsing gets disabled when images spill out of the containing block.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):

2004-02-11  David Hyatt  <hyatt@apple.com>

	Fix the .rows and .cells arrays on tables by merging with the KHTML trunk.  TH was being included
	as a row instead of as a cell.
	
        Reviewed by kocienda

        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::calcLength):
        (HTMLCollectionImpl::getItem):
        (HTMLCollectionImpl::getNamedItem):

2004-02-11  David Hyatt  <hyatt@apple.com>

	Remove my bogus refs of the elementSheet.  Fixes 3554213 and 3555467.
	
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::createLinkDecl):
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::additionalAttributeStyleDecl):
        (HTMLTableElementImpl::getSharedCellDecl):

2004-02-11  David Hyatt  <hyatt@apple.com>

	Fix for 3556037, regression where display:block generated content didn't work.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::setStyle):
        (khtml::RenderBlock::addChildToFlow):
        (khtml::RenderBlock::removeChild):
        (khtml::RenderBlock::renderName):
        * khtml/rendering/render_container.cpp:
        (RenderContainer::insertChildNode):
        (RenderContainer::removeLeftoverAnonymousBoxes):
        * khtml/rendering/render_inline.cpp:
        (RenderInline::splitFlow):
        (RenderInline::renderName):
        * khtml/rendering/render_list.cpp:
        (RenderListItem::updateMarkerLocation):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::isAnonymousBlock):
        * layout-tests/css1/pseudo/firstletter-expected.txt:
        * layout-tests/css1/pseudo/multiple_pseudo_elements-expected.txt:
        * layout-tests/fast/css-generated-content/002-expected.txt:
        * layout-tests/fast/css-generated-content/004-expected.txt:
        * layout-tests/fast/css-generated-content/005-expected.txt:
        * layout-tests/fast/css-generated-content/006-expected.txt:
        * layout-tests/fast/css-generated-content/007-expected.txt:
        * layout-tests/fast/css-generated-content/009-expected.txt:
        * layout-tests/fast/css-generated-content/010-expected.txt:
        * layout-tests/fast/selectors/039-expected.txt:
        * layout-tests/fast/selectors/039b-expected.txt:
        * layout-tests/fast/selectors/041-expected.txt:
        * layout-tests/fast/selectors/042-expected.txt:
        * layout-tests/fast/selectors/166a-expected.txt:
        * layout-tests/fast/selectors/168-expected.txt:
        * layout-tests/fast/selectors/168a-expected.txt:
        * layout-tests/fast/selectors/169-expected.txt:
        * layout-tests/fast/selectors/169a-expected.txt:
        * layout-tests/fast/text/firstline/002-expected.txt:
        * layout-tests/fast/text/firstline/003-expected.txt:

2004-02-11  Darin Adler   <darin@apple.com>

        Reviewed by Richard.

        * kwq/KWQTextCodec.mm:
        (KWQTextDecoder::convertLatin1):
	Fix off by one error.

2004-02-11  David Hyatt  <hyatt@apple.com>

	Convert paint methods over to use a new PaintInfo struct.  Eliminate the paintObject method.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paint):
        (khtml::RenderBlock::paintObject):
        (khtml::RenderBlock::paintFloats):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::paint):
        (RenderBox::paintRootBoxDecorations):
        (RenderBox::paintBoxDecorations):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_br.h:
        (khtml::RenderBR::paint):
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::paint):
        (RenderCanvas::paintBoxDecorations):
        * khtml/rendering/render_canvas.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLineBoxBackgroundBorder):
        (RenderFlow::paintLineBoxDecorations):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_form.cpp:
        (RenderFieldset::paintBoxDecorations):
        * khtml/rendering/render_form.h:
        * khtml/rendering/render_image.cpp:
        (RenderImage::paint):
        (RenderImage::updateFromElement):
        * khtml/rendering/render_image.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::paint):
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::paintLayer):
        * khtml/rendering/render_line.cpp:
        (InlineFlowBox::paintBackgroundAndBorder):
        (InlineFlowBox::paintDecorations):
        * khtml/rendering/render_line.h:
        (khtml::InlineRunBox::paintBackgroundAndBorder):
        (khtml::InlineRunBox::paintDecorations):
        * khtml/rendering/render_list.cpp:
        (RenderListItem::paint):
        (RenderListMarker::paint):
        * khtml/rendering/render_list.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::paint):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::PaintInfo::PaintInfo):
        (khtml::RenderObject::paintBoxDecorations):
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::shouldPaint):
        (RenderWidget::paint):
        * khtml/rendering/render_replaced.h:
        * khtml/rendering/render_table.cpp:
        (RenderTable::paint):
        (RenderTable::paintBoxDecorations):
        (RenderTableSection::paint):
        (RenderTableCell::paint):
        (RenderTableCell::paintBoxDecorations):
        * khtml/rendering/render_table.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::paint):
        * khtml/rendering/render_text.h:

2004-02-11  Ken Kocienda  <kocienda@apple.com>

		Removed include file I was considering checking, but 
		decided against. Of course, this dangling include
		broke the build.
		
        * kwq/KWQKHTMLPart.mm
        * kwq/WebCoreBridge.mm

2004-02-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        Several big changes.
        
        EditSteps are now all EditCommands.
        Smart pointer for Shared classes added to shared.h.
		Some events, like text input events, are now coalesced.
		"Undo typing" now implemented, even though the name is not in the menu yet.
		Integer id's added to EditCommand and its subclasses.
		A bunch of cleanup in the EditCommand classes.

        * khtml/editing/htmlediting.cpp:
        (EditCommand::EditCommand):
        (EditCommand::~EditCommand):
        (EditCommand::commandID):
        (EditCommand::reapply):
        (EditCommand::beginApply):
        (EditCommand::endApply):
        (EditCommand::beginUnapply):
        (EditCommand::endUnapply):
        (EditCommand::beginReapply):
        (EditCommand::endReapply):
        (EditCommand::currentSelection):
        (EditCommand::coalesce):
        (EditCommand::groupForUndo):
        (EditCommand::groupForRedo):
        (EditCommand::moveToStartingSelection):
        (EditCommand::moveToEndingSelection):
        (EditCommand::name):
        (CompositeEditCommand::CompositeEditCommand):
        (CompositeEditCommand::~CompositeEditCommand):
        (CompositeEditCommand::unapply):
        (CompositeEditCommand::reapply):
        (CompositeEditCommand::applyCommand):
        (CompositeEditCommand::insertNodeBefore):
        (CompositeEditCommand::insertNodeAfter):
        (CompositeEditCommand::appendNode):
        (CompositeEditCommand::removeNode):
        (CompositeEditCommand::splitTextNode):
        (CompositeEditCommand::joinTextNodes):
        (CompositeEditCommand::insertText):
        (CompositeEditCommand::deleteText):
        (CompositeEditCommand::moveSelectionTo):
        (CompositeEditCommand::deleteSelection):
        (InsertNodeBeforeCommand::InsertNodeBeforeCommand):
        (InsertNodeBeforeCommand::~InsertNodeBeforeCommand):
        (InsertNodeBeforeCommand::apply):
        (InsertNodeBeforeCommand::unapply):
        (AppendNodeCommand::AppendNodeCommand):
        (AppendNodeCommand::~AppendNodeCommand):
        (AppendNodeCommand::apply):
        (AppendNodeCommand::unapply):
        (RemoveNodeCommand::RemoveNodeCommand):
        (RemoveNodeCommand::~RemoveNodeCommand):
        (RemoveNodeCommand::apply):
        (RemoveNodeCommand::unapply):
        (ModifyTextNodeCommand::ModifyTextNodeCommand):
        (ModifyTextNodeCommand::~ModifyTextNodeCommand):
        (ModifyTextNodeCommand::splitTextNode):
        (ModifyTextNodeCommand::joinTextNodes):
        (SplitTextNodeCommand::SplitTextNodeCommand):
        (SplitTextNodeCommand::~SplitTextNodeCommand):
        (SplitTextNodeCommand::apply):
        (SplitTextNodeCommand::unapply):
        (JoinTextNodesCommand::JoinTextNodesCommand):
        (JoinTextNodesCommand::~JoinTextNodesCommand):
        (JoinTextNodesCommand::apply):
        (JoinTextNodesCommand::unapply):
        (InsertTextCommand::InsertTextCommand):
        (InsertTextCommand::~InsertTextCommand):
        (InsertTextCommand::apply):
        (InsertTextCommand::unapply):
        (DeleteTextCommand::DeleteTextCommand):
        (DeleteTextCommand::~DeleteTextCommand):
        (DeleteTextCommand::apply):
        (DeleteTextCommand::unapply):
        (MoveSelectionToCommand::MoveSelectionToCommand):
        (MoveSelectionToCommand::~MoveSelectionToCommand):
        (MoveSelectionToCommand::commandID):
        (MoveSelectionToCommand::apply):
        (MoveSelectionToCommand::unapply):
        (DeleteSelectionCommand::DeleteSelectionCommand):
        (DeleteSelectionCommand::~DeleteSelectionCommand):
        (DeleteSelectionCommand::apply):
        (InputTextCommand::InputTextCommand):
        (InputTextCommand::~InputTextCommand):
        (InputTextCommand::commandID):
        (InputTextCommand::isLineBreak):
        (InputTextCommand::isSpace):
        (InputTextCommand::apply):
        (InputTextCommand::coalesce):
        (InputTextCommand::groupForUndo):
        (InputTextCommand::groupForRedo):
        (InputTextCommand::execute):
        (DeleteKeyCommand::DeleteKeyCommand):
        (DeleteKeyCommand::~DeleteKeyCommand):
        (DeleteKeyCommand::commandID):
        (DeleteKeyCommand::apply):
        (DeleteKeyCommand::groupForUndo):
        (DeleteKeyCommand::groupForRedo):
        (PasteHTMLCommand::PasteHTMLCommand):
        (PasteHTMLCommand::~PasteHTMLCommand):
        (PasteHTMLCommand::apply):
        * khtml/editing/htmlediting.h:
        (khtml::):
        (khtml::EditCommand::):
        (khtml::EditCommand::document):
        (khtml::EditCommand::state):
        (khtml::EditCommand::setState):
        (khtml::SplitTextNodeCommand::joinState):
        (khtml::SplitTextNodeCommand::splitState):
        (khtml::JoinTextNodesCommand::joinState):
        (khtml::JoinTextNodesCommand::splitState):
        * khtml/khtml_part.cpp:
        (KHTMLPart::openURL):
        (KHTMLPart::deleteSelection):
        (KHTMLPart::applyCommand):
        (KHTMLPart::undoEditing):
        (KHTMLPart::redoEditing):
        (KHTMLPart::pasteHTMLString):
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:
        (KHTMLPartPrivate::~KHTMLPartPrivate):
        * khtml/misc/shared.h:
        (khtml::SharedPtr::SharedPtr):
        (khtml::SharedPtr::~SharedPtr):
        (khtml::SharedPtr::isEmpty):
        (khtml::SharedPtr::get):
        (khtml::SharedPtr::operator*):
        (khtml::SharedPtr::operator->):
        (khtml::SharedPtr::operator!):
        (khtml::SharedPtr::operator==):
        (khtml::::operator):
        (khtml::operator!=):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::defaultEventHandler):
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::registerCommandForUndo):
        (KWQKHTMLPart::registerCommandForRedo):
        (KWQKHTMLPart::clearUndoRedoOperations):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge undoEditing:]):
        (-[WebCoreBridge redoEditing:]):

2004-02-10  David Hyatt  <hyatt@apple.com>

	Eliminate the double-completion and double-parsing of KURLs for every single image request.
	
        * khtml/misc/loader.cpp:
        (DocLoader::requestImage):
        (Cache::requestImage):
        * khtml/misc/loader.h:

2004-02-10  David Hyatt  <hyatt@apple.com>

	Merged patch that fixes clear:both for floats.  This patch comes from the KHTML tree.
	
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionNewFloats):
        * layout-tests/fast/block/float/029-expected.txt: Added.
        * layout-tests/fast/block/float/029.html: Added.

2004-02-10  David Hyatt  <hyatt@apple.com>

	Fix crasher in list code caused by incorrect style deallocation.  Regression from the
	arena changes for RenderStyles.
	
        Reviewed by darin

        * khtml/rendering/render_object.cpp:
        (RenderObject::remove):
        (RenderObject::arenaDelete):

2004-02-10  David Hyatt  <hyatt@apple.com>

	Fix for osnews.com's wacky layout problem.  Put back in the check for isEmpty.
	
        Reviewed by darin

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::scriptHandler):

2004-02-10  David Hyatt  <hyatt@apple.com>

	Fix for the bad background color on abcnews.com.  Make cloning optionally drop the style declarations.

        * khtml/html/html_elementimpl.cpp:
        (HTMLAttributeImpl::clone):
        * khtml/html/html_elementimpl.h:
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):
        * khtml/xml/dom_elementimpl.cpp:
        (AttributeImpl::clone):
        * khtml/xml/dom_elementimpl.h:

2004-02-10  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3552545>: Cut, Paste and Delete must support Undo and Redo

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (ModifyTextNodeStep::splitTextNode): ken's fix that fixes a problem with unapply
        (ModifyTextNodeStep::joinTextNodes): my fix that fixes a problem with unapply
        (PasteHTMLCommand::PasteHTMLCommand): new
        (PasteHTMLCommand::apply): moved from dom_docimpl.cpp and improved
        * khtml/editing/htmlediting.h:
        (khtml::PasteHTMLCommand::~PasteHTMLCommand):
        * khtml/khtml_part.cpp:
        (KHTMLPart::deleteSelection): new, create and applies a DeleteTextCommand
        (KHTMLPart::pasteHTMLString): new, create and applies a PasteHTMLCommand
        * khtml/khtml_part.h:
        * khtml/xml/dom_docimpl.cpp: moved paste code to htmlediting.cpp
        * khtml/xml/dom_docimpl.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge pasteHTMLString:]): call pasteHTMLString on the part instead of the bridge
        (-[WebCoreBridge deleteSelection]): call deleteSelection on the part instead of the bridge

2004-02-10  David Hyatt  <hyatt@apple.com>

	Fix crash on abcnews.com by adding isEmpty checks before dereferencing.
	
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::parseTag):

2004-02-10  David Hyatt  <hyatt@apple.com>

	Improve attribute parsing of mapped attributes (that map to CSS properties) so that they can pull the
	style declarations from a global cache.

	Made RenderStyles be arena allocated as well.
	
        Reviewed by darin

        * khtml/css/css_valueimpl.cpp:
        (CSSImageValueImpl::CSSImageValueImpl):
        (CSSImageValueImpl::image):
        * khtml/css/css_valueimpl.h:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::initForStyleResolve):
        (khtml::CSSStyleSelector::styleForElement):
        (khtml::CSSStyleSelector::pseudoStyleForElement):
        (khtml::CSSStyleSelector::applyProperty):
        * khtml/css/cssstyleselector.h:
        * khtml/css/html4.css:
        * khtml/css/quirks.css:
        * khtml/dom/dom_element.cpp:
        (Element::style):
        * khtml/dom/html_element.cpp:
        * khtml/dom/html_element.h:
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::HTMLBodyElementImpl):
        (HTMLBodyElementImpl::mapToEntry):
        (HTMLBodyElementImpl::parseHTMLAttribute):
        (HTMLBodyElementImpl::insertedIntoDocument):
        (HTMLFrameElementImpl::parseHTMLAttribute):
        (HTMLFrameSetElementImpl::parseHTMLAttribute):
        (HTMLIFrameElementImpl::mapToEntry):
        (HTMLIFrameElementImpl::parseHTMLAttribute):
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_blockimpl.cpp:
        (HTMLDivElementImpl::mapToEntry):
        (HTMLDivElementImpl::parseHTMLAttribute):
        (HTMLHRElementImpl::mapToEntry):
        (HTMLHRElementImpl::parseHTMLAttribute):
        (HTMLParagraphElementImpl::mapToEntry):
        (HTMLParagraphElementImpl::parseHTMLAttribute):
        (HTMLMarqueeElementImpl::mapToEntry):
        (HTMLMarqueeElementImpl::parseHTMLAttribute):
        (HTMLLayerElementImpl::HTMLLayerElementImpl):
        (HTMLLayerElementImpl::id):
        * khtml/html/html_blockimpl.h:
        * khtml/html/html_documentimpl.cpp:
        (HTMLDocumentImpl::determineParseMode):
        * khtml/html/html_documentimpl.h:
        * khtml/html/html_elementimpl.cpp:
        (CSSMappedAttributeDeclarationImpl::~CSSMappedAttributeDeclarationImpl):
        (HTMLElementImpl::getMappedAttributeDecl):
        (HTMLElementImpl::setMappedAttributeDecl):
        (HTMLElementImpl::removeMappedAttributeDecl):
        (HTMLAttributeImpl::~HTMLAttributeImpl):
        (HTMLAttributeImpl::clone):
        (m_mappedAttributeCount):
        (HTMLNamedAttrMapImpl::clearAttributes):
        (HTMLElementImpl::HTMLElementImpl):
        (HTMLElementImpl::~HTMLElementImpl):
        (HTMLElementImpl::createAttribute):
        (HTMLElementImpl::createInlineStyleDecl):
        (HTMLElementImpl::attributeChanged):
        (HTMLElementImpl::mapToEntry):
        (HTMLElementImpl::parseHTMLAttribute):
        (HTMLElementImpl::additionalAttributeStyleDecl):
        (isHexDigit):
        (toHex):
        (HTMLElementImpl::addCSSProperty):
        (HTMLElementImpl::addCSSStringProperty):
        (HTMLElementImpl::addCSSImageProperty):
        (HTMLElementImpl::addCSSLength):
        (HTMLElementImpl::addHTMLColor):
        (HTMLElementImpl::createMappedDecl):
        (HTMLElementImpl::addHTMLAlignment):
        (HTMLElementImpl::setContentEditable):
        * khtml/html/html_elementimpl.h:
        (DOM::):
        (DOM::CSSMappedAttributeDeclarationImpl::CSSMappedAttributeDeclarationImpl):
        (DOM::CSSMappedAttributeDeclarationImpl::setMappedState):
        (DOM::HTMLAttributeImpl::HTMLAttributeImpl):
        (DOM::HTMLAttributeImpl::decl):
        (DOM::HTMLAttributeImpl::setDecl):
        (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
        (DOM::HTMLNamedAttrMapImpl::declRemoved):
        (DOM::HTMLNamedAttrMapImpl::declAdded):
        (DOM::HTMLNamedAttrMapImpl::attributeItem):
        (DOM::HTMLElementImpl::hasMappedAttributes):
        (DOM::HTMLElementImpl::htmlAttributes):
        (DOM::HTMLElementImpl::inlineStyleDecl):
        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::parseHTMLAttribute):
        (HTMLGenericFormElementImpl::parseHTMLAttribute):
        (HTMLButtonElementImpl::parseHTMLAttribute):
        (HTMLInputElementImpl::setType):
        (HTMLInputElementImpl::mapToEntry):
        (HTMLInputElementImpl::parseHTMLAttribute):
        (HTMLInputElementImpl::attach):
        (HTMLLabelElementImpl::parseHTMLAttribute):
        (HTMLSelectElementImpl::parseHTMLAttribute):
        (HTMLKeygenElementImpl::parseHTMLAttribute):
        (HTMLOptGroupElementImpl::parseHTMLAttribute):
        (HTMLOptionElementImpl::parseHTMLAttribute):
        (HTMLTextAreaElementImpl::parseHTMLAttribute):
        (HTMLIsIndexElementImpl::parseHTMLAttribute):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_headimpl.cpp:
        (HTMLBaseElementImpl::parseHTMLAttribute):
        (HTMLLinkElementImpl::parseHTMLAttribute):
        (HTMLMetaElementImpl::parseHTMLAttribute):
        (HTMLStyleElementImpl::parseHTMLAttribute):
        * khtml/html/html_headimpl.h:
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::mapToEntry):
        (HTMLImageElementImpl::parseHTMLAttribute):
        (HTMLMapElementImpl::parseHTMLAttribute):
        (HTMLAreaElementImpl::parseHTMLAttribute):
        * khtml/html/html_imageimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::parseHTMLAttribute):
        (HTMLBRElementImpl::mapToEntry):
        (HTMLBRElementImpl::parseHTMLAttribute):
        (HTMLFontElementImpl::mapToEntry):
        (HTMLFontElementImpl::parseHTMLAttribute):
        * khtml/html/html_inlineimpl.h:
        * khtml/html/html_listimpl.cpp:
        (HTMLUListElementImpl::mapToEntry):
        (HTMLUListElementImpl::parseHTMLAttribute):
        (HTMLOListElementImpl::mapToEntry):
        (HTMLOListElementImpl::parseHTMLAttribute):
        (HTMLLIElementImpl::mapToEntry):
        (HTMLLIElementImpl::parseHTMLAttribute):
        * khtml/html/html_listimpl.h:
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::mapToEntry):
        (HTMLAppletElementImpl::parseHTMLAttribute):
        (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
        (HTMLEmbedElementImpl::mapToEntry):
        (HTMLEmbedElementImpl::parseHTMLAttribute):
        (HTMLEmbedElementImpl::attach):
        (HTMLObjectElementImpl::mapToEntry):
        (HTMLObjectElementImpl::parseHTMLAttribute):
        (HTMLParamElementImpl::parseHTMLAttribute):
        * khtml/html/html_objectimpl.h:
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::HTMLTableElementImpl):
        (HTMLTableElementImpl::~HTMLTableElementImpl):
        (HTMLTableElementImpl::mapToEntry):
        (HTMLTableElementImpl::parseHTMLAttribute):
        (HTMLTableElementImpl::additionalAttributeStyleDecl):
        (HTMLTableElementImpl::getSharedCellDecl):
        (HTMLTableElementImpl::attach):
        (HTMLTablePartElementImpl::mapToEntry):
        (HTMLTablePartElementImpl::parseHTMLAttribute):
        (HTMLTableCellElementImpl::mapToEntry):
        (HTMLTableCellElementImpl::parseHTMLAttribute):
        (HTMLTableCellElementImpl::additionalAttributeStyleDecl):
        (HTMLTableCellElementImpl::attach):
        (HTMLTableColElementImpl::mapToEntry):
        (HTMLTableColElementImpl::parseHTMLAttribute):
        (HTMLTableCaptionElementImpl::mapToEntry):
        (HTMLTableCaptionElementImpl::parseHTMLAttribute):
        * khtml/html/html_tableimpl.h:
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):
        (KHTMLParser::getElement):
        * khtml/html/htmltokenizer.h:
        (khtml::Token::addAttribute):
        * khtml/misc/htmlattrs.c:
        (hash_attr):
        (findAttr):
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::setStyle):
        (khtml::RenderBlock::updateFirstLetter):
        * khtml/rendering/render_container.cpp:
        (RenderContainer::addChild):
        (RenderContainer::updatePseudoChild):
        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget):
        * khtml/rendering/render_inline.cpp:
        (RenderInline::addChildToFlow):
        * khtml/rendering/render_list.cpp:
        (RenderListItem::setStyle):
        * khtml/rendering/render_object.cpp:
        (RenderObject::~RenderObject):
        (RenderObject::createAnonymousBlock):
        (RenderObject::setStyle):
        (RenderObject::remove):
        * khtml/rendering/render_style.cpp:
        (throw):
        (RenderStyle::operator delete):
        (RenderStyle::arenaDelete):
        (RenderStyle::RenderStyle):
        (RenderStyle::~RenderStyle):
        (RenderStyle::addPseudoStyle):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::ref):
        (khtml::RenderStyle::deref):
        (khtml::RenderStyle::hasOneRef):
        (khtml::RenderStyle::refCount):
        * khtml/rendering/render_table.cpp:
        (RenderTable::addChild):
        (RenderTableSection::addChild):
        (RenderTableRow::addChild):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::createAttribute):
        (DocumentImpl::recalcStyle):
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (AttributeImpl::clone):
        (AttrImpl::setValue):
        (AttrImpl::cloneNode):
        (ElementImpl::setAttribute):
        (ElementImpl::createAttribute):
        (ElementImpl::setAttributeMap):
        (ElementImpl::recalcStyle):
        (NamedAttrMapImpl::~NamedAttrMapImpl):
        (NamedAttrMapImpl::operator=):
        (NamedAttrMapImpl::addAttribute):
        (NamedAttrMapImpl::removeAttribute):
        * khtml/xml/dom_elementimpl.h:
        (DOM::AttributeImpl::~AttributeImpl):
        (DOM::ElementImpl::attributeChanged):
        (DOM::NamedAttrMapImpl::length):
        * khtml/xml/dom_nodeimpl.cpp:

2004-02-09  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        * khtml/html/html_formimpl.cpp: (HTMLGenericFormElementImpl::defaultEventHandler):
        Removed bogus extra setActive/focus code. Dave says this is no longer needed for
        the active state handling, and the focus call caused a problem, although I can't
        find the bug report at the moment.

2004-02-08  Darin Adler  <darin@apple.com>

        Reviewed by Don.

        - fixed an assertion failure when putting up Java applets caused by my last change

        * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget):
        Don't try to get x() and y(). They are always zero because the widget is just being
        created at this point and has not yet been positioned; trying to get them
        leads to an assertion because there is no NSView until we call setView().
        Before my change, there was a KWQView object at 0,0 that was released when we called
        setView, which is why the problem is new.

2004-02-08  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed things seen in the profile, for a total speedup of 4% on cvs-base
        - fixed some layout regressions from my last speedup due to text measurement inconsistencies

        * WebCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
        macros from working right in C+code that uses the <cctype> header.

        * khtml/css/cssstyleselector.cpp:
        (khtml::checkPseudoState): Use prepend instead of operator here. Will probably be obviated if
        someone fixes the checkPseudoState problem.
        (khtml::colorForCSSValue): Get rid of all the code that uses QPalette; it wasn't doing any good
        in Safari. Instead, hardcode the UI colors.

        * kwq/KWQChar.mm:
        (QChar::isDigitNonASCII): Non-inline part. The ASCII case is handled with an inline now.
        (QChar::isLetterNonASCII): Ditto.
        (QChar::isNumberNonASCII): Ditto.
        (QChar::isLetterOrNumberNonASCII): Ditto.
        (QChar::lowerNonASCII): Ditto.
        (QChar::upperNonASCII): Ditto.
        (QChar::digitValueNonASCII): Ditto.

        * kwq/KWQColorGroup.mm: Put all roles base inside #if, since we don't need them, and copying
        the color group and palette was making things slow.

        * kwq/KWQComboBox.h: Remove KWQComboBoxAdapter, not needed any more.
        * kwq/KWQComboBox.mm:
        (QComboBox::QComboBox): Remove KWQComboBoxAdapter, not needed any more.
        (QComboBox::~QComboBox): Ditto.
        (QComboBox::sizeHint): Turn off rounding; we use that in web text, but not in widgets.
        (-[KWQPopUpButton action:]): Moved the action method here.

        * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth): Turn off rounding. We use it in web
        page text, but not in widgets.
        * kwq/KWQListBox.mm:
        (QListBox::sizeForNumberOfLines): Ditto.
        (-[KWQTableView drawRow:clipRect:]): Ditto.

        * kwq/KWQKURL.mm:
        (KURL::KURL): Added code to put the "file:" in front of a path without making a QString.
        (hasSlashDotOrDotDot): Added. Faster than two calls to strstr.
        (matchLetter): Added. Faster than tolower calls on each letter.
        (KURL::parse): Changed to use matchLetter and hasSlashDotOrDotDot.

        * kwq/KWQPalette.h: Remove all roles except base, and all groups except active, since we don't
        need them, and copying the color group and palette was making things slow.
        * kwq/KWQPalette.mm: Ditto.

        * kwq/KWQRegExp.mm: (QRegExp::match): Fixed logic so we don't create and destroy a QCString
        in the fast case. Also avoid UTF-8/UTF-16 offset mapping.

        * kwq/KWQString.h:
        (QChar::isDigit): Add inline section for ASCII.
        (QChar::isLetter): Ditto.
        (QChar::isNumber): Ditto.
        (QChar::isLetterOrNumber): Ditto.
        (QChar::digitValue): Ditto.
        (QChar::lower): Ditto.
        (QChar::upper): Ditto.
        (QString::utf8): Add a new version that returns the length; used by QRegExp.
        (QString::operator+=): Call a new append function.
        * kwq/KWQString.mm:
        (ucstrcmp): Made this function inline.
        (equal): Added, replacing various strcmp functions.
        (equalCaseInsensitive): Ditto.
        (ok_in_base): Changed to use <ctype.h> isdigit and isalpha instead of QChar functions.
        (QString::detachInternal): Moved up so it will be inlined.
        (QString::~QString): Streamlined a little.
        (QString::utf8): Changed to return the length.
        (QString::find): Use unicode() instead of cell() in various places. Also refined a faster
        version of the one that takes a char *.
        (QString::contains): Changed all of the overloads to have structure that's more similar,
        and made them slightly faster too.
        (QString::isAllLatin1): Added.
        (QString::copyLatin1): Added. Lets you get the string as a char * buffer without changing
        the string itself into that format.
        (QString::toLong): Changed to use <ctype.h> isdigit instead of QChar function.
        (QString::toULong): Ditto.
        (QString::setUnicode): Call the new detachAndDiscardCharacters; not implemented yet.
        (QString::setLatin1): Call the new detachAndDiscardCharacters; not implemented yet.
        (QString::sprintf): Call the new detachAndDiscardCharacters; not implemented yet.
        (QString::insert): Remove one memmove call for the case that appends at the end.
        (QString::detach): Change code to use the internal data if we can; saves at destructor time.
        (QString::detachAndDiscardCharacters): Added. Placeholder for now that just calls detach().
        (QString::setLength): Optimize the setLength(0) case.
        (QString::fill): Call the new detachAndDiscardCharacters; not implemented yet.
        (QString::append): Renamed from operator+=, which now simply calls append().
        (QString::reserve): Added. Useful when building up a string, like in QTextCodec.

        * WebCore-tests.exp: Added new function names for QChar.
        * WebCore-combined.exp: Updated.

        * kwq/KWQTextCodec.mm:
        (KWQTextDecoder::convertLatin1): Added. Since this is the most common encoding, and very
        easy to decode (built into QString, in fact), best to do it as a special case, not with TEC.
        (KWQTextDecoder::convertUTF16): Added a reserve() call for better performance and made the
        stack buffer larger.
        (KWQTextDecoder::convertUsingTEC): Added a reserve() call for better performance and made the
        stack buffer larger.
        (KWQTextDecoder::convert): Added a switch statement and convertLatin1 case.

        * kwq/KWQView.h: Removed the KWQView class.
        * kwq/KWQView.mm: Removed.
        * WebCore.pbproj/project.pbxproj: Removed KWQView.mm.

        * kwq/KWQWidget.h: Changed name of QWidgetPrivate to KWQWidgetPrivate.
        * kwq/KWQWidget.mm:
        (QWidget::QWidget): Got rid of code that makes a KWQView when no view is passed in. We were
        creating and destroying extra views because of this.
        (QWidget::setFrameGeometry): Only call getOuterView() once, not three times. Also, don't do
        any work at all if the frame is already correct.
        * khtml/khtmlview.cpp: (KHTMLView::init): Removed a call that will hit an assertion due to the
        way a new KHTMLView does not yet have an NSView.

        * kwq/WebCoreTextRenderer.h: Broke applyRounding into applyRunRounding and applyWordRounding.
        * kwq/WebCoreTextRendererFactory.m: (WebCoreInitializeEmptyTextStyle): Initialize both rounding
        flags on.

2004-02-07  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - switched KWQComboBox, KWQListBox, and KWQLineEdit to use WebKit text measuring/rendering instead of AppKit
        - fixed width calculation for KWQListBox that made them too wide (the computation used the width of standard scroll
          bars rather than the small scroll bars they actually use)

        Speeds up cvs-base by 5%!

        * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
        Get rid of beginBatchInsert, and rename endBatchInsert. Use our own "append" calls instead of "insert" calls.

        * kwq/KWQComboBox.h: Replace insertItem with appendItem. Add a new populateMenu call (for internal use,
        but public). Change width member to be int instead of float. Remove updateCurrentItem(), and add a
        menuPopulated boolean and a QStringList containing the items.
        * kwq/KWQComboBox.mm:
        (QComboBox::QComboBox): Initialize currentItem directly instead of calling updateCurrentItem. Also initialize
        menuPopulated to true.
        (QComboBox::appendItem): Replaces insertItem. Put items in a string list. Don't keep the menu populated unless
        the button is highlighted (which indicates the menu is showing).
        (QComboBox::sizeHint): Compute widths using WebCoreTextRenderer, and the string list.
        (QComboBox::baselinePosition): Change ceil to ceilf, since we are dealing with floats, not doubles.
        (QComboBox::clear): Clear the items list. Also reset the currentItem field directly instead of using updateCurrentItem().
        (QComboBox::setCurrentItem): If the menu is not populated, then keep a single item with the appropriate title.
        If the menu is populated, then select the appropriate item.
        (QComboBox::itemSelected): Moved the logic from updateCurrentItem in here for simplicity.
        (QComboBox::focusPolicy): Tweaked the comment.
        (QComboBox::populateMenu): Added.
        (-[KWQPopUpButtonCell setHighlighted:]): Populate the menu when the cell is highlighted.

        * kwq/KWQLineEdit.mm:
        (QLineEdit::sizeForCharacterWidth): Put an empty string in the cell, and add in a separately-computed width
        for the string.
        (QLineEdit::baselinePosition): Use ceilf instead of ceil since we are doing floats, not doubles.

        * kwq/KWQListBox.h: Changed the items list from an NSArray to a QValueList.
        (KWQListBoxItem::KWQListBoxItem): Added a new class to keep the string and the "is label" boolean.
        (QListBox::count): Now inline.
        (QListBox::appendItem): Replaced insertItem with this.
        (QListBox::appendGroupLabel): Replaced insertGroupLabel with this.
        (QListBox::itemAtIndex): Replaced itemIsGroupLabel with this.
        * kwq/KWQListBox.mm:
        (itemTextRenderer): Replaced itemFont with this, which returns a WebCoreTextRenderer.
        (groupLabelTextRenderer): Ditto.
        (QListBox::QListBox): Removed the _insertingItems boolean, and handling of the _items list.
        (QListBox::~QListBox): Ditto.
        (QListBox::clear): Now clears the items list. Doesn't both with reloadData, since doneAppendingItems
        handles that.
        (QListBox::appendItem): Replaced insertItem. Just adds to the list. No need to construct attributed
        strings any more.
        (QListBox::doneAppendingItems): Replaced endBatchInsert. No need to clear the obsolete _insertingItems
        boolean.
        (QListBox::setEnabled): Added a call to reloadData.
        (QListBox::sizeForNumberOfLines): Compute widths using WebCoreTextRenderer, and the string list.
        Also adjust for the difference in widths between small and default scrollers and add in margins.
        (QListBox::setWritingDirection): Remove code that updates the direction in attributed strings.
        (-[KWQTableView initWithListBox:]): Compute height from font, not cell.
        (-[KWQTableView numberOfRowsInTableView:]): Get count from QListBox instead of items array.
        (-[KWQTableView tableView:objectValueForTableColumn:row:]): Return nil becase we don't want to
        create an NSString for each cell. We'll draw the appropriate thing.
        (-[KWQTableView tableView:shouldSelectRow:]): Update for change to QComboBox function.
        (-[KWQTableView drawRow:clipRect:]): Added. Draws the text in the cell, with the appropriate color
        and position, using WebCoreTextRenderer for speed.
        (-[KWQTableView _accessibilityTableCell:tableColumn:]): Set up cell with a string in this case,
        because we need the string to be seen by the accessibilty framework.

        * kwq/WebCoreTextRenderer.h: Fixed typo in comment.
        * kwq/WebCoreTextRendererFactory.m: Removed bogus inline specifiers.

        * khtml/rendering/render_layer.cpp: Fixed a couple of cases of RenderLayer::RenderLayer that just
        should have said RenderLayer.

2004-02-07  Darin Adler  <darin@apple.com>

        * WebCore.pbproj/project.pbxproj: Get rid of the DEPLOYMENT_LOCATION and DEPLOYMENT_POSTPROCESSING
        flags that were in the Deployment build style. These were causing the need to chmod all the time
        after building WebCore successfully, and were doing us no good.

2004-02-07  Darin Adler  <darin@apple.com>

        * kwq/can-convert.mm: Added test program to see which conversions are actually supported by TEC.

2004-02-06  David Hyatt  <hyatt@apple.com>

        Implemented a TokenizerString that can walk a list of substrings, so that data can be enqueued
        in the list without having to do a copy.  Speeds up voodooextreme by 20% or so, giving the overall
        page-load tests get a 2% boost.
        
        Reviewed by darin

        * WebCore.pbproj/project.pbxproj:
        * khtml/html/html_documentimpl.h:
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::begin):
        (khtml::HTMLTokenizer::processListing):
        (khtml::HTMLTokenizer::parseSpecial):
        (khtml::HTMLTokenizer::scriptHandler):
        (khtml::HTMLTokenizer::parseComment):
        (khtml::HTMLTokenizer::parseServer):
        (khtml::HTMLTokenizer::parseProcessingInstruction):
        (khtml::HTMLTokenizer::parseText):
        (khtml::HTMLTokenizer::parseEntity):
        (khtml::HTMLTokenizer::parseTag):
        (khtml::HTMLTokenizer::write):
        (khtml::HTMLTokenizer::notifyFinished):
        (khtml::HTMLTokenizer::setSrc):
        (khtml::HTMLTokenizer::setOnHold):
        * khtml/html/htmltokenizer.h:
        (khtml::Token::Token):
        (khtml::Token::~Token):
        (khtml::Token::addAttribute):
        (khtml::Token::reset):
        * khtml/khtml_part.cpp:
        (KHTMLPart::handleMousePressEventDoubleClick):
        * khtml/khtml_part.h:
        * khtml/misc/stringit.cpp: Added.
        (khtml::TokenizerString::length):
        (khtml::TokenizerString::clear):
        (khtml::TokenizerString::append):
        (khtml::TokenizerString::prepend):
        (khtml::TokenizerString::advanceSubstring):
        (khtml::TokenizerString::toString):
        * khtml/misc/stringit.h:
        (khtml::TokenizerSubstring::TokenizerSubstring):
        (khtml::TokenizerSubstring::clear):
        (khtml::TokenizerSubstring::appendTo):
        (khtml::TokenizerString::TokenizerString):
        (khtml::TokenizerString::push):
        (khtml::TokenizerString::isEmpty):
        (khtml::TokenizerString::advance):
        (khtml::TokenizerString::escaped):
        (khtml::TokenizerString::lineCount):
        (khtml::TokenizerString::resetLineCount):
        (khtml::TokenizerString::operator++):
        (khtml::TokenizerString::operator*):
        (khtml::TokenizerString::operator->):
        (khtml::TokenizerString::current):
        * khtml/xbl/xbl_docimpl.cpp:
        * khtml/xbl/xbl_docimpl.h:
        (XBL::):
        * khtml/xbl/xbl_tokenizer.h:
        (XBL::):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::tokenizer):
        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::write):
        * khtml/xml/xml_tokenizer.h:
        * kwq/KWQSignalStubs.mm:
        * kwq/KWQValueList.h:
        (QValueList::insert):
        (QValueList::fromLast):
        * kwq/KWQValueListImpl.h:
        * kwq/KWQValueListImpl.mm:
        (KWQValueListImpl::clear):
        (KWQValueListImpl::insert):
        (KWQValueListImpl::fromLast):

=== Safari-127 ===

2004-02-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Chris

	Steps no longer return int error codes. Steps are operations
	that should succeed. (When was the last time that typing in
	a text editor failed for reasons which could not have been
	figured out ahead of time...like file permissions?).
	If this does not work for the future, perhaps we can change 
	some or all of the many asserts in the code to throw C+
	exceptions instead, which can be caught and handled at a
	suitable level.

	I also made some nice convenience functions to create and apply
	EditStep objects, and moved the command code to use the new
	functions.

        * khtml/editing/htmlediting.cpp:
        (EditStep::EditStep):
        (EditStep::~EditStep):
        (EditStep::reapply):
        (EditStep::beginApply):
        (EditStep::endApply):
        (EditStep::beginUnapply):
        (EditStep::endUnapply):
        (EditStep::beginReapply):
        (EditStep::endReapply):
        (CompositeEditStep::unapply):
        (CompositeEditStep::reapply):
        (CompositeEditStep::applyStep):
        (CompositeEditStep::insertNodeBefore):
        (CompositeEditStep::insertNodeAfter):
        (CompositeEditStep::appendNode):
        (CompositeEditStep::removeNode):
        (CompositeEditStep::splitTextNode):
        (CompositeEditStep::joinTextNodes):
        (CompositeEditStep::insertText):
        (CompositeEditStep::deleteText):
        (CompositeEditStep::moveSelectionTo):
        (CompositeEditStep::deleteSelection):
        (InsertNodeBeforeStep::InsertNodeBeforeStep):
        (InsertNodeBeforeStep::apply):
        (InsertNodeBeforeStep::unapply):
        (AppendNodeStep::AppendNodeStep):
        (AppendNodeStep::apply):
        (AppendNodeStep::unapply):
        (RemoveNodeStep::RemoveNodeStep):
        (RemoveNodeStep::apply):
        (RemoveNodeStep::unapply):
        (ModifyTextNodeStep::ModifyTextNodeStep):
        (ModifyTextNodeStep::splitTextNode):
        (ModifyTextNodeStep::joinTextNodes):
        (SplitTextNodeStep::apply):
        (SplitTextNodeStep::unapply):
        (JoinTextNodesStep::apply):
        (JoinTextNodesStep::unapply):
        (InsertTextStep::InsertTextStep):
        (InsertTextStep::apply):
        (InsertTextStep::unapply):
        (DeleteTextStep::DeleteTextStep):
        (DeleteTextStep::apply):
        (DeleteTextStep::unapply):
        (MoveSelectionToStep::MoveSelectionToStep):
        (MoveSelectionToStep::apply):
        (MoveSelectionToStep::unapply):
        (DeleteSelectionStep::apply):
        (EditCommand::EditCommand):
        (EditCommand::~EditCommand):
        (EditCommand::currentSelection):
        (InputTextCommand::apply):
        (DeleteTextCommand::apply):
        * khtml/editing/htmlediting.h:
        (khtml::MoveSelectionToStep::~MoveSelectionToStep):
        (khtml::EditCommand::cookie):
        * khtml/khtml_part.cpp:
        (KHTMLPart::applyCommand):
        (KHTMLPart::undoRedoEditing):
        (KHTMLPart::undoEditing):
        (KHTMLPart::redoEditing):
        * khtml/khtml_part.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::defaultEventHandler):

2004-02-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt
        
        This patch includes two major pieces of work.
        
        1. The KHTMLSelection object has been reworked to be a value object.
        Part-related state has been moved out to KHTMLPart. This change makes
        it much easier to program with these objects, since they can now be
        treating unambigously like built-in types. As part of this work, I
        did a pass over the API and improved some function names. A related
        part of work was to clean up the relationship between KHTMLSelection, 
        KHTMLPart and DOMDocumentImpl, and cleared up how to change the selection
        when that is necessary. (There is now a small set of functions on KHTMLPart). 
        
        2. Implemented undo/redo, and hooked into the Cocoa undo architecture. The
        notion of EditCommands has been enhanced by the addition of EditSteps, which
        are primitive operations out of which edit commands are built. Most of the
        existing operations have been updated to use this new design. The last couple
        will be updated soon, so that all supported editing operations will be undoable.

        * khtml/editing/htmlediting.cpp:
        * khtml/editing/htmlediting.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::isFocusable): Prevents children of content editable parents
        from receiving focus.
        * khtml/khtml_part.cpp: Modified to work with new KHTMLSelection class design.
        Also added some new code to work with new edit command architecture. 
        * khtml/khtml_part.h:
        * khtml/khtml_selection.cpp: Reworked as a value class. Too much state was
        being stored in this object for it to be convenient to use as a value. That
        has been fixed.
        * khtml/khtml_selection.h:
        * khtml/khtmlpart_p.h:
        (KHTMLPartPrivate::KHTMLPartPrivate):
        (KHTMLPartPrivate::~KHTMLPartPrivate):
        * khtml/khtmlview.cpp: Modified to work with new KHTMLSelection class design.
        * khtml/rendering/render_block.cpp: Modified to work with new KHTMLSelection class design.
        (khtml::RenderBlock::paintObject):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateSelection):
        (DocumentImpl::deleteSelection):
        (DocumentImpl::pasteHTMLString):
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_elementimpl.cpp: 
        (ElementImpl::defaultEventHandler): Modified to work with new edit command architecture.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::registerCommandForUndo): Added hook to Cocoa undo/redo architecture.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge isSelectionEditable]): Modified to work with new edit command architecture.
        (-[WebCoreBridge moveCaretToPoint:]): Ditto
        (-[WebCoreBridge haveSelection]): Ditto
        (-[WebCoreBridge selectedHTML]): Ditto
        (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]): Ditto
        (-[WebCoreBridge reconstructedSource]): Ditto
        (-[WebCoreBridge undoRedoEditing:]): Added hook to Cocoa undo/redo architecture.

2004-02-04  David Hyatt  <hyatt@apple.com>

	Improve rule matching in the style system.  Filter out most rules up front, so that only a small
	number of rules need to be walked for any given element.  Yields a ~4-5% improvement on the PLT.
	
        Reviewed by kocienda

        * khtml/css/css_base.cpp:
        (StyleBaseImpl::setParsedValue):
        (CSSSelector::specificity):
        (CSSSelector::extractPseudoType):
        (CSSSelector::operator == ):
        * khtml/css/css_base.h:
        (DOM::CSSSelector::CSSSelector):
        (DOM::CSSSelector::~CSSSelector):
        (DOM::CSSSelector::append):
        (DOM::CSSSelector::next):
        (DOM::CSSSelector::):
        (DOM::StyleBaseImpl::StyleBaseImpl):
        * khtml/css/css_ruleimpl.cpp:
        (CSSStyleRuleImpl::selectorText):
        (CSSRuleListImpl::insertRule):
        * khtml/css/css_ruleimpl.h:
        (DOM::CSSStyleRuleImpl::setSelector):
        (DOM::CSSStyleRuleImpl::selector):
        * khtml/css/css_stylesheetimpl.cpp:
        * khtml/css/css_stylesheetimpl.h:
        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::getPropertyCSSValue):
        (CSSStyleDeclarationImpl::removeProperty):
        (CSSStyleDeclarationImpl::setProperty):
        (CSSStyleDeclarationImpl::setStringProperty):
        (CSSStyleDeclarationImpl::setImageProperty):
        (CSSStyleDeclarationImpl::setLengthProperty):
        (CSSStyleDeclarationImpl::cssText):
        (CSSStyleDeclarationImpl::setCssText):
        * khtml/css/css_valueimpl.h:
        (DOM::CSSStyleDeclarationImpl::node):
        (DOM::CSSProperty::CSSProperty):
        (DOM::CSSProperty::id):
        (DOM::CSSProperty::isImportant):
        * khtml/css/cssparser.cpp:
        (CSSParser::CSSParser):
        (ParseString::lower):
        (CSSParser::parseValue):
        (CSSParser::parseDeclaration):
        (CSSParser::addProperty):
        (CSSParser::parseShadow):
        * khtml/css/cssparser.h:
        * khtml/css/cssstyleselector.cpp:
        (khtml::):
        (khtml::CSSStyleSelector::CSSStyleSelector):
        (khtml::CSSStyleSelector::init):
        (khtml::CSSStyleSelector::~CSSStyleSelector):
        (khtml::CSSStyleSelector::loadDefaultStyle):
        (khtml::CSSStyleSelector::addMatchedRule):
        (khtml::CSSStyleSelector::addMatchedDeclaration):
        (khtml::CSSStyleSelector::matchRules):
        (khtml::CSSStyleSelector::matchRulesForList):
        (khtml::operator >):
        (khtml::operator <=):
        (khtml::CSSStyleSelector::sortMatchedRules):
        (khtml::CSSStyleSelector::initForStyleResolve):
        (khtml::CSSStyleSelector::styleForElement):
        (khtml::CSSStyleSelector::pseudoStyleForElement):
        (khtml::checkPseudoState):
        (khtml::CSSStyleSelector::checkSelector):
        (khtml::CSSStyleSelector::checkOneSelector):
        (khtml::CSSRuleSet::CSSRuleSet):
        (khtml::CSSRuleSet::addToRuleSet):
        (khtml::CSSRuleSet::addRule):
        (khtml::CSSRuleSet::addRulesFromSheet):
        (khtml::CSSStyleSelector::applyDeclarations):
        (khtml::CSSStyleSelector::applyProperty):
        (khtml::CSSStyleSelector::smallerFontSize):
        (khtml::CSSStyleSelector::getColorFromPrimitiveValue):
        * khtml/css/cssstyleselector.h:
        (khtml::):
        (khtml::CSSRuleData::m_next):
        (khtml::CSSRuleData::~CSSRuleData):
        (khtml::CSSRuleData::position):
        (khtml::CSSRuleData::rule):
        (khtml::CSSRuleData::selector):
        (khtml::CSSRuleData::next):
        (khtml::CSSRuleDataList::CSSRuleDataList):
        (khtml::CSSRuleDataList::~CSSRuleDataList):
        (khtml::CSSRuleDataList::first):
        (khtml::CSSRuleDataList::last):
        (khtml::CSSRuleDataList::append):
        (khtml::CSSRuleSet::~CSSRuleSet):
        (khtml::CSSRuleSet::getIDRules):
        (khtml::CSSRuleSet::getClassRules):
        (khtml::CSSRuleSet::getTagRules):
        (khtml::CSSRuleSet::getUniversalRules):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/css/html4.css:
        * khtml/css/parser.cpp:
        * khtml/css/parser.h:
        * khtml/css/parser.y:
        * khtml/dom/dom_element.cpp:
        (Element::style):
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::HTMLBodyElementImpl):
        (HTMLBodyElementImpl::~HTMLBodyElementImpl):
        (HTMLBodyElementImpl::createLinkDecl):
        (HTMLBodyElementImpl::parseAttribute):
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLNamedAttrMapImpl::parseClassAttribute):
        (HTMLElementImpl::HTMLElementImpl):
        (HTMLElementImpl::~HTMLElementImpl):
        (HTMLElementImpl::createInlineStyleDecl):
        (HTMLElementImpl::createMappedAttributeDecl):
        (HTMLElementImpl::parseAttribute):
        (HTMLElementImpl::getClassList):
        (HTMLElementImpl::addCSSProperty):
        (HTMLElementImpl::addCSSStringProperty):
        (HTMLElementImpl::addCSSImageProperty):
        (HTMLElementImpl::addCSSLength):
        (HTMLElementImpl::addHTMLColor):
        (HTMLElementImpl::removeCSSProperty):
        * khtml/html/html_elementimpl.h:
        (DOM::HTMLNamedAttrMapImpl::getClassList):
        (DOM::HTMLElementImpl::inlineStyleDecl):
        (DOM::HTMLElementImpl::attributeStyleDecl):
        (DOM::HTMLElementImpl::getInlineStyleDecl):
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::createSharedCellDecls):
        (HTMLTableCellElementImpl::additionalAttributeStyleDecl):
        * khtml/html/html_tableimpl.h:
        * khtml/xml/dom_atomicstring.cpp:
        (DOM::AtomicString::add):
        (DOM::AtomicString::remove):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::resetLinkColor):
        (DocumentImpl::resetVisitedLinkColor):
        (DocumentImpl::resetActiveLinkColor):
        (DocumentImpl::recalcStyleSelector):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::linkColor):
        (DOM::DocumentImpl::visitedLinkColor):
        (DOM::DocumentImpl::activeLinkColor):
        (DOM::DocumentImpl::setLinkColor):
        (DOM::DocumentImpl::setVisitedLinkColor):
        (DOM::DocumentImpl::setActiveLinkColor):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::ElementImpl):
        (ElementImpl::~ElementImpl):
        (ElementImpl::getClassList):
        (ElementImpl::getIDAttribute):
        (ElementImpl::cloneNode):
        (XMLElementImpl::cloneNode):
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::inlineStyleDecl):
        (DOM::ElementImpl::attributeStyleDecl):
        (DOM::ElementImpl::getInlineStyleDecl):
        (DOM::ElementImpl::additionalAttributeStyleDecl):
        (DOM::NamedAttrMapImpl::id):
        (DOM::NamedAttrMapImpl::setID):
        * khtml/xml/dom_stringimpl.cpp:
        (DOM::DOMStringImpl::DOMStringImpl):
        (DOM::DOMStringImpl::~DOMStringImpl):
        (DOM::DOMStringImpl::append):
        (DOM::DOMStringImpl::insert):
        (DOM::DOMStringImpl::truncate):
        (DOM::DOMStringImpl::remove):
        (DOM::DOMStringImpl::split):
        * khtml/xml/dom_stringimpl.h:
        (DOM::DOMStringImpl::DOMStringImpl):

2004-02-04  David Hyatt  <hyatt@apple.com>

	Fix line-height regression on altavista.

        * khtml/rendering/render_br.cpp:
        (RenderBR::RenderBR):
        (RenderBR::position):
        (RenderBR::lineHeight):
        (RenderBR::setStyle):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_flow.h:
        (khtml::RenderFlow::RenderFlow):

2004-02-04  David Hyatt  <hyatt@apple.com>

	Fix a regression in the line-height of first-lines and inline-blocks.
	
        Reviewed by darin

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::lineHeight):
        * khtml/rendering/render_text.cpp:
        (RenderText::lineHeight):

2004-02-02  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3546924>: REGRESSION: dragging text or images over a WebView is jerky


        Reviewed by mjs.

        * WebCore-combined.exp:
        * WebCore.exp:
        * kwq/WebCoreBridge.h: added the DOM node element key constant (SPI for now)
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]): instead of calling toHTML for every node, put the node on the element so the caller can get the HTML string representation when it needs to.
        * kwq/WebCoreDOMNode.mm:
        (-[WebCoreDOMNode HTMLString]): new

2004-02-02  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - use toInt32 where we really need an int, rather than toInteger,
          because toInteger needs to return an integral number as a double,
          not as an int

        * khtml/ecma/kjs_css.cpp:
        (DOMCSSStyleDeclarationProtoFunc::tryCall): Call toInt32 intead of toInteger.
        (DOMStyleSheetListFunc::tryCall): Ditto.
        (KJS::DOMMediaListProtoFunc::tryCall): Ditto.
        (DOMCSSStyleSheetProtoFunc::tryCall): Ditto.
        (DOMCSSRuleListFunc::tryCall): Ditto.
        (DOMCSSRuleFunc::tryCall): Ditto.
        (DOMCSSPrimitiveValueProtoFunc::tryCall): Ditto.
        (DOMCSSValueListFunc::tryCall): Ditto.
        * khtml/ecma/kjs_dom.cpp:
        (DOMCharacterDataProtoFunc::tryCall): Ditto.
        (DOMTextProtoFunc::tryCall): Ditto.
        * khtml/ecma/kjs_events.cpp:
        (DOMUIEventProtoFunc::tryCall): Ditto.
        (DOMMouseEventProtoFunc::tryCall): Ditto.
        (DOMKeyboardEventProtoFunc::tryCall): Ditto.
        (DOMMutationEventProtoFunc::tryCall): Ditto.
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElementFunction::tryCall): Ditto.
        (KJS::HTMLElement::putValue): Ditto.
        (KJS::HTMLSelectCollection::tryPut): Ditto.
        * khtml/ecma/kjs_range.cpp:
        (DOMRangeProtoFunc::tryCall): Ditto.
        * khtml/ecma/kjs_traversal.cpp: (JSNodeFilter::acceptNode): Ditto.
        * khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall): Ditto.
        (HistoryFunc::tryCall): Ditto.

2004-02-02  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fix at least some of <rdar://problem/3546393>: 10,000 leaks, many of DOM::AtomicString::add, after one run of cvs-base

        * khtml/xml/dom_atomicstring.cpp: (DOM::AtomicString::add): Remove extra allocation of strings.
        This should speed things up a bit as well as fixing one big leak.

2004-02-02  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3546379>: support for editing via drag & drop

        Reviewed by kocienda.

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::deleteSelection): fixed a crash I encountered while attempting to delete and empty selection
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge isSelectionEditable]): renamed from isEditable
        (-[WebCoreBridge moveCaretToPoint:]): new
        (-[WebCoreBridge elementAtPoint:]): added support for WebCoreElementHTMLStringKey and WebCoreElementIsEditableKey

2004-01-30  David Hyatt  <hyatt@apple.com>

	Fix for 3522497, <br>s should not get AXObjects created.
	
        Reviewed by mjs

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityIsIgnored]):

=== Safari-126 ===

2004-01-30  David Hyatt  <hyatt@apple.com>

	Fix a regression I introduced in my atomicstring patch.  I meant to say !attr->isNull() in the contentedtiable
	attribute parsing code.
	
        Reviewed by cblu

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseAttribute):

2004-01-30  David Hyatt  <hyatt@apple.com>

	Make m_lineHeight be cached on RenderFlow instead of RenderText and avoid recomputing it so much when it
	is not set by CSS (since calls to fontMetrics().lineSpacing() are expensive).

	Yields ~1.5% performance improvement.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::setStyle):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::lineHeight):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::setStyle):
        * khtml/rendering/render_object.cpp:
        (RenderObject::verticalPositionHint):
        (RenderObject::lineHeight):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::setStyle):
        (RenderText::checkSelectionPointIgnoringContinuations):
        (RenderText::height):
        (RenderText::lineHeight):
        * khtml/rendering/render_text.h:

2004-01-30  David Hyatt  <hyatt@apple.com>

	Disable XBL.  The loadBindings call was taking 0.1-0.25%.  While I know how to get rid of this overhead,
	it's easier for now to just disable all of XBL.

        * WebCorePrefix.h:
        * khtml/misc/loader.h:
        * khtml/xbl/xbl_binding.cpp:
        * khtml/xbl/xbl_binding_manager.cpp:
        * khtml/xbl/xbl_docimpl.cpp:
        * khtml/xbl/xbl_protobinding.cpp:
        * khtml/xbl/xbl_protohandler.cpp:
        * khtml/xbl/xbl_protoimplementation.cpp:
        * khtml/xbl/xbl_tokenizer.cpp:

2004-01-29  David Hyatt  <hyatt@apple.com>

	Atomize font families (KWQFontFamily) and all attribute values.  Move atomic string into separate files.

	In my testing, this patch yields the same score as Safari-125 in tests and recovers all lost performance
	(mostly from excess copying of AtomicStrings where DOMStringImpl* used to be returned).
	
        Reviewed by darin

        * ForwardingHeaders/xml/dom_atomicstring.h: Added.
        * WebCore.pbproj/project.pbxproj:
        * khtml/css/css_base.cpp:
        (CSSSelector::print):
        (CSSSelector::extractPseudoType):
        (CSSSelector::selectorText):
        * khtml/css/css_valueimpl.cpp:
        (FontFamilyValueImpl::FontFamilyValueImpl):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseFontFamily):
        * khtml/css/cssparser.h:
        * khtml/css/cssstyleselector.cpp:
        (khtml::checkPseudoState):
        (khtml::CSSStyleSelector::checkOneSelector):
        (khtml::CSSStyleSelector::applyRule):
        * khtml/dom/dom_element.cpp:
        (Element::getAttributeNS):
        * khtml/dom/dom_string.cpp:
        (DOMString::toInt):
        (DOMString::toLengthArray):
        (DOM::operator==):
        * khtml/dom/dom_string.h:
        (DOM::operator==):
        (DOM::operator!=):
        * khtml/ecma/kjs_navigator.cpp:
        (Plugins::get):
        (MimeTypes::get):
        (Plugin::get):
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::parseAttribute):
        (HTMLFrameElementImpl::isURLAllowed):
        (HTMLFrameElementImpl::openURL):
        (HTMLFrameElementImpl::parseAttribute):
        (HTMLFrameElementImpl::attach):
        (HTMLFrameElementImpl::setLocation):
        (HTMLFrameSetElementImpl::parseAttribute):
        (HTMLIFrameElementImpl::attach):
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_blockimpl.cpp:
        (HTMLHRElementImpl::parseAttribute):
        (HTMLHRElementImpl::attach):
        (HTMLMarqueeElementImpl::parseAttribute):
        * khtml/html/html_documentimpl.cpp:
        (HTMLDocumentImpl::documentElement):
        * khtml/html/html_documentimpl.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseAttribute):
        (HTMLElementImpl::addCSSLength):
        (HTMLElementImpl::addHTMLAlignment):
        * khtml/html/html_elementimpl.h:
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::parseAttribute):
        (HTMLInputElementImpl::parseAttribute):
        (HTMLInputElementImpl::attach):
        (HTMLSelectElementImpl::parseAttribute):
        (HTMLKeygenElementImpl::parseAttribute):
        (HTMLKeygenElementImpl::encoding):
        (HTMLOptionElementImpl::parseAttribute):
        (HTMLTextAreaElementImpl::parseAttribute):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_headimpl.cpp:
        (HTMLLinkElementImpl::parseAttribute):
        (HTMLStyleElementImpl::parseAttribute):
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::parseAttribute):
        (HTMLAreaElementImpl::parseAttribute):
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::parseAttribute):
        * khtml/html/html_listimpl.cpp:
        (HTMLOListElementImpl::parseAttribute):
        (HTMLLIElementImpl::parseAttribute):
        * khtml/html/html_miscimpl.cpp:
        (HTMLCollectionImpl::getNamedItem):
        (HTMLFormCollectionImpl::getNamedFormItem):
        (HTMLFormCollectionImpl::getNamedImgItem):
        * khtml/html/html_objectimpl.cpp:
        (HTMLEmbedElementImpl::parseAttribute):
        (HTMLObjectElementImpl::parseAttribute):
        (HTMLParamElementImpl::HTMLParamElementImpl):
        (HTMLParamElementImpl::~HTMLParamElementImpl):
        (HTMLParamElementImpl::parseAttribute):
        * khtml/html/html_objectimpl.h:
        (DOM::HTMLParamElementImpl::name):
        (DOM::HTMLParamElementImpl::value):
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::parseAttribute):
        (HTMLTablePartElementImpl::parseAttribute):
        (HTMLTableCellElementImpl::parseAttribute):
        (HTMLTableColElementImpl::parseAttribute):
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):
        (KHTMLParser::handleIsindex):
        * khtml/html/htmltokenizer.cpp:
        (HTMLTokenizer::parseTag):
        * khtml/html/htmltokenizer.h:
        (khtml::Token::addAttribute):
        * khtml/khtml_part.cpp:
        (KHTMLPart::init):
        * khtml/khtmlview.cpp:
        (KHTMLToolTip::maybeTip):
        * khtml/xml/dom_atomicstring.cpp: Added.
        (DOM::AtomicStringStatisticsExitLogger::~AtomicStringStatisticsExitLogger):
        (DOM::AtomicString::equal):
        (DOM::AtomicString::add):
        (DOM::AtomicString::insert):
        (DOM::AtomicString::remove):
        (DOM::AtomicString::expand):
        (DOM::AtomicString::shrink):
        (DOM::AtomicString::rehash):
        (DOM::AtomicString::init):
        (DOM::operator==):
        (DOM::equalsIgnoreCase):
        * khtml/xml/dom_atomicstring.h: Added.
        (DOM::AtomicString::AtomicString):
        (DOM::AtomicString:::m_string):
        (DOM::AtomicString::operator const DOMString&):
        (DOM::AtomicString::domString):
        (DOM::AtomicString::string):
        (DOM::AtomicString::implementation):
        (DOM::AtomicString::unicode):
        (DOM::AtomicString::length):
        (DOM::AtomicString::ascii):
        (DOM::AtomicString::find):
        (DOM::AtomicString::toInt):
        (DOM::AtomicString::percentage):
        (DOM::AtomicString::toLengthArray):
        (DOM::AtomicString::isNull):
        (DOM::AtomicString::isEmpty):
        (DOM::AtomicString::equal):
        (DOM::operator==):
        (DOM::operator!=):
        * khtml/xml/dom_atomicstringlist.h: Added.
        (DOM::AtomicStringList:::m_next):
        (DOM::AtomicStringList::m_next):
        (DOM::AtomicStringList::~AtomicStringList):
        (DOM::AtomicStringList::next):
        (DOM::AtomicStringList::setNext):
        (DOM::AtomicStringList::string):
        (DOM::AtomicStringList::setString):
        (DOM::AtomicStringList::clone):
        (DOM::AtomicStringList::clear):
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (AttrImpl::nodeValue):
        (AttrImpl::cloneNode):
        (ElementImpl::getAttribute):
        (ElementImpl::getAttributeNS):
        (ElementImpl::setAttribute):
        (ElementImpl::setAttributeMap):
        (ElementImpl::attach):
        (ElementImpl::detach):
        (ElementImpl::updateId):
        (NamedAttrMapImpl::setNamedItem):
        (NamedAttrMapImpl::removeNamedItem):
        (NamedAttrMapImpl::getAttributeItem):
        (NamedAttrMapImpl::operator=):
        (NamedAttrMapImpl::removeAttribute):
        * khtml/xml/dom_elementimpl.h:
        (DOM::AttributeImpl::AttributeImpl):
        (DOM::AttributeImpl::value):
        (DOM::AttributeImpl::prefix):
        (DOM::AttributeImpl::isNull):
        (DOM::AttributeImpl::isEmpty):
        (DOM::AttributeImpl::setValue):
        (DOM::AttributeImpl::setPrefix):
        (DOM::ElementImpl::getAttribute):
        * khtml/xml/dom_nameimpl.cpp: Removed.
        * khtml/xml/dom_nameimpl.h:
        (DOM::Name::namespaceURI):
        (DOM::Name::localName):
        * khtml/xml/dom_nodeimpl.h:
        * khtml/xml/dom_stringimpl.cpp:
        * kwq/KWQFont.mm:
        (QFont::family):
        * kwq/KWQFontFamily.h:
        (KWQFontFamily::family):
        * kwq/KWQFontFamily.mm:
        (retainDOMStringImpl):
        (releaseDOMStringImpl):
        (KWQFontFamily::getNSFamily):
        (KWQFontFamily::setFamily):
        (KWQFontFamily::operator==):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fileWrapperForElement):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]):

2004-01-29  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3543619>: copied HTML is strangely formatted, random whitespace and return characters

        Reviewed by dave.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithRange): remove all code that tries to format the HTML since we can rely on the existing white space to preserve the original formatting

2004-01-28  John Sullivan  <sullivan@apple.com>

        Reviewed by Dave.

        * khtml/rendering/render_text.cpp:
        (RenderText::paintObject):
        Increment s in the while() clause so it is incremented even
        after a continue statement. This fixes an infinite loop I ran
        into in the printing code path at certain scaled print sizes
        on certain pages.

2004-01-28  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3543041>: when pasting an image, cursor should be after the image, not before

        Reviewed by rjw.

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::pasteHTMLString): when the last node of the paste is non-text, use 1 instead of 0 as the start offset of the caret

2004-01-28  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

	A small collection of fixes and improvements to editing.

	Added a forwarding header for dom_position.h
	Added some debugging output to KHTMLSelection
	Added support for left arrow navigation.
	Greatly improved support for right arrow navigation.
	Added include guards to dom_position.h. Oops!
	Removed pruneEmptyNodes() function from htmlediting.cpp. That was crack.
	Improved the text insert command so that it splits the text node being
	    operated on only when necessary.
	Added support for placing the caret in and arrowing into BR elements.
	Moved precedesLineBreak/followsLineBreak from RenderText to RenderObject.	

        * ForwardingHeaders/dom/dom_position.h: Added.
        * khtml/dom/dom_position.h:
        * khtml/editing/htmlediting.cpp:
        (InputTextCommand::apply):
        (DeleteTextCommand::apply):
        * khtml/khtml_selection.cpp:
        (KHTMLSelection::setSelection):
        (KHTMLSelection::alterSelection):
        (KHTMLSelection::update):
        (KHTMLSelection::previousCharacterPosition):
        (KHTMLSelection::nextCharacterPosition):
        (startAndEndLineNodesIncludingNode):
        (KHTMLSelection::debugRenderer):
        (KHTMLSelection::debugPosition):
        * khtml/khtml_selection.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::RenderBR):
        (RenderBR::position):
        (RenderBR::caretMaxOffset):
        (RenderBR::caretPos):
        * khtml/rendering/render_br.h:
        (khtml::RenderBR::xPos):
        (khtml::RenderBR::yPos):
        (khtml::RenderBR::height):
        * khtml/rendering/render_object.cpp:
        (RenderObject::precedesLineBreak):
        (RenderObject::followsLineBreak):
        (RenderObject::isEditable):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::caretPos):
        (RenderText::position):
        (RenderText::caretMaxOffset):
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::defaultEventHandler):

2004-01-28  David Hyatt  <hyatt@apple.com>

	Fix for 3537694, make blocks for parents of inline children be axobjects.
	
        Reviewed by kocienda

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject role]):
        (-[KWQAccObject accessibilityIsIgnored]):

2004-01-28  David Hyatt  <hyatt@apple.com>

	Make AtomicString a new class that owns DOMStrings, instead of using KJS::Identifier.  One day when we
	convert DOMString and UString to have the same underlying rep, then these classes could possibly re-merge.
	For now this provides an easy migration path for all the code that is using DOMStringImpl*.

	Also fixed a bug with float clearing in the style cascade.
	
        Reviewed by darin

        * khtml/css/cssparser.h:
        (DOM::atomicString):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::checkOneSelector):
        (khtml::CSSStyleSelector::applyRule):
        * khtml/dom/dom_string.cpp:
        (DOMString::DOMString):
        * khtml/xml/dom_nameimpl.cpp:
        (DOM::AtomicStringStatisticsExitLogger::~AtomicStringStatisticsExitLogger):
        (DOM::AtomicString::equal):
        (DOM::AtomicString::add):
        (DOM::AtomicString::insert):
        (DOM::AtomicString::remove):
        (DOM::AtomicString::expand):
        (DOM::AtomicString::shrink):
        (DOM::AtomicString::rehash):
        (DOM::AtomicString::null):
        (DOM::AtomicString::init):
        (DOM::operator==):
        (DOM::equalsIgnoreCase):
        * khtml/xml/dom_nameimpl.h:
        (DOM::AtomicString::AtomicString):
        (DOM::AtomicString:::m_string):
        (DOM::AtomicString::string):
        (DOM::AtomicString::qstring):
        (DOM::AtomicString::implementation):
        (DOM::AtomicString::unicode):
        (DOM::AtomicString::length):
        (DOM::AtomicString::ascii):
        (DOM::AtomicString::find):
        (DOM::AtomicString::isNull):
        (DOM::AtomicString::isEmpty):
        (DOM::AtomicString::equal):
        (DOM::operator==):
        (DOM::operator!=):
        * khtml/xml/dom_stringimpl.cpp:
        (DOM::DOMStringImpl::empty):
        (DOM::DOMStringImpl::DOMStringImpl):
        (DOM::DOMStringImpl::~DOMStringImpl):
        (DOM::DOMStringImpl::append):
        (DOM::DOMStringImpl::insert):
        (DOM::DOMStringImpl::truncate):
        (DOM::DOMStringImpl::remove):
        (DOM::DOMStringImpl::split):
        (DOM::DOMStringImpl::substring):
        (DOM::DOMStringImpl::replace):
        (DOM::DOMStringImpl::computeHash):
        * khtml/xml/dom_stringimpl.h:
        (DOM::DOMStringImpl::DOMStringImpl):
        (DOM::DOMStringImpl::hash):
        * khtml/xml/dom_textimpl.cpp:
        (CharacterDataImpl::CharacterDataImpl):

2004-01-27  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3541812>: Implement Paste menu item
	<rdar://problem/3541814>: Implement Delete menu item
	<rdar://problem/3541811>: Implement Cut menu item

        Reviewed by dave.

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::deleteSelection): new
        (DocumentImpl::pasteHTMLString): new
        * khtml/xml/dom_docimpl.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge isEditable]): new
        (-[WebCoreBridge pasteHTMLString:]): new
        (-[WebCoreBridge deleteSelection]): new
        (-[WebCoreBridge haveSelection]): new

2004-01-27  David Hyatt  <hyatt@apple.com>

	Add a new AtomicString type (that is really just a KJS::Identifier).  Define a Name class that will eventually
	be used for element and attribute names.

	Atomize the CSS selector's "value" field, used to hold class names, identifier names, attribute values, and
	pseudo-element names.
	
        Reviewed by rjw

        * ForwardingHeaders/kjs/identifier.h: Added.
        * WebCore.pbproj/project.pbxproj:
        * khtml/css/css_base.cpp:
        (CSSSelector::print):
        (CSSSelector::specificity):
        (CSSSelector::extractPseudoType):
        (CSSSelector::selectorText):
        * khtml/css/css_base.h:
        (DOM::CSSSelector::):
        * khtml/css/cssparser.cpp:
        (ParseString::lower):
        * khtml/css/cssparser.h:
        (DOM::atomicString):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::checkOneSelector):
        * khtml/css/parser.cpp:
        * khtml/css/parser.y:
        * khtml/html/html_elementimpl.cpp:
        (:NamedAttrMapImpl):
        (HTMLNamedAttrMapImpl::clearAttributes):
        (HTMLNamedAttrMapImpl::isHTMLAttributeMap):
        (HTMLNamedAttrMapImpl::parseClassAttribute):
        (HTMLNamedAttrMapImpl::matchesCSSClass):
        (HTMLElementImpl::parseAttribute):
        (HTMLElementImpl::createAttributeMap):
        (HTMLElementImpl::matchesCSSClass):
        * khtml/html/html_elementimpl.h:
        * khtml/html/html_objectimpl.cpp:
        (HTMLObjectElementImpl::recalcStyle):
        * khtml/html/htmltokenizer.h:
        (khtml::Token::addAttribute):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::matchesCSSClass):
        (NamedAttrMapImpl::isHTMLAttributeMap):
        (NamedAttrMapImpl::operator=):
        * khtml/xml/dom_elementimpl.h:
        * khtml/xml/dom_nameimpl.cpp: Added.
        (DOM::AtomicStringList::clone):
        (DOM::operator==):
        (DOM::equalsIgnoreCase):
        * khtml/xml/dom_nameimpl.h: Added.
        (DOM::AtomicStringList:::m_next):
        (DOM::AtomicStringList::m_next):
        (DOM::AtomicStringList::~AtomicStringList):
        (DOM::AtomicStringList::next):
        (DOM::AtomicStringList::setNext):
        (DOM::AtomicStringList::string):
        (DOM::AtomicStringList::setString):
        (DOM::AtomicStringList::clear):
        (DOM::Name::Name):
        (DOM::Name::m_localName):
        (DOM::Name::namespaceURI):
        (DOM::Name::localName):
        (DOM::operator==):
        (DOM::operator!=):
        * khtml/xml/dom_nodeimpl.h:

2004-01-27  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed <rdar://problem/3526056>: W3C says that DEL key identifier should be U+00007F, we give ForwardDelete instead

        * kwq/KWQEvent.mm: (keyIdentifierForKeyEvent): Correct the key identifiers for the Delete, Insert,
        Menu, Scroll Lock, and Select keys, as well as some obscure F25 and higher keys. Also add some
        explicit constants for the keys defined in NSEvent.h that we map to a key identifier using the
        vendor-area Unicode values (which are probably not appropriate).

2004-01-27  David Hyatt  <hyatt@apple.com>

	Make a change suggested by kocienda to add a remove() method to InlineBoxes.
	
        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::detach):
        (RenderBox::position):
        * khtml/rendering/render_line.cpp:
        (InlineBox::remove):
        * khtml/rendering/render_line.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::detach):
        (RenderText::position):

2004-01-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - follow-on to the text-align change I did earlier today

        * khtml/css/html4.css: Set input and textarea so they do not inherit text-align
        from their parent by doing "text-align: -khtml-auto". This fixes google.com among others.

2004-01-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3539414>: pop-up windows appear very narrow because of bogus width (carad.com/ebaymotors)

        * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Check the "OK" result from toFloat in
        window.open, and omit any parameters that can't be parsed.

2004-01-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3537371>: REGRESSION (100-125): optgroup labels are no longer indented as they were before

        * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
        Move code that adds spaces after code that strips whitespace. Also simplify
        the code a bit by using DOMString::string().

2004-01-26  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3539286>: text with a transparent background color pastes as black on black

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::attributedString): Don't put color in the mutable
        string if it's entirely transparent.
        * kwq/KWQColor.mm: (QColor::getNSColor): Fix bug where we would return nil for RGBA of 0.

2004-01-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3529120>: text-align style property not respected on input fields

        * khtml/rendering/render_form.h: Added textAlignment function.
        * khtml/rendering/render_form.cpp:
        (RenderFormElement::textAlignment): Added. Converts style alignment to Qt alignment.
        (RenderLineEdit::setStyle): Call textAlignment intead of using direction from style.
        (RenderTextArea::setStyle): Call textAlignment intead of using direction from style.

        * kwq/KWQLineEdit.h: Added KWQNSTextAlignmentForAlignmentFlags function.
        * kwq/KWQLineEdit.mm:
        (QLineEdit::setAlignment): Use KWQNSTextAlignmentForAlignmentFlags instead of code
        that handles only left and right alignment.
        (KWQNSTextAlignmentForAlignmentFlags): Added. Converts Qt alignment to NS alignment.
        * kwq/KWQTextEdit.mm: (QTextEdit::setAlignment): Use KWQNSTextAlignmentForAlignmentFlags
        instead of code that handles only left and right alignment.

2004-01-26  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3477707>: background image with apostrophe in name missing at http://www.nbc.com

        * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseAttribute): Use addCSSImageProperty
        instead of addCSSProperty, obviating the need for the "url()" syntax (and fixing quoting issues).

        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::parseAttribute): Ditto.
        (HTMLTablePartElementImpl::parseAttribute): Ditto.

        * khtml/html/html_elementimpl.h: Added addCSSStringProperty and addCSSImageProperty.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::addCSSStringProperty): Added. Calls setStringProperty. Not used yet.
        (HTMLElementImpl::addCSSImageProperty): Added. Calls setImageProperty.

        * khtml/css/css_valueimpl.h: Added setStringProperty and setImageProperty.
        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::setStringProperty): Added. Sets a property without parsing.
        (CSSStyleDeclarationImpl::setImageProperty): Added. Sets a property without parsing.
        You'd think we'd be able to just use setStringProperty, but that's not how the image
        properties work.

2004-01-26  Darin Adler  <darin@apple.com>

        * Makefile.am: Switch from pbxbuild to xcodebuild.

2004-01-26  David Hyatt  <hyatt@apple.com>

	Add CSS3 @namespace support.  The whole way namespaces, element, and attribute names are being handled
	right now is temporary.  This code gives us a baseline of functionality (for regression testing) that we
	can use when we implement namespaces "the right way."
	
        Reviewed by darin

        * WebCore.pbproj/project.pbxproj:
        * khtml/css/css_base.cpp:
        (CSSSelector::specificity):
        (CSSSelector::selectorText):
        * khtml/css/css_base.h:
        (DOM::CSSNamespace::m_parent):
        (DOM::CSSNamespace::~CSSNamespace):
        (DOM::CSSNamespace::uri):
        (DOM::CSSNamespace::prefix):
        (DOM::CSSNamespace::namespaceForPrefix):
        (DOM::CSSSelector::CSSSelector):
        * khtml/css/css_stylesheetimpl.cpp:
        (CSSStyleSheetImpl::CSSStyleSheetImpl):
        (CSSStyleSheetImpl::addNamespace):
        (CSSStyleSheetImpl::determineNamespace):
        * khtml/css/css_stylesheetimpl.h:
        (DOM::CSSStyleSheetImpl::~CSSStyleSheetImpl):
        * khtml/css/cssparser.cpp:
        (CSSParser::CSSParser):
        (CSSParser::parseSheet):
        * khtml/css/cssparser.h:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::styleForElement):
        (khtml::CSSStyleSelector::pseudoStyleForElement):
        (khtml::CSSStyleSelector::checkSelector):
        (khtml::CSSStyleSelector::checkOneSelector):
        (khtml::CSSStyleSelector::buildLists):
        * khtml/css/html4.css:
        * khtml/css/parser.cpp:
        * khtml/css/parser.y:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::~DocumentImpl):
        (DocumentImpl::attrId):
        (DocumentImpl::attrName):
        (DocumentImpl::tagId):
        (DocumentImpl::tagName):
        (DocumentImpl::namespaceURI):
        * khtml/xml/dom_elementimpl.cpp:
        (NamedAttrMapImpl::getAttributeItem):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::checkSetPrefix):
        * khtml/xml/dom_nodeimpl.h:
        (DOM::namespacePart):
        (DOM::localNamePart):
        (DOM::makeId):
        * khtml/xml/dom_xmlimpl.cpp:
        (ProcessingInstructionImpl::checkStyleSheet):
        * khtml/xml/xml_namespace_table.cpp: Added.
        (DOM::XmlNamespaceTable::getNamespaceID):
        (DOM::XmlNamespaceTable::getNamespaceURI):
        * khtml/xml/xml_namespace_table.h: Added.
        (DOM::XmlNamespaceEntry::m_uri):

2004-01-26  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed <rdar://problem/3532519>: <select> menus show label property instead of tag contents (ups.com time and cost site)

        * khtml/html/html_formimpl.cpp: (HTMLOptionElementImpl::text): Ignore the label property as
        a quirk. Neither WinIE nor Mozilla implement the label property, so neither shall we (except
        on strict pages, where we just go crazy and do everything "right").

2004-01-26  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

        * khtml/rendering/render_line.h:
        (khtml::InlineBox::isFirstLineStyle): Helper to return whether
	the line box has the first line style bit set.
        * khtml/rendering/render_text.cpp:
        (RenderText::caretPos): Noe correctly accounts for white space
	which can precede an inline text box.

2004-01-26  David Hyatt  <hyatt@apple.com>

	Remove incremental repainting ifdef.

        * khtml/khtmlview.h:
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::repaintObjectsBeforeLayout):
        (khtml::RenderBlock::positionNewFloats):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::computeAbsoluteRepaintRect):
        (RenderBox::repaintDuringLayoutIfMoved):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::removeChildNode):
        * khtml/rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutBlock):
        (khtml::RenderFlexibleBox::placeChild):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::getAbsoluteRepaintRect):
        * khtml/rendering/render_image.cpp:
        (RenderImage::layout):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::RenderLayer):
        (RenderLayer::computeRepaintRects):
        (RenderLayer::updateLayerPositions):
        (RenderLayer::updateLayerPosition):
        (RenderLayer::paintLayer):
        * khtml/rendering/render_layer.h:
        (khtml::RenderLayer::relativePositionOffset):
        * khtml/rendering/render_object.cpp:
        (RenderObject::setNeedsLayout):
        (RenderObject::setChildNeedsLayout):
        (RenderObject::markContainingBlocksForLayout):
        (RenderObject::getAbsoluteRepaintRectIncludingFloats):
        (RenderObject::detach):
        (RenderObject::scheduleRelayout):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_table.cpp:
        (RenderTable::layout):
        (RenderTableSection::layoutRows):

2004-01-26  David Hyatt  <hyatt@apple.com>

	Preserve the integrity of the line box tree when elements get removed.  Change RenderText over to using
	the same data structures as inlines and blocks for maintaining its list of line boxes.
	
        Reviewed by kocienda

        * khtml/khtml_part.cpp:
        (KHTMLPart::text):
        (KHTMLPart::customEvent):
        * khtml/khtml_selection.cpp:
        (KHTMLSelection::nextCharacterPosition):
        (firstRunAt):
        (lastRunAt):
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::removeChild):
        * khtml/rendering/render_box.cpp:
        (RenderBox::RenderBox):
        (RenderBox::detach):
        (RenderBox::position):
        (RenderBox::inlineBoxWrapper):
        (RenderBox::deleteLineBoxWrapper):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::removeChildNode):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::detach):
        * khtml/rendering/render_line.cpp:
        (InlineFlowBox::removeChild):
        * khtml/rendering/render_line.h:
        (khtml::InlineBox::nextOnLine):
        (khtml::InlineBox::prevOnLine):
        (khtml::InlineBox::setNextOnLine):
        (khtml::InlineBox::setPrevOnLine):
        (khtml::InlineRunBox::prevLineBox):
        (khtml::InlineRunBox::nextLineBox):
        * khtml/rendering/render_object.cpp:
        (RenderObject::isEditable):
        (RenderObject::inlineBoxWrapper):
        (RenderObject::deleteLineBoxWrapper):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::documentBeingDestroyed):
        * khtml/rendering/render_text.cpp:
        (RenderText::RenderText):
        (RenderText::detach):
        (RenderText::deleteTextBoxes):
        (RenderText::absoluteRects):
        (RenderText::findNextInlineTextBox):
        (RenderText::nodeAtPoint):
        (RenderText::checkSelectionPointIgnoringContinuations):
        (RenderText::caretPos):
        (RenderText::paintObject):
        (RenderText::paint):
        (RenderText::minXPos):
        (RenderText::xPos):
        (RenderText::yPos):
        (RenderText::height):
        (RenderText::createInlineBox):
        (RenderText::position):
        (RenderText::width):
        (RenderText::caretMinOffset):
        (RenderText::caretMaxOffset):
        * khtml/rendering/render_text.h:
        (khtml::InlineTextBox:::InlineRunBox):
        (khtml::InlineTextBox::nextTextBox):
        (khtml::InlineTextBox::prevTextBox):
        (khtml::RenderText::firstTextBox):
        (khtml::RenderText::lastTextBox):
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityIsIgnored]):
        * kwq/KWQDef.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::attributedString):
        * kwq/KWQRenderTreeDebug.cpp:
        (write):

2004-01-24  David Hyatt  <hyatt@apple.com>

	Polish the error message from the xml tokenizer.

        * khtml/xml/xml_tokenizer.cpp:
        (XMLTokenizer::finish):

2004-01-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setShowsFirstResponder): Now adjusts caret visibility
	apprpropriately.

2004-01-23  David Hyatt  <hyatt@apple.com>

	Stub out @namespace support.  Implement the callbacks into the stylesheet that will enable us to
	store namespace information for simple selectors.

	Basically with this patch we no longer bomb when we encounter namespaced stylesheets, but we don't handle
	them properly yet either.
	
        Reviewed by kocienda

        * khtml/css/css_stylesheetimpl.cpp:
        (CSSStyleSheetImpl::addNamespace):
        (CSSStyleSheetImpl::determineNamespace):
        * khtml/css/css_stylesheetimpl.h:
        * khtml/css/cssparser.cpp:
        (DOM::CSSParser::lex):
        * khtml/css/cssparser.h:
        * khtml/css/parser.cpp:
        * khtml/css/parser.h:
        * khtml/css/parser.y:
        * khtml/css/tokenizer.cpp:
        * khtml/css/tokenizer.flex:

2004-01-23  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

	Merged HTML editing progress to TOT from the branch
	I have been maintaining.

        * khtml/dom/dom_position.cpp: Added.
        * khtml/dom/dom_position.h: Added.
        * khtml/editing/htmlediting.cpp: Added.
        * khtml/editing/htmlediting.h: Added.
        * khtml/khtml_selection.cpp: Added.
        * khtml/khtml_selection.h: Added.

2004-01-22  David Hyatt  <hyatt@apple.com>

	Fix a bug I accidentally introduced in static positioned elements.  Add more margin collapsing tests.
	
        * ChangeLog:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):
        * layout-tests/fast/block/margin-collapse/044-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/044.html: Added.
        * layout-tests/fast/block/margin-collapse/045-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/045.html: Added.
        * layout-tests/fast/block/margin-collapse/062-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/062.html: Added.
        * layout-tests/fast/block/margin-collapse/063-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/063.html: Added.
        * layout-tests/fast/block/positioning/007-expected.txt:

2004-01-22  David Hyatt  <hyatt@apple.com>

        Reviewed by NOBODY (OOPS!).

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):
        * layout-tests/fast/block/margin-collapse/062-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/062.html: Added.
        * layout-tests/fast/block/margin-collapse/063-expected.txt: Added.
        * layout-tests/fast/block/margin-collapse/063.html: Added.
        * layout-tests/fast/block/positioning/007-expected.txt:

2004-01-22  David Hyatt  <hyatt@apple.com>

	(1) Implement better XML error handling.
	(2) Fix a minor z-index bug with the 'initial' value.
	(3) Initial landing of XBL support.  Code is all ifnef KHTML_NO_XBL so that it can be turned off easily if
	XBL never comes to fruition.
	
        Reviewed by darin

        * ForwardingHeaders/xbl/xbl_binding_manager.h: Added.
        * ForwardingHeaders/xbl/xbl_docimpl.h: Added.
        * WebCore.pbproj/project.pbxproj:
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/dom/dom_element.cpp:
        (Element::getAttributeNS):
        * khtml/misc/loader.cpp:
        (CachedXBLDocument::CachedXBLDocument):
        (CachedXBLDocument::~CachedXBLDocument):
        (CachedXBLDocument::ref):
        (CachedXBLDocument::deref):
        (CachedXBLDocument::data):
        (CachedXBLDocument::checkNotify):
        (CachedXBLDocument::error):
        (DocLoader::requestXBLDocument):
        (Cache::requestXBLDocument):
        (CachedObjectClient::setXBLDocument):
        (Cache::getStatistics):
        * khtml/misc/loader.h:
        (khtml::CachedObject::):
        (khtml::CachedXBLDocument::document):
        (khtml::CachedXBLDocument::schedule):
        * khtml/misc/loader_client.h:
        * khtml/rendering/render_style.cpp:
        (bindingURI):
        (marquee):
        (StyleCSS3NonInheritedData::~StyleCSS3NonInheritedData):
        (StyleCSS3NonInheritedData::bindingsEquivalent):
        (StyleCSS3NonInheritedData::operator==):
        (:m_next):
        (BindingURI::~BindingURI):
        (BindingURI::copy):
        (BindingURI::operator==):
        (RenderStyle::addBindingURI):
        * khtml/rendering/render_style.h:
        (khtml::BindingURI::operator!=):
        (khtml::BindingURI::next):
        (khtml::BindingURI::setNext):
        (khtml::BindingURI::uri):
        (khtml::RenderStyle::bindingURIs):
        (khtml::RenderStyle::setHasAutoZIndex):
        (khtml::RenderStyle::setZIndex):
        (khtml::RenderStyle::deleteBindingURIs):
        (khtml::RenderStyle::inheritBindingURIs):
        * khtml/xbl/xbl_binding.cpp: Added.
        (XBL::m_markedForDeath):
        (XBL::XBLBindingChain::~XBLBindingChain):
        (XBL::XBLBindingChain::firstStyleBindingChain):
        (XBL::XBLBindingChain::lastBindingChain):
        (XBL::XBLBindingChain::insertBindingChain):
        (XBL::XBLBindingChain::markForDeath):
        (XBL::XBLBindingChain::loaded):
        (XBL::XBLBindingChain::hasStylesheets):
        (XBL::XBLBindingChain::failed):
        (XBL::m_nextBinding):
        (XBL::XBLBinding::~XBLBinding):
        (XBL::XBLBinding::loaded):
        (XBL::XBLBinding::setXBLDocument):
        * khtml/xbl/xbl_binding.h: Added.
        (XBL::):
        (XBL::XBLBindingChain::uri):
        (XBL::XBLBindingChain::nextChain):
        (XBL::XBLBindingChain::previousChain):
        (XBL::XBLBindingChain::setNextBindingChain):
        (XBL::XBLBindingChain::setPreviousBindingChain):
        (XBL::XBLBindingChain::markedForDeath):
        (XBL::XBLBindingChain::element):
        * khtml/xbl/xbl_binding_manager.cpp: Added.
        (XBL::m_bindingChainTable):
        (XBL::XBLBindingManager::~XBLBindingManager):
        (XBL::XBLBindingManager::getBindingChain):
        (XBL::XBLBindingManager::setBindingChain):
        (XBL::XBLBindingManager::loadBindings):
        (XBL::XBLBindingManager::checkLoadState):
        * khtml/xbl/xbl_binding_manager.h: Added.
        * khtml/xbl/xbl_docimpl.cpp: Added.
        (XBL:::DocumentImpl):
        (XBL::XBLDocumentImpl::~XBLDocumentImpl):
        (XBL::XBLDocumentImpl::createTokenHandler):
        (XBL::XBLDocumentImpl::setPrototypeBinding):
        (XBL::XBLDocumentImpl::prototypeBinding):
        * khtml/xbl/xbl_docimpl.h: Added.
        (XBL::):
        * khtml/xbl/xbl_protobinding.cpp: Added.
        (XBL::m_handler):
        (XBL::XBLPrototypeBinding::initialize):
        (XBL::XBLPrototypeBinding::document):
        (XBL::XBLPrototypeBinding::addResource):
        * khtml/xbl/xbl_protobinding.h: Added.
        (XBL::XBLPrototypeBinding::element):
        (XBL::XBLPrototypeBinding::setHandler):
        (XBL::XBLPrototypeBinding::handler):
        * khtml/xbl/xbl_protohandler.cpp: Added.
        (XBL::m_unused):
        (XBL::XBLPrototypeHandler::~XBLPrototypeHandler):
        (XBL::XBLPrototypeHandler::appendData):
        * khtml/xbl/xbl_protohandler.h: Added.
        (XBL::XBLPrototypeHandler::setNext):
        (XBL::XBLPrototypeHandler::next):
        * khtml/xbl/xbl_protoimplementation.cpp: Added.
        (XBL::m_compiled):
        (XBL::m_next):
        (XBL::XBLPrototypeMember::appendData):
        (XBL:::XBLPrototypeMember):
        (XBL::XBLPrototypeMethod::isConstructor):
        (XBL::XBLPrototypeMethod::isDestructor):
        (XBL::XBLPrototypeMethod::addParameter):
        (XBL:::XBLPrototypeMethod):
        (XBL::XBLPrototypeConstructor::isConstructor):
        (XBL::XBLPrototypeDestructor::isDestructor):
        (XBL::m_readonly):
        (XBL::XBLPrototypeProperty::appendGetterText):
        (XBL::XBLPrototypeProperty::appendSetterText):
        * khtml/xbl/xbl_protoimplementation.h: Added.
        (XBL::XBLPrototypeMember::~XBLPrototypeMember):
        (XBL::XBLPrototypeMember::setNext):
        (XBL::XBLPrototypeMember::next):
        (XBL::XBLPrototypeImplementation::~XBLPrototypeImplementation):
        (XBL::XBLPrototypeImplementation::setMember):
        (XBL::XBLPrototypeParameter::m_next):
        (XBL::XBLPrototypeParameter::~XBLPrototypeParameter):
        (XBL::XBLPrototypeParameter::next):
        (XBL::XBLPrototypeParameter::setNext):
        (XBL::):
        * khtml/xbl/xbl_tokenizer.cpp: Added.
        (XBL::XBLTokenHandler::XBLTokenHandler):
        (XBL::XBLTokenHandler::~XBLTokenHandler):
        (XBL::XBLTokenHandler::xblDocument):
        (XBL::XBLTokenHandler::startElement):
        (XBL::XBLTokenHandler::endElement):
        (XBL::XBLTokenHandler::characters):
        (XBL::XBLTokenHandler::createBinding):
        (XBL::XBLTokenHandler::createHandler):
        (XBL::XBLTokenHandler::createResource):
        (XBL::XBLTokenHandler::createImplementation):
        (XBL::XBLTokenHandler::addMember):
        (XBL::XBLTokenHandler::createConstructor):
        (XBL::XBLTokenHandler::createDestructor):
        (XBL::XBLTokenHandler::createField):
        (XBL::XBLTokenHandler::createProperty):
        (XBL::XBLTokenHandler::createMethod):
        (XBL::XBLTokenHandler::createParameter):
        * khtml/xbl/xbl_tokenizer.h: Added.
        (XBL::):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::~DocumentImpl):
        (DocumentImpl::createTokenHandler):
        (DocumentTypeImpl::DocumentTypeImpl):
        (DocumentTypeImpl::~DocumentTypeImpl):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::bindingManager):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::getAttributeNS):
        (ElementImpl::childAllowed):
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::getAttribute):
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/xml_tokenizer.cpp:
        (XMLHandler::XMLHandler):
        (XMLHandler::startDocument):
        (XMLHandler::startElement):
        (XMLHandler::endElement):
        (XMLHandler::startCDATA):
        (XMLHandler::endCDATA):
        (XMLHandler::characters):
        (XMLHandler::comment):
        (XMLHandler::processingInstruction):
        (XMLHandler::warning):
        (XMLHandler::error):
        (XMLHandler::fatalError):
        (XMLTokenizer::finish):
        * khtml/xml/xml_tokenizer.h:
        * kwq/KWQXmlSimpleReader.h:
        (QXmlSimpleReader::sawError):
        (QXmlSimpleReader::recordError):
        * kwq/KWQXmlSimpleReader.mm:
        (warningHandler):
        (fatalErrorHandler):
        (normalErrorHandler):
        (QXmlSimpleReader::parse):

2004-01-22  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3537542>: support for copying HTML

        Reviewed by dave.

        * khtml/xml/dom2_rangeimpl.cpp:
        (RangeImpl::toHTML): implemented
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::recursive_toHTMLWithRange): new
        * khtml/xml/dom_nodeimpl.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge selectedHTML]): new
        (-[WebCoreBridge reconstructedSource]): new

2004-01-21  David Hyatt  <hyatt@apple.com>

	Fix for two margin collapsing edge cases.
	
        Reviewed by darin

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):

2004-01-21  David Hyatt  <hyatt@apple.com>

	Switch from expat to libxml and implement namespace support in the simplereader.
	
        Reviewed by darin

        * ChangeLog:
        * expat/Changes: Removed.
        * expat/MANIFEST: Removed.
        * expat/README: Removed.
        * expat/expat_config.h: Removed.
        * expat/lib/ascii.h: Removed.
        * expat/lib/asciitab.h: Removed.
        * expat/lib/expat.h: Removed.
        * expat/lib/iasciitab.h: Removed.
        * expat/lib/internal.h: Removed.
        * expat/lib/latin1tab.h: Removed.
        * expat/lib/nametab.h: Removed.
        * expat/lib/utf8tab.h: Removed.
        * expat/lib/xmlparse.c: Removed.
        * expat/lib/xmlrole.c: Removed.
        * expat/lib/xmlrole.h: Removed.
        * expat/lib/xmltok.c: Removed.
        * expat/lib/xmltok.h: Removed.
        * expat/lib/xmltok_impl.c: Removed.
        * expat/lib/xmltok_impl.h: Removed.
        * expat/lib/xmltok_ns.c: Removed.
        * kwq/KWQXmlAttributes.h:
        (QXmlAttributes::QXmlAttributes):
        (QXmlAttributes::qName):
        (QXmlAttributes::uri):
        * kwq/KWQXmlAttributes.mm:
        (QXmlAttributes::QXmlAttributes):
        (QXmlAttributes::~QXmlAttributes):
        (QXmlAttributes::operator=):
        (QXmlAttributes::localName):
        (QXmlAttributes::split):
        * kwq/KWQXmlSimpleReader.h:
        (KWQXmlNamespace::m_ref):
        (KWQXmlNamespace::uriForPrefix):
        (KWQXmlNamespace::ref):
        (KWQXmlNamespace::deref):
        (QXmlParseException::QXmlParseException):
        (QXmlParseException::message):
        (QXmlParseException::columnNumber):
        (QXmlParseException::lineNumber):
        (QXmlSimpleReader::errorHandler):
        (QXmlSimpleReader::xmlNamespace):
        (QXmlSimpleReader::parserStopped):
        * kwq/KWQXmlSimpleReader.mm:
        (startElementHandler):
        (endElementHandler):
        (charactersHandler):
        (processingInstructionHandler):
        (cdataBlockHandler):
        (commentHandler):
        (warningHandler):
        (fatalErrorHandler):
        (QXmlSimpleReader::pushNamespaces):
        (QXmlSimpleReader::popNamespaces):
        (QXmlSimpleReader::parse):
        (QXmlSimpleReader::stopParsing):
        (QXmlSimpleReader::lineNumber):
        (QXmlSimpleReader::columnNumber):

2004-01-21  David Hyatt  <hyatt@apple.com>

        Reviewed by NOBODY (OOPS!).

        * ForwardingHeaders/xbl/xbl_binding_manager.h: Added.
        * ForwardingHeaders/xbl/xbl_docimpl.h: Added.
        * WebCore.pbproj/project.pbxproj:
        * expat/COPYING: Removed.
        * expat/Changes: Removed.
        * expat/MANIFEST: Removed.
        * expat/README: Removed.
        * expat/expat_config.h: Removed.
        * expat/lib/ascii.h: Removed.
        * expat/lib/asciitab.h: Removed.
        * expat/lib/expat.h: Removed.
        * expat/lib/iasciitab.h: Removed.
        * expat/lib/internal.h: Removed.
        * expat/lib/latin1tab.h: Removed.
        * expat/lib/nametab.h: Removed.
        * expat/lib/utf8tab.h: Removed.
        * expat/lib/xmlparse.c: Removed.
        * expat/lib/xmlrole.c: Removed.
        * expat/lib/xmlrole.h: Removed.
        * expat/lib/xmltok.c: Removed.
        * expat/lib/xmltok.h: Removed.
        * expat/lib/xmltok_impl.c: Removed.
        * expat/lib/xmltok_impl.h: Removed.
        * expat/lib/xmltok_ns.c: Removed.
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/dom/dom_element.cpp:
        (Element::getAttributeNS):
        * khtml/misc/loader.cpp:
        (CachedXBLDocument::CachedXBLDocument):
        (CachedXBLDocument::~CachedXBLDocument):
        (CachedXBLDocument::ref):
        (CachedXBLDocument::deref):
        (CachedXBLDocument::data):
        (CachedXBLDocument::checkNotify):
        (CachedXBLDocument::error):
        (DocLoader::requestXBLDocument):
        (Cache::requestXBLDocument):
        (CachedObjectClient::setXBLDocument):
        (Cache::getStatistics):
        * khtml/misc/loader.h:
        (khtml::CachedObject::):
        (khtml::CachedXBLDocument::document):
        (khtml::CachedXBLDocument::schedule):
        * khtml/misc/loader_client.h:
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):
        * khtml/rendering/render_style.cpp:
        (bindingURI):
        (marquee):
        (StyleCSS3NonInheritedData::~StyleCSS3NonInheritedData):
        (StyleCSS3NonInheritedData::bindingsEquivalent):
        (StyleCSS3NonInheritedData::operator==):
        (:m_next):
        (BindingURI::~BindingURI):
        (BindingURI::copy):
        (BindingURI::operator==):
        (RenderStyle::addBindingURI):
        * khtml/rendering/render_style.h:
        (khtml::BindingURI::operator!=):
        (khtml::BindingURI::next):
        (khtml::BindingURI::setNext):
        (khtml::BindingURI::uri):
        (khtml::RenderStyle::bindingURIs):
        (khtml::RenderStyle::setHasAutoZIndex):
        (khtml::RenderStyle::setZIndex):
        (khtml::RenderStyle::deleteBindingURIs):
        (khtml::RenderStyle::inheritBindingURIs):
        * khtml/xbl/xbl_binding.cpp: Added.
        (XBL::m_markedForDeath):
        (XBL::XBLBindingChain::~XBLBindingChain):
        (XBL::XBLBindingChain::firstStyleBindingChain):
        (XBL::XBLBindingChain::lastBindingChain):
        (XBL::XBLBindingChain::insertBindingChain):
        (XBL::XBLBindingChain::markForDeath):
        (XBL::XBLBindingChain::loaded):
        (XBL::XBLBindingChain::hasStylesheets):
        (XBL::XBLBindingChain::failed):
        (XBL::m_nextBinding):
        (XBL::XBLBinding::~XBLBinding):
        (XBL::XBLBinding::loaded):
        (XBL::XBLBinding::setXBLDocument):
        * khtml/xbl/xbl_binding.h: Added.
        (XBL::):
        (XBL::XBLBindingChain::uri):
        (XBL::XBLBindingChain::nextChain):
        (XBL::XBLBindingChain::previousChain):
        (XBL::XBLBindingChain::setNextBindingChain):
        (XBL::XBLBindingChain::setPreviousBindingChain):
        (XBL::XBLBindingChain::markedForDeath):
        (XBL::XBLBindingChain::element):
        * khtml/xbl/xbl_binding_manager.cpp: Added.
        (XBL::m_bindingChainTable):
        (XBL::XBLBindingManager::~XBLBindingManager):
        (XBL::XBLBindingManager::getBindingChain):
        (XBL::XBLBindingManager::setBindingChain):
        (XBL::XBLBindingManager::loadBindings):
        (XBL::XBLBindingManager::checkLoadState):
        * khtml/xbl/xbl_binding_manager.h: Added.
        * khtml/xbl/xbl_docimpl.cpp: Added.
        (XBL:::DocumentImpl):
        (XBL::XBLDocumentImpl::~XBLDocumentImpl):
        (XBL::XBLDocumentImpl::createTokenHandler):
        (XBL::XBLDocumentImpl::setPrototypeBinding):
        (XBL::XBLDocumentImpl::prototypeBinding):
        * khtml/xbl/xbl_docimpl.h: Added.
        (XBL::):
        * khtml/xbl/xbl_protobinding.cpp: Added.
        (XBL::m_handler):
        (XBL::XBLPrototypeBinding::initialize):
        (XBL::XBLPrototypeBinding::document):
        (XBL::XBLPrototypeBinding::addResource):
        * khtml/xbl/xbl_protobinding.h: Added.
        (XBL::XBLPrototypeBinding::element):
        (XBL::XBLPrototypeBinding::setHandler):
        (XBL::XBLPrototypeBinding::handler):
        * khtml/xbl/xbl_protohandler.cpp: Added.
        (XBL::m_unused):
        (XBL::XBLPrototypeHandler::~XBLPrototypeHandler):
        (XBL::XBLPrototypeHandler::appendData):
        * khtml/xbl/xbl_protohandler.h: Added.
        (XBL::XBLPrototypeHandler::setNext):
        (XBL::XBLPrototypeHandler::next):
        * khtml/xbl/xbl_protoimplementation.cpp: Added.
        (XBL::m_compiled):
        (XBL::m_next):
        (XBL::XBLPrototypeMember::appendData):
        (XBL:::XBLPrototypeMember):
        (XBL::XBLPrototypeMethod::isConstructor):
        (XBL::XBLPrototypeMethod::isDestructor):
        (XBL::XBLPrototypeMethod::addParameter):
        (XBL:::XBLPrototypeMethod):
        (XBL::XBLPrototypeConstructor::isConstructor):
        (XBL::XBLPrototypeDestructor::isDestructor):
        (XBL::m_readonly):
        (XBL::XBLPrototypeProperty::appendGetterText):
        (XBL::XBLPrototypeProperty::appendSetterText):
        * khtml/xbl/xbl_protoimplementation.h: Added.
        (XBL::XBLPrototypeMember::~XBLPrototypeMember):
        (XBL::XBLPrototypeMember::setNext):
        (XBL::XBLPrototypeMember::next):
        (XBL::XBLPrototypeImplementation::~XBLPrototypeImplementation):
        (XBL::XBLPrototypeImplementation::setMember):
        (XBL::XBLPrototypeParameter::m_next):
        (XBL::XBLPrototypeParameter::~XBLPrototypeParameter):
        (XBL::XBLPrototypeParameter::next):
        (XBL::XBLPrototypeParameter::setNext):
        (XBL::):
        * khtml/xbl/xbl_tokenizer.cpp: Added.
        (XBL::XBLTokenHandler::XBLTokenHandler):
        (XBL::XBLTokenHandler::~XBLTokenHandler):
        (XBL::XBLTokenHandler::xblDocument):
        (XBL::XBLTokenHandler::startElement):
        (XBL::XBLTokenHandler::endElement):
        (XBL::XBLTokenHandler::characters):
        (XBL::XBLTokenHandler::createBinding):
        (XBL::XBLTokenHandler::createHandler):
        (XBL::XBLTokenHandler::createResource):
        (XBL::XBLTokenHandler::createImplementation):
        (XBL::XBLTokenHandler::addMember):
        (XBL::XBLTokenHandler::createConstructor):
        (XBL::XBLTokenHandler::createDestructor):
        (XBL::XBLTokenHandler::createField):
        (XBL::XBLTokenHandler::createProperty):
        (XBL::XBLTokenHandler::createMethod):
        (XBL::XBLTokenHandler::createParameter):
        * khtml/xbl/xbl_tokenizer.h: Added.
        (XBL::):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::~DocumentImpl):
        (DocumentImpl::createTokenHandler):
        (DocumentTypeImpl::DocumentTypeImpl):
        (DocumentTypeImpl::~DocumentTypeImpl):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::bindingManager):
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::getAttributeNS):
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::getAttribute):
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/xml_tokenizer.cpp:
        (XMLHandler::startElement):
        (XMLTokenizer::finish):
        * khtml/xml/xml_tokenizer.h:
        * kwq/KWQXmlAttributes.h:
        (QXmlAttributes::QXmlAttributes):
        (QXmlAttributes::qName):
        (QXmlAttributes::uri):
        * kwq/KWQXmlAttributes.mm:
        (QXmlAttributes::QXmlAttributes):
        (QXmlAttributes::~QXmlAttributes):
        (QXmlAttributes::operator=):
        (QXmlAttributes::localName):
        (QXmlAttributes::split):
        * kwq/KWQXmlSimpleReader.h:
        (XmlNamespace::m_ref):
        (XmlNamespace::uriForPrefix):
        (XmlNamespace::ref):
        (XmlNamespace::deref):
        (QXmlParseException::QXmlParseException):
        (QXmlParseException::message):
        (QXmlParseException::columnNumber):
        (QXmlParseException::lineNumber):
        (QXmlSimpleReader::errorHandler):
        (QXmlSimpleReader::xmlNamespace):
        (QXmlSimpleReader::parserStopped):
        * kwq/KWQXmlSimpleReader.mm:
        (startElementHandler):
        (endElementHandler):
        (charactersHandler):
        (processingInstructionHandler):
        (cdataBlockHandler):
        (commentHandler):
        (warningHandler):
        (fatalErrorHandler):
        (QXmlSimpleReader::pushNamespaces):
        (QXmlSimpleReader::popNamespaces):
        (QXmlSimpleReader::parse):
        (QXmlSimpleReader::stopParsing):
        (QXmlSimpleReader::lineNumber):
        (QXmlSimpleReader::columnNumber):
        * layout-tests/fast/overflow/003.xml:

2004-01-21  David Hyatt  <hyatt@apple.com>

	Add some methods to dicts and stacks that exist in Qt.
	
        Reviewed by darin

        * kwq/KWQDict.h:
        (QDict::replace):
        * kwq/KWQPtrDict.h:
        (QPtrDict::replace):
        (QPtrDict::find):
        * kwq/KWQPtrStack.h:
        (QPtrStack::current):
        (QPtrStack::setAutoDelete):

2004-01-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John, Ken, Dave.

	<rdar://problem/3533319>: Safari allows upload of arbitrary local files w/o user's knowledge or permission
        
	* khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::value): Don't fall back to the value
	attribute for file inputs, since that way malicious HTML could
	force the user to upload files unexpectedly.

2004-01-18  David Hyatt  <hyatt@apple.com>

	Fix for 3532569, bugzilla patch viewer doesn't work.  My previous fix for 3531983 caused moves to happen
	when they should not have, due to childX and childY not being implemented at all on KWQScrollView.

        Reviewed by darin
	
        * kwq/KWQScrollView.mm:
        (QScrollView::childX):
        (QScrollView::childY):

=== Safari-124 ===

2004-01-16  David Hyatt  <hyatt@apple.com>

	Fix for 3531983, fixed positioning not working for widgets.  Make sure to move widgets at paint time
	if necessary.
	
        Reviewed by darin
	
        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::paintObject):

2004-01-15  David Hyatt  <hyatt@apple.com>

	Fix for 3530734, many java applets don't show up.  Go ahead and just use the width/height from the style
	system as the initial size when the width/height are fixed.
	
        Reviewed by rjw

        * khtml/rendering/render_applet.cpp:
        (RenderApplet::createWidgetIfNecessary):

2004-01-15  Richard Williamson   <rjw@apple.com>

	Fixed 3529426.  Exclude pages that contain Java applets from 
	the page cache.  The means applets get the normal stop/destroy
	messages that they expect when a user leaves a page.

        Reviewed by John.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::canCachePage):

2004-01-15  Vicki Murley  <vicki@apple.com>

        Reviewed by Darin.

        * WebCore.pbproj/project.pbxproj: Update copyright date to 2004.

2004-01-15  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed 3529943: REGRESSION (119-120): nil-deref in KHTMLPart::javaEnabled when hitting back button

        * khtml/html/html_objectimpl.cpp: (HTMLAppletElementImpl::getAppletInstance):
        Add missing nil check that the other call to javaEnabled has.

=== Safari-122 ===

2004-01-14  David Hyatt  <hyatt@apple.com>

	Fix for 3527819, marquee makes page layout too wide.  Make sure marquees have a minimum width of 0.
	
        Reviewed by john

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::calcMinMaxWidth):
        (khtml::RenderBlock::calcInlineMinMaxWidth):

2004-01-13  David Hyatt  <hyatt@apple.com>

	Fix for 3527707, crash on w3c css page.  Make sure height isn't allowed to be negative when computing
	positioned elements' heights.  Also bulletproof the crash in case there are other negative height code
	paths.
	
        Reviewed by john

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
        * khtml/rendering/render_box.cpp:
        (RenderBox::calcAbsoluteVertical):

2004-01-13  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3527853>: REGRESSION (119-120): Peoplesoft menus do not work
	
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::scrollToAnchor): Right before calling checkCompleted(), set
	m_bComplete to false, so it can get set right back to true if we're actually done
	loading and fire all the right signals.

2004-01-13  David Hyatt  <hyatt@apple.com>

	Fix for 3526710, applets need to have the correct initial size after a layout has been done, since our
	Java applets can't yet resize.
	
        Reviewed by john

        * khtml/rendering/render_applet.cpp:
        (RenderApplet::createWidgetIfNecessary):
        (RenderApplet::layout):
        (RenderEmptyApplet::layout):

=== Safari-121 ===

2004-01-11  Darin Adler  <darin@apple.com>

        - fixed Dave's check-in so it compiles; I assume he forgot to land one source file

        * khtml/khtmlview.h: Add RenderPart to the friends of KHTMLView.

2004-01-11  David Hyatt  <hyatt@apple.com>

	Fix for frame repainting bugs (3510669, 3515442).  This is a narrower fix than the previous attempt.
	
        Reviewed by darin

        * khtml/rendering/render_frames.cpp:
        (RenderPart::updateWidgetPositions):
        * khtml/rendering/render_frames.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::updateWidgetPositions):

2004-01-10  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3525468: REGRESSION (114-115): HOMEPAGE: after hitting textarea limit, backspace key is ignored

        * kwq/KWQEvent.mm:
        (keyIdentifierForKeyEvent): Treat 7F as 08; matches other browsers.
        (QKeyEvent::QKeyEvent): Ditto.

2004-01-09  David Hyatt  <hyatt@apple.com>

	Fixes for 3510669 and 3515442, blank frame problems caused by WebKit's use of a separate needsLayout boolean.
	
        Reviewed by darin

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setNeedsLayout]):

2004-01-08  David Hyatt  <hyatt@apple.com>

	Fix for 3524118, floats don't repaint when moved.
	
        Reviewed by darin

         * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionNewFloats):
 
2004-01-08  David Hyatt  <hyatt@apple.com>

	Fix for 3519003, crash in mail because <dir> and <menu> don't allow the same children as <ul> and <ol>.
	
        Reviewed by darin

        * khtml/html/dtd.cpp:
        (DOM::checkChild):

2004-01-08  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3524359>: REGRESSSION (119-120): 
        Double click to select text in form broken

        Reviewed by Dave and Darin.

        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent):
        Don't blur the focused node if that's the one you clicked on.

2004-01-07  Richard Williamson   <rjw@apple.com>

	Fixed 3517550.  Named array lookup of applet failed, i.e.:
	var appletobj = document.applets['myapplet']

        Reviewed by Chris.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLCollection::getNamedItems):

=== Safari-120 ===

2004-01-06  David Hyatt  <hyatt@apple.com>

	Possible fix for table bugs 3510005 and 3492945, repainting glitches that occurred when table cells moved.

	Fix for 33522497, empty AXElements appear in AXBrowser.
	
        Reviewed by darin

        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):
        (RenderTableCell::setWidth):
        * khtml/rendering/render_table.h:

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject accessibilityIsIgnored]):

2004-01-06  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3484465>: REGRESSION (118): button click does 
        not take focus away from <textarea>; breaks Outlook Web Access

        Reviewed by Dave.

        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent):
        Removed nodeimpl == nil test that was preventing button/link clicks
        from blurring previously-focused text field.

2004-01-06  David Hyatt  <hyatt@apple.com>

	Fix for 3520636, infinite loop in page breaking code when printing.
	
        Reviewed by darin

        * khtml/rendering/render_text.cpp:
        (RenderText::paintObject):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge computePageRectsWithPrintWidth:printHeight:]):

2004-01-05  David Hyatt  <hyatt@apple.com>

	Fix for 3521466, generated image content should not try to calcWidth/height when it isn't yet rooted in
	the rendering tree.
	
        Reviewed by john

        * khtml/rendering/render_image.cpp:
        (RenderImage::setPixmap):

2003-12-26  Darin Adler  <darin@apple.com>

        - one more small step to make -[KWQPageState dealloc] safer

        * kwq/KWQPageState.mm: (-[KWQPageState dealloc]): Only do the real detach() if the
        document is already in the detached state; we don't want to detach prematurely.

2003-12-23  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3451306>: address book search fails at Airborne 
        Express Corporate site (Apple Shipping wants to use it)

        Reviewed by Darin.

        * khtml/ecma/kjs_html.cpp:
        commented out definition of document.all; now sites like this one that
        set document.all to a value will work.
        * khtml/ecma/kjs_html.lut.h: regenerated this file

2003-12-23  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - another try at fixing the -[KWQPageState dealloc] bug, even though we don't fully understand it
        
        This change saves the renderer inside the document rather than in the KWQPageState to
        try to eliminate the possibility that multiple KWQPageState objects could restore the
        same renderer multiple times, resulting in multiple detaches of the same renderer.

        * khtml/xml/dom_docimpl.h: Add a m_savedRenderer field.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl): Initialize m_savedRenderer to 0.
        (DocumentImpl::~DocumentImpl): Added some asserts to make sure we don't get destroyed
        while we are in the page cache.
        (DocumentImpl::attach): Added an assert.
        (DocumentImpl::setInPageCache): Save the renderer when setting the flag, and restore
        the renderer when clearing it.

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::openURLFromPageCache): Instead of doing a restoreRenderer
        call, just do setInPageCache(NO), which will restore the renderer as a side effect.

        * kwq/KWQPageState.h: Removed the renderer method and field.
        * kwq/KWQPageState.mm:
        (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]):
        Don't store a pointer to the renderer.
        (-[KWQPageState clear]): New method, shared by invalidate and dealloc.
        (-[KWQPageState invalidate]): Removed code relating to "relinquishing object ownership";
        just deallocate everything here without doing a detach().
        (-[KWQPageState dealloc]): Removed restoreRenderer now that setInPageCache(NO) handles that.
        Added some assertions. Share code with invalidate by calling clear.

2003-12-22  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3508798>: ACCESSIBILITY: role/description/value strings not defined

        Reviewed by Darin.

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject roleDescription]):
        provide not-yet-localized strings for all the role descriptions that this class uses.
        (-[KWQAccObject value]):
        return nil string rather than dummy string for the cases where we don't have a value attribute.
        (-[KWQAccObject accessibilityActionDescription:]):
        changed comment passed to UI_STRING bogus macro so it won't have to change if/when macro
        loses its bogosity

2003-12-22  John Sullivan  <sullivan@apple.com>

	- WebCore part of fix for <rdar://problem/3515706>: 
	REGRESSION (100-118): Web Kit printing does not honor Page Setup scale factor

        Reviewed by Darin.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge computePageRectsWithPrintWidth:printHeight:]):
	renamed method for clarity; now iterates over pages horizontally as well 
	as vertically; assume x starts at 0 as we were already assuming that y
	starts at 0; now returns autoreleased result

2003-12-22  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - follow-on to my fix for 3467919: handle collapsed spaces at the starts of runs too, not just at the
          end, and make sure that a space inherits style from the run it was collapsed from rather than always
          from the run it precedes

        * khtml/khtml_part.cpp: (KHTMLPart::text): Add code to deal with collapsed spaces at the start of runs.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::attributedString): Change code to keep the style of a space that
        was collapsed at the end of the run, and use that styled space if necessary. Also add the code to deal
        with collapsed spaces at the start of runs. Also remove comment that refers to long-since-deleted code.

2003-12-21  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3467919: REGRESSION (91-92): space missing when copying text with link at start or end of line

        * khtml/khtml_part.cpp: (KHTMLPart::text):
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::attributedString):
        Changed both "turn HTML into text" code paths to generate spaces in a different way.
        First, corrected the logic so it notices spaces left out at the end of a RenderText object.
        Second, don't emit the space until we are emitting more text, to prevent emitting trailing
        spaces. To get this completely right for the attributed string case, I had to add code to
        adjust the offset used to mark links.

2003-12-21  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3477453: nowrap in a fixed-width TD is ignored on screen but not when printed (Williams-Sonoma)

        * khtml/rendering/render_table.cpp: (RenderTableCell::setStyle):
        Compute the proper whitespace mode before calling the base class setStyle,
        since the base class setStyle may create styles that inherit from our style,
        and we want them to inherit the computed whitespace mode.

        * WebCore.pbproj/project.pbxproj: Let Xcode be 1.1, as it was meant to be.

2003-12-21  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed a storage leak

        * khtml/rendering/render_style.h: Added a destructor and a private unimplemented assignment
        operator to StyleCSS3InheritedData, since the textShadow field that needs to be allocated
        and deallocated and the default destructor and assignment operator don't do that.
        * khtml/rendering/render_style.cpp: (StyleCSS3InheritedData::~StyleCSS3InheritedData):
        Added destructor that deletes the textShadow object.

        - fixed locking for JavaScript debugging tools in Caches window

        * kwq/WebCoreJavaScript.mm:
        (+[WebCoreJavaScript rootObjectClasses]): Lock and unlock around call to JavaScriptCore.
        (+[WebCoreJavaScript garbageCollect]): Ditto.

2003-12-19  David Hyatt  <hyatt@apple.com>

	Fix for 3483130, repaint doesn't occur when font is decreased dynamically when at the bottom of
	amazon.com.
	
        Reviewed by john

        * khtml/khtml_part.cpp:
        (KHTMLPart::setZoomFactor):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setTextSizeMultiplier:]):

2003-12-19  Richard Williamson   <rjw@apple.com>

	Fixed 3515590.  Return Undefined to JS for applet if
	Java is disabled.

        Reviewed by Chris.

        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::getAppletInstance):

2003-12-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Chris.

	<rdar://problem/3512545>: reproducible assertion failure in KWQKHTMLPart::addData scrolling to anchor while page loads
        
	* kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::scrollToAnchor): Don't pretend we finished loading,
	because we don't actually make anchor scrolling stop the current
	page load.

=== Safari-119 ===

2003-12-18  Richard Williamson   <rjw@apple.com>

	Fixed 3511415.  We have to un-visually order visually ordered text
	before passing to ATSU.

        Reviewed by John.

        * khtml/rendering/font.cpp:
        (Font::drawHighlightForText):
        (Font::drawText):
        * khtml/rendering/font.h:
        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintSelection):
        (RenderText::paintObject):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::drawText):
        (QPainter::drawHighlightForText):
        * kwq/WebCoreTextRenderer.h:
        * kwq/WebCoreTextRendererFactory.m:
        (WebCoreInitializeEmptyTextStyle):

2003-12-17  Richard Williamson   <rjw@apple.com>

        Reviewed by NOBODY (OOPS!).

        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::getAppletInstance):
        * khtml/html/html_objectimpl.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getAppletInstanceForView):
        (KWQKHTMLPart::addPluginRootObject):
        (KWQKHTMLPart::cleanupPluginRootObjects):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge init]):

2003-12-17  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3469085: can't tab to all links on aintitcool.com

        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isFocusable): Re-implemented this to check width and height of
        all continuations, not just the main render object. Also, check the absoluteRects after
        checking all the render objects to catch things like floats.
        (HTMLAnchorElementImpl::isMouseFocusable): Clean up the code here a bit.

        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_inline.cpp: (RenderInline::absoluteRects):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_object.cpp: (RenderObject::absoluteRects):
        * khtml/rendering/render_text.h:
        * khtml/rendering/render_text.cpp: (RenderText::absoluteRects):
        * kwq/KWQAccObject.mm: (boundingBoxRect):
        Use QValueList instead of QPtrList for clarity and to fix storage leaks.

=== Safari-118 ===

2003-12-16  David Hyatt  <hyatt@apple.com>

	Fix for 3510956, crash on mezzoblue.com.  Relax the float-list searching code that runs when
	a float is removed.
	
        Reviewed by darin

        * khtml/rendering/render_object.cpp:
        (checkFloats):
        (RenderObject::removeFromObjectLists):

2003-12-16  John Sullivan  <sullivan@apple.com>

        fixed <rdar://problem/3482852>: oft-seen, non-repro, nil-deref in 
        HTMLTokenizer::notifyFinished (snapfish.com, etc.)
        
        At least one of the dupes of this bug is a separate (still reproducible) issue;
        I'll clone it back to life and test the others.

        Reviewed by Darin.

        * khtml/html/htmltokenizer.cpp:
        (HTMLTokenizer::notifyFinished):
        Move check of cachedScript.isEmpty() until after scriptExecution()
        call, because cachedScript.isEmpty() value can be changed by that call.

2003-12-15  David Hyatt  <hyatt@apple.com>

	Fix for 3508807, positions/sizes wrong for text elts and multi-line elts for accessibility.
	
        Reviewed by john

        * khtml/rendering/render_inline.cpp:
        (RenderInline::absoluteRects):
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::absoluteRects):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::absoluteRects):
        * khtml/rendering/render_text.h:
        * kwq/KWQAccObject.mm:
        (boundingBoxRect):
        (-[KWQAccObject position]):
        (-[KWQAccObject size]):

2003-12-15  Richard Williamson   <rjw@apple.com>

	Return 0 if the view doesn't have a bridge.

        Reviewed by John.

        * kwq/WebCoreBridge.mm:
        (rootForView):

2003-12-15  David Hyatt  <hyatt@apple.com>

	Fix for 3508792.  Remove tables and cells as AxObjects.
	
        Reviewed by john

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject role]):
        (-[KWQAccObject accessibilityIsIgnored]):

2003-12-15  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3510459>: REGRESSION (100-113): Pressing button at google.com 
        removes focus from text field

        Reviewed by Dave.

        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent):
        Don't clear the focused widget when a mousedown occurs on a widget that is focusable
        in the abstract sense but is not mouse focusable or currently keyboard focusable. This
        matches the behavior of older Safaris (clicking in background or page text will make the
        webview itself be first responder, but clicking on a button won't).

2003-12-14  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3458937: nil-deref in timed layout

        * khtml/khtmlview.cpp: (KHTMLView::layout): Add a nil check for m_part.

2003-12-14  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3311205: click() on a file input type form element does not work bring up the file chooser as it does in IE

        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::click): Add a case for FILE that calls RenderFileButton's click() function.
        Get rid of the default case and list more cases explicitly.
        (HTMLInputElementImpl::accessKeyAction): Change FILE from just focus to focus/click.

        * khtml/rendering/render_form.h: Added a click() function to RenderFileButton.
        * khtml/rendering/render_form.cpp:
        (RenderFileButton::slotTextChanged): Added call to onChange on the element to match text input
        fields; helpful for the test case Adobe supplied.
        (RenderFileButton::click): Added. Calls click() on KWQFileButton.

        * kwq/KWQFileButton.h: Added a click function.
        * kwq/KWQFileButton.mm: (KWQFileButton::click): Added. Calls performClick on the file button.

        * kwq/WebCoreBridge.h: Add a performClick method to WebCoreFileButton.

2003-12-13  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3269212>: FILEMAKER: can't use Option objects created in a different window

        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::updateDOMObjectDocument): Update per-document
	caching for the DOM object - let it be protected by both the old
	and the new document.
        * khtml/ecma/kjs_binding.h: Prototype new method.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::setDocument): New method to change a node's document pointer.
        (NodeImpl::checkAddChild): If the new child node is owned by the
	wrong document but not actually in it, change its document (using
	the two aforementioned methods) instead of throwing an exception.
	* khtml/xml/dom_nodeimpl.h: Prototype new method.

2003-12-14  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3332280: REGRESSION (74-85): setting src of iframe results in two GETs

        * khtml/html/html_baseimpl.h: Added openURL virtual function.
        * khtml/html/html_baseimpl.cpp:
        (HTMLFrameElementImpl::updateForNewURL): Call openURL to do the meat of the work,
        since it's different for frames and iframes.
        (HTMLFrameElementImpl::openURL): Move the part that's different for frames in here.
        (HTMLFrameElementImpl::parseAttribute): Call setLocation to share code.
        (HTMLFrameElementImpl::setLocation): Do nothing if the location is not changing.
        Not needed to fix this bug, but could eliminate other cases of extra GETs.
        (HTMLIFrameElementImpl::parseAttribute): Remove special handling of SRC, because now
        we will end up calling openURL, which will do the right thing for iframes.
        (HTMLIFrameElementImpl::openURL): Instead of doing the change to the frame directly,
        use updateWidget, since that's what we do for other changes to iframes. To trigger a
        call to updateWidget(), set needWidgetUpdate and mark the node changed.

2003-12-13  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3507885>: REGRESSION (100-116): frames missing due to cross-domain check (derstandard.at)
        
	* khtml/ecma/kjs_window.cpp:
        (Window::isSafeScript): Loosen the frame access rules a bit. We already allowed access to
	a document loaded as empty from the parent or opener. Now also allow access from any document
	in the same domain as the parent or opener, so that, for instance, a sibling frame can access it
	so long as it is in the same domain as the parent.

2003-12-13  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3506204: homepage.mac slide show window is wrong size on 2nd monitor

        * kwq/KWQApplication.mm: (QDesktopWidget::screenGeometry): Add code to flip the Y coordinate.
        This has no effect on the main screen, but a big effect on others. I used the same code to
        flip Y screen coordinates that is used KWQWindowWidget.mm and KWQKHTMLPartBrowserExtension.mm.
        * kwq/KWQKWinModule.mm: (KWinModule::workArea): Replaced the incorrect code to flip the Y
        coordinate here with correct code. The code flipped based on the frame of the main screen,
        but it needs to flip based on the frame of screen 0.

2003-12-12  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3505208>: keys added to keychain from KEYGEN need better UI names

        Reviewed by rjw.

        * khtml/html/html_formimpl.cpp:
        (HTMLKeygenElementImpl::encoding): pass the page URL to signedPublicKeyAndChallengeString
        * kwq/KWQKSSLKeyGen.h:
        * kwq/KWQKSSLKeyGen.mm:
        (KSSLKeyGen::signedPublicKeyAndChallengeString): take a URL
        * kwq/WebCoreKeyGenerator.h:
        * kwq/WebCoreKeyGenerator.m:
        (-[WebCoreKeyGenerator signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:pageURL:]): take a URL

2003-12-12  David Hyatt  <hyatt@apple.com>

	Fix for 3254534, CSS background-image style should be loaded lazily only when used.
	
        Reviewed by rjw

        * ChangeLog:
        * khtml/css/css_valueimpl.cpp:
        (CSSImageValueImpl::CSSImageValueImpl):
        (CSSImageValueImpl::~CSSImageValueImpl):
        (CSSImageValueImpl::image):
        * khtml/css/css_valueimpl.h:
        
2003-12-11  David Hyatt  <hyatt@apple.com>

	WebCore part of 3453214.  This ensures that all outline styles except for auto (which has a CG bug) will
	be displayed properly during the PaintActionOutline phase.
	
        Reviewed by john and darin

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paint):
        * khtml/rendering/render_box.cpp:
        (RenderBox::setStyle):
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::RenderCanvas):
        * khtml/rendering/render_canvas.h:
        (khtml::RenderCanvas::setMaximalOutlineSize):
        (khtml::RenderCanvas::maximalOutlineSize):
        * khtml/rendering/render_object.cpp:
        (RenderObject::maximalOutlineSize):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::paint):
        * khtml/rendering/render_table.cpp:
        (RenderTable::paint):
        (RenderTableSection::paint):
        (RenderTableCell::paint):

2003-12-12  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3508825>: REGRESSION (100-116): crash in 
        HTMLGenericFormElementImpl::attach at sonyericsson.com

        Reviewed by Maciej.

        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::attach):
        Move a few lines inside an existing nil check to prevent nil dereference.

2003-12-12  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3508760>: tabbing to out-of-sight link behaves 
        differently than tabbing to out-of-sight form control

        Reviewed by Dave.

        * kwq/KWQScrollView.h:
        * kwq/KWQScrollView.mm:
        (QScrollView::ensureVisible):
        added comments and changed parameter names to reveal differences between
        what we've implemented and what QScrollView was intended to do.
        (QScrollView::ensureRectVisibleCentered):
        New method that calls _KWQ_scrollRectToVisible, which is the method
        we use when scrolling to reveal form controls.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrame):
        call ensureRectVisibleCentered so tabbing to a link will use the
        same scroll-to-reveal code as tabbing to a form control
        
2003-12-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3507856>: XMLHttpRequest xhtml test displays but doesn't load

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequestProtoFunc::tryCall): complete the URL using the document,
	not the htmlDocument.

2003-12-12  Richard Williamson   <rjw@apple.com>

	Replace call to global functions with static member functions.

        Reviewed by Ken.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::cleanupPluginRootObjects):
        * kwq/WebCoreBridge.mm:
        (rootForView):
        (-[WebCoreBridge init]):

2003-12-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3464315>: createDocument creates document with initial child element, unlike other browsers
	
        * khtml/xml/dom_docimpl.cpp:
        (DOMImplementationImpl::createDocument): Don;t add initial element.

2003-12-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin. 

	<rdar://problem/3507863>: XMLHttpRequest should not parse response if HTML
        
	* khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty):

2003-12-11  Richard Williamson   <rjw@apple.com>

	Cleaned up and verified reference counting scheme, and
	dereferencing of vended JavaScript objects when applet is
	destroyed (actually when part is destroyed).

        Reviewed by Ken.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::~KWQKHTMLPart):
        (KWQKHTMLPart::getAppletInstanceForView):
        (KWQKHTMLPart::addPluginRootObject):
        (KWQKHTMLPart::cleanupPluginRootObjects):
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (rootForView):
        (-[WebCoreBridge init]):

2003-12-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3507862>: XMLHttpRequest documents that reference external resources (e.g. stylesheets) cause crash

        * khtml/html/html_headimpl.cpp:
        (HTMLLinkElementImpl::process):
        * khtml/html/htmltokenizer.cpp:
        (HTMLTokenizer::scriptHandler):
        * khtml/xml/dom_xmlimpl.cpp:
        (ProcessingInstructionImpl::checkStyleSheet):
        * khtml/xml/xml_tokenizer.cpp:
        (XMLHandler::processingInstruction):
        (XMLTokenizer::executeScripts):

2003-12-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Chris.

	<rdar://problem/3507859>: Status text should only include "OK", not full "HTTP/1.0 200 OK" status line
	
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getStatusText): Include only the status
	text, not the full status line.

=== Safari-117 ===

2003-12-11  David Hyatt  <hyatt@apple.com>

	Fix for 3507164, scrolling really slow on hixie's web forms spec page.  Hixie has 12 little transparent layers
        at various points on this page, and beginning/ending transparency on only those 12 layers as you scroll
        is enough to kill scrolling performance.

	This patch works around the issue by lazily beginning transparency layers only when we determine that
	we're actually painting a descendant layer of a transparent ancestor or a transparent layer.

	Also fixing QColor's comparison operator.  It was broken and not comparing the "valid" bit, so invalid and
	valid colors were being assumed to be the same.

	Also fixed the render dumper to not dump transparent and invalid background colors and fixed it do dump the
	alpha for colors with an alpha < 0xFF.
	
	Reviewed by mjs (opacity changes), darin (color changes) and john (render tree dumper changes)

        * ChangeLog:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::RenderLayer):
        (RenderLayer::beginTransparencyLayers):
        (RenderLayer::paint):
        (RenderLayer::paintLayer):
        * khtml/rendering/render_layer.h:
        * kwq/KWQColor.h:
        (operator==):
        (operator!=):
        * kwq/KWQColor.mm:
        (QColor::name):
        * kwq/KWQRenderTreeDebug.cpp:
        (operator<<):

2003-12-11  Ken Kocienda  <kocienda@apple.com>

        * kwq/KWQLoader.mm:
        (KWQCacheObjectExpiresTime): Fixed deployment build bustage.

2003-12-09  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin
        
        <rdar://problem/3505444>: WebCore cache does not use expiration dates on cache items
        
        * khtml/misc/loader.cpp:
        (Loader::slotFinished): Don't reset expiration date. We set this once in
        slotReceivedResponse.
        (Loader::slotReceivedResponse): Call new KWQ function to get a cache object's
        expiration date using its NSURLResponse data.
        (Cache::requestImage): Don't reset expiration date. We set this once in
        slotReceivedResponse, and we do not want the value from the DocLoader
	anyway.
        (Cache::requestStyleSheet): Ditto.
        (Cache::requestScript): Ditto.
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (KWQCacheObjectExpiresTime): New function. Call over bridge to get access
        to SPI in NSURLResponse to calculate expiration time.
        * kwq/WebCoreBridge.h: Declare bridge method.

2003-12-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3504156>: XMLHttpRequest reuse test fails
	<rdar://problem/3505158>: XMLHttpRequest "abort with open" test fails

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::open):
        (KJS::XMLHttpRequest::abort):
        (KJS::XMLHttpRequestProtoFunc::tryCall):

2003-12-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3507175>: Setting timeout function can allocate JS objects without lock

        * khtml/ecma/kjs_window.cpp:
        (ScheduledAction::execute): Lock interpreter around code that
	might allocate JS objects.

2003-12-10  David Hyatt  <hyatt@apple.com>

	Fix for 3507097, overflow:auto should include the height of the horizontal scrollbar when the height
	of the block is auto.
	
        Reviewed by darin

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):

2003-12-10  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3506739: nil-deref in DocumentImpl::setSelection triple clicking (generated content)

        * khtml/khtml_part.cpp: (KHTMLPart::khtmlMousePressEvent): Check for the case where
        m_selectionEnd is 0. This doesn't fix the behavior completely, but it does prevent a crash.

2003-12-10  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/3487160>: Implement synchronous loading for XMLHttpRequest
        
	* khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::XMLHttpRequest):
        (KJS::XMLHttpRequest::send):
        (KJS::XMLHttpRequest::abort):
        (KJS::XMLHttpRequest::processSyncLoadResults):
        (KJS::XMLHttpRequest::slotRedirection):
        (KJS::XMLHttpRequest::slotData):
        * khtml/ecma/xmlhttprequest.h:
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (KWQHeaderStringFromDictionary):
        (KWQServeSynchronousRequest):
        (KWQResponseHeaderString):
        * kwq/WebCoreBridge.h:

2003-12-10  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3506706: REGRESSION (100-115): onkeyup handlers called twice for active input fields

        * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView keyUp:]): Don't call super because we
        don't want to pass the event down the responder chain.
        * kwq/KWQTextField.mm: (-[KWQTextField textView:shouldHandleEvent:]): Return NO for
        key up events because we don't want to pass the event down the responder chain.

2003-12-10  Richard Williamson   <rjw@apple.com>

	Added method to get to the bridge from a view.  This is
	used to ultimately get the part and KJS::Window for a
	particular applet.

        Reviewed by Hyatt.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (rootForView):
        (-[WebCoreBridge init]):
        * kwq/WebCoreViewFactory.h:
        * kwq/WebCoreViewFactory.m:

2003-12-10  John Sullivan  <sullivan@apple.com>

        - WebCore part of fix for:
        <rdar://problem/3505231>: REGRESSION (100-114): Some sites autoscroll to bottom of page when loading

        Reviewed by Darin.

        * kwq/KWQNSViewExtras.h:
        * kwq/KWQNSViewExtras.m:
        (-[NSView _KWQ_scrollPointRecursive:]):
        (-[NSView _KWQ_scrollPointRecursive:inView:]):
        new methods, similar to existing scrollRect methods
        except that the preferred position for the point is
        the top-left corner rather than centered in the visible area
        
        * kwq/KWQScrollView.h:
        * kwq/KWQScrollView.mm:
        (QScrollView::setContentsPosRecursive):
        new method, calls _KWQ_scrollPointRecursive:

        * khtml/khtml_part.cpp:
        (KHTMLPart::gotoAnchor):
        call setContentsPosRecursive instead of setContentsPos; also remove
        the 50 pixel offset that upset Hyatt so.
        

2003-12-10  Chris Blumenberg  <cblu@apple.com>

        * kwq/KWQKSSLKeyGen.mm:
        (KSSLKeyGen::signedPublicKeyAndChallengeString): removed unnecessary includes

2003-12-10  David Hyatt  <hyatt@apple.com>

	Fix for 3505846, overflow:auto region doesn't update when scrolled.  The child layers inside an overflow:auto
	block were not updating their positions.
	
        Reviewed by john

        * khtml/khtmlview.cpp:
        (KHTMLView::layout):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::updateLayerPositions):
        (RenderLayer::scrollToOffset):
        * khtml/rendering/render_layer.h:

2003-12-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3505795>: loading invalid XML document crashes trying to create h1 element
	<rdar://problem/3504158>: XMLHttpRequest xhtml test totally fails
        
	* khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::isValidName): include "0123456789" instead of
	"0-9", it's not a regexp it's just a list of characters.

2003-12-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3504155>: Safari fails XMLHttpRequest abort test
        
	* khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequestProtoFunc::tryCall): Avoid throwing an
	exception after send().

2003-12-09  David Hyatt  <hyatt@apple.com>

	Rename -apple-aqua to auto for outline styles.
	
        Reviewed by darin

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/css/html4.css:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::paintObject):
        * khtml/rendering/render_object.cpp:
        (RenderObject::drawBorder):
        (RenderObject::paintOutline):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::OutlineValue::OutlineValue):
        (khtml::RenderStyle::outlineStyleIsAuto):
        (khtml::RenderStyle::outlineOffset):
        (khtml::RenderStyle::setOutlineStyle):
        (khtml::RenderStyle::setOutlineOffset):
        * kwq/KWQRenderTreeDebug.cpp:
        (printBorderStyle):

2003-12-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3487195>: Implement responseXML property for XMLHttpRequest
        
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty): Implemented responseXML by parsing the
	document and returning it.
        (KJS::XMLHttpRequest::XMLHttpRequest): Initialize new field
        * khtml/ecma/xmlhttprequest.h:

        * khtml/ecma/kjs_window.cpp: 
	(Windw::get): Forgot this in last commit; add XMLSerializer
	constructor.
        * khtml/ecma/kjs_window.lut.h:
	* khtml/ecma/Makefile.am: Forgot to include this in the last commit.

2003-12-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/3504049>: XMLSerializer object and serializeToString method needed for XMLHttpRequest testing

	Also fixed some lasst-minute mistakes in the DOM serialization
	code that was already there.
	
        * WebCore.pbproj/project.pbxproj:
        * khtml/dom/dom_doc.h:
        * khtml/ecma/Makefile.am:
        * khtml/ecma/kjs_window.cpp:
        (Window::get):
        * khtml/ecma/kjs_window.h:
        (KJS::Window::):
        * khtml/ecma/kjs_window.lut.h:
        (KJS::):
        * khtml/ecma/xmlserializer.cpp: Added.
        (KJS::XMLSerializerConstructorImp::XMLSerializerConstructorImp):
        (KJS::XMLSerializerConstructorImp::implementsConstruct):
        (KJS::XMLSerializerConstructorImp::construct):
        (KJS::):
        (KJS::XMLSerializer::XMLSerializer):
        (KJS::XMLSerializerProtoFunc::tryCall):
        * khtml/ecma/xmlserializer.h: Added.
        (KJS::XMLSerializer::toBoolean):
        (KJS::XMLSerializer::classInfo):
        (KJS::XMLSerializer::):
        * khtml/ecma/xmlserializer.lut.h: Added.
        (KJS::):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::toString):
        (DocumentFragmentImpl::toString):
        * khtml/xml/dom_elementimpl.cpp:
        (AttrImpl::toString):
        (ElementImpl::toString):

2003-12-09  David Hyatt  <hyatt@apple.com>

	Implement start() and stop() for marquees.
	
        Reviewed by darin

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::classInfo):
        (KJS::HTMLElementFunction::tryCall):
        * khtml/ecma/kjs_html.h:
        (KJS::HTMLElement::):
        * khtml/ecma/kjs_html.lut.h:
        (KJS::):

2003-12-09  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3505277: nil-deref in ownerElement after choosing item from menu at projectnissan.com

        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchWindowEvent): Add check for nil.

2003-12-09  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::saveLocationProperties): Add locking around the call to get the location
        since it can allocate.
        (KWQKHTMLPart::restoreLocationProperties): Ditto.

2003-12-09  David Hyatt  <hyatt@apple.com>

	Fix for mojibake bg painting problem on bofa.com.  The bug # is 3487144.  Transparent colors were not
	being handled properly when specified on the body.
	
        Reviewed by darin

        * khtml/rendering/render_box.cpp:
        (RenderBox::paintRootBoxDecorations):
        (RenderBox::paintBackgroundExtended):

2003-12-09  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3505391: REGRESSION (100-116): pages that move cells around don't repaint correctly

        * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows): Added code
        similar to the code in RenderBlock::layoutBlock, but for table cells.

2003-12-09  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Add locking around the call to
        push event handler scope. Without this, we hit the "allocated without locking" assertion.

2003-12-09  David Hyatt  <hyatt@apple.com>

	Fix the dirty rect checks on various render_objects to be more accurate so that page-break properties don't
	have mojibake when printing.
	
        Reviewed by john

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paint):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::paintLineBoxBackgroundBorder):
        (RenderFlow::paintLineBoxDecorations):
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::paint):
        * khtml/rendering/render_table.cpp:
        (RenderTable::paint):

2003-12-09  Darin Adler  <darin@apple.com>

        Reviewed by Richard.

        - fixed 3500408: Web Kit should pass the MAYSCRIPT attribute from the APPLET tag to the Java plug-in

        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::parseAttribute): Allow the "mayscript" attribute.
        (HTMLAppletElementImpl::createRenderer): Pass the value of the "mayscript" attribute
        as an argument named "mayScript".

        * khtml/misc/htmlattrs.in: Added "mayscript".
        * khtml/misc/htmlattrs.c: Regenerated.
        * khtml/misc/htmlattrs.h: Regenerated.

2003-12-09  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3501030>: JavaScript sites crash when a PAC file is in place (WebCore,Safari 1.2)
	
        * khtml/ecma/kjs_events.cpp:
        (JSEventListener::handleEvent): Lock interpreter when needed.
        (JSLazyEventListener::parseCode): Likewise.
        (KJS::getDOMEvent): Likewise.
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::evaluate): Likewise.
        (KJSProxyImpl::initScript): Likewise.

2003-12-09  David Hyatt  <hyatt@apple.com>

	Fix for 3491235, really make <script src="..."/> work in HTML.  My original attempt to fix this only made
	the tag flat, but did not ensure that the script got processed.
	
        Reviewed by john

        * khtml/html/htmltokenizer.cpp:
        (HTMLTokenizer::parseTag):

2003-12-08  David Hyatt  <hyatt@apple.com>

	Fix for 3503652, news.com misrenders badly (footer is out of position).  My fix to 3495748 caused this
	regression.  I made the tag priority of <nobr> too high.  It needed to be the same as <div>, and I
	accidentally made it higher.  I intended for it to be the same as <div>.

	I also had to make a fix (now that <nobr> has a higher priority) to ensure <nobr> can't be nested inside
	other <nobr>.  

	Both fixes were required to make news.com render correctly again.
	
        Reviewed by darin

        * khtml/html/dtd.cpp:
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::getElement):

2003-12-08  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3234676>: Support for KEYGEN tag (ie 509 email certificates from www.thawte.com)

        Reviewed by mjs.

        * WebCore-combined.exp:
        * WebCore.exp:
        * WebCore.pbproj/project.pbxproj:
        * khtml/html/html_formimpl.cpp:
        (HTMLKeygenElementImpl::parseAttribute): store the KEYTYPE attribute
        (HTMLKeygenElementImpl::encoding): call KSSLKeyGen::signedPublicKeyAndChallengeString
        * khtml/html/html_formimpl.h: remove 2 declared but unimplemented methods
        * khtml/misc/htmlattrs.c: generated changes
        (hash_attr):
        (findAttr):
        * khtml/misc/htmlattrs.h: generated change
        * khtml/misc/htmlattrs.in: added KEYTYPE
        * kwq/KWQKSSLKeyGen.h:
        * kwq/KWQKSSLKeyGen.mm:
        (KSSLKeyGen::supportedKeySizes): call renamed strengthMenuItemTitles
        (KSSLKeyGen::signedPublicKeyAndChallengeString): new, calls [WebCoreKeyGenerationFactory signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:] 
        * kwq/WebCoreKeyGenerationFactory.h: Added.
        * kwq/WebCoreKeyGenerationFactory.m: Added.
        (+[WebCoreKeyGenerationFactory sharedFactory]):
        (-[WebCoreKeyGenerationFactory init]):
        (-[WebCoreKeyGenerationFactory strengthMenuItemTitles]):
        (-[WebCoreKeyGenerationFactory signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:]):
        * kwq/WebCoreLocalizedStringFactory.h: Removed.
        * kwq/WebCoreLocalizedStringFactory.m: Removed.

2003-12-08  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3504047>: XMLHttpRequest object needs onload event
        
	* khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty): Implemented onload property.
        (KJS::XMLHttpRequest::putValue): Ditto.
        (KJS::XMLHttpRequest::XMLHttpRequest): Ditto.
        (KJS::XMLHttpRequest::changeState): Ditto.
        * khtml/ecma/xmlhttprequest.h:
        * khtml/ecma/xmlhttprequest.lut.h: Regenerated.

2003-12-08  David Hyatt  <hyatt@apple.com>

	Fix for 3503022, asahi.com is too wide.  Bugs in line breaking of breakable Japanese characters caused
	the breaks to be ignored.
	
        Reviewed by john

        * khtml/rendering/render_text.cpp:
        (RenderText::calcMinMaxWidth):

2003-12-05  David Hyatt  <hyatt@apple.com>

	Fix the position method to return screen coords like it should and to use the lower left corner instead of
	the upper left.
	
        Reviewed by john

        * kwq/KWQAccObject.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject position]):
        (-[KWQAccObject size]):

2003-12-07  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3502347: REGRESSION (100-116): bottom of login window sometimes missing (TR background image)

        * khtml/rendering/render_object.h: Added setPixmap.
        * khtml/rendering/render_object.cpp: (RenderObject::setPixmap): Moved this
        function here from RenderBox. This code is needed for the table row class and
        similar classes that supply a background image that is drawn by the table cell,
        and those are not RenderBox subclasses.

        * khtml/rendering/render_box.cpp: Removed setPixmap.
        * khtml/rendering/render_box.h: Removed setPixmap.

2003-12-06  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3502655>: REGRESSION: Repro crash at espn.com

        Reviewed by Darin.

        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::getAppletInstance):
        Check for nil RenderApplet before dereferencing rather than after.

2003-12-05  David Hyatt  <hyatt@apple.com>

	Add support for link clicking as an accessibility action.
	
        Reviewed by john

        * kwq/KWQAccObject.mm:
        (-[KWQAccObject anchorElement]):
        (-[KWQAccObject role]):
        (-[KWQAccObject accessibilityAttributeNames]):
        (-[KWQAccObject accessibilityActionNames]):
        (-[KWQAccObject accessibilityActionDescription:]):
        (-[KWQAccObject accessibilityPerformAction:]):

2003-12-05  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3487222>: Add ability to create working fully standalone document object
	
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::CSSStyleSelector):
        (khtml::CSSStyleSelector::addSheet):
        (khtml::CSSStyleSelector::initForStyleResolve):
        (khtml::CSSStyleSelector::applyRule):
        * khtml/dom/dom_doc.cpp:
        (DOM::Document::part):
        * khtml/dom/dom_doc.h:
        * khtml/ecma/kjs_dom.cpp:
        (DOMDocument::getValueProperty):
        (KJS::checkNodeSecurity):
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocFunction::tryCall):
        (KJS::HTMLDocument::tryGet):
        (KJS::HTMLDocument::putValue):
        (KJS::HTMLElement::tryGet):
        (Image::notifyFinished):
        * khtml/ecma/kjs_traversal.cpp:
        (JSNodeFilter::acceptNode):
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::changeState):
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::insertedIntoDocument):
        (HTMLFrameElementImpl::isURLAllowed):
        (HTMLFrameElementImpl::attach):
        (HTMLFrameElementImpl::detach):
        (HTMLFrameElementImpl::contentDocument):
        (HTMLIFrameElementImpl::attach):
        * khtml/html/html_documentimpl.cpp:
        (HTMLDocumentImpl::referrer):
        (HTMLDocumentImpl::lastModified):
        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::formData):
        (HTMLFormElementImpl::prepareSubmit):
        (HTMLFormElementImpl::submit):
        (HTMLFormElementImpl::reset):
        (HTMLGenericFormElementImpl::isKeyboardFocusable):
        (HTMLGenericFormElementImpl::defaultEventHandler):
        * khtml/html/html_headimpl.cpp:
        (HTMLBaseElementImpl::process):
        (HTMLLinkElementImpl::process):
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isKeyboardFocusable):
        (HTMLAnchorElementImpl::defaultEventHandler):
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::createRenderer):
        (HTMLAppletElementImpl::getAppletInstance):
        (HTMLEmbedElementImpl::rendererIsNeeded):
        (HTMLObjectElementImpl::rendererIsNeeded):
        * khtml/html/htmltokenizer.cpp:
        (HTMLTokenizer::scriptExecution):
        (HTMLTokenizer::parseTag):
        * khtml/rendering/render_applet.cpp:
        (RenderApplet::RenderApplet):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::setTitle):
        (DocumentImpl::part):
        (DocumentImpl::close):
        (DocumentImpl::processHttpEquiv):
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchEvent):
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject textUnderElement]):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::partForNode):
        (KWQKHTMLPart::attributedString):

2003-12-05  Richard Williamson   <rjw@apple.com>

	Fixed 3501885.  Added null test to returned node from collection.

        Reviewed by John.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLCollection::tryGet):

2003-12-04  Richard Williamson   <rjw@apple.com>

	Added support for named applet access from document node.
	Factored creation of KJS::Values from RuntimeObjectImps.

        Reviewed by Chris.

        * khtml/ecma/kjs_dom.cpp:
        (KJS::getDOMNamedNodeMap):
        (KJS::getRuntimeObject):
        * khtml/ecma/kjs_dom.h:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLDocument::tryGet):
        (KJS::HTMLElement::tryGet):
        (KJS::HTMLCollection::tryGet):

2003-12-04  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3498712: REGRESSION (100-115): Safari aborts at http://www11.dht.dk/~blangstrup_org/

        This was an uncaught exception thrown by DocumentImpl. But the design of KHTML DOM is that
        "impl" classes return exception codes; they don't throw exceptions.

        * khtml/dom/dom_doc.cpp:
        (DOM::Document::createElement): Throw exception if necessary. The impl function now returns
        an exception code.
        (DOM::Document::createElementNS): Ditto.

        * khtml/html/html_documentimpl.h: Add exception code parameter to createElement.
        * khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::createElement): Pass along the
        exception code from the lower level.

        * khtml/xml/dom_docimpl.h: Add exception code parameters to createElement, createElementNS,
        and createHTMLElement.
        * khtml/xml/dom_docimpl.cpp:
        (DOMImplementationImpl::createDocument): Handle exception code from createElementNS.
        (DocumentImpl::createElement): Add exception code parameter, not set since there is
        no exception.
        (DocumentImpl::importNode): Handle exception code from createElementNS.
        (DocumentImpl::createElementNS): Add exception code parameter. Propagate the exception
        codes that we get from createHTMLElement and setPrefix.
        (DocumentImpl::createHTMLElement): Add exception code parameter. Use an exception code
        rather than a C+exception for INVALID_CHARACTER_ERR.

        * khtml/xml/dom_elementimpl.cpp: (ElementImpl::cloneNode): Pass exception code parameter to
        createElement.

        * khtml/xml/xml_tokenizer.cpp:
        (XMLHandler::startElement): Pass exception code parameter to createElementNS, and return false
        if it is not zero. This is where the bug happened. Before we would get an exception from
        createElementNS, but "impl" functions are not supposed to throw in KHTML's DOM.
        (XMLTokenizer::finish): Add various exception code parameters to compile, but we know we won't
        get any exceptions.

        * kwq/WebCoreDOMDocument.mm:
        (-[WebCoreDOMDocument createElement:]): Pass an (ignored) exception code parameter.
        (-[WebCoreDOMDocument createElementNS::]): Pass an (ignored) exception code parameter.

=== Safari-116 ===

2003-12-03  Richard Williamson   <rjw@apple.com>

	LiveConnect:  Removed some debugging.

        Reviewed by Chris.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLCollection::tryGet):

2003-12-03  David Hyatt  <hyatt@apple.com>

	Fix for 3475761, list bullets mislayout after text zooming.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::setStyle):

2003-12-03  David Hyatt  <hyatt@apple.com>

	Fix for 3493356, table cells didn't repaint properly.
	
        Reviewed by kocienda

        * khtml/rendering/render_object.cpp:
        (RenderObject::repaintObjectsBeforeLayout):
        * khtml/rendering/render_table.cpp:
        (RenderTableCell::getAbsoluteRepaintRect):
        * khtml/rendering/render_table.h:

2003-12-03  David Hyatt  <hyatt@apple.com>

	Fix for 3495748, hang in parser at ocelot.ca.  <nobr> needs to have very high priority (equal to the
	priority of blocks like h1-6, p, and div), so that unclosed <nobr>s will close divs and ps.
	
        Reviewed by gramps

        * khtml/html/dtd.cpp:

2003-12-03  David Hyatt  <hyatt@apple.com>

	Fix for 3475767, hang at saabnet.com.  Fix h1-h6 to be more tolerant regarding allowed child elements, to avoid
	deeply nested pages.
	
        Reviewed by darin

        * khtml/html/dtd.cpp:
        (DOM::checkChild):

2003-12-03  John Sullivan  <sullivan@apple.com>

        - fixed these two design issues after Dave and I talked to HI:
        <rdar://problem/3497072>: There shouldn't be a focus ring around clicked regions
        <rdar://problem/3499315>: Focus ring should use aqua color always

        Reviewed by Dave.

        * khtml/css/html4.css:

2003-12-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3395759>: results of parent.document.getElementsByTagName can't be added to string
        
	* khtml/ecma/kjs_dom.cpp:
        (DOMNodeList::toPrimitive): Always convert to string instead of trying to convert
	to number and failing, as is done for DOMNode.
        * khtml/ecma/kjs_dom.h: Prototype new method.

2003-12-02  Richard Williamson   <rjw@apple.com>

	Return a value that is backed by RuntimeObjectImpl, instead
	of a DOM object for applet[0].  This is better than having
	the DOM object redirect to the RuntimeObjectImpl.

        Reviewed by Chris.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLCollection::tryGet):

2003-12-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/3488220>: namespaces test from David Faure causes Safari to crash in DOM::DocumentImpl::createElementNS
	
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createElementNS): Check if new element is NULL
	before messing with it, to avoid a crash.

2003-12-02  David Hyatt  <hyatt@apple.com>

	Fix for 3497999, null check the text() of RenderTexts to avoid a crash in current().
	
        Reviewed by kocienda

        * khtml/rendering/bidi.cpp:
        (khtml::BidiIterator::current):

2003-12-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	Implemented a simple form of document serialization, enough to take care of:

	<rdar://problem/3487190>: implement send of DOMDocument for XMLHttpRequest

        * khtml/dom/dom_doc.cpp:
        (DOM::Document::toString):
        * khtml/dom/dom_doc.h:
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::urlMatchesDocumentDomain):
        (KJS::XMLHttpRequestProtoFunc::tryCall):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::toString):
        * khtml/html/html_elementimpl.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::toString):
        (DocumentFragmentImpl::toString):
        (DocumentTypeImpl::copyFrom):
        (DocumentTypeImpl::toString):
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (AttrImpl::toString):
        (ElementImpl::openTagStartToString):
        (ElementImpl::toString):
        * khtml/xml/dom_elementimpl.h:
        * khtml/xml/dom_nodeimpl.h:
        * khtml/xml/dom_textimpl.cpp:
        (CommentImpl::toString):
        (TextImpl::toString):
        (CDATASectionImpl::toString):
        * khtml/xml/dom_textimpl.h:
        * khtml/xml/dom_xmlimpl.cpp:
        (EntityImpl::toString):
        (EntityReferenceImpl::toString):
        (ProcessingInstructionImpl::setStyleSheet):
        (ProcessingInstructionImpl::toString):
        * khtml/xml/dom_xmlimpl.h:

2003-12-02  David Hyatt  <hyatt@apple.com>

	Fix for 3493677, containingBlock() null because we tried to support position:relative on table rows.  Fix
	is to disallow this.
	
        Reviewed by kocienda

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::adjustRenderStyle):

2003-12-02  David Hyatt  <hyatt@apple.com>

	Fix for 3493697, nil-deref in bidi code.  Need to null-check strings with no length.
	
        Reviewed by john

        * khtml/rendering/bidi.cpp:
        (khtml::addRun):

2003-12-02  David Hyatt  <hyatt@apple.com>

	Fix for 3495746, nil deref of containing block (frame inside frameset).
	
        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::containingBlockWidth):

2003-12-02  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        * kwq/KWQRect.h:
        * kwq/KWQRect.mm:
        (QRect::bottomRight): Added helper.

2003-12-02  Maciej Stachowiak  <mjs@apple.com>

	Merged the following patch from David Faure to fix:

	<rdar://problem/3497663>: Can't look up frames by number using windw[i] notation

    2003-11-25  David Faure  <faure@kde.org>

        * ecma/kjs_window.cpp: Implement hasProperty and get for frames by number in Window,
        to fix window[0] and parent[1] etc. (#56983)

2003-11-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/3487185>: implement security checks for XMLHttpRequest
	
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::open): Refuse to start if the URL is not one
	this document is allowed to access.
        (KJS::XMLHttpRequest::slotRedirection): Stop the job if we redirect
	to a URL the home document is not allowed to access.
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader redirectedToURL:]): emit the right signal
        * kwq/WebCoreResourceLoader.h: Prototype new method

2003-12-01  Richard Williamson   <rjw@apple.com>

Fixed parameter passing to applet.  Child elements are NOT valid in setStyle().  So we now either create the widget before needed with createWidgetIfNecessary.  This either happens when doing the first layout, or when JavaScript first references the applet element.

Fixed early delete of the the main applet instance.  When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance.  This caused the applet instance cached on the applet element to be invalid.  The applet instance is the only Java object not to be cleaned up by the JS collector.

Added support for getting at Java object fields.

        Reviewed by Chris.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::tryGet):
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::createRenderer):
        (HTMLAppletElementImpl::getAppletInstance):
        * khtml/html/html_objectimpl.h:
        * khtml/rendering/render_applet.cpp:
        (RenderApplet::createWidgetIfNecessary):
        (RenderApplet::layout):
        * khtml/rendering/render_applet.h:
        (khtml::RenderApplet::renderName):

2003-12-01  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3496960: nil-deref in idFromNode inside elementDoesAutoComplete:

        * kwq/WebCoreBridge.mm:
        (inputElementFromDOMElement): Added nil check.
        (formElementFromDOMElement): Added nil check.

2003-12-01  David Hyatt  <hyatt@apple.com>

	Fix for 3490959, collapsed border tables don't paint backgrounds.
	
        Reviewed by darin

        * khtml/rendering/render_table.cpp:
        (RenderTable::setStyle):
        (RenderTable::paint):
        (RenderTable::paintBoxDecorations):
        * khtml/rendering/render_table.h:

2003-12-01  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3493939: ordered lists with type="A" roll over to A' after X rather than after Z

        * khtml/rendering/render_list.cpp: (toLetter): Change 24 to 26.

=== Safari-115 ===

2003-11-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	WebCore part of fix for:
	
	<rdar://problem/3487134>: Implement http request/response status and headers for XMLHttpRequest

        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty): Call appropriate methods for
	status and statusText.
        (KJS::XMLHttpRequest::send): Set request headers as "customHeaders"
	metadata property.
        (KJS::XMLHttpRequest::setRequestHeader): Simply append to header
	string.
        (KJS::XMLHttpRequest::getAllResponseHeaders): Return the header string
	except for the first line.
	(KJS::XMLHttpRequest::getResponseHeader): Scan the response header
	string for the header field. Not sure if it's worth being more
	efficient.
        (KJS::XMLHttpRequest::getStatus): Try to pull a code out
	of the status line.
        (KJS::XMLHttpRequest::getStatusText): Pull the first line
	off the headers (if any), otherwise return undefined.
        (KJS::XMLHttpRequest::slotData): The first time through, save
	the response headers, retrieved from "HTTP-Headers" metadata
	property.
        (KJS::XMLHttpRequestProtoFunc::tryCall): Make setRequestHeader,
	getResponseHeader, getAllResponseHeaders call the right thing.
        * khtml/ecma/xmlhttprequest.h:
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate): Added header
	support.
        (KIO::TransferJobPrivate::~TransferJobPrivate):
        (KIO::TransferJob::assembleResponseHeaders): Get a header string
	out of the response if needed.
        (KIO::TransferJob::queryMetaData): Special-case "HTTP-Headers".
        (KIO::TransferJob::emitReceivedResponse): Save response.
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (-[NSDictionary _webcore_initWithHeaderString:]): Helper method to
	turn a string of header fields into a dictionary.
        (KWQServeRequest): Pass custom headers through.
        (KWQResponseMIMEType): Admit it's an NSURLResponse *.
        (KWQResponseHeaderString): Assembled status code and response
	header fields into response header. Cheat a little on the status
	line.
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader receivedResponse:]): Admit it's an
	NSURLResponse *.
        * kwq/WebCoreResourceLoader.h: Ditto.
	* kwq/WebCoreBridge.h: Add customHeader: arguments.

2003-11-21  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3491907>: When viewing applet, view hierarchy was an empty KWQView

        Reviewed by rjw.

        * WebCore.pbproj/project.pbxproj:
        * khtml/html/html_objectimpl.cpp: removed setupApplet because that work is done when the applet widget is created
        (HTMLAppletElementImpl::createRenderer): pass the PARAM args to the render object
        (HTMLAppletElementImpl::getAppletInstance): don't call setupApplet
        * khtml/rendering/render_applet.cpp:
        (RenderApplet::RenderApplet): store args and context, don't call setQWidget here 
        (RenderApplet::setStyle): call setQWidget here
        (RenderApplet::layout): don't parse args here, that is done in HTMLAppletElementImpl::createRenderer
        * khtml/rendering/render_applet.h:
        * kwq/KWQKJavaAppletWidget.h:
        (KJavaApplet::KJavaApplet): turned into a stub, this work is no longer needed
        (KJavaApplet::setAppletClass): ditto
        (KJavaApplet::setAppletName): ditto
        (KJavaApplet::setArchives): ditto
        (KJavaApplet::setBaseURL): ditto
        (KJavaApplet::setCodeBase): ditto
        (KJavaApplet::setParameter): ditto
        (KJavaAppletWidget::~KJavaAppletWidget): ditto
        (KJavaAppletWidget::applet): ditto
        (KJavaAppletWidget::setBaseURL): ditto
        (KJavaAppletWidget::setParameter): ditto
        (KJavaAppletWidget::showApplet): ditto 
        * kwq/KWQKJavaAppletWidget.mm:
        (KJavaAppletWidget::KJavaAppletWidget): create the java here instead of doing it later

2003-11-21  John Sullivan  <sullivan@apple.com>

        - WebCore part of fix for <rdar://problem/3333744>: Safari prints page with 
        very, very long line very, very small

        Reviewed by Ken.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::forceLayoutWithPageWidthRange):
        Changed method name from forceLayoutForPageWidth; now takes min and max
        page width values. Use max page width value to limit how wide page will
        get when there's a very long line.
        
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
        changed pageWidth parameter into min and max parameters; pass them along to KWQKHTMLPart.

2003-11-21  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed 3490260: allow &sup1 to be misspelled &supl (lowercase l instead of numeral 1) because WinIE does

        * khtml/html/kentities.gperf: Added supl to the list. Maps to U+00B9, just as sup1 does.
        * khtml/html/kentities.c: Regenerated.

2003-11-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3487201 - Implement abort for XMLHttpRequest async loads
	
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::abort): Kill and clear job.
        (KJS::XMLHttpRequest::slotData): Avoid moving to state 3 on early abort.
        (KJS::XMLHttpRequestProtoFunc::tryCall): Call abort when appropriate.
        * khtml/ecma/xmlhttprequest.h:

2003-11-20  John Sullivan  <sullivan@apple.com>

        - WebCore part of <rdar://problem/3183124>: Support page-break-before/after with a value of "always"

        Dave wrote this part and we reviewed it together.

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject):
        if printing, check for CSS page break locations
        (khtml::RenderBlock::inRootBlockContext):
        new method, used to check whether we're in a context for which
        CSS page breaks are legal.
        
        * khtml/rendering/render_block.h:
        prototype for inRootBlockContext; this might be useful for
        other code later.
        
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::setBestTruncatedAt):
        now takes a forcedBreak parameter which overrides others.
        
        * khtml/rendering/render_canvas.h:
        (khtml::RenderCanvas::setTruncatedAt):
        set default value for m_forcedPageBreak
        
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge computePageRects:withPageHeight:]):
        do the real work of pagination here

2003-11-20  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3491225>: Need UI and localized strings for <KEYGEN> support

        Reviewed by john.

        * WebCore-combined.exp:
        * WebCore.exp:
        * WebCore.pbproj/project.pbxproj:
        * kwq/KWQKSSLKeyGen.h:
        * kwq/KWQKSSLKeyGen.mm: Added.
        (KSSLKeyGen::supportedKeySizes): implemented, calls [WebCoreLocalizedStringFactory keyGenerationMenuItemTitles]
        * kwq/WebCoreLocalizedStringFactory.h: Added.
        * kwq/WebCoreLocalizedStringFactory.m: Added.
        (+[WebCoreLocalizedStringFactory sharedFactory]): new
        (-[WebCoreLocalizedStringFactory init]): new
        (-[WebCoreLocalizedStringFactory keyGenerationMenuItemTitles]): new

2003-11-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	- fixed 3490086 - support http post for XMLHttpRequest
	
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJobPrivate::TransferJobPrivate):
        (KIO::TransferJob::TransferJob):

2003-11-20  Richard Williamson   <rjw@apple.com>

	Cleaned up synchronous applet lookup and initialization.
	We need to further cleanup applet instantiation.  It doesn't
	need to be lazy with my modified Java Plugin.

        Reviewed by Chris.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::tryGet):
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::setupApplet):
        (HTMLAppletElementImpl::getAppletInstance):
        * khtml/html/html_objectimpl.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getAppletInstanceForView):
        * kwq/KWQKJavaAppletWidget.h:
        * kwq/KWQKJavaAppletWidget.mm:
        (KJavaAppletWidget::showApplet):

2003-11-20  Ken Kocienda  <kocienda@apple.com>

        Reviewed by David

	Fix for this bug:

	<rdar://problem/3487421>: crash/exception when tabbing to a link without text

        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isFocusable): A link is also not focusable 
	if it has zero width or height, if it has no children, or if it is 
	is not a continuation.
        * kwq/KWQPainter.mm:
        (QPainter::drawFocusRing): Put in a guard against trying to draw a focus
        ring with no control points. Log this as an error.

2003-11-19  David Hyatt  <hyatt@apple.com>

	Fix for 3486963, crash because generated content was referencing a deleted object.  Fix is to update the
	variable to a sane value after deleting old generated content.
	
        Reviewed by darin

        * khtml/rendering/render_container.cpp:
        (RenderContainer::updatePseudoChild):

2003-11-19  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3486998 - Implement asynchronous http loading for XMLHttpRequest
	
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequestQObject::XMLHttpRequestQObject): New QObject to use to
	connect to signals.
        (KJS::XMLHttpRequestQObject::slotData): Call XMLHttpRequest.
        (KJS::XMLHttpRequestQObject::slotFinished): Ditto.
        (KJS::XMLHttpRequestQObject::slotRedirection): Ditto.
        (KJS::XMLHttpRequest::getValueProperty): Implemented, onrequeststatechange,
	readyState and responseText.
        (KJS::XMLHttpRequest::putValue): Implemented onrequeststatechange.
        (KJS::XMLHttpRequest::XMLHttpRequest): Initialize new fields.
        (KJS::XMLHttpRequest::~XMLHttpRequest): Delete decoder.
        (KJS::XMLHttpRequest::changeState): Update state, and send event if needed.
        (KJS::XMLHttpRequest::open): Save the parameters.
        (KJS::XMLHttpRequest::send): Fire up a post or get job.
        (KJS::XMLHttpRequest::slotFinished): go to final state.
        (KJS::XMLHttpRequest::slotRedirection): Just stub for now.
        (KJS::XMLHttpRequest::slotData): Update state; decode & save data.
        (KJS::XMLHttpRequestProtoFunc::tryCall): Implemented open and send.
        * khtml/ecma/xmlhttprequest.h: Prototyped new stuff.
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId): Added "readystatechange" event.
        (EventImpl::idToType): Ditto.
        * khtml/xml/dom2_eventsimpl.h: Ditto.
        * kwq/KWQLoader.h:
        * kwq/KWQLoader.mm:
        (KWQServeRequest): New variant that doesn't need a Request.
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot): Handle XMLHttpRequestQObject's slots.
        (KWQSlot::call): Ditto.

2003-11-19  Richard Williamson   <rjw@apple.com>

	More LiveConnect stuff.  With that patch we make the applet
	visible to JavaScript in an Bindings::Instance.  Next step
	it to flush out implementation of RuntimeObjectImp and
	RuntimeFunctionImp.

        Reviewed by Ken.

        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::HTMLAppletElementImpl):
        (HTMLAppletElementImpl::~HTMLAppletElementImpl):
        (HTMLAppletElementImpl::getAppletInstance):
        * khtml/html/html_objectimpl.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getAppletInstanceForView):
        * kwq/WebCoreBridge.h:

2003-11-19  David Hyatt  <hyatt@apple.com>

	Fix for 3488888, about:blank in iframes doesn't repaint properly.  Fix for 3485478, refreshing a remote
	page often causes a white flash.  Fix for 3488827, XML/XHTML documents don't fire load events on bodies/framesets.
	
        Reviewed by darin
	
        * khtml/html/html_documentimpl.cpp:
        (HTMLDocumentImpl::HTMLDocumentImpl):
        * khtml/html/html_documentimpl.h:
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::RenderCanvas):
        (RenderCanvas::layout):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::body):
        (DocumentImpl::close):
        * khtml/xml/dom_docimpl.h:

2003-11-18  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3488883 - KIO::TransferJob needs to really use signals instead of calling loader directly
        
	* khtml/khtml_part.cpp:
        (KHTMLPart::openURL):
        * khtml/misc/loader.cpp:
        (Loader::servePendingRequests):
        (Loader::slotReceivedResponse):
        * khtml/misc/loader.h:
        * kwq/KWQKJobClasses.h:
        * kwq/KWQKJobClasses.mm:
        (KIO::TransferJob::TransferJob):
        (KIO::TransferJob::url):
        (KIO::TransferJob::emitData):
        (KIO::TransferJob::emitRedirection):
        (KIO::TransferJob::emitResult):
        (KIO::TransferJob::emitReceivedResponse):
        * kwq/KWQLoader.mm:
        (KWQServeRequest):
        * kwq/KWQObject.mm:
        (QObject::connect):
        * kwq/KWQResourceLoader.h:
        * kwq/KWQResourceLoader.mm:
        (-[KWQResourceLoader receivedResponse:]):
        (-[KWQResourceLoader addData:]):
        (-[KWQResourceLoader finishJobAndHandle]):
        * kwq/KWQSignal.h:
        * kwq/KWQSignal.mm:
        (KWQSignal::call):
        * kwq/KWQSlot.h:
        * kwq/KWQSlot.mm:
        (KWQSlot::KWQSlot):
        (KWQSlot::call):

2003-11-18  David Hyatt  <hyatt@apple.com>

	Fix for 3488244, marquee-increments with percentage values not handled correctly.  Also added a tweak to ensure
	that 1% of a small value ends up being at least an increment of 1.  Also added an optimization to not even
	bother kicking off the marquee timer if the increment's initial value is 0 (matches WinIE).

        * khtml/rendering/render_layer.cpp:
        (Marquee::start):
        (Marquee::timerEvent):

2003-11-18  Richard Williamson   <rjw@apple.com>

	More live connect stuff.  We're getting close.

        Reviewed by Chris.

        * WebCore.pbproj/project.pbxproj:
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::tryGet):
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::parseAttribute):
        (HTMLAppletElementImpl::getAppletInstance):
        * khtml/html/html_objectimpl.h:

2003-11-18  David Hyatt  <hyatt@apple.com>

	Fix for 3478122, crash using first-letter and zooming, and also the fix for 3478078, generated content
	does not get removed properly on w3c site.  The root cause of these two bugs was the same, namely my
	change to meld the concept of generated anonymous content and anonymous blocks created by the layout
	engine together.  RenderBlock's setStyle method was incorrectly updating before/after/first-letter content
	and wiping out its style in random (and bad) ways.
	
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::setStyle):

2003-11-18  David Hyatt  <hyatt@apple.com>

	Fix for 3487424, images not painting because of dropped layouts.  When replaced elements dirtied
	themselves during line layout, they only needed to do a local dirty and not walk up the parent chain.
	
        Reviewed by mjs

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):

2003-11-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- fixed 3486991 - Add XMLHttpRequest object and stub methods

        * khtml/ecma/kjs_window.cpp:
        (Window::get): Handle XMLHttpRequest constructor like Option and Image.
        * khtml/ecma/kjs_window.h: Ditto.
        * khtml/ecma/kjs_window.lut.h: Regenerated.
        * khtml/ecma/xmlhttprequest.cpp: Added. Stub implementations of everything.
        (KJS::XMLHttpRequestConstructorImp::XMLHttpRequestConstructorImp):
        (KJS::XMLHttpRequestConstructorImp::implementsConstruct):
        (KJS::XMLHttpRequestConstructorImp::construct):
        (KJS::XMLHttpRequest::tryGet):
        (KJS::XMLHttpRequest::getValueProperty):
        (KJS::XMLHttpRequest::tryPut):
        (KJS::XMLHttpRequest::putValue):
        (KJS::XMLHttpRequest::notifyFinished):
        (KJS::XMLHttpRequest::XMLHttpRequest):
        (KJS::XMLHttpRequest::~XMLHttpRequest):
        (KJS::XMLHttpRequestProtoFunc::tryCall):
        * khtml/ecma/xmlhttprequest.h: Added. Stub implementations of everything.
        (KJS::XMLHttpRequest::toBoolean):
        (KJS::XMLHttpRequest::classInfo):
        * khtml/ecma/xmlhttprequest.lut.h: Added.
        * khtml/ecma/Makefile.am: Add new .lut.h file.
	* WebCore.pbproj/project.pbxproj: Add new files.

2003-11-17  David Hyatt  <hyatt@apple.com>

	Fix for 3487136, marquees reset when you return to a page in the b/f cache.  This patch makes
	marquees suspend and resume properly, so they pick up animating where they left off.
	
        Reviewed by mjs

        * khtml/rendering/render_layer.cpp:
        (RenderLayer::suspendMarquees):
        (m_direction):
        (Marquee::start):
        (Marquee::suspend):
        * khtml/rendering/render_layer.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::clearTimers):

2003-11-17  Maciej Stachowiak  <mjs@apple.com>

	Merged from khtml:
	
	- fixed 3487324 - CSS url values should be wrapped in "url()" for cssText purposes
	
    2003-11-07  Dirk Mueller  <mueller@kde.org>
	 
	* css/css_valueimpl.cpp (cssText): wrap uri's into url(). 
	Stephan Kulow noted that other browsers do that.
	

2003-11-17  David Hyatt  <hyatt@apple.com>

	Fix for 3472998, stop a crash on an insanely malformed page.  I had to change the concept of 
	"inStrayTableContent" to be a counter, since you could be nested and need to push/pop, and
	then I also had to stop from mistakenly popping when I didn't need to.
	
        Reviewed by rjw

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::reset):
        (KHTMLParser::insertNode):
        (KHTMLParser::reopenResidualStyleTags):
        (KHTMLParser::popBlock):
        (KHTMLParser::popOneBlock):
        * khtml/html/htmlparser.h:

2003-11-17  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - did keyboard event cleanup to follow up on the keyCode work I did before
        - fixed 3485558: key identifers use lowercase hex, but the W3C document shows uppercase
        - fixed 3485564: key identifier for the Return key should be "Enter"
        - fixed 3485579: letter keys generate different key identifiers depending on whether the shift key is down
        - fixed 3485568: keyboard event modifier key bits are uninitialized; may have incorrect values
        - fixed 3481514: which attribute for DOM events reports incorrect value
        - fixed 3452569: charCode attribute for DOM events not supported

        * khtml/dom/dom2_events.h: Added charCode.
        * khtml/dom/dom2_events.cpp:
        (UIEvent::keyCode): Call through to KeyboardEventImpl instead of doing the work here;
        better factoring.
        (UIEvent::charCode): Added. Calls through to KeyboardEventImpl.
        (UIEvent::which): Call keyCode in KeyboardEventImpl to share code.

        * khtml/ecma/kjs_events.h: Added charCode property for DOMUIEvent.
        * khtml/ecma/kjs_events.cpp: (DOMUIEvent::getValueProperty): Added charCode.
        * khtml/ecma/kjs_events.lut.h: Regenerated.

        * khtml/html/html_formimpl.h:
        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::defaultEventHandler): Remove checks for "U+00000d" since we now use "Enter"
        for that key; also, we use capitalized hex, so it would have to change to "U+00000D" anyway.
        (HTMLSelectElementImpl::defaultEventHandler): Ditto.
        * khtml/html/html_inlineimpl.cpp: (HTMLAnchorElementImpl::defaultEventHandler): Ditto.

        * khtml/khtmlview.cpp: (KHTMLView::keyPressEvent): Put !APPLE_CHANGES around code we are not
        using. It was doing a switch based on Qt key codes, but the key value it was using to check
        was a Macintosh virtual key code, which could yield strange results when the codes happen to
        match. Safer and smaller code size not to do any of it at all.

        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::RenderLineEdit): Use a KLineEdit instead of LineEditWidget for APPLE_CHANGES.
        Allows us to put !APPLE_CHANGES around more Qt key code stuff.
        (RenderLineEdit::select): Cast to KLineEdit instead of LineEditWidget.
        (ComboBoxWidget::event): Put !APPLE_CHANGES around more unneeded Qt key code stuff.
        (TextAreaWidget::event): Put !APPLE_CHANGES around more unneeded Qt key code stuff.

        * khtml/xml/dom2_eventsimpl.h: Made id() const and added keyCode() and charCode().
        * khtml/xml/dom2_eventsimpl.cpp:
        (KeyboardEventImpl::KeyboardEventImpl): Initialize all fields in the empty constructor.
        Initialize all the modifier bits in the main constructor; the old code assumed they started
        off false, which is not a safe assumption. Also set m_altGraphKey false. Eliminated the
        unneeded check of text() before calling identifier(). Also adapted for the name change from
        identifier() to keyIdentifier().
        (KeyboardEventImpl::keyCode): Added. Returns the Windows virtual key code for keydown and
        keyup events, and the Unicode character for all other events.
        (KeyboardEventImpl::charCode): Added. Returns the Unicode character.

        * kwq/KWQEvent.h: Changed QCustomEvent to be a typedef for QEvent.
        (QEvent::QEvent): Removed AccelAvailable, and added KParts, so I could remove some ugly
        constants from the KParts code.
        (QMouseEvent::button): Use a cast here since the field is now int.
        (QMouseEvent::state): Use a cast here since the field is now int.
        (QMouseEvent::stateAfter): Use a cast here since the field is now int, and use the new
        _stateAfter field.
        (QTimerEvent::QTimerEvent): Moved the constructor to be inline since it's so simple.
        (QKeyEvent::QKeyEvent): Removed type and button state parameters, now unneeded.
        Also removed now-unused _key, _ascii, and _count fields, and key(), ascii(),
        and count() functions.
        (QKeyEvent::state): Made inline.
        (QKeyEvent::isAccepted): Made inline.
        (QKeyEvent::text): Made inline.
        (QKeyEvent::isAutoRepeat): Made inline.
        (QKeyEvent::accept): Made inline.
        (QKeyEvent::ignore): Made inline.
        (QKeyEvent::unmodifiedText): Made inline.
        (QKeyEvent::keyIdentifier): Made inline and chnaged name from identifier().
        * kwq/KWQEvent.mm:
        (keyIdentifierForKeyEvent): Renamed from identifierForKeyText and changed parameter
        to be the event. Cleaned up the code a little bit, and wrote a comment or two.
        Changed from lowercase hex to uppercase, and called toupper on the key so that
        letter a-z would work properly. (A non-Unicode toupper is just the ticket here,
        because I am only sure we want to do this for a-z, not other lowercase characters.)
        (isKeypadEvent): Added. Uses virtual key codes to decide if a key event is a keypad
        event, so we can set the state flag correctly.
        (WindowsKeyCodeForKeyEvent): Added Clear key to the switch statement; it was missing.
        Changed to no longe use the characterCode helper function since this was the only
        place it was needed.
        (mouseButtonForEvent): Added. Similar logic to what was in KWQKHTMLPart before; better
        factoring to have it in here.
        (nonMouseButtonsForEvent): Ditto.
        (QMouseEvent::QMouseEvent): Rewrote constructors. One matches the one from Qt that's
        used in some places in KHTML code. The other takes an NSEvent and uses the new functions
        above to compute the button and state.
        (QKeyEvent::QKeyEvent): Computer type based on the passed-in NSEvent. Compute the
        auto-repeat flag based on the event and also the "forceAutoRepeat" parameter. Compute
        the button state based on the event too.

        * kwq/KWQKHTMLPart.h: Remove buttonForCurrentEvent and stateForCurrentEvent. Both
        are now in KWQEvent.mm.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::keyEvent): Remove extra parameters in code that creates QKeyEvent, now
        that QKeyEvent can handle everything itself.
        (KWQKHTMLPart::mouseDown): Same thing as above, only for QMouseEvent.
        (KWQKHTMLPart::mouseDragged): Ditto.
        (KWQKHTMLPart::mouseUp): Ditto.
        (KWQKHTMLPart::mouseMoved): Ditto.
        (KWQKHTMLPart::sendContextMenuEvent): Ditto.

        * kwq/KWQKPartsEvent.h: Tweaked the class around a little so it can work without
        taking advantage of QCustomEvent's data pointer.
        * kwq/KWQKPartsEvent.mm:
        (KParts::Event::Event): Changed so it does a strdup on the event name and uses the
        new event type pre-allocated in KWQEvent.h for us.
        (KParts::Event::~Event): Free the event name.
        (KParts::Event::test): Reimplemented this.

        * kwq/KWQKPartsPart.h: (KParts::Part::event): Removed now-unnecessary cast to change
        a QCustomEvent into a QEvent.

        * kwq/KWQNamespace.h: Removed the Qt::Key enum. All the code that used it was already
        broken because of the mixup between Qt and Macintosh key codes.

2003-11-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

	<rdar://problem/3487079>: Some scheme checks in KURL do not verify 
	first char is a legal first char for a scheme

        * kwq/KWQKURL.mm:
        (KURL::KURL): Added some additional checks when looking through
	strings looking for schemes. Now the first character is checked
	for validity as a first character in a scheme.

2003-11-17  David Hyatt  <hyatt@apple.com>

	Fix for 3486441, don't use the visibleWidth when computing the containingBlockWidth().  No need to
	query the view, since the canvas's width has been set to the proper size (when printing).
	
        Reviewed by john

        * khtml/rendering/render_box.cpp:
        (RenderBox::containingBlockWidth):

2003-11-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3413713 - iframe forms posting fails without initial src attribute value

        * khtml/rendering/render_frames.cpp:
        (RenderPartObject::updateWidget): If the new part is for "about:blank",
	set the document base URL to parent's base URL.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::createEmptyDocument): If this part is an
	iframe, set the document base URL to the parent's base URL.

2003-11-17  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3485925: Safari does not correctly parse eight-digit hex character entities

        * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::parseEntity): Replaced puzzling variable limit
        on number of hexadecimal characters to parse with an 8-character limit.

2003-11-17  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3485572 -- secure form check in KHTML uses case-sensitive comparison with "https"

        * khtml/html/html_formimpl.h:
        * khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formWouldHaveSecureSubmission):
        Changed to take a DOMString reference for slightly better efficiency, and to use startsWith
        so the prefix check is not case sensitive and for slightly better efficiency and clarity
        than calling latin1() and using strncmp.

2003-11-17  Maciej Stachowiak  <mjs@apple.com>

	- commit updated .lut.h file that I forgot to commit before

        * khtml/ecma/kjs_window.lut.h:

2003-11-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3382829 - Safari won't load script src javascript if done by a document.write followed by document.close
	
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::closeInternal): Don't delete the tokenizer if it's
	waiting for scripts. It will get destroyed later when the part
	gets all subresources and closes the document.
        * khtml/html/htmltokenizer.cpp:
        (HTMLTokenizer::isWaitingForScripts): Added.
        * khtml/html/htmltokenizer.h: Prototyped.
        * khtml/xml/xml_tokenizer.cpp:
        (XMLTokenizer::isWaitingForScripts): Added.
        * khtml/xml/xml_tokenizer.h: Prototyped.

2003-11-17  David Hyatt  <hyatt@apple.com>

	Fix for 3480108, crash because of the wrong malformedTableParent when stray content is placed inside
	a <tr>.
	
        Reviewed by john

        * khtml/html/htmlparser.cpp:
        (KHTMLParser::popBlock):

2003-11-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- fixed 3397494 - FileMaker: Setting option object text fails if created without text
	
        * khtml/html/html_formimpl.cpp:
        (HTMLOptionElementImpl::childrenChanged): Update the select element.
	This ends up getting called when you add a text node to an option that
	didn't used to have one.
        * khtml/html/html_formimpl.h: Prototype it.

2003-11-17  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

	Fix for this bug:

	<rdar://problem/3480023>: Links don't work if there's a colon in the URL

	The colon in the URL was confusing KURL. I modified some checks in
	KURL so that its search for schemes stops when a non-scheme 
	character is found rather than when a path end segment character
	is found.

        * kwq/KWQKURL.mm: Added a new Colon class to the table of characters.
        (isSchemeCharOrColon): New helper.
        (KURL::KURL): Call on new helper when looking for a scheme.
        (KURL::findHostnameInHierarchicalURL): Ditto.

2003-11-17  David Hyatt  <hyatt@apple.com>

	Fix for 2931829, lines with hyphens should break on the hyphens.  Match WinIE's behavior of
	breaking on - and ?.
	
        Reviewed by john

        * khtml/rendering/break_lines.cpp:
        (khtml::isBreakable):

2003-11-17  David Hyatt  <hyatt@apple.com>

	Fix for 3415771, Safari should use mini form controls when necessary.  This patch adds heuristics for
	swapping in mini form controls and also drops intrinsic margins when mini form controls are used.

	Fix for 3486454, options/optgroups should strip leading/trailing space.
	
	Together these two fixes solve 3486581, travelocity misrenders because form controls are too large.

	Reviewed by Darin

	Also fixing 3474994, alink needs to be restricted to actual links and not all <a> tags.

	Reviewed by John

	Finally, adding :active outlines around <input type=image> (covered by the old bug 3141767).

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::CSSStyleSelector):
        (khtml::CSSStyleSelector::applyRule):
        (khtml::CSSStyleSelector::checkForGenericFamilyChange):
        (khtml::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
        (khtml::):
        (khtml::CSSStyleSelector::fontSizeForKeyword):
        (khtml::CSSStyleSelector::largerFontSize):
        (khtml::CSSStyleSelector::smallerFontSize):
        * khtml/css/cssstyleselector.h:
        * khtml/css/html4.css:
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::parseAttribute):
        * khtml/khtml_part.cpp:
        (KHTMLPart::setZoomFactor):
        * khtml/rendering/render_form.cpp:
        (RenderFormElement::addIntrinsicMarginsIfAllowed):
        (RenderSelect::updateFromElement):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::recalcStyle):
        (DocumentImpl::attach):
        * kwq/KWQButton.mm:
        (KWQNSControlSizeForFont):

2003-11-17  David Hyatt  <hyatt@apple.com>

	Back out my change to exclude text runs from getting a relayout on a style change.  I totally forgot about
	text zooming.
	
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):

2003-11-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	<rdar://problem/3131664>: add support for the window.print() command used for "print this page" buttons
        
	* khtml/ecma/kjs_window.cpp:
        (Window::get): add support for window.print (Apple-only)
        (WindowFunc::tryCall): ditto
        * khtml/ecma/kjs_window.h: Add Print to enum
        * khtml/ecma/kjs_window.lut.h: Regenerated
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::print): Call bridge.
        * kwq/KWQKHTMLPart.h: Declare above.
        * kwq/WebCoreBridge.h: prototype print method for other side of bridge.

2003-11-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

        * kwq/KWQKHTMLPartBrowserExtension.mm:
        (KHTMLPartBrowserExtension::createNewWindow): Check for the
	returned part being NULL, not the out value pointer.

2003-11-16  David Hyatt  <hyatt@apple.com>

	Fix for 3485779, <input type=image> and <button> should not be mouse focusable.

	Fix for 3485795, <input type=image> and <button> are being treated like links when they should not be.

	Fix for 3485817, <input type=image> and <button> should obey full keyboard access mode.

	Fix for 3485802, fieldset/legend/option/optgroup/label should not be focusable at all.
	
        Reviewed by kocienda

        * ChangeLog:
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::isKeyboardFocusable):
        (HTMLGenericFormElementImpl::isMouseFocusable):
        (HTMLFieldSetElementImpl::isFocusable):
        (HTMLLabelElementImpl::isFocusable):
        (HTMLLegendElementImpl::isFocusable):
        (HTMLOptGroupElementImpl::isFocusable):
        (HTMLOptionElementImpl::HTMLOptionElementImpl):
        (HTMLOptionElementImpl::isFocusable):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isMouseFocusable):
        (HTMLAnchorElementImpl::isKeyboardFocusable):
        * khtml/html/html_inlineimpl.h:
        * khtml/khtml_part.cpp:
        (KHTMLPart::tabsToLinks):
        (KHTMLPart::tabsToAllControls):
        * khtml/khtml_part.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrame):
        (KWQKHTMLPart::tabsToLinks):
        (KWQKHTMLPart::tabsToAllControls):

2003-11-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- fixed 3484723 - name property of window reference from window.open call is always empty
	
        * kwq/KWQKHTMLPartBrowserExtension.mm:
        (KHTMLPartBrowserExtension::createNewWindow): Set the part name on the khtml side when
	making a new window.

2003-11-16  David Hyatt  <hyatt@apple.com>

	Fix for 3485766.
	
	Make sure DOM elements that are programmatically focused at a time when they have no render objects restore the
	focus to their widgets when render objects get built.
	
        Reviewed by darin

        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::attach):

2003-11-16  David Hyatt  <hyatt@apple.com>

	Add border info to the render tree dumper.

        * khtml/rendering/render_style.h:
        (khtml::BorderValue::operator!=):
        * kwq/KWQRenderTreeDebug.cpp:
        (printBorderStyle):
        (operator<<):
        * layout-tests/apple-only/base/bugzilla.mozilla.org/index-expected.txt:
        * layout-tests/apple-only/base/home.netscape.com/index-expected.txt:
        * layout-tests/apple-only/base/lxr.mozilla.org/index-expected.txt:
        * layout-tests/apple-only/base/my.netscape.com/index-expected.txt:
        * layout-tests/apple-only/base/news.cnet.com/index-expected.txt:
        * layout-tests/apple-only/base/web.icq.com/index-expected.txt:
        * layout-tests/apple-only/base/www.altavista.com/index-expected.txt:
        * layout-tests/apple-only/base/www.amazon.com/index-expected.txt:
        * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
        * layout-tests/apple-only/base/www.digitalcity.com/index-expected.txt:
        * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
        * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
        * layout-tests/apple-only/base/www.expedia.com/index-expected.txt:
        * layout-tests/apple-only/base/www.iplanet.com/index-expected.txt:
        * layout-tests/apple-only/base/www.mapquest.com/index-expected.txt:
        * layout-tests/apple-only/base/www.microsoft.com/index-expected.txt:
        * layout-tests/apple-only/base/www.moviefone.com/index-expected.txt:
        * layout-tests/apple-only/base/www.msn.com/index-expected.txt:
        * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
        * layout-tests/apple-only/base/www.nytimes.com/index-expected.txt:
        * layout-tests/apple-only/base/www.nytimes.com_Table/index-expected.txt:
        * layout-tests/apple-only/base/www.quicken.com/index-expected.txt:
        * layout-tests/apple-only/base/www.sun.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.w3.org_DOML2Core/index-expected.txt:
        * layout-tests/apple-only/base/www.yahoo.com/index-expected.txt:
        * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
        * layout-tests/apple-only/base/www.zdnet.com_Gamespot.com/index-expected.txt:
        * layout-tests/css1/basic/class_as_selector-expected.txt:
        * layout-tests/css1/basic/comments-expected.txt:
        * layout-tests/css1/basic/containment-expected.txt:
        * layout-tests/css1/basic/contextual_selectors-expected.txt:
        * layout-tests/css1/basic/grouping-expected.txt:
        * layout-tests/css1/basic/id_as_selector-expected.txt:
        * layout-tests/css1/basic/inheritance-expected.txt:
        * layout-tests/css1/box_properties/acid_test-expected.txt:
        * layout-tests/css1/box_properties/border-expected.txt:
        * layout-tests/css1/box_properties/border_bottom-expected.txt:
        * layout-tests/css1/box_properties/border_bottom_inline-expected.txt:
        * layout-tests/css1/box_properties/border_bottom_width-expected.txt:
        * layout-tests/css1/box_properties/border_bottom_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_color-expected.txt:
        * layout-tests/css1/box_properties/border_color_inline-expected.txt:
        * layout-tests/css1/box_properties/border_inline-expected.txt:
        * layout-tests/css1/box_properties/border_left-expected.txt:
        * layout-tests/css1/box_properties/border_left_inline-expected.txt:
        * layout-tests/css1/box_properties/border_left_width-expected.txt:
        * layout-tests/css1/box_properties/border_left_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_right-expected.txt:
        * layout-tests/css1/box_properties/border_right_inline-expected.txt:
        * layout-tests/css1/box_properties/border_right_width-expected.txt:
        * layout-tests/css1/box_properties/border_right_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_style-expected.txt:
        * layout-tests/css1/box_properties/border_style_inline-expected.txt:
        * layout-tests/css1/box_properties/border_top-expected.txt:
        * layout-tests/css1/box_properties/border_top_inline-expected.txt:
        * layout-tests/css1/box_properties/border_top_width-expected.txt:
        * layout-tests/css1/box_properties/border_top_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_width-expected.txt:
        * layout-tests/css1/box_properties/border_width_inline-expected.txt:
        * layout-tests/css1/box_properties/clear-expected.txt:
        * layout-tests/css1/box_properties/clear_float-expected.txt:
        * layout-tests/css1/box_properties/float-expected.txt:
        * layout-tests/css1/box_properties/float_elements_in_series-expected.txt:
        * layout-tests/css1/box_properties/float_margin-expected.txt:
        * layout-tests/css1/box_properties/float_on_text_elements-expected.txt:
        * layout-tests/css1/box_properties/height-expected.txt:
        * layout-tests/css1/box_properties/margin-expected.txt:
        * layout-tests/css1/box_properties/margin_bottom-expected.txt:
        * layout-tests/css1/box_properties/margin_bottom_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_left-expected.txt:
        * layout-tests/css1/box_properties/margin_left_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_right-expected.txt:
        * layout-tests/css1/box_properties/margin_right_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_top-expected.txt:
        * layout-tests/css1/box_properties/margin_top_inline-expected.txt:
        * layout-tests/css1/box_properties/padding-expected.txt:
        * layout-tests/css1/box_properties/padding_bottom-expected.txt:
        * layout-tests/css1/box_properties/padding_bottom_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_left-expected.txt:
        * layout-tests/css1/box_properties/padding_left_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_right-expected.txt:
        * layout-tests/css1/box_properties/padding_right_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_top-expected.txt:
        * layout-tests/css1/box_properties/padding_top_inline-expected.txt:
        * layout-tests/css1/box_properties/width-expected.txt:
        * layout-tests/css1/cascade/cascade_order-expected.txt:
        * layout-tests/css1/cascade/important-expected.txt:
        * layout-tests/css1/classification/display-expected.txt:
        * layout-tests/css1/classification/list_style-expected.txt:
        * layout-tests/css1/classification/list_style_image-expected.txt:
        * layout-tests/css1/classification/list_style_position-expected.txt:
        * layout-tests/css1/classification/list_style_type-expected.txt:
        * layout-tests/css1/classification/white_space-expected.txt:
        * layout-tests/css1/color_and_background/background-expected.txt:
        * layout-tests/css1/color_and_background/background_attachment-expected.txt:
        * layout-tests/css1/color_and_background/background_color-expected.txt:
        * layout-tests/css1/color_and_background/background_image-expected.txt:
        * layout-tests/css1/color_and_background/background_position-expected.txt:
        * layout-tests/css1/color_and_background/background_repeat-expected.txt:
        * layout-tests/css1/color_and_background/color-expected.txt:
        * layout-tests/css1/conformance/forward_compatible_parsing-expected.txt:
        * layout-tests/css1/font_properties/font-expected.txt:
        * layout-tests/css1/font_properties/font_family-expected.txt:
        * layout-tests/css1/font_properties/font_size-expected.txt:
        * layout-tests/css1/font_properties/font_style-expected.txt:
        * layout-tests/css1/font_properties/font_variant-expected.txt:
        * layout-tests/css1/font_properties/font_weight-expected.txt:
        * layout-tests/css1/formatting_model/canvas-expected.txt:
        * layout-tests/css1/formatting_model/floating_elements-expected.txt:
        * layout-tests/css1/formatting_model/height_of_lines-expected.txt:
        * layout-tests/css1/formatting_model/inline_elements-expected.txt:
        * layout-tests/css1/formatting_model/replaced_elements-expected.txt:
        * layout-tests/css1/formatting_model/vertical_formatting-expected.txt:
        * layout-tests/css1/pseudo/anchor-expected.txt:
        * layout-tests/css1/pseudo/firstletter-expected.txt:
        * layout-tests/css1/pseudo/firstline-expected.txt:
        * layout-tests/css1/pseudo/multiple_pseudo_elements-expected.txt:
        * layout-tests/css1/pseudo/pseudo_elements_in_selectors-expected.txt:
        * layout-tests/css1/text_properties/letter_spacing-expected.txt:
        * layout-tests/css1/text_properties/line_height-expected.txt:
        * layout-tests/css1/text_properties/text-transform-expected.txt:
        * layout-tests/css1/text_properties/text_align-expected.txt:
        * layout-tests/css1/text_properties/text_decoration-expected.txt:
        * layout-tests/css1/text_properties/text_indent-expected.txt:
        * layout-tests/css1/text_properties/text_transform-expected.txt:
        * layout-tests/css1/text_properties/vertical_align-expected.txt:
        * layout-tests/css1/text_properties/word_spacing-expected.txt:
        * layout-tests/css1/units/color_units-expected.txt:
        * layout-tests/css1/units/length_units-expected.txt:
        * layout-tests/css1/units/percentage_units-expected.txt:
        * layout-tests/css1/units/urls-expected.txt:
        * layout-tests/fast/block/basic/001-expected.txt:
        * layout-tests/fast/block/basic/002-expected.txt:
        * layout-tests/fast/block/basic/003-expected.txt:
        * layout-tests/fast/block/basic/004-expected.txt:
        * layout-tests/fast/block/basic/007-expected.txt:
        * layout-tests/fast/block/basic/011-expected.txt:
        * layout-tests/fast/block/basic/015-expected.txt:
        * layout-tests/fast/block/basic/016-expected.txt:
        * layout-tests/fast/block/basic/017-expected.txt:
        * layout-tests/fast/block/basic/018-expected.txt:
        * layout-tests/fast/block/basic/019-expected.txt:
        * layout-tests/fast/block/float/004-expected.txt:
        * layout-tests/fast/block/float/005-expected.txt:
        * layout-tests/fast/block/float/006-expected.txt:
        * layout-tests/fast/block/float/007-expected.txt:
        * layout-tests/fast/block/float/012-expected.txt:
        * layout-tests/fast/block/float/013-expected.txt:
        * layout-tests/fast/block/float/015-expected.txt:
        * layout-tests/fast/block/float/016-expected.txt:
        * layout-tests/fast/block/float/017-expected.txt:
        * layout-tests/fast/block/float/019-expected.txt:
        * layout-tests/fast/block/float/021-expected.txt:
        * layout-tests/fast/block/float/022-expected.txt:
        * layout-tests/fast/block/float/024-expected.txt:
        * layout-tests/fast/block/float/025-expected.txt:
        * layout-tests/fast/block/float/026-expected.txt:
        * layout-tests/fast/block/float/027-expected.txt:
        * layout-tests/fast/block/float/028-expected.txt:
        * layout-tests/fast/block/margin-collapse/001-expected.txt:
        * layout-tests/fast/block/margin-collapse/005-expected.txt:
        * layout-tests/fast/block/margin-collapse/006-expected.txt:
        * layout-tests/fast/block/margin-collapse/010-expected.txt:
        * layout-tests/fast/block/margin-collapse/011-expected.txt:
        * layout-tests/fast/block/margin-collapse/012-expected.txt:
        * layout-tests/fast/block/margin-collapse/015-expected.txt:
        * layout-tests/fast/block/margin-collapse/016-expected.txt:
        * layout-tests/fast/block/margin-collapse/017-expected.txt:
        * layout-tests/fast/block/margin-collapse/018-expected.txt:
        * layout-tests/fast/block/margin-collapse/019-expected.txt:
        * layout-tests/fast/block/margin-collapse/020-expected.txt:
        * layout-tests/fast/block/margin-collapse/021-expected.txt:
        * layout-tests/fast/block/margin-collapse/022-expected.txt:
        * layout-tests/fast/block/margin-collapse/024-expected.txt:
        * layout-tests/fast/block/margin-collapse/025-expected.txt:
        * layout-tests/fast/block/margin-collapse/026-expected.txt:
        * layout-tests/fast/block/margin-collapse/027-expected.txt:
        * layout-tests/fast/block/margin-collapse/028-expected.txt:
        * layout-tests/fast/block/margin-collapse/029-expected.txt:
        * layout-tests/fast/block/margin-collapse/030-expected.txt:
        * layout-tests/fast/block/margin-collapse/032-expected.txt:
        * layout-tests/fast/block/margin-collapse/033-expected.txt:
        * layout-tests/fast/block/margin-collapse/034-expected.txt:
        * layout-tests/fast/block/margin-collapse/035-expected.txt:
        * layout-tests/fast/block/margin-collapse/041-expected.txt:
        * layout-tests/fast/block/margin-collapse/042-expected.txt:
        * layout-tests/fast/block/margin-collapse/043-expected.txt:
        * layout-tests/fast/block/positioning/048-expected.txt:
        * layout-tests/fast/block/positioning/049-expected.txt:
        * layout-tests/fast/block/positioning/050-expected.txt:
        * layout-tests/fast/block/positioning/051-expected.txt:
        * layout-tests/fast/block/positioning/056-expected.txt:
        * layout-tests/fast/block/positioning/057-expected.txt:
        * layout-tests/fast/block/positioning/058-expected.txt:
        * layout-tests/fast/block/positioning/auto/001-expected.txt:
        * layout-tests/fast/block/positioning/auto/002-expected.txt:
        * layout-tests/fast/block/positioning/auto/003-expected.txt:
        * layout-tests/fast/block/positioning/auto/004-expected.txt:
        * layout-tests/fast/block/positioning/auto/005-expected.txt:
        * layout-tests/fast/block/positioning/auto/006-expected.txt:
        * layout-tests/fast/clip/013-expected.txt:
        * layout-tests/fast/clip/014-expected.txt:
        * layout-tests/fast/css-generated-content/006-expected.txt:
        * layout-tests/fast/css/003-expected.txt:
        * layout-tests/fast/css/004-expected.txt:
        * layout-tests/fast/css/005-expected.txt:
        * layout-tests/fast/dynamic/002-expected.txt:
        * layout-tests/fast/dynamic/004-expected.txt:
        * layout-tests/fast/encoding/utf-16-big-endian-expected.txt:
        * layout-tests/fast/encoding/utf-16-little-endian-expected.txt:
        * layout-tests/fast/flexbox/007-expected.txt:
        * layout-tests/fast/flexbox/008-expected.txt:
        * layout-tests/fast/flexbox/009-expected.txt:
        * layout-tests/fast/flexbox/011-expected.txt:
        * layout-tests/fast/flexbox/016-expected.txt:
        * layout-tests/fast/flexbox/017-expected.txt:
        * layout-tests/fast/flexbox/018-expected.txt:
        * layout-tests/fast/flexbox/019-expected.txt:
        * layout-tests/fast/flexbox/022-expected.txt:
        * layout-tests/fast/flexbox/025-expected.txt:
        * layout-tests/fast/forms/001-expected.txt:
        * layout-tests/fast/forms/002-expected.txt:
        * layout-tests/fast/forms/006-expected.txt:
        * layout-tests/fast/forms/007-expected.txt:
        * layout-tests/fast/forms/form-element-geometry-expected.txt:
        * layout-tests/fast/frames/001-expected.txt:
        * layout-tests/fast/inline-block/001-expected.txt:
        * layout-tests/fast/inline-block/002-expected.txt:
        * layout-tests/fast/inline-block/003-expected.txt:
        * layout-tests/fast/inline/001-expected.txt:
        * layout-tests/fast/invalid/008-expected.txt:
        * layout-tests/fast/invalid/014-expected.txt:
        * layout-tests/fast/invalid/016-expected.txt:
        * layout-tests/fast/lists/001-expected.txt:
        * layout-tests/fast/lists/004-expected.txt:
        * layout-tests/fast/lists/007-expected.txt:
        * layout-tests/fast/overflow/001-expected.txt:
        * layout-tests/fast/overflow/002-expected.txt:
        * layout-tests/fast/overflow/004-expected.txt:
        * layout-tests/fast/replaced/005-expected.txt:
        * layout-tests/fast/replaced/006-expected.txt:
        * layout-tests/fast/replaced/008-expected.txt:
        * layout-tests/fast/selectors/009-expected.txt:
        * layout-tests/fast/selectors/014-expected.txt:
        * layout-tests/fast/selectors/032-expected.txt:
        * layout-tests/fast/selectors/033-expected.txt:
        * layout-tests/fast/selectors/039-expected.txt:
        * layout-tests/fast/selectors/039b-expected.txt:
        * layout-tests/fast/selectors/064-expected.txt:
        * layout-tests/fast/selectors/077-expected.txt:
        * layout-tests/fast/selectors/077b-expected.txt:
        * layout-tests/fast/selectors/078-expected.txt:
        * layout-tests/fast/selectors/078b-expected.txt:
        * layout-tests/fast/selectors/166a-expected.txt:
        * layout-tests/fast/table/003-expected.txt:
        * layout-tests/fast/table/004-expected.txt:
        * layout-tests/fast/table/005-expected.txt:
        * layout-tests/fast/table/006-expected.txt:
        * layout-tests/fast/table/007-expected.txt:
        * layout-tests/fast/table/008-expected.txt:
        * layout-tests/fast/table/009-expected.txt:
        * layout-tests/fast/table/015-expected.txt:
        * layout-tests/fast/table/017-expected.txt:
        * layout-tests/fast/table/018-expected.txt:
        * layout-tests/fast/table/020-expected.txt:
        * layout-tests/fast/table/023-expected.txt:
        * layout-tests/fast/table/025-expected.txt:
        * layout-tests/fast/table/027-expected.txt:
        * layout-tests/fast/table/028-expected.txt:
        * layout-tests/fast/table/029-expected.txt:
        * layout-tests/fast/table/030-expected.txt:
        * layout-tests/fast/table/035-expected.txt:
        * layout-tests/fast/table/036-expected.txt:
        * layout-tests/fast/table/038-expected.txt:
        * layout-tests/fast/table/border-collapsing/001-expected.txt:
        * layout-tests/fast/table/border-collapsing/002-expected.txt:
        * layout-tests/fast/table/border-collapsing/003-expected.txt:
        * layout-tests/fast/table/border-collapsing/004-expected.txt:
        * layout-tests/fast/table/large-width-expected.txt:
        * layout-tests/fast/table/nobr-expected.txt:
        * layout-tests/fast/text/basic/001-expected.txt:
        * layout-tests/fast/text/basic/003-expected.txt:
        * layout-tests/fast/text/basic/004-expected.txt:
        * layout-tests/fast/text/basic/005-expected.txt:
        * layout-tests/fast/text/basic/006-expected.txt:
        * layout-tests/fast/text/basic/007-expected.txt:
        * layout-tests/fast/text/basic/012-expected.txt:
        * layout-tests/fast/text/firstline/002-expected.txt:
        * layout-tests/fast/text/whitespace/002-expected.txt:
        * layout-tests/fast/text/whitespace/003-expected.txt:
        * layout-tests/fast/text/whitespace/020-expected.txt:
        * layout-tests/fast/text/whitespace/023-expected.txt:
        * layout-tests/fast/text/whitespace/024-expected.txt:
        * layout-tests/fast/text/whitespace/025-expected.txt:
        * layout-tests/fast/text/whitespace/027-expected.txt:

2003-11-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3362841 - javascript History Object length property is always 0

        * kwq/KWQKPartsBrowserInterface.mm:
        (KParts::BrowserInterface::property): For the historyLength property,
	retturn a UInt variant, not Int, because that's what the kjs_window code
	expects.

2003-11-14  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken and Dave.

	- fixed 3471925 - getting and setting cssText not implemented

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::cssText): Implemented by gathering text of all
	properties (that are not non-CSS hints), separated with semicolons.
        (CSSStyleDeclarationImpl::setCssText): Implemented by clearing all existing
	properties (that are not non-CSS hints) and invoking css parser.
        (CSSValueListImpl::cssText): Implemented.
        (FontValueImpl::cssText): Implemented.
        (ShadowValueImpl::cssText): Implemented.
        (CSSProperty::cssText): Implemented.
        * khtml/css/css_valueimpl.h: Declared new methods; made
	CSSValueImpl::cssText() pure virtual; removed CSSValueImpl::setCssText().

2003-11-16  David Hyatt  <hyatt@apple.com>

	3485717, Cleanup of the float code.  Eliminated the -khtml-flow-mode style property in favor of two simple methods,
	avoidsFloats() and usesLineWidth().  avoidsFloats can be called to tell whether an object does not want
	floats to intrude into its space (and that it should also move to avoid floats).  usesLineWidth is called
	to find out if an object's containing block width is the line width or the content width, and has all the
	right smarts to emulate WinIE's behaviors in both quirks and strict mode.

	Also fixed a bug (3485718) where overflow:scroll blocks with auto height did not factor in the horizontal scrollbar's
	height (thus causing it to paint on top of content).
	
        Reviewed by darin

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/css/html4.css:
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):
        (khtml::RenderBlock::clearFloats):
        * khtml/rendering/render_box.cpp:
        (RenderBox::containingBlockWidth):
        (RenderBox::calcWidth):
        * khtml/rendering/render_object.cpp:
        (RenderObject::isHR):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::avoidsFloats):
        (khtml::RenderObject::usesLineWidth):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::NonInheritedFlags::operator==):
        (khtml::RenderStyle::setBitDefaults):
        (khtml::RenderStyle::initialTextDecoration):
        * khtml/rendering/render_table.cpp:
        (RenderTable::calcWidth):

2003-11-14  David Hyatt  <hyatt@apple.com>

	Fix for 3485260, regression on Uniview site from incremental repainting.  When appending/inserting child
	nodes into the render tree, we need to always mark them as needing layout themselves (and not just as
	having children needing layout).  This ensures that the incremental repainting code will know to repaint the
	enclosing container (even though that container's size may not change).

	Fix for 3411960, block-level replaced elements should avoid floats.

	Fix for 3463234, floats should not intrude into overflow blocks (even when siblings happen to get in
	between the float and the overflow block).

	Fix for 3485576, the containing block for text runs is incorrect.

	Fix for 3485577, text runs should not trigger layout when style is re-resolved.
	
        Reviewed by darin

        * khtml/rendering/render_container.cpp:
        (RenderContainer::appendChildNode):
        (RenderContainer::insertChildNode):
        * khtml/rendering/render_box.cpp
	* khtml/rendering/render_object.cpp
	
2003-11-14  David Hyatt  <hyatt@apple.com>

	Fix for 3473707, 100% height positioned divs are too tall.  The padding box wasn't being used like it was
	supposed to be when calcing percentage heights.
	
        Reviewed by kocienda

        * khtml/rendering/render_box.cpp:
        (RenderBox::calcAbsoluteVertical):

=== Safari-114 ===

2003-11-14  Maciej Stachowiak  <mjs@apple.com>

        - backed out changes unintentionally commited while the tree was closed

        * khtml/css/css_valueimpl.cpp:
        * khtml/css/css_valueimpl.h:
        * kwq/KWQKPartsBrowserInterface.mm:

2003-11-14  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	- fixed 3471925 - getting and setting cssText not implemented

        * khtml/css/css_valueimpl.cpp:
        (CSSStyleDeclarationImpl::cssText): Implemented by gathering text of all
	properties, separated with semicolons.
        (CSSStyleDeclarationImpl::setCssText): Implemented by clearing all existing
	properties and invoking css parser.
        (CSSValueListImpl::cssText): Implemented.
        (FontValueImpl::cssText): Implemented.
        (ShadowValueImpl::cssText): Implemented.
        (CSSProperty::cssText): Implemented.
        * khtml/css/css_valueimpl.h: Declared new methods; made
	CSSValueImpl::cssText() pure virtual; removed
	CSSValueImpl::setCssText().

2003-11-14  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - first half of fix for 3457162 -- selecting text during a page load that blows the text field
          away causes a crash

        The WebCore part of this fix is to generalize the "defers loading" feature to all mouse clicks,
        rather than just doing it for mouse clicks on the combo box.

        * kwq/KWQComboBox.mm: (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
        Remove code to defer loading.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Put the code here
        instead.

2003-11-14  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3483585>: Option-tab in a text field inputs 
        a character rather than tabbing to the next widget

        Reviewed by Ken.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::handleKeyboardOptionTabInView):
        New method. If current event is option-tab or option-shift-tab, do
        keyboard navigation and return YES.
        
        * kwq/KWQTextArea.mm:
        (-[KWQTextArea textDidChange:]):
        Bail out if KWQKHTMLPart::handleKeyboardOptionTabInView returns YES.
        
        * kwq/KWQTextField.mm:
        (-[KWQTextField controlTextDidChange:]):
        Bail out if KWQKHTMLPart::handleKeyboardOptionTabInView returns YES.

2003-11-13  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3472875 -- REGRESSION (109-110): insertion point does not blink in a nonempty textarea
        - fixed 3484002 -- disabling, then enabling a read-only <textarea> will make it editable

        * kwq/KWQTextArea.mm:
        (-[KWQTextArea setText:]): Call updateTextColor after setting the text.
        (-[KWQTextArea setEditable:]): Don't set the NSTextView editable property directly,
        because we don't want to make a disabled text view editable right away, but we need
        to later if it's enabled.
        (-[KWQTextArea isEditable]): Don't get the NSTextView editable property directly,
        because it can be appropriate to return YES even if the text view happens to be disabled.
        (-[KWQTextAreaTextView initWithFrame:textContainer:]): Initialize editableIfEnabled to YES.
        (-[KWQTextAreaTextView setEnabled:]): Don't set the editable state to true if
        editableIfEnabled is NO. The old code would make a read-only field editable if you
        changed it to be enabled. Also update the color of the text here.
        (-[KWQTextAreaTextView setEditableIfEnabled:]): Store the editableIfEnabled state in a
        field, and then alter the state of the editable flag to match if we're currently enabled.
        (-[KWQTextAreaTextView isEditableIfEnabled]): Return the editableIfEnabled state.
        (-[KWQTextAreaTextView updateTextColor]): Update the color of the text. This was done in
        drawRect: before, which was the cause of the lack of insertion point.

2003-11-13  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3474330 -- tooltips do not work for <area> elements

        * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): When looking for a title, start
        with innerNode (which can be an <area> inside a <map>). This matches what Mozilla does.

2003-11-13  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed - 3479285 - hang at www.saccourt.com
	- fixed - 3477088 - (85-112) Safari frozen loading a page at Postal Service site of Taiwan
	
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLSelectCollection::tryPut): Use the range-checking
	version of the number-conversion function to avoid negative
	numbers and NaN.

2003-11-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John
	
	Fix for this bug:

	<rdar://problem/3483284>: Tabbing to links needs to honor new 
	WebKit tab-to-links preference

	In addition to fixing the bug, I also did a bit of cleanup
	in the code which helps to determine tab order.

	Biggest change is to modify the keyboard UI mode function so
	that it is a set of flags, rather than a straight-up value.

	I also tweaked the names on the keyboard UI mode constants
	to make them read better.

        * kwq/KWQButton.mm:
        (QButton::focusPolicy): Tweaks to make more readable and use 
	new model for keyboard UI mode.
        * kwq/KWQComboBox.mm:
        (QComboBox::focusPolicy): Ditto. Plus, this function was not
	blocking exceptions.
        * kwq/KWQFileButton.mm:
        (KWQFileButton::focusPolicy): Tweaks to make more readable and use 
        new model for keyboard UI mode.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrame): Now checks new tabsToLinks
	function to determine if links can be tabbed to.
        (KWQKHTMLPart::currentEventIsKeyboardOptionTab): New function
	checks for option-tab keyboard event.
        (KWQKHTMLPart::tabsToLinks): New helper to take keyboard UI mode
	and option-tab into account.
        (KWQKHTMLPart::keyboardUIMode): Name tweak.
        * kwq/KWQListBox.mm: Tweaks to make more readable and use 
        new model for keyboard UI mode.
        (QListBox::focusPolicy):
        * kwq/WebCoreKeyboardAccess.h: Tweaked names. Added WebCoreKeyboardAccessTabsToLinks.

2003-11-13  David Hyatt  <hyatt@apple.com>

	Implement a custom unfurl marquee style.
	
        Reviewed by john

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/rendering/render_box.cpp:
        (RenderBox::calcHeight):
        * khtml/rendering/render_layer.cpp:
        (m_direction):
        (Marquee::isUnfurlMarquee):
        (Marquee::start):
        (Marquee::updateMarqueePosition):
        (Marquee::updateMarqueeStyle):
        (Marquee::timerEvent):
        * khtml/rendering/render_layer.h:
        (khtml::):
        * khtml/rendering/render_style.h:
        (khtml::):

2003-11-13  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

	Fix for this bug:

	<rdar://problem/3480761>: event object type attribute returns 
	khtml_keypress instead of keypress

	Fixed string so that it returns keypress instead of khtml_keypress.
	While I was at it, I changed the constant used for this event from
	KHTML_KEYPRESS_EVENT to KEYPRESS_EVENT.

        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::wasRunByUserGesture): Constant name fixup.
        * khtml/ecma/kjs_dom.cpp: Ditto.
        (DOMNode::getValueProperty): Ditto.
        (DOMNode::putValue): Ditto.
        * khtml/ecma/kjs_window.cpp:
        (Window::get): Ditto.
        (Window::put): Ditto.
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseAttribute): Ditto.
        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::defaultEventHandler): Ditto.
        (HTMLSelectElementImpl::defaultEventHandler): Ditto.
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::idToType): This is the change that fixes the bug.
        (KeyboardEventImpl::KeyboardEventImpl): Constant name fixup.
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::): Ditto.

2003-11-13  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed 3452554 -- keyCode attribute for DOM events reports incorrect value

        * khtml/dom/dom2_events.cpp:
        (UIEvent::keyCode): Return the Windows key code for keydown and keyup events.
        But for other events, return the character code. This matches IE.
        (UIEvent::which): Same behavior for now; may need further refinement.

        * kwq/KWQEvent.h: Change QEvent to allow copying. The Qt version probably doesn't
        allow it, but for us it's no big deal. Our event objects are just data holders.
        (QKeyEvent::QKeyEvent): Change parameters; take an NSEvent and figure the rest out
        here. Except for now get the type, button state, and auto repeat flag from the caller
        because that's a smaller change from how things are done now. I'll take this the next
        step later.
        * kwq/KWQEvent.mm:
        (characterCode): Added. Extracts the character code from the string if it's exactly
        1 character long.
        (WindowsKeyCode): Added. Given an event, figures out the Windows key code. 
        (QKeyEvent::QKeyEvent): Changed to get things from the NSEvent rather than having them
        passed individually. One change is that _ascii is now the Unicode value of the first
        character in the string. This causes us to return the Unicode value from keyCode for
        keypress events. Another change is that we now compute the Windows key code.

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent): Change to use the new QKeyEvent
        constructor, passing in the NSEvent.

        * khtml/xml/dom2_eventsimpl.cpp: (KeyboardEventImpl::KeyboardEventImpl):
        In APPLE_CHANGES, copy the QKeyEvent using the copy constructor rather than
        listing the fields. This is easier to maintain when the list of fields changes.

        * khtml/rendering/render_form.cpp: (ComboBoxWidget::eventFilter): Put #if
        !APPLE_CHANGES around code that constructs a QKeyEvent. We don't ever run this
        code, but now we can't compile it either so we need the #if.

2003-11-12  David Hyatt  <hyatt@apple.com>

	Fix for 3482132, incremental repainting for layout, i.e., only repaint areas that change when
	doing a layout.
	
        Reviewed by kocienda

        * khtml/khtmlview.h:
        * khtml/rendering/render_canvas.cpp:
        (RenderCanvas::repaintViewRectangle):
        * khtml/rendering/render_layer.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::setNeedsLayout):
        (RenderObject::setChildNeedsLayout):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_table.cpp:
        (RenderTableSection::layoutRows):

2003-11-12  Ken Kocienda  <kocienda@apple.com>

	I am an idiot for just assuming that these elements implement a focus()
	function, without actually compiling and testing. I will have to add 
	this function to these elements so I can make this work.

        * khtml/html/html_formimpl.cpp:
        (HTMLButtonElementImpl::accessKeyAction): These elements do not implement focus().
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::accessKeyAction): Ditto.

2003-11-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

        * khtml/html/html_formimpl.cpp:
        (HTMLButtonElementImpl::click): Implemented. Missed this in my earlier patch.
        (HTMLButtonElementImpl::accessKeyAction): Added. Focus and click.
        (HTMLInputElementImpl::accessKeyAction): Added. Focus the element.
        (HTMLSelectElementImpl::accessKeyAction): Added. Focus the element.
        (HTMLTextAreaElementImpl::accessKeyAction): Added. Focus the element.
        * khtml/html/html_formimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::accessKeyAction): Added. Focus and click.
        * khtml/html/html_inlineimpl.h:
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        (DocumentImpl::addElementById): Dirty the accesskey dictionary.
        (DocumentImpl::removeElementById): Ditto.
        (DocumentImpl::getElementByAccessKey): Function to look up an element
	based on the key provided.
        (DocumentImpl::setDocumentChanged): Dirty the accesskey dictionary.
        (DocumentImpl::defaultEventHandler): Check the accesskey dictionary
	to see if some element wants to handle a key event.
        * khtml/xml/dom_docimpl.h:
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::accessKeyAction): Added. Send a click to the element.

2003-11-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

	Fix for this bug:

	<rdar://problem/3481600>: key event objects do not preserve unmodified keys

        * khtml/xml/dom2_eventsimpl.cpp: Modified constructor call to include
	unmodifiedText.
        (KeyboardEventImpl::KeyboardEventImpl):
        * kwq/KWQEvent.h: Added unmodifiedText accessor and variable to QKeyEvent.
        * kwq/KWQEvent.mm:
        (QKeyEvent::QKeyEvent): Modified constructor to include unmodifiedText.
        (QKeyEvent::unmodifiedText): Added accessor.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::keyEvent): Modified constructor call to include
        unmodifiedText.

2003-11-12  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::click): Implemented a programmatic click function for
	elements.
        * khtml/html/html_elementimpl.h:
        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::submitClick): Implemented a programmatic click function for
	elements.
        (HTMLInputElementImpl::click): This implementation calls through
	to Cocoa button programmatic click function to get user interface
	feedback for button elements, and calls through to the superclass
	for other elements.
        * khtml/html/html_formimpl.h:
        * khtml/html/html_inlineimpl.cpp: Removed click() function for anchors.
	No longer needed.
        * khtml/html/html_inlineimpl.h: Ditto.

2003-11-12  David Hyatt  <hyatt@apple.com>

	Fix build bustage in deployment builds.

        * kwq/KWQLineEdit.mm:
        (QLineEdit::hasMarkedText):

2003-11-11  David Hyatt  <hyatt@apple.com>

	Fix for 3481134, shorthand parsing in CSS does not fill in omitted values.  The fix is to implement
	the CSS3 'initial' value for all properties (covered by 3481323), and then to fill in the omitted 
	values with the 'initial' value.

	This patch also fixes two bugs in the style system: 3481324, collapsed borders with border-style: none
	should always return a width of 0, and 3481322, 'clip' not inheriting properly in CSS when explicit
	inheritance is used.
	
        Reviewed by mjs

        * khtml/css/css_valueimpl.cpp:
        (CSSInitialValueImpl::cssText):
        * khtml/css/css_valueimpl.h:
        (DOM::CSSInitialValueImpl::cssValueType):
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        (CSSParser::parseShortHand):
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/dom/css_value.h:
        (DOM::CSSValue::):
        * khtml/rendering/render_style.cpp:
        (StyleBoxData::StyleBoxData):
        (StyleVisualData::StyleVisualData):
        (StyleBackgroundData::StyleBackgroundData):
        (StyleMarqueeData::StyleMarqueeData):
        (StyleFlexibleBoxData::StyleFlexibleBoxData):
        (opacity):
        (StyleInheritedData::StyleInheritedData):
        (RenderStyle::diff):
        * khtml/rendering/render_style.h:
        (khtml::BorderValue::BorderValue):
        (khtml::CollapsedBorderValue::width):
        (khtml::RenderStyle::InheritedFlags::operator==):
        (khtml::RenderStyle::setBitDefaults):
        (khtml::RenderStyle::resetBorderTop):
        (khtml::RenderStyle::resetBorderRight):
        (khtml::RenderStyle::resetBorderBottom):
        (khtml::RenderStyle::resetBorderLeft):
        (khtml::RenderStyle::resetOutline):
        (khtml::RenderStyle::setHasClip):
        (khtml::RenderStyle::resetMargin):
        (khtml::RenderStyle::resetPadding):
        (khtml::RenderStyle::setCursor):

2003-11-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3479537 - reproducible crash in KJS::WindowFunc::tryCall
	
        * khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall): Check part and doc impl for null.

2003-11-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	- fixed 3472330 -  REGRESSION: onKeyPress handler not called when hitting keys in <input type=password> field

        * kwq/KWQTextField.mm:
        (-[KWQSecureTextField initWithQLineEdit:]): New initializer, so
	the secure text field knows about the widget.
        (-[KWQTextField setPasswordMode:]): Use new initializer for
	KWQSecureTextField.
        (-[KWQSecureTextField textView:shouldHandleEvent:]): New method,
	do the same thing as the non-secure text field to pass the event on.
        (-[KWQSecureTextField textView:didHandleEvent:]): Ditto.

2003-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

	Fix for this bug:

	<rdar://problem/3480173>: Too many names for programmatic click functions

	Changed all instances of performClick() and simulateClick() to click().
	Changed all instances of performSubmitClick() to submitClick().

	Additionally, KWQButton had a simulateClick method, which was redundant
	given that its superclass has a performClick: method.

        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::submitClick):
        (HTMLInputElementImpl::defaultEventHandler):
        (HTMLSelectElementImpl::defaultEventHandler):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::defaultEventHandler):
        (HTMLAnchorElementImpl::click):
        * khtml/html/html_inlineimpl.h:
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::slotReturnPressed):
        * kwq/KWQButton.h:
        * kwq/KWQButton.mm:
        (QButton::click):

2003-11-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3475272 - custom property on CSSStyleObject won't hold a value

        * khtml/ecma/kjs_css.cpp:
        (DOMCSSStyleDeclaration::tryPut): If the property is not a css property,
	save it as a custom object property in the normal way.

2003-11-11  John Sullivan  <sullivan@apple.com>

        - fixed <rdar://problem/3480421>: Focus rings around links are too thick, 
        should use 3 px instead of 5 px

        Reviewed by Don and Ken.

        * khtml/css/html4.css:
        use 3px instead of 5 px for :active, :focus

2003-11-11  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

	In the DOM Level 3 Events specification, keydown and keyup are 
	standard events. We can remove the KHTML component in the names 
	of these constants. Note that the keypress event is still 
	nonstandard and will retain the KHTML name component.

        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::wasRunByUserGesture)
        * khtml/ecma/kjs_dom.cpp:
        (DOMNode::getValueProperty)
        (DOMNode::putValue)
        * khtml/ecma/kjs_window.cpp:
        (Window::get)
        (Window::put)
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::parseAttribute)
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::defaultEventHandler)
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::defaultEventHandler)
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::typeToId)
        (EventImpl::idToType)
        (KeyboardEventImpl::KeyboardEventImpl)
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::)

2003-11-11  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3480281>: drag image of selected text and images include broken images
	
        Reviewed by dave.

        * khtml/rendering/render_image.cpp:
        (RenderImage::paintObject): when drawing the drag image, don't draw the broken image

2003-11-11  Vicki Murley  <vicki@apple.com>

        Reviewed by sullivan.

	- rolled Merlot build fix onto the trunk

        * WebCorePrefix.h: added #include <sys/types.h>

2003-11-10  David Hyatt  <hyatt@apple.com>

	Fix for 3473531, text nested in hr inside h3 did not get the h3's style.
	
        Reviewed by darin

        * khtml/html/dtd.cpp:
        (DOM::checkChild):

2003-11-10  David Hyatt  <hyatt@apple.com>

	Fix for 3478435, <hr> tags should be centered by default.  Ditched the 1px margin as well.

	Fix for 3479441, <h1>-<h6> tags should *not* be centered by default.  They should also use bold instead of
	bolder.
	
        Reviewed by darin

        * khtml/css/html4.css:
        * khtml/html/html_blockimpl.cpp:
        (HTMLHRElementImpl::parseAttribute):
        * layout-tests/apple-only/base/bugzilla.mozilla.org/index-expected.txt:
        * layout-tests/apple-only/base/home.netscape.com/index-expected.txt:
        * layout-tests/apple-only/base/www.altavista.com/index-expected.txt:
        * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
        * layout-tests/apple-only/base/www.digitalcity.com/index-expected.txt:
        * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
        * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
        * layout-tests/apple-only/base/www.mapquest.com/index-expected.txt:
        * layout-tests/apple-only/base/www.microsoft.com/index-expected.txt:
        * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
        * layout-tests/apple-only/base/www.nytimes.com/index-expected.txt:
        * layout-tests/apple-only/base/www.nytimes.com_Table/index-expected.txt:
        * layout-tests/apple-only/base/www.quicken.com/index-expected.txt:
        * layout-tests/apple-only/base/www.w3.org_DOML2Core/index-expected.txt:
        * layout-tests/css1/basic/class_as_selector-expected.txt:
        * layout-tests/css1/basic/comments-expected.txt:
        * layout-tests/css1/basic/containment-expected.txt:
        * layout-tests/css1/basic/contextual_selectors-expected.txt:
        * layout-tests/css1/basic/grouping-expected.txt:
        * layout-tests/css1/basic/id_as_selector-expected.txt:
        * layout-tests/css1/basic/inheritance-expected.txt:
        * layout-tests/css1/box_properties/border-expected.txt:
        * layout-tests/css1/box_properties/border_bottom-expected.txt:
        * layout-tests/css1/box_properties/border_bottom_inline-expected.txt:
        * layout-tests/css1/box_properties/border_bottom_width-expected.txt:
        * layout-tests/css1/box_properties/border_bottom_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_color-expected.txt:
        * layout-tests/css1/box_properties/border_color_inline-expected.txt:
        * layout-tests/css1/box_properties/border_inline-expected.txt:
        * layout-tests/css1/box_properties/border_left-expected.txt:
        * layout-tests/css1/box_properties/border_left_inline-expected.txt:
        * layout-tests/css1/box_properties/border_left_width-expected.txt:
        * layout-tests/css1/box_properties/border_left_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_right-expected.txt:
        * layout-tests/css1/box_properties/border_right_inline-expected.txt:
        * layout-tests/css1/box_properties/border_right_width-expected.txt:
        * layout-tests/css1/box_properties/border_right_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_style-expected.txt:
        * layout-tests/css1/box_properties/border_style_inline-expected.txt:
        * layout-tests/css1/box_properties/border_top-expected.txt:
        * layout-tests/css1/box_properties/border_top_inline-expected.txt:
        * layout-tests/css1/box_properties/border_top_width-expected.txt:
        * layout-tests/css1/box_properties/border_top_width_inline-expected.txt:
        * layout-tests/css1/box_properties/border_width-expected.txt:
        * layout-tests/css1/box_properties/border_width_inline-expected.txt:
        * layout-tests/css1/box_properties/clear-expected.txt:
        * layout-tests/css1/box_properties/clear_float-expected.txt:
        * layout-tests/css1/box_properties/float-expected.txt:
        * layout-tests/css1/box_properties/float_elements_in_series-expected.txt:
        * layout-tests/css1/box_properties/float_margin-expected.txt:
        * layout-tests/css1/box_properties/float_on_text_elements-expected.txt:
        * layout-tests/css1/box_properties/height-expected.txt:
        * layout-tests/css1/box_properties/margin-expected.txt:
        * layout-tests/css1/box_properties/margin_bottom-expected.txt:
        * layout-tests/css1/box_properties/margin_bottom_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_left-expected.txt:
        * layout-tests/css1/box_properties/margin_left_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_right-expected.txt:
        * layout-tests/css1/box_properties/margin_right_inline-expected.txt:
        * layout-tests/css1/box_properties/margin_top-expected.txt:
        * layout-tests/css1/box_properties/margin_top_inline-expected.txt:
        * layout-tests/css1/box_properties/padding-expected.txt:
        * layout-tests/css1/box_properties/padding_bottom-expected.txt:
        * layout-tests/css1/box_properties/padding_bottom_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_left-expected.txt:
        * layout-tests/css1/box_properties/padding_left_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_right-expected.txt:
        * layout-tests/css1/box_properties/padding_right_inline-expected.txt:
        * layout-tests/css1/box_properties/padding_top-expected.txt:
        * layout-tests/css1/box_properties/padding_top_inline-expected.txt:
        * layout-tests/css1/box_properties/width-expected.txt:
        * layout-tests/css1/cascade/cascade_order-expected.txt:
        * layout-tests/css1/cascade/important-expected.txt:
        * layout-tests/css1/classification/display-expected.txt:
        * layout-tests/css1/classification/list_style-expected.txt:
        * layout-tests/css1/classification/list_style_image-expected.txt:
        * layout-tests/css1/classification/list_style_position-expected.txt:
        * layout-tests/css1/classification/list_style_type-expected.txt:
        * layout-tests/css1/classification/white_space-expected.txt:
        * layout-tests/css1/color_and_background/background-expected.txt:
        * layout-tests/css1/color_and_background/background_attachment-expected.txt:
        * layout-tests/css1/color_and_background/background_color-expected.txt:
        * layout-tests/css1/color_and_background/background_image-expected.txt:
        * layout-tests/css1/color_and_background/background_position-expected.txt:
        * layout-tests/css1/color_and_background/background_repeat-expected.txt:
        * layout-tests/css1/color_and_background/color-expected.txt:
        * layout-tests/css1/conformance/forward_compatible_parsing-expected.txt:
        * layout-tests/css1/font_properties/font-expected.txt:
        * layout-tests/css1/font_properties/font_family-expected.txt:
        * layout-tests/css1/font_properties/font_size-expected.txt:
        * layout-tests/css1/font_properties/font_style-expected.txt:
        * layout-tests/css1/font_properties/font_variant-expected.txt:
        * layout-tests/css1/font_properties/font_weight-expected.txt:
        * layout-tests/css1/formatting_model/canvas-expected.txt:
        * layout-tests/css1/formatting_model/floating_elements-expected.txt:
        * layout-tests/css1/formatting_model/height_of_lines-expected.txt:
        * layout-tests/css1/formatting_model/inline_elements-expected.txt:
        * layout-tests/css1/formatting_model/replaced_elements-expected.txt:
        * layout-tests/css1/formatting_model/vertical_formatting-expected.txt:
        * layout-tests/css1/pseudo/anchor-expected.txt:
        * layout-tests/css1/pseudo/firstletter-expected.txt:
        * layout-tests/css1/pseudo/firstline-expected.txt:
        * layout-tests/css1/pseudo/multiple_pseudo_elements-expected.txt:
        * layout-tests/css1/pseudo/pseudo_elements_in_selectors-expected.txt:
        * layout-tests/css1/text_properties/letter_spacing-expected.txt:
        * layout-tests/css1/text_properties/line_height-expected.txt:
        * layout-tests/css1/text_properties/text-transform-expected.txt:
        * layout-tests/css1/text_properties/text_align-expected.txt:
        * layout-tests/css1/text_properties/text_decoration-expected.txt:
        * layout-tests/css1/text_properties/text_indent-expected.txt:
        * layout-tests/css1/text_properties/text_transform-expected.txt:
        * layout-tests/css1/text_properties/vertical_align-expected.txt:
        * layout-tests/css1/text_properties/word_spacing-expected.txt:
        * layout-tests/css1/units/color_units-expected.txt:
        * layout-tests/css1/units/length_units-expected.txt:
        * layout-tests/css1/units/percentage_units-expected.txt:
        * layout-tests/css1/units/urls-expected.txt:
        * layout-tests/fast/encoding/utf-16-big-endian-expected.txt:
        * layout-tests/fast/encoding/utf-16-little-endian-expected.txt:

2003-11-10  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3479266>: selected images don't obey CSS3 selection background-color attribute
	
        Reviewed by dave.

        * khtml/rendering/render_image.cpp:
        (RenderImage::selectionTintColor): new, takes style into account
        (RenderImage::paintObject): use selectionTintColor
        * khtml/rendering/render_image.h:
        * kwq/KWQPainter.h: removed selectedImageTintColor
        * kwq/KWQPainter.mm:

2003-11-10  David Hyatt  <hyatt@apple.com>

	Fix for 3479287, macro-ize the handling of the CSS 'inherit' value.  This patch is preparation for
	adding support for the 'initial' value, which will be used to fix the CSS parser's shorthand parsing
	bugs.
	
        Reviewed by kocienda

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/khtmlview.cpp:
        (KHTMLView::layout):

2003-11-10  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3478883>: REGRESSION (113-114u): drag image for selected text includes unselected images
	<rdar://problem/3479204>: selected images don't look selected

        Reviewed by dave.

        * khtml/rendering/render_image.cpp:
        (RenderImage::RenderImage): init m_selectionState
        (RenderImage::paintObject): draw a tint over the image if selected, don't draw anything if not selected and the action is PaintActionSelection
        * khtml/rendering/render_image.h:
        (khtml::RenderImage::selectionState): new
        (khtml::RenderImage::setSelectionState): new
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::selectedImageTintColor): new

2003-11-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

	Fix for this bug:

	<rdar://problem/3477795>: REGRESSION: can't submit form without 
	submit button by hitting return (cocoadev.com)

	When I changed submitting forms using the return key in a text field
	to go through a search for the correct submit or image input 
	element to use when submitting, I neglected to cover the case of
	forms which have neither a submit or image input element. When
	I encounter a form such as this now, I submit it anyway after
	performing the submit or image input element and failing to find one.

        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::performSubmitClick)

2003-11-10  Richard Williamson   <rjw@apple.com>

	Fixed 3478765.  Use ICU to access unicode properties.
	Fixed 3478831.  Unicode property/conversion functions should be 32 bit savvy.

        Reviewed by Darin.

        * WebCore-combined.exp:
        * WebCore.exp:
        * kwq/KWQChar.mm:
        (QChar::lower):
        (QChar::upper):
        (QChar::mirroredChar):
        * kwq/KWQString.h:
        (QChar::direction):
        * kwq/WebCoreUnicode.cpp:
        * kwq/WebCoreUnicode.h:

2003-11-10  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3478781>: drag image of selected text and images doesn't include images

        Reviewed by rjw.

        * khtml/rendering/render_image.cpp:
        (RenderImage::paintObject): paint when the paint action is PaintActionSelection
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::paint): ditto

2003-11-10  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

	Fix for this bug:

	<rdar://problem/3477624>: REGRESSION (113): Using input method to 
	enter non-ascii text submits the form

	This regression has been in the tree for a couple of versions now, 
	since we improved the way key events are processed. The solution
	is to ask the text input manager if it has any marked text when
	the return key (or enter key) is pressed, because if it does, the key
	needs to work in the "accept" role for the input manager. Fixing
	in this way has the pleasant effect of making return/enter key
	behavior "do the right thing" based on context.

        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::defaultEventHandler): Add check to see
	if text input manager has marked text before submitting text
	and password fields. Broke out key handling for checkboxes and
	radios, since the old code for these widgets worked fine.
        * kwq/KWQLineEdit.h: Added hasMarkedText function.
        * kwq/KWQLineEdit.mm:
        (QLineEdit::hasMarkedText): Returns whether the current input
	manager has marked text or not.

2003-11-09  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3478173 -- REGRESSION (112-113): getElementById is failing for many types of elements

        The problem was that ElementImpl::attach was being skipped for many objects with classes
        derived from ElementImpl. By changing them all to call up to their base classes instead of
        skipping levels, the bug went away. This was possible (and easy to do) because of the
        rendererIsNeeded() change I made a while back.

        * khtml/html/html_baseimpl.cpp:
        (HTMLFrameElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
        and then calling NodeBaseImpl::attach(). This was a remnant of the old way of changing the logic
        about when to create the renderer, not needed now that we have rendererIsNeeded().
        (HTMLFrameSetElementImpl::attach): Ditto.
        (HTMLIFrameElementImpl::attach): Ditto.

        * khtml/html/html_formimpl.h: Removed many unused attach() overrides.
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::attach): Ditto.
        (HTMLButtonElementImpl::attach): Removed, because now the base class's attach does the right thing.
        (HTMLFieldSetElementImpl::attach): Ditto.
        (HTMLInputElementImpl::attach): Removed explicit createRendererIfNeeded call, not needed now that
        HTMLGenericFormElementImpl calls through to its base class.
        (HTMLLegendElementImpl::attach): Removed, because now the base class's attach does the right thing.
        (HTMLSelectElementImpl::attach): Ditto.
        (HTMLTextAreaElementImpl::attach): Ditto.

        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
        and then calling NodeBaseImpl::attach().
        (HTMLImageElementImpl::detach): Call base class's detach() instead of NodeBaseImpl::detach(). No
        need to skip the ElementImpl::detach() function, and important not to for the new "id" optimization.

        * khtml/html/html_inlineimpl.h: Removed HTMLBRElementImpl::attach override.
        * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach): Call base class's attach() instead
        of creating renderer explicitly and then calling NodeBaseImpl::attach().

        * khtml/html/html_objectimpl.h: Removed HTMLAppletElementImpl::attach override.
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::attach): Removed, because the base class's attach does the right thing.
        (HTMLEmbedElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
        and then calling NodeBaseImpl::attach().
        (HTMLObjectElementImpl::attach): Ditto.

2003-11-09  David Hyatt  <hyatt@apple.com>

	Fix for 3478317, letter/word-spacing don't inherit properly through italic/bold elements.
	
        Reviewed by darin

        * khtml/rendering/font.h:
        (khtml::Font::Font):
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::setFontDef):

2003-11-09  David Hyatt  <hyatt@apple.com>

	Fix for 3478309, make sure backgrounds paint in the border box and not just in the padding box.
	
        Reviewed by darin

	Also making sure that <frame>s aren't transparent, since other browsers seem to only make <iframe>s/<object>s
	be transparent.
	
        * khtml/rendering/render_box.cpp:
        (RenderBox::paintRootBoxDecorations):
        (RenderBox::paintBackgroundExtended):

2003-11-08  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3478025 -- links with non-Latin-1 characters in the hostname are not getting IDN-encoded

        * kwq/KWQKURL.mm:
        (KURL::parse): Changed existing code to take advantage of the fact that a NUL character
        is classified as a path segment end character.
        (KURL::findHostnameInHierarchicalURL): Don't treat NUL characters as terminating characters
        for hostnames, because QChar::latin1() turns all non-Latin-1 characters into NUL characters.

2003-11-08  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3477509 -- REGRESSION (112-113): crash in KHTMLPart::processObjectRequest at espn.com, chosun.com

        * khtml/khtml_part.cpp: (KHTMLPart::processObjectRequest): Use a dynamic_cast to check the type of the
        part rather than assuming it's always a KHTMLPart. The crash was caused by casting a KWQPluginPart to
        KHTMLPart.

2003-11-08  Darin Adler  <darin@apple.com>

        Reviewed by Richard.

        - event cleanup motivated by questions on khtml-devel

        * khtml/dom/dom2_events.h: Removed eventModuleName.
        * khtml/dom/dom2_events.cpp: Removed eventModuleName.

        * khtml/xml/dom2_eventsimpl.h: Removed eventModuleName, made many trivially simple
        functions inline, made virtual functions no longer inline. Also made some functions const.
        (DOM::EventImpl::propagationStopped): Made this non-virtual; there was no reason for
        it to be virtual I could see.
        (DOM::EventImpl::defaultPrevented): Ditto.
        (DOM::EventImpl::setDefaultHandled): Ditto.
        (DOM::UIEventImpl::view): Made this inline.
        (DOM::UIEventImpl::detail): Ditto.
        (DOM::MouseEventImpl::screenX): Ditto.
        (DOM::MouseEventImpl::screenY): Ditto.
        (DOM::MouseEventImpl::clientX): Ditto.
        (DOM::MouseEventImpl::clientY): Ditto.
        (DOM::MouseEventImpl::layerX): Ditto.
        (DOM::MouseEventImpl::layerY): Ditto.
        (DOM::MouseEventImpl::ctrlKey): Ditto.
        (DOM::MouseEventImpl::shiftKey): Ditto.
        (DOM::MouseEventImpl::altKey): Ditto.
        (DOM::MouseEventImpl::metaKey): Ditto.
        (DOM::MouseEventImpl::button): Ditto.
        (DOM::MouseEventImpl::relatedTarget): Ditto.
        (DOM::MutationEventImpl::relatedNode): Ditto.
        (DOM::MutationEventImpl::prevValue): Ditto.
        (DOM::MutationEventImpl::newValue): Ditto.
        (DOM::MutationEventImpl::attrName): Ditto.
        (DOM::MutationEventImpl::attrChange): Ditto.

        * khtml/ecma/kjs_events.cpp: (KJS::getDOMEvent): Changed implementation to no longer
        require eventModuleName(), and removed some unneeded casts.

        * khtml/xml/dom2_eventsimpl.cpp: Made lots of functions inline.
        (EventImpl::isUIEvent): Since this is virtual, make it no longer inline.
        (EventImpl::isMouseEvent): Ditto.
        (EventImpl::isMutationEvent): Ditto.
        (EventImpl::isKeyboardEvent): Ditto.
        (UIEventImpl::isUIEvent): Ditto.
        (MouseEventImpl::isMouseEvent): Ditto.
        (KeyboardEventImpl::isKeyboardEvent): Ditto.
        (MutationEventImpl::isMutationEvent): Ditto.

2003-11-07  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3020196>: links with href="" don't show hand cursor when you mouse over them

        Reviewed by darin.

        * khtml/khtmlview.cpp:
        (KHTMLView::viewportMouseMoveEvent): check if the URL on the event is non-NULL, not if it is non-empty

2003-11-07  Richard Williamson   <rjw@apple.com>

	Fixed 3477067.  Use our case unicode conversion routines.

        Reviewed by Ken.

        * kwq/KWQChar.mm:
        (QChar::lower):
        (QChar::upper):

2003-11-06  David Hyatt  <hyatt@apple.com>

	Fixes for 3476717, inline blocks should expand to encompass floats; 3476718, inline blocks should not
	collapse margins with children; and 3476721, run-ins and compacts can flow into anonymous blocks, even
	ones that they caused to be created by failing to run in/compact in the first place.
	
        Reviewed by darin (inline block fixes only).

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        (khtml::RenderBlock::layoutBlockChildren):

2003-11-06  Richard Williamson   <rjw@apple.com>

	Fixed 3476563.  Remove unnecessary call to set view position after load completes.
 
        Reviewed by Gramps.

        * khtml/khtml_part.cpp:
        (KHTMLPart::checkCompleted):

2003-11-06  Chris Blumenberg  <cblu@apple.com>

        * khtml/rendering/render_image.h:
        (khtml::RenderImage::isDisplayingError): forgot to remove the "virtual" part of the declaration

2003-11-06  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3275118>: Dragging from missing-image link stretches missing-image icon to size of missing image
	<rdar://problem/3476225>: assert dragging non-existant images

        Reviewed by rjw.

        * khtml/rendering/render_image.h:
        (khtml::RenderImage::isDisplayingError): new method, returns true for the broken image
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]): only provide info if there is an image and the image is not broken

2003-11-06  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Richard

	Fixes for these bugs:

	<rdar://problem/3476006>: Form file input widgets do not scroll 
	to view when focused

	<rdar://problem/3476007>: Form file input widgets should only 
	focus when full keyboard access is on

        * kwq/KWQFileButton.h: Added focusPolicy declaration.
        * kwq/KWQFileButton.mm:
        (KWQFileButton::focusPolicy): Added. Now works like other buttons.
	Fixes 3476007.
        (KWQFileButton::focusChanged): Added. Code similar to text area
	widgets. Fixes 3476006.

2003-11-06  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3308609>: 6L60 Safari URL links with line-endings converted to hex by contextual menu

        Reviewed by rjw.

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge elementAtPoint:]): use parseURL to go from an attribute string to a URL string

=== Safari-113 ===

2003-11-06  John Sullivan  <sullivan@apple.com>

        - fixed broken build

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::completeURL):
        removed stray character

2003-11-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3475366 - 4.5% of time spent making html event listeners on slow intel page.

	6% speedup on intel page, 1% speedup on cvs-base PLT.
	
        * khtml/ecma/kjs_events.cpp:
        (JSEventListener::JSEventListener): Don't add self to hashtable if imp is null (which
	can now happen in the lazy listener case).
        (JSEventListener::~JSEventListener): Ditto on removing.
        (JSEventListener::listenerObj): Made this virtual.
        (JSLazyEventListener::JSLazyEventListener): New constructor.
	(JSLazyEventListener::handleEvent): call parseCode, then
	superclass if it appeared to succeed.
        (JSLazyEventListener::listenerObj): call parseCode, then superclass.
        (JSLazyEventListener::parseCode):
        (KJS::getNodeEventListener): Check for null listenerObjImp in case of
	lazy listener that failed to parse.
        * khtml/ecma/kjs_dom.cpp:
	(DOMNode::getListener): Ditto.
        * khtml/ecma/kjs_html.cpp:
        (Image::getValueProperty): Ditto.
        * khtml/ecma/kjs_events.h:
	(KJS::JSEventListener::listenerObjImp): call listenerObj() virtual
	method and get imp from the result.
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::createHTMLEventHandler): Don't parse the code here, make a lazy
	listener.
        * khtml/ecma/kjs_window.cpp:
        (Window::getJSLazyEventListener): make a new JSLazyEventListener - no need
	to check the listeners hashtable cause a brand new lazy listener won't have
	a function anyway.
        * khtml/ecma/kjs_window.h: Prototype new method.

2003-11-06  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3475397 - REGRESSION: relative URLs on page load test sometimes contain garbage, leading to missing images
	
        * kwq/KWQKURL.mm:
        (KURL::KURL): When constructing from NSURL, null-terminate the raw
	bytes since KURL::parse expects a null-terminated C string. It
	might be even better to pass a length to parse, but this fix is
	simple and does the job.

2003-11-05  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3475109 -- support keyboard event object properties of altkey, ctrlKey, shiftKey

        We had the DOM Level 3 KeyboardEvent class already; I just had to add JavaScript bindings.

        * khtml/ecma/kjs_events.h: Added DOMKeyboardEvent class.
        * khtml/ecma/kjs_events.cpp:
        (KJS::getDOMEvent): Added code to make a DOMKeyboardEvent if the event is a DOM::KeyboardEvent.
        (DOMKeyboardEvent::~DOMKeyboardEvent): Added.
        (DOMKeyboardEvent::classInfo): Added.
        (DOMKeyboardEvent::tryGet): Added.
        (DOMKeyboardEvent::getValueProperty): Added.
        (DOMKeyboardEventProtoFunc::tryCall): Added.

        * khtml/dom/dom2_events.cpp:
        (KeyboardEvent::keyIdentifier): Added.
        (KeyboardEvent::keyLocation): Added.

        * khtml/ecma/kjs_events.lut.h: Regenerated.

2003-11-05  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3475092 - Notifying the bridge about duplicate images takes 13% of time on intel page

	Another 15% speedup on the intel page.

	This also results in a 3% speedup on cvs-base PLT! (or maybe that was my last change)
	
        * kwq/KWQLoader.mm:
        (KWQServeRequest): Note that we told the bridge about the load.
        (KWQCheckCacheObjectStatus): Don't tell the bridge about the load
	if we have alrady; if we do tell it, then note it down.
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::didTellBridgeAboutLoad): Helper method for the above.
        (KWQKHTMLPart::haveToldBridgeAboutLoad): Ditto.
        (KWQKHTMLPart::clear): Clear our idea of what URLs we told the bridge about.
        * khtml/khtml_part.h: make clear() virtual.

2003-11-05  Darin Adler  <darin@apple.com>

        * WebCore-combined.exp: Checked in generated file.

2003-11-05  Richard Williamson   <rjw@apple.com>

	Fixed 3474957.  Changed name of image rendering method to better reflect it's actual function.

	- (void)beginAnimationInRect:(NSRect)ir fromRect:(NSRect)fr;

	renamed to

	- (void)drawImageInRect:(NSRect)ir fromRect:(NSRect)fr;

        Reviewed by Chris.

        * kwq/KWQPainter.mm:
        (QPainter::drawPixmap):
        * kwq/WebCoreImageRenderer.h:

2003-11-05  Darin Adler  <darin@apple.com>

        * WebCore-tests.exp: Added missing symbol so tests will link.

2003-11-05  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	- fixed 3474756 - Creating HTML event listeners takes 5% of time on particular slow intel page
	
        * khtml/ecma/kjs_window.h: Make jsEventListeners a hashtable keyed
	by listener object, not a list.
        * khtml/ecma/kjs_window.cpp:
        (Window::getJSEventListener): Do hashtable lookup for existing listener instead of
	walking list.
        * khtml/ecma/kjs_events.cpp:
        (JSEventListener::JSEventListener): Use hashtable insert instead of list append.
        (JSEventListener::~JSEventListener): Use hashtable remove instead of list removeRef.

2003-11-05  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3473872 -- encode domain names for IDN when creating URLs inside WebCore

        * kwq/KWQKURL.h: Added KWQIntegerPair type, a number of private functions.
        * kwq/KWQKURL.mm:
        (isSchemeFirstChar): Make inline function from macro.
        (isSchemeChar): Make inline function from macro.
        (isUserInfoChar): Make inline function from macro.
        (isHostnameChar): Make inline function from macro.
        (isIPv6Char): Make inline function from macro.
        (isPathSegmentEndChar): Make inline function from macro.
        (isBadChar): Make inline function from macro.
        (isHexDigit): Make inline function from macro.
        (KURL::KURL): Remove unneeded initializations of m_isValid, since parse sets it.
        Use CFURLGetBytes in one place a FIXME asked for it. Changed non-ASCII case to use
        a separate function instead of code in line.
        (KURL::encodeHostnames): Added. Finds host names and encodes them.
        (KURL::findHostnameInHierarchicalURL): Added. Finds host name in a hierarchical URL.
        (KURL::encodeHostname): Added. Encodes one host name.
        (KURL::findHostnamesInMailToURL): Added. Finds host names in a mailto URL.

        * kwq/KWQString.h: Added new overloads for startsWith.
        * kwq/KWQString.mm:
        (compareIgnoringCaseForASCIIOnly): Moved these functions up in the file so they can be
        used by more methods of QString.
        (QString::startsWith): Added new overloads.

        * WebCore.pbproj/project.pbxproj: Add libicucore.A.dylib library.

2003-11-05  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3473906 - getElementById takes about 44% of time on particular slow intel page

	I fixed this by adding a per-document id --> element hash
	table. This speeds up my local copy of the intel page by 60% (50
	sec to 20 sec!) and does not cause any PLT slowdown.
	
        * khtml/xml/dom_docimpl.h: New QDict field for id to element hash table.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::getElementById): Just look it up in the newly
	added hash table.
        (DocumentImpl::addElementById): New method. Add to hash table if
	no other element is set for that key (this lets the first element
	of several with matching ids win).
        (DocumentImpl::removeElementById): New method. Remove from hash
	table only if the key and value both match.

	These Element changes to keep the id --> element hashtable working
	seem needlessly tricky, due to lack of bottlenecks in attribute
	changing.
	
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::updateId): New method that removes element from
	hash table for old it
        (ElementImpl::setAttribute): If setting id, call updateId.
        (ElementImpl::setAttributeMap): If either the old or the new map
	includes id, call updateId.
        (ElementImpl::attach): If we have an id, call updateId to set it
	after attaching.
        (ElementImpl::detach): Newly added. If we have an id, call
	updateId to clear it before detaching.
	(NamedAttrMapImpl::setNamedItem): If the name is id, call updateId on
	our element.
        (NamedAttrMapImpl::removeNamedItem): If the name is id, call updateId on
	our element.
        (NamedAttrMapImpl::operator=): If old or new contents include id attribute,
	call updateId on our element.
	* khtml/xml/dom_elementimpl.h: Prototype new methods.

2003-11-05  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

	Fix for these bugs:

	<rdar://problem/3467558>: Cannot tab to form file input widgets
	<rdar://problem/3473631>: WebFileButton sends notifications to communicate with WebCore

	Tabbing now works for these widgets. While I was in the neighborhood,
	I improved the communication mechanism between the WebKit and WebCore
	sides of the file button implementation, replacing notifications
	with a callback object.

        * WebCore-combined.exp: Remove no-longer used WebCoreFileButtonClicked
    	and WebCoreFileButtonFilenameChanged notofication strings.
        * WebCore.exp: Ditto.
        * kwq/KWQFileButton.h: Changed declarations to match changes in
        callback functions.
        * kwq/KWQFileButton.mm:
        (KWQFileButton::KWQFileButton): Now sets the view after creating
        the delegate object.
        (KWQFileButton::filenameChanged): Now takes a QString argument
        which indicates the filename.
        (KWQFileButton::focusChanged): New function. Sends DOM focus and
        blur events.
        (-[KWQFileButtonAdapter initWithKWQFileButton:]): No longer needs
        to register for notifications.
        (-[KWQFileButtonAdapter dealloc]): No longer needs to remove itself
        from the notification center.
        (-[KWQFileButtonAdapter filenameChanged:]): No longer a notification
        callback. Now a WebCoreFileButtonCallback callback.
        (-[KWQFileButtonAdapter focusChanged:]): New WebCoreFileButtonCallback
        callback.
        (-[KWQFileButtonAdapter clicked]): No longer a notification
        callback. Now a WebCoreFileButtonCallback callback.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrame): Unrelated cleanup.
        * kwq/WebCoreBridge.h: Declared new WebCoreFileButtonDelegate protocol.

2003-11-05  Maciej Stachowiak  <mjs@apple.com>

	- fixed deployment build
	
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fileWrapperForElement):

2003-11-04  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

        * khtml/ecma/kjs_window.cpp: Don't make event read-only, some
	sites want to set their own top-level function named "event" and
	will hang if they can't.
        * khtml/ecma/kjs_window.lut.h: Regenerated.

2003-11-03  David Hyatt  <hyatt@apple.com>

	Fix for 3472167, for shrink-to-fit style printing, grow the width of the initial containing block
	to be as large as the rightmost position after doing a layout to the page width.
	
        Reviewed by john

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::forceLayoutForPageWidth):

2003-11-04  Chris Blumenberg  <cblu@apple.com>

	Fixed:
	<rdar://problem/3472403>: RTFD of copied text and images should use original image data not tiffs

        Reviewed by john.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fileWrapperForElement): call [_bridge _fileWrapperForURL:] to get cached data
        * kwq/WebCoreBridge.h: added _fileWrapperForURL: to the bridge protocol
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge selectedAttributedString]): call the instance method attributedString 
        (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): call the instance method attributedString 

2003-11-04  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Chris.

        - fixed 3472893 - Slow intel page takes 20% of its time in CachedObject::ref
        
	Speeds up loading of
	http://www.intel.com/cd/ids/developer/asmo-na/eng/index.htm by
	19%, no slowdown on PLT.
	
        * khtml/misc/loader.h: Use QPtrDict for m_clients instead of QPtrList.
	* khtml/misc/loader.cpp:
        (CachedObjectClientWalker::CachedObjectClientWalker): Ditto.
        (CachedObject::ref): Ditto.
        * kwq/KWQPtrDict.h:
        (QPtrDict::isEmpty): Implemented.

2003-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3370085 - new frames with javascript: URLs should be populated with the result of the JavaScript code
	
        * ChangeLog:
        * khtml/html/html_baseimpl.cpp:
        (HTMLFrameElementImpl::updateForNewURL): Skip special filtering of
	javascript:.
        (HTMLFrameElementImpl::attach): Ditto.
        * khtml/khtml_part.cpp:
        (KHTMLPart::replaceContentsWithScriptResult): New method to execute
	script and if the result is a string, set it as the new document contents.
	(KHTMLPart::requestFrame): Removed APPLE_CHANGES around
	javascript: handling. Use new
	replaceContentsWithScriptResult method. This executes the
	JS in the new child frame, not the parent frame, as in other
	browsers.
        * khtml/khtml_part.h: Prototype new method.
        * kwq/KWQKHTMLPartBrowserExtension.mm:
        (KHTMLPartBrowserExtension::openURLRequest): Use new part method.

2003-11-03  Vicki Murley  <vicki@apple.com>

        Reviewed by kocienda.

	- fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.

        * WebCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles

2003-11-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Maciej

	Fix for this bug:

	<rdar://problem/3470338>: onclick is not executing when you hit enter on focused links

	Now when we trap return or enter when a link is focused, we send
	a click event to the node.

        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::defaultEventHandler): Swallow key event when 
	return or enter and send a mouse event.
        (HTMLAnchorElementImpl::performClick): New function to send simulated
	click.
        * khtml/html/html_inlineimpl.h: Declare performClick function.

2003-11-03  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3392543 -- incorrect base writing direction in RTL form controls
        - fixed baseline for list box <select> elements
        - moved style code from updateFromElement to setStyle

        * khtml/rendering/render_form.h: Added setStyle function to RenderFormElement, RenderLineEdit,
        RenderSelect, and RenderTextArea. Removed some unused stuff.
        * khtml/rendering/render_form.cpp:
        (RenderFormElement::setStyle): Set the font based on the style.
        (RenderFormElement::updateFromElement): Remove font setting code; moved to setStyle.
        Also ifdef'd out the color-setting code, which belongs in setStyle and is irrelevant
        for KWQ anyway.
        (RenderSubmitButton::setStyle): Set the writing direction based on the style.
        (RenderSubmitButton::updateFromElement): Tiny code cleanup, using a local variable.
        (RenderLineEdit::setStyle): Set the alignment and writing direction based on the style.
        (RenderLineEdit::updateFromElement): Remove alignment setting code; moved to setStyle.
        (RenderFileButton::RenderFileButton): Remove code to set m_focus, a data member that was
        never used.
        (RenderSelect::setWidgetWritingDirection): Added. Helper function.
        (RenderSelect::setStyle): Call setWidgetWritingDirection.
        (RenderSelect::updateFromElement): Call setWidgetWritingDirection if a new widget is created.
        (RenderSelect::baselinePosition): Added a FIXME comment.
        (RenderTextArea::setStyle): Set the alignment and writing direction based on the style.
        (RenderTextArea::updateFromElement): Remove alignment setting code; moved to setStyle.

        * kwq/KWQButton.h: Added setWritingDirection function.
        * kwq/KWQButton.mm:
        (+[KWQButton cellClass]): Use KWQButtonCell.
        (-[KWQButtonCell baseWritingDirection:]): Return base writing direction.
        (-[KWQButtonCell setBaseWritingDirection:]): Store base writing direction.
        (-[KWQButtonCell _textAttributes]): Set the base writing direction in the paragraph
        style if it's not already right.
        (QButton::setWritingDirection): Call setBaseWritingDirection: on the cell and do
        setNeedsDisplay: as needed.

        * kwq/KWQComboBox.h: Added setWritingDirection function.
        * kwq/KWQComboBox.mm:
        (QComboBox::setWritingDirection): Call setBaseWritingDirection: on the cell and do
        setNeedsDisplay: as needed.
        (-[KWQPopUpButtonCell setBaseWritingDirection:]): Store base writing direction.
        (-[KWQPopUpButtonCell baseWritingDirection:]): Return base writing direction.
        (-[KWQPopUpButtonCell _textAttributes]): Set the base writing direction in the
        paragraph style if it's not already right.

        * kwq/KWQLineEdit.h: Added setWritingDirection function.
        * kwq/KWQLineEdit.mm:
        (QLineEdit::setAlignment): Tweaked to match new setWritingDirection in style.
        (QLineEdit::setWritingDirection): Call setBaseWritingDirection: on the KWQTextField.

        * kwq/KWQTextField.h: Added setBaseWritingDirection method.
        * kwq/KWQTextField.mm:
        (-[KWQTextField setPasswordMode:]): Set the base writing direction of the secure field's
        cell based on the base writing direction of the parent field's cell, when creating the
        secure field.
        (-[KWQTextField setBaseWritingDirection:]): Added. Sets the base writing direction of
        the field's cell and the secure field's cell, if it exists, and does setNeedsDisplay
        as needed.
        (-[KWQTextFieldCell setBaseWritingDirection:]): Added. Stores the base writing direction.
        (-[KWQTextFieldCell baseWritingDirection]): Added. Returns the base writing direction.
        (-[KWQTextFieldCell _textAttributes]): Set the base writing direction in the paragraph
        style if it's not already right.
        (-[KWQSecureTextFieldCell setBaseWritingDirection:]): Added. Stores the base writing
        direction.
        (-[KWQSecureTextFieldCell _textAttributes]): Set the base writing direction in the
        paragraph style if it's not already right.

        * kwq/KWQListBox.h: Added itemIsGroupLabel and setWritingDirection functions, and made
        the private insertItem function take a QString instead of an NSObject.
        (QListBox::insertItem): Changed parameter from unsigned to int to match Qt, and made it
        use an inlne to call the private insertItem function shared with insertGroupLabel.
        (QListBox::insertGroupLabel): Changed parameter from unsigned to int and made it use an
        inline to call the private insertItem function.
        * kwq/KWQListBox.mm:
        (itemFont): Added. Returns a suitable font for individual items.
        (groupLabelFont): Added. Returns a suitable font for group labels.
        (paragraphStyle): Added. Returns a suitable paragraph style for a given writing direction.
        (stringAttributes): Added. Returns a string attributes dictionary for a given writing direction for
        either individual items or group labels.
        (QListBox::insertItem): Use an attributed string to give the item the appropriate font and
        writing direction, calling stringAttributes to get the attributes dictionary, and getting
        the writing direction from the table view.
        (QListBox::endBatchInsert): Tweak for consistency with other nearby methods.
        (QListBox::setSelected): Add an assertion and tweak a bit.
        (QListBox::isSelected): Add an assertion and tweak a bit.
        (QListBox::setWritingDirection): Update the styles for all the attributed strings and call
        reloadData if the writing direction changes. Also store the direction in the table view.
        (QListBox::itemIsGroupLabel): Added. Returns true if a given item is a group label; works
        by checking the font in the attributed string.
        (-[KWQTableView initWithListBox:items:]): Use itemFont() instead of computing the font.
        (-[KWQTableView tableView:shouldSelectRow:]): Use itemIsGroupLabel function instead of
        checking for NSString vs. NSttributedString in the items array; we now use attributed
        strings for all the items.
        (-[KWQTableView setBaseWritingDirection:]): Added. Stores a base writing direction.
        (-[KWQTableView baseWritingDirection]): Added. Returns the stored base writing direction.

        * kwq/KWQTextEdit.h: Added setWritingDirection function.
        * kwq/KWQTextEdit.mm:
        (QTextEdit::setAlignment): Removed code to set base writing direction.
        (QTextEdit::setWritingDirection): Added. Sets base writing direction.

        * kwq/KWQTextArea.mm: (-[KWQTextArea setBaseWritingDirection:]): Call setNeedsDisplay:YES.

2003-11-03  David Hyatt  <hyatt@apple.com>

	Fix 3472200, media tests fail to parse correctly.  Merging a patch to handle exotic media types
	from the KHTML trunk.

        * khtml/css/parser.cpp:
        * khtml/css/parser.y:

2003-11-03  David Hyatt  <hyatt@apple.com>

	Fix for 3471314, make sure to check the outline phase before painting backgrounds of iframes.
	
        Reviewed by mjs

        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::paint):

2003-11-03  David Hyatt  <hyatt@apple.com>

	Fix for 3470855, links with script action stay focused when clicking.

	Fix for 3470858, clicking and dragging a link and then releasing doesn't clear the glow ring.

	Fix for 3472090, link should not be mouse focusable.
	
        Reviewed by mjs

        * khtml/css/html4.css:
        * khtml/html/html_inlineimpl.h:
        (DOM::HTMLAnchorElementImpl::isMouseFocusable):

2003-11-03  David Hyatt  <hyatt@apple.com>

	Fix for 3472030, line-height not properly reset in all cases when the font shorthand is used.
	
        Reviewed by mjs

        * khtml/css/cssparser.cpp:
        (CSSParser::parseFont):

2003-11-03  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3472023 - REGRESSION: assertion on layout tests
	
        * kwq/KWQTextCodec.mm:
        (KWQTextDecoder::convertUTF16): Remove assert that length is not
	0, since we can get zero length now when flushing.

2003-11-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

	Fix for this bug:

	<rdar://problem/3260780>: hitting return in a text field submits 
	form without running onclick handler for submit button

        * khtml/html/html_formimpl.cpp:
        (HTMLFormElementImpl::performSubmitClick): Refactored this function to
	be more generic, so that text fields can use it, too.
        (HTMLInputElementImpl::defaultEventHandler): Removed code to check
	for a submit button, and merged this code into new performSubmitClick.
        (HTMLSelectElementImpl::defaultEventHandler): Ditto.
        * khtml/html/html_formimpl.h: Removed declaration for simulateButtonClickForEvent.
	Added declaration for performSubmitClick.
        * khtml/rendering/render_form.cpp:
        (RenderLineEdit::slotReturnPressed): Now calls performSubmitClick rather
	than prepareSubmit on the form. This is the key piece for the bug fix.

2003-11-03  Ken Kocienda  <kocienda@apple.com>

        Reviewed by John

        Fix for this bug:

        <rdar://problem/3470342>: focus rings are shown for links in
        web pages even in non-frontmost windows

        * kwq/KWQKHTMLPart.h: Add setShowsFirstResponder, showsFirstResponder functions and
        _showsFirstResponder member variable.
        (KWQKHTMLPart::showsFirstResponder): Added.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::KWQKHTMLPart): Initialize _showsFirstResponder to true
        (KWQKHTMLPart::setShowsFirstResponder): Sets whether the painter draws focus rings.
        * kwq/KWQPainter.h: Add _drawsFocusRing member variable.
        (QPainter::setDrawsFocusRing): Sets whether the painter draws focus rings.
        * kwq/KWQPainter.mm:
        (QPainter::QPainter): Initialize _drawsFocusRing to true.
        (QPainter::initFocusRing): Check _drawsFocusRing flag. Return if set to false.
        (QPainter::addFocusRingRect): Ditto.
        (QPainter::drawFocusRing): Ditto.
        * kwq/WebCoreBridge.h: Add setShowsFirstResponder method.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge drawRect:]): Sets the value for _drawsFocusRing on the
	painter using _showsFirstResponder value from the part.
        (-[WebCoreBridge setShowsFirstResponder:]): Set passed in value on the part.
	Redraw the focus ring if flag has changed.

2003-11-03  David Hyatt  <hyatt@apple.com>

	Remove unneeded style property additions for form controls.  In the KHTML trunk these moved into the UA
	sheet, but we don't even need them there, since we don't honor any of them.

        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::attach):
        (HTMLSelectElementImpl::attach):
        (HTMLTextAreaElementImpl::attach):

2003-11-03  David Hyatt  <hyatt@apple.com>

	Patch from KHTML trunk.  Move frameset positioning reset into adjustRenderStyle so as not to
	pollute the render tree.

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::adjustRenderStyle):
        * khtml/rendering/render_box.cpp:
        (RenderBox::setStyle):

2003-11-03  David Hyatt  <hyatt@apple.com>

	Fix for 3471609, 'transparent' should be an acceptable named color value instead of a special
	keyword used only by background/border.
	
        Reviewed by kocienda

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssstyleselector.cpp:
        (khtml::):
        (khtml::CSSStyleSelector::applyRule):
        * khtml/css/cssvalues.c:
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/rendering/render_box.cpp:
        (RenderBox::paintBackgroundExtended):
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):
        * khtml/rendering/render_style.h:
        (khtml::BorderValue::BorderValue):
        (khtml::BorderValue::isTransparent):
        (khtml::BorderValue::operator==):
        (khtml::CollapsedBorderValue::isTransparent):
        (khtml::RenderStyle::setBorderLeftColor):
        (khtml::RenderStyle::setBorderRightColor):
        (khtml::RenderStyle::setBorderTopColor):
        (khtml::RenderStyle::setBorderBottomColor):

2003-11-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3471226 - HTML document that's less than 16 bytes comes out blank
	
        * kwq/KWQTextCodec.mm:
        (KWQTextDecoder::toUnicode): When flushing, don't bail out early
	if there are no new characters!

2003-11-02  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- don't resolve Null href or src attributes, since the distinction
	between empty and absent attribute is important.

        * khtml/dom/html_base.cpp:
        (HTMLIFrameElement::src):
        * khtml/dom/html_form.cpp:
        (HTMLInputElement::src):
        * khtml/dom/html_head.cpp:
        (HTMLBaseElement::href):
        (HTMLLinkElement::href):
        (HTMLScriptElement::src):
        * khtml/dom/html_image.cpp:
        (HTMLAreaElement::href):
        (HTMLImageElement::src):
        * khtml/dom/html_inline.cpp:
        (HTMLAnchorElement::href):

2003-11-01  David Hyatt  <hyatt@apple.com>

	Fix for 3468924, an implementation of outline-offset.  We also give :focus links a built-in offset of 
	outline-width/2  by default for the Apple Aqua style.

	Fix for 3470660, input type=image excluded from tab order.
	
        Reviewed by darin

        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/css/html4.css:
        * khtml/rendering/render_box.cpp:
        (RenderBox::getAbsoluteRepaintRect):
        (RenderBox::computeAbsoluteRepaintRect):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::getAbsoluteRepaintRect):
        * khtml/rendering/render_inline.cpp:
        (RenderInline::paintFocusRing):
        (RenderInline::paintOutlines):
        (RenderInline::paintOutline):
        * khtml/rendering/render_object.cpp:
        (RenderObject::paintOutline):
        * khtml/rendering/render_style.h:
        (khtml::OutlineValue::OutlineValue):
        (khtml::RenderStyle::outlineSize):
        (khtml::RenderStyle::outlineOffset):
        (khtml::RenderStyle::setOutlineOffset):
        * khtml/rendering/render_text.cpp:
        (RenderText::paintObject):
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainterPrivate::QPainterPrivate):
        (QPainter::initFocusRing):
        (QPainter::addFocusRingRect):

2003-11-01  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3469262 - REGRESSION (110-112): logitech page is very slow to load (due to style sheet updates?)
	
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchGenericEvent): Don't do default handling for
	events that don't bubble. Not 100% sure why this caused the big
	slowdown but it was a somewhat arbitrary change in my earlier
	patch.

2003-11-01  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3468870 -- REGRESSION (108-109): cannot upload files (<input type=file> is broken)

        * kwq/KWQFileButton.mm: (KWQFileButton::filenameChanged): Pass the filename to
        the textChanged signal. The one without a parameter is a different signal.

2003-11-01  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3466714 -- page with <object> tag with text subtype and no URL causes hang

        * khtml/khtml_part.cpp: (KHTMLPart::requestObject): Added a check so that an empty
        URL string doesn't get completed, and results in an empty KURL object. Also made the
        change to allow empty URLs unconditional, because I don't think it's a WebCore-specific
        thing on further reflection.

2003-10-31  David Hyatt  <hyatt@apple.com>

	Fix for 3470489, I just forgot to commit a piece of my patch.  This has actually even
	been reviewed by ken already.

	Reviewed by kocienda
	
        * khtml/rendering/render_replaced.cpp:
        (RenderWidget::eventFilter):

2003-10-31  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3457875 -- text disappears from fields in forms upon certain types of scrolling

        * kwq/KWQTextField.mm: (-[KWQTextField control:textShouldBeginEditing:]):
        Call releaseGState on the field editor and its clip view to prevent undesirable caching.

2003-10-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

	Fix for this bug:

	<rdar://problem/3440719>: Read-only text field form controls 
	do not keyboard focus and do not take part in tabbing

        * kwq/KWQTextField.mm:
        (-[KWQTextField acceptsFirstResponder]): We want our text fields
        to accept first responder even if not editable.

	Once this is fixed, this one comes along for free:

	<rdar://problem/3440710>: Read-only textarea form controls should select all text when focused

2003-10-31  Darin Adler  <darin@apple.com>

        Reviewed by Ken.

        - fixed 3469383 -- REGRESSION (100-111): if one line is selected on this page, too much gets copied (plain text)

        * khtml/khtml_part.cpp: (KHTMLPart::text): Range check the child node indices before using them
        to get at a child node. We don't want to set startNode or endNode to nil in any case. If the end
        node is set to nil, we end up copying the entire remainder of the page.

2003-10-31  David Hyatt  <hyatt@apple.com>

	Fix for 3470007, links don't get focus on mouse down.  Fix the focus check on mouse down to actually
	crawl up the content tree in order to find the nearest enclosing focusable node.  Also clean up and
	fix checks that improperly blurred the link after it got focused.

	Fix for 3450335, AppKit widgets not obeying their desired focus policies.  I renamed isSelectable to
	isFocusable and then also added isMouseFocusable and isKeyboardFocusable methods.
	
        Reviewed by kocienda

        * khtml/css/html4.css:
        * khtml/html/html_baseimpl.cpp:
        (HTMLFrameElementImpl::isFocusable):
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::isFocusable):
        (HTMLGenericFormElementImpl::isKeyboardFocusable):
        (HTMLGenericFormElementImpl::isMouseFocusable):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isFocusable):
        * khtml/html/html_inlineimpl.h:
        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::nextFocusNode):
        (DocumentImpl::previousFocusNode):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::isFocusable):
        (NodeImpl::isKeyboardFocusable):
        (NodeImpl::isMouseFocusable):
        * khtml/xml/dom_nodeimpl.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::khtmlMousePressEvent):

2003-10-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by David

	Fix for this bug:

	<rdar://problem/3470233>: solid outlines drawing incorrectly

	The problem was that when I collected the array of line boxes for
	render inlines, I put a QRect() at the start and the end of the list.
	However, the border calculation code expected "invalid" rectangles
	(rects with 0 for all four dimentions) in the first and last
	positions, and the default constructor for QRect makes rects with 1,1
	for width/height.

        * khtml/rendering/render_inline.cpp:
        (RenderInline::paintOutlines)

2003-10-31  Darin Adler  <darin@apple.com>

        Reviewed by Dave.

        - fixed 3464759 -- REGRESSION (100-107): Pressing on link loses mouse-down feedback almost instantly

        * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Pass true for the "read-only"
        flag in prepareMoveEvent to prevent us from updating :hover and :active while the mouse is down.

2003-10-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by David

	<rdar://problem/3468910>: REGRESSION: other than focus rings, outlines styles are broken

	Outlines now draw like they used to.

        * khtml/rendering/render_inline.cpp:
        (RenderInline::paintObject): Now branches to call focus ring or "regular" outlines.
        (RenderInline::paintFocusRing): Broke out drawing aqua focus rings into its
	own function.
        (RenderInline::paintOutlines): New function to draw "regular outlines.
        (RenderInline::paintOutline): Removed code which special-cased aqua outlines.
        * khtml/rendering/render_inline.h: Added paintOutlines declaration.

2003-10-31  David Hyatt  <hyatt@apple.com>

	Fix for 3467419, highlighted text in "search in books" Amazon feature is obscured.  The
	site is using the CSS3 opacity property.  The CSS3 Color module is far enough along now
	that opacity can safely be used without the "-khtml-" in front of it.

	Fix for 3466542, the minimum font size bug.  I am introducing a new minimum font size pref that
	really is a hard override.
	
        Reviewed by gramps (opacity) and john (min font size)
	
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):

2003-10-31  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Darin

	Fix for this bug:

	<rdar://problem/3469088>: focus not removed from text link 
	when user hits cmd-L or clicks in window chrome

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge deselectAll]): Now clears the focus ring as well.
        (-[WebCoreBridge deselectText]): Just clears text selection.

2003-10-31  David Hyatt  <hyatt@apple.com>

	Three simple fixes:
	
	(1) Fix for 3463777, crash on CSS3 box model draft.  This was just a situation where a simple null-check
	was needed for generated content.

	(2) Added a != check when the old and new hover obj are the same to avoid a little bit of extra work.

	(3) Removed the m_pressed member from DOM nodes and removed the calls to setPressed, since this code
	is dead and not used by anyone.
	
        * khtml/khtmlview.cpp:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::addChild):
        (RenderLayer::updateHoverActiveState):
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::NodeImpl):
        * khtml/xml/dom_nodeimpl.h:
        (DOM::NodeImpl::hasStyle):
        (DOM::NodeImpl::setHasStyle):

2003-10-30  David Hyatt  <hyatt@apple.com>

	Fix for 3469330, the Marquee data in RenderStyle needs a copy constructor hack like all the other
	objects do.

        * khtml/rendering/render_style.cpp:
        (direction):
        * khtml/rendering/render_style.h:

2003-10-30  David Hyatt  <hyatt@apple.com>

	Fix for 3469206, images didn't paint outlines any more.  They were bailing early because I forgot to
	add a check for my new PaintAction.
	
        Reviewed by darin

        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::paint):

2003-10-30  David Hyatt  <hyatt@apple.com>

	Fixes for 3469057, outlines not drawn on aintitcool.com and also for 3469178, objects with width/height of 0
	incorrectly excluded from tabbing.
	
        Reviewed by darin

        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::isSelectable):
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isSelectable):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::getAbsoluteRepaintRect):
        * khtml/rendering/render_inline.cpp:
        (RenderInline::addFocusRingRects):
        (RenderInline::paintOutline):
        * khtml/rendering/render_object.cpp:
        (RenderObject::addFocusRingRects):
        (RenderObject::getAbsoluteRepaintRectWithOutline):

2003-10-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3426081 - empty cells HTMLCollection for <tr>
	- fixed 3367598 - "length" attribute for table row "cells" always returns 0
	
        * khtml/dom/html_table.cpp:
        (HTMLTableRowElement::cells): TR_CELLS, not TABLE_ROWS.

2003-10-30  David Hyatt  <hyatt@apple.com>

	Fix for 3468916, outline needs its own paint action so that focus rings don't draw under other content.
	
        Reviewed by kocienda

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintObject):
        (khtml::RenderBlock::paintFloats):
        * khtml/rendering/render_image.cpp:
        (RenderImage::paintObject):
        * khtml/rendering/render_inline.cpp:
        (RenderInline::paintObject):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::paintLayer):
        * khtml/rendering/render_object.h:

2003-10-30  Maciej Stachowiak  <mjs@apple.com>

	Fixed Dave's fix to my fix to my fix:

        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::width): Put back m_render check, consider
	the case of image with no width/height attributes and display:none
	set. We don't want to crash on that.
        (HTMLImageElementImpl::height): Ditto.

2003-10-30  Ken Kocienda  <kocienda@apple.com>

        Reviewed by Hyatt

	Support for tabbing to links.

	Fixes these bugs

	<rdar://problem/3468395>: fix full keyboard access loop for buttons
	<rdar://problem/3468397>: paint aqua focus rings around text links
	<rdar://problem/3468406>: focused links do not activate by hitting
	   return key
	<rdar://problem/3468410>: paintTextOutline in RenderText objects
	   should be done at a higher level
	<rdar://problem/3468424>: improve function to determine if a node is
	   tab selectable
	<rdar://problem/3468427>: add bridge function to access active
	   document view for a node
	<rdar://problem/3468429>: links do not scroll into view when focusing
	<rdar://problem/3468435>: when tabbing out of a frame, last focused
	   node is not cleared if it is a text link
	<rdar://problem/3468436>: focus on text link does not clear when
	   clicking mouse in document body
	<rdar://problem/3468440>: add setRect convenience to QRect
	<rdar://problem/3468444>: elements paint their outlines even if they
	   are not visible
	<rdar://problem/3468448>: setting focus on a node sets focus on all
	   its siblings
	<rdar://problem/3468456>: cannot tab to form image input elements
	<rdar://problem/3468461>: tab focus can seem to disappear from view on
	   pages with dhtml menus
	<rdar://problem/3469021>: webcore bridge nextKeyView always starts 
	from the beginning of the document

        * WebCore-combined.exp: Export WebCoreGraphicsBridge class
        * WebCore.exp: Ditto
        * WebCore.pbproj/project.pbxproj: Add WebCoreGraphicsBridge class
        * khtml/css/cssparser.cpp: 
        (CSSParser::parseValue): border style check now take apple aqua
	style into account
        * khtml/css/cssvalues.in: Add -apple-aqua border value
        * khtml/css/html4.css: Change focus, a:link:active, and a:visited:active
	to use new -apple-aqua focus rings.
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::isSelectable): Improve function so
	that invisible elements are no longer considered selectable
        * khtml/html/html_inlineimpl.cpp:
        (HTMLAnchorElementImpl::isSelectable): Ditto.
        (HTMLAnchorElementImpl::defaultEventHandler): Make return key
	activate links as well as Enter.
        * khtml/html/html_inlineimpl.h: Move isSelectable function into
	implementation file.
        * khtml/rendering/render_block.cpp: 
        (khtml::RenderBlock::paintObject): Do not paint outlines if
	content is invisible.
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::getAbsoluteRepaintRect): Improve function to correctly
	calculate repaint rects including outlines.
        * khtml/rendering/render_image.cpp:
        (RenderImage::paintObject): Do not paint outlines if
        content is invisible.
        * khtml/rendering/render_inline.cpp:
        (RenderInline::paintObject): Ditto.
        (RenderInline::addFocusRingRects): New function to gather up rects
	to use for painting outlines.
        (RenderInline::paintOutline): Added code to paint aqua focus rings.
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::drawBorder): Add case for apple aqua border style.
        (RenderObject::addFocusRingRects): New function to gather up rects
        to use for painting outlines.
        (RenderObject::paintOutline): Added code to paint aqua focus rings.
        (RenderObject::getAbsoluteRepaintRectWithOutline): Helper function
	to calculate rectangle to use for repainting when an object has an
	outline.
        * khtml/rendering/render_object.h: Add addFocusRingRects declaration.
        * khtml/rendering/render_style.h: Add APPLEAQUA to border enum
        * khtml/rendering/render_text.cpp:
        (RenderText::paintObject): Removed code to draw outlines.
        * khtml/rendering/render_text.h: Ditto.
        * khtml/xml/dom_elementimpl.cpp: Removed redundant isSelectable check.
        * khtml/xml/dom_elementimpl.h: Ditto.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::isSelectable): Added.
        (NodeBaseImpl::setFocus): Do not set focus on siblings.
        * khtml/xml/dom_nodeimpl.h: Moved implementation to .cpp file.
        * kwq/KWQButton.mm:
        (-[KWQButton nextKeyView]): Send a blur before going to next
	key view. This prevents focus from being lost altogether.
        (-[KWQButton previousKeyView]): Ditto.
        * kwq/KWQKHTMLPart.h: Added documentViewForNode function.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::nextKeyViewInFrame): Add check for other focusables,
	like text links.
        (KWQKHTMLPart::nextKeyViewInFrameHierarchy): Remove focus when leaving
	a view.
        (KWQKHTMLPart::documentViewForNode): Added.
        (KWQKHTMLPart::khtmlMousePressEvent): Remove focus when you click in
	a non-focusable area, like the document body.
        * kwq/KWQPainter.h: Added declarations.
        * kwq/KWQPainter.mm:
        (QPainterPrivate::QPainterPrivate): Modified constructor for new fields.
        (QPainter::initFocusRing): Added.
        (QPainter::addFocusRingRect): Added.
        (QPainter::drawFocusRing): Added.
        (QPainter::clearFocusRing): Added.
        * kwq/KWQRect.h:
        (QRect::setRect): Added.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge nextKeyView]): Start from the currently-focused node,
	if there is one, not unconditionally from the start of the document.
        (-[WebCoreBridge previousKeyView]): Ditto
        * kwq/WebCoreGraphicsBridge.h: Added.
        * kwq/WebCoreGraphicsBridge.m: Added.
        (+[WebCoreGraphicsBridge sharedBridge]): Added.
        (-[WebCoreGraphicsBridge init]): Added.
        (-[WebCoreGraphicsBridge setFocusRingStyle:radius:color:]): Added.

2003-10-30  Maciej Stachowiak  <mjs@apple.com>

	Fix mistake in my last change that I did not mean to commit.

        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::width): Remove extraneous second attempt to
	lay out.

2003-10-30  David Hyatt  <hyatt@apple.com>

	Put paged-media changes back without the wrongful removal of the style data copy constructors (which
	were necessary after all).
	
        * ChangeLog:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/rendering/render_style.cpp:
        (StyleInheritedData::StyleInheritedData):
        (StyleInheritedData::operator==):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::NonInheritedFlags::operator==):
        (khtml::RenderStyle::setBitDefaults):
        (khtml::RenderStyle::widows):
        (khtml::RenderStyle::orphans):
        (khtml::RenderStyle::pageBreakInside):
        (khtml::RenderStyle::pageBreakBefore):
        (khtml::RenderStyle::pageBreakAfter):
        (khtml::RenderStyle::setWidows):
        (khtml::RenderStyle::setOrphans):
        (khtml::RenderStyle::setPageBreakInside):
        (khtml::RenderStyle::setPageBreakBefore):
        (khtml::RenderStyle::setPageBreakAfter):

2003-10-30  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- fixed 3468129 - REGRESSION: FOUC occurs on Surfin' Safari
	
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::getValueProperty): Don't force layout for image
	width/height if you can determine it statically from the attribute.
        * khtml/html/html_image.cpp:
        (HTMLImageElementImpl::width):
        (HTMLImageElementImpl::height):

=== Safari-112 ===

2003-10-30  Ken Kocienda  <kocienda@apple.com>

	Rolling out this code since it caused a big performance 
	regression.

	2003-10-29  David Hyatt  <hyatt@apple.com>

		Add the paged media properties to RenderStyle.  
		They aren't used yet, but they should now be
		parsed and interpreted correctly.

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/rendering/render_style.cpp:
        (StyleSurroundData::StyleSurroundData):
        (StyleBoxData::StyleBoxData):
        (StyleBoxData::operator==):
        (StyleVisualData::~StyleVisualData):
        (StyleVisualData::StyleVisualData):
        (StyleBackgroundData::StyleBackgroundData):
        (StyleFlexibleBoxData::StyleFlexibleBoxData):
        (opacity):
        (textShadow):
        (StyleInheritedData::StyleInheritedData):
        (StyleInheritedData::~StyleInheritedData):
        (StyleInheritedData::operator==):
        * khtml/rendering/render_style.h:
        (khtml::StyleBackgroundData::~StyleBackgroundData):
        (khtml::StyleFlexibleBoxData::~StyleFlexibleBoxData):
        (khtml::RenderStyle::NonInheritedFlags::operator==):
        (khtml::RenderStyle::setBitDefaults):

2003-10-29  David Hyatt  <hyatt@apple.com>

	Fix for 3466628, widgets in overflow blocks don't move when the overflow block is scrolled.  This
	was a regression caused by my change to move widgets only during layout and not at paint time.  The
	problem with this is that scrolling an overflow block doesn't do a layout, just a repaint.  I patched
	the layer code to update widget positions on an overflow block scroll.

	This then exposed a bug in absolutePosition, namely that the scroll offset was never factored in when
	computing absolutePosition.  This bug also explains why text selection and cursor display were wrong
	inside scrolled overflow blocks.
	
        Reviewed by mjs

        * khtml/rendering/render_box.cpp:
        (RenderBox::absolutePosition):
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::scrollToOffset):
        * khtml/rendering/render_object.cpp:
        (RenderObject::absolutePosition):
        * khtml/rendering/render_text.cpp:
        (RenderText::cursorPos):
        (RenderText::posOfChar):
        * khtml/rendering/render_text.h:

2003-10-29  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave.

	- fixed 3467499 - REGRESSION: onClick handlers on links don't work (bubbling broken)
	
        * khtml/xml/dom2_eventsimpl.cpp:
        (EventImpl::EventImpl): Initialize m_cancelBubble (duh).

2003-10-29  David Hyatt  <hyatt@apple.com>

	Fix for 3466802.  When breaking on a newline, "pre" is determined by checking the actual object that
	the line broke on, and not by simply checking the "pre" status of the containing block.
	
        Reviewed by mjs

        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::layoutInlineChildren):

2003-10-29  David Hyatt  <hyatt@apple.com>

	Add the paged media properties to RenderStyle.  They aren't used yet, but they should now be 
	parsed and interpreted correctly.
	
        Reviewed by kocienda

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/rendering/render_style.cpp:
        (StyleBoxData::operator==):
        (StyleFlexibleBoxData::StyleFlexibleBoxData):
        (:opacity):
        (:textShadow):
        (StyleInheritedData::StyleInheritedData):
        (StyleInheritedData::operator==):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::NonInheritedFlags::operator==):
        (khtml::RenderStyle::setBitDefaults):
        (khtml::RenderStyle::widows):
        (khtml::RenderStyle::orphans):
        (khtml::RenderStyle::pageBreakInside):
        (khtml::RenderStyle::pageBreakBefore):
        (khtml::RenderStyle::pageBreakAfter):
        (khtml::RenderStyle::setWidows):
        (khtml::RenderStyle::setOrphans):
        (khtml::RenderStyle::setPageBreakInside):
        (khtml::RenderStyle::setPageBreakBefore):
        (khtml::RenderStyle::setPageBreakAfter):

2003-10-29  David Hyatt  <hyatt@apple.com>

        Reviewed by NOBODY (OOPS!).

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyRule):
        * khtml/rendering/render_style.cpp:
        (StyleBoxData::operator==):
        (StyleFlexibleBoxData::StyleFlexibleBoxData):
        (:opacity):
        (:textShadow):
        (StyleInheritedData::StyleInheritedData):
        (StyleInheritedData::operator==):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::NonInheritedFlags::operator==):
        (khtml::RenderStyle::setBitDefaults):
        (khtml::RenderStyle::widows):
        (khtml::RenderStyle::orphans):
        (khtml::RenderStyle::pageBreakInside):
        (khtml::RenderStyle::pageBreakBefore):
        (khtml::RenderStyle::pageBreakAfter):
        (khtml::RenderStyle::setWidows):
        (khtml::RenderStyle::setOrphans):
        (khtml::RenderStyle::setPageBreakInside):
        (khtml::RenderStyle::setPageBreakBefore):
        (khtml::RenderStyle::setPageBreakAfter):

2003-10-29  David Hyatt  <hyatt@apple.com>

	Refine the fix to updateLayout.
	updateStyleSelector would get called over and over again when you queried for layout properties from
	JS.  If no stylesheets are pending, this isn't necessary (and is quite expensive, since updateStyleSelector
	is a slow function).
	
        Reviewed by darin

        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::updateLayout):

2003-10-29  David Hyatt  <hyatt@apple.com>

	Fix crasher in border collapsing code.
	
        Reviewed by kocienda

        * khtml/rendering/render_table.cpp:
        (RenderTable::cellRight):

2003-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3163842 - Citibank cardmember central DHTML menus not working right in Safari
	
        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLElement::getValueProperty): update layout before fetching image properties
	that need it.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl): Initialize m_ignorePendingStylesheets to false.
        (DocumentImpl::updateLayout): Ignore pending stylesheets - when JS demands a
	layout, it wants a real one now.
        (DocumentImpl::updateStyleSelector): Go ahead with the update if we're ignoring
	pending stylesheets.
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::haveStylesheetsLoaded): Pretend stylesheets have loaded if
	we're temporarily ignoring pending stylesheets.

2003-10-29  David Hyatt  <hyatt@apple.com>

	Implement support for <marquee>.  This includes support for the CSS3 specification (although modified a fair
	bit to actually be compatible with WinIE's version and to correct obvious errors in the draft).  All of the
	marquee behaviors (slide, scroll, and alternate) are supported.

	This patch also fixes the following bugs that were discovered while testing marquee:
	(1) An error in the computation of scrollWidth and scrollHeight.  
	(2) The ability to ask for the leftmostPosition as well as the rightmostPosition of content and to
	be able to ask for the positions of children (via left/right/lowest) without including the parent in the
	computation.
	(3) An optimization to RenderFlow's rightmost/lowestPosition functions to avoid examining text elements since
	they are always fully accounted for by either overflow or by inline flow boxes.
	(4) A fix for RTL rendering.  A block with direction:RTL was being placed on the right, when in reality only
	its children should be placed on the right.
	(5) A fix to prevent inline blocks and tables from computing auto margins (making them just like floats in this
	regard).
	
        Reviewed by darin

        * khtml/css/cssparser.cpp:
        (validUnit):
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::convertToLength):
        (khtml::CSSStyleSelector::applyRule):
        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/css/html4.css:
        * khtml/html/html_blockimpl.cpp:
        (HTMLMarqueeElementImpl::HTMLMarqueeElementImpl):
        (HTMLMarqueeElementImpl::id):
        (HTMLMarqueeElementImpl::parseAttribute):
        * khtml/html/html_blockimpl.h:
        (DOM::HTMLMarqueeElementImpl::minimumDelay):
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::getElement):
        * khtml/misc/htmlattrs.c:
        (hash_attr):
        (findAttr):
        * khtml/misc/htmlattrs.h:
        * khtml/misc/htmlattrs.in:
        * khtml/rendering/bidi.cpp:
        (khtml::RenderBlock::findNextLineBreak):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::lowestPosition):
        (khtml::RenderBlock::rightmostPosition):
        (khtml::RenderBlock::leftmostPosition):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_box.cpp:
        (RenderBox::setStyle):
        (RenderBox::calcWidth):
        (RenderBox::calcHorizontalMargins):
        (RenderBox::lowestPosition):
        (RenderBox::rightmostPosition):
        (RenderBox::leftmostPosition):
        * khtml/rendering/render_box.h:
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::lowestPosition):
        (RenderFlow::rightmostPosition):
        (RenderFlow::leftmostPosition):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_layer.cpp:
        (RenderLayer::RenderLayer):
        (RenderLayer::~RenderLayer):
        (RenderLayer::updateLayerPositions):
        (RenderLayer::scrollToOffset):
        (RenderLayer::computeScrollDimensions):
        (RenderLayer::styleChanged):
        (RenderLayer::stopMarquees):
        (m_whiteSpace):
        (Marquee::marqueeSpeed):
        (Marquee::direction):
        (Marquee::isHorizontal):
        (Marquee::computePosition):
        (Marquee::start):
        (Marquee::stop):
        (Marquee::updateMarqueePosition):
        (Marquee::updateMarqueeStyle):
        (Marquee::timerEvent):
        * khtml/rendering/render_layer.h:
        (khtml::):
        (khtml::RenderLayer::marquee):
        * khtml/rendering/render_object.cpp:
        (RenderObject::isHTMLMarquee):
        (RenderObject::sizesToMaxWidth):
        * khtml/rendering/render_object.h:
        (khtml::RenderObject::lowestPosition):
        (khtml::RenderObject::rightmostPosition):
        (khtml::RenderObject::leftmostPosition):
        * khtml/rendering/render_style.cpp:
        (StyleMarqueeData::StyleMarqueeData):
        (StyleMarqueeData::operator==):
        (opacity):
        (marquee):
        (StyleCSS3NonInheritedData::operator==):
        (RenderStyle::RenderStyle):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::StyleMarqueeData::operator!=):
        (khtml::RenderStyle::marqueeIncrement):
        (khtml::RenderStyle::marqueeSpeed):
        (khtml::RenderStyle::marqueeLoopCount):
        (khtml::RenderStyle::marqueeBehavior):
        (khtml::RenderStyle::marqueeDirection):
        (khtml::RenderStyle::setMarqueeIncrement):
        (khtml::RenderStyle::setMarqueeSpeed):
        (khtml::RenderStyle::setMarqueeDirection):
        (khtml::RenderStyle::setMarqueeBehavior):
        (khtml::RenderStyle::setMarqueeLoopCount):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::createHTMLElement):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::clearTimers):

2003-10-29  David Hyatt  <hyatt@apple.com>

	Make <button> be an inline-block.
	
        * khtml/css/html4.css:

2003-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	 - fixed 3465547 - REGRESSION (100-111)?: window.prompt does not work
	
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::runJavaScriptPrompt): Return the result properly
	instead of always returning false.

2003-10-28  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3465504 -- REGRESSION (100-111): text areas with Chinese text in them are wider than ones without

        * kwq/KWQTextArea.h: Add _font field.
        * kwq/KWQTextArea.mm:
        (-[KWQTextArea dealloc]): Release _font.
        (-[KWQTextArea setFont:]): Store font in _font as well as setting it in the text view.
        (-[KWQTextArea sizeWithColumns:rows:]): Use _font rather than asking the text view for the font.

2003-10-28  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3464702 -- node.item(x) is not implemented (dynamic menus not filled out at techcu.com)

        * khtml/ecma/kjs_dom.cpp: (DOMNodeProtoFunc::tryCall): Add implementation of item function.
        * khtml/ecma/kjs_dom.h: Added Item to the enum.
        * khtml/ecma/kjs_dom.lut.h: Regenerated.

2003-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave,

	- fixed 3379725 - for <a> elements with both onclick and href, Web Kit's behavior does not match other browsers

	The fix for this was to make cancelBubble only prevent bubbling,
	but not stop propagation or prevent default. While I was at it, I
	made returnValue work right too.
	
        * khtml/ecma/kjs_events.cpp:
        (DOMEvent::getValueProperty): Implement cancelBubble and returnValue properties properly.
        (DOMEvent::putValue): Ditto.
        * khtml/dom/dom2_events.cpp:
        (Event::setCancelBubble): Call impl.
        (Event::setDefaultPrevented): Ditto.
        (Event::getCancelBubble): Ditto.
        (Event::defaultPrevented): Ditto.
        * khtml/dom/dom2_events.h:
        * khtml/xml/dom2_eventsimpl.h:
        (DOM::EventImpl::propagationStopped): Made this a const method.
        (DOM::EventImpl::defaultPrevented): Ditto.
        (DOM::EventImpl::setCancelBubble): Implemented by setting a new field.
        (DOM::EventImpl::getCancelBubble): Corresponding getter.
        (DOM::EventImpl::setDefaultPrevented): Set the already existing field for this.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::dispatchGenericEvent): Check getCancelBubble() when bubbling. Do not
	check bubbles() before default handling.

2003-10-28  Chris Blumenberg  <cblu@apple.com>

	Fixed: <rdar://problem/3464472>: REGRESSION: New CSS cursor support breaks style="cursor:default

        Reviewed by dave.

        * kwq/KWQWidget.mm:
        (QWidget::cursor): break after we hit a view that responds to documentCursor as we do in setCursor. Without breaking we were returning the cursor of the most super HTML view which is not what we want.

2003-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3421393 - window.open does not handle non-integral height/width (small window at saabusa.com)
	
        * khtml/ecma/kjs_window.cpp:
        (WindowFunc::tryCall): Parse width, height, top and left as
	floating point and then cast to int instead of parsing as int to
	match other browsers and avoid rejecting floating point numbers.

2003-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3464528 - addEventListener does not work for buttons, text areas, or inputs

        * khtml/rendering/render_form.cpp:
        (RenderFormElement::slotClicked): Send CLICK_EVENT as well as one
	of KHTML_CLICK_EVENT or KHTML_DOUBLE_CLICK_EVENT.

2003-10-28  Maciej Stachowiak  <mjs@apple.com>

        Fixed broken build.

        * kwq/KWQKPartsPart.mm:
        (KParts::ReadOnlyPart::setName): It's a ReadOnlyPart method, not a Part method.

2003-10-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	- fixed 3427046 - href and src attributes don't always give resolved URL

	It turns out that all href and src attributes should be resolved
	against the base, except for frame elements.
	
        * khtml/dom/html_base.cpp:
        (HTMLIFrameElement::src): Resolve against base URL.
        * khtml/dom/html_form.cpp:
        (HTMLInputElement::src): Resolve URL even when empty. Remove
	comment questioning resolution against base - it's definitely
	right.
        * khtml/dom/html_head.cpp:
        (HTMLBaseElement::href): Resolve against base URL.
        (HTMLLinkElement::href): Ditto.
        (HTMLScriptElement::src): Ditto.
        * khtml/dom/html_image.cpp:
        (HTMLAreaElement::href): Ditto.
	(HTMLImageElement::src): Resolve URL even when empty. Remove
	comment questioning resolution against base - it's definitely
	right.
        * khtml/dom/html_inline.cpp:
        (HTMLAnchorElement::href): Resolve against base URL.

2003-10-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- fixed 3083264 - frame names changed by JavaScript are not reflected in WebFrame at the WebKit level
	
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::setName): Make sure the name is unique. Then tell
	the bridge and the superclass about it.
        * kwq/KWQKPartsPart.h:
        (KParts::ReadOnlyPart::setName): Made this method virtual.
        * kwq/KWQKPartsPart.m: Added. Moved implementations of virtual methods here.
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge setName:]): Call the superclass method to avid
	sending the name pointlessly back across the bridge.

2003-10-28  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed 3465063 -- REGRESSION (107-108): hang when fetching a page with an ad in a subframe (theage.com.au)

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::openURL): Follow the parent chain properly rather
        than repeatedly getting the part's own parent!

2003-10-27  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	Improved exception blocking in the following ways:

	- use C+constructors and destructors so returning or breaking out of an exception block works
	- Remove use of volatile
	- Collapse the caught exception case into a single function call to reduce code size.

        * WebCore.pbproj/project.pbxproj:
        * kwq/KWQButton.mm:
        * kwq/KWQCheckBox.mm:
        * kwq/KWQComboBox.mm:
        * kwq/KWQExceptions.h:
        * kwq/KWQExceptions.mm: Added.
        * kwq/KWQFileButton.mm:
        * kwq/KWQFont.mm:
        * kwq/KWQFrame.mm:
        * kwq/KWQKConfigBase.mm:
        * kwq/KWQKCookieJar.mm:
        * kwq/KWQKCursor.mm:
        * kwq/KWQKHTMLPart.mm:
        * kwq/KWQKHTMLPartBrowserExtension.mm:
        * kwq/KWQKHistoryProvider.mm:
        * kwq/KWQKJavaAppletWidget.mm:
        * kwq/KWQKJobClasses.mm:
        * kwq/KWQKLocale.mm:
        * kwq/KWQKPartsBrowserInterface.mm:
        * kwq/KWQLineEdit.mm:
        * kwq/KWQListBox.mm:
        * kwq/KWQLoader.mm:
        * kwq/KWQPainter.mm:
        * kwq/KWQPushButton.mm:
        * kwq/KWQRadioButton.mm:
        * kwq/KWQScrollBar.mm:
        * kwq/KWQScrollView.mm:
        * kwq/KWQTextEdit.mm:
        * kwq/KWQWidget.mm:
        
2003-10-26  Darin Adler  <darin@apple.com>

        * khtml/khtml_part.cpp: (findWordBoundary): Fix small mistake from NULL check-in earlier.

2003-10-26  Darin Adler  <darin@apple.com>

        * kwq/KWQLoader.mm: (KWQResponseMIMEType): Removed an excess volatile.

2003-10-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3463624 -- page at cinemakorea.com shows up blank due to kTECBufferBelowMinimumSizeErr from TEC

        * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC): To work around the bug
        I found in the decoder (Radar 3351093), change kTECBufferBelowMinimumSizeErr to
        kTECOutputBufferFullStatus in cases where bytes were actually converted.

2003-10-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3463586 -- WebCore does not compile with new definition of NULL

        * khtml/khtml_part.cpp: (findWordBoundary): Changed NULL to 0 and did a little code
        cleanup of the surrounding code.
        * khtml/rendering/break_lines.cpp: (khtml::isBreakable): Changed NULL to 0 and did
        a tiny bit of cleanup.

        * WebCorePrefix.h: Add a definition of NULL here that takes advantage of the GNU
        __null feature even if the system C library doesn't.

2003-10-26  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed 3457831 -- REGRESSION: copying particular text and pasting (plain) produces lots of extra text

        * khtml/khtml_part.cpp: (KHTMLPart::text): Check for the end node when following a
        link to the parent node, not just when following a link to the next child node.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::attributedString): Ditto.

== Rolled over to ChangeLog-2003-10-25 ==ite
