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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	Fixed <rdar://problem/3903749> REGRESSION (8A321): WebKit gets incorrect glyph metrics due to change in how AppKit uses CGFont

	Use CGFontRef direction when both getting font metrics and drawing
	glyphs, instead on depending on [NSFont set].

        Reviewed by John.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (getUncachedWidth):
        (_drawGlyphs):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	Fixed: <rdar://problem/3907381> NSURLConnection and WebKit buffer 2 copies of incoming data

        Reviewed by darin.

        * WebView.subproj/WebBaseResourceHandleDelegate.h:
        * WebView.subproj/WebBaseResourceHandleDelegate.m:
        (+[WebBaseResourceHandleDelegate initialize]): cache check to see if Foundation supports access to its buffered data
        (-[WebBaseResourceHandleDelegate addData:]): don't buffer data if Foundation is buffering it for us
        (-[WebBaseResourceHandleDelegate saveResource]): when creating a WebResource, pass NO for copyData since we know it won't be mutated
        (-[WebBaseResourceHandleDelegate resourceData]): return the buffered data from the connection if it supports it
        (-[WebBaseResourceHandleDelegate willStopBufferingData:]): make a mutable copy of the data from NSURLConnection so we can continue buffering
        (-[WebBaseResourceHandleDelegate willCacheResponse:]): removed optimization that used the cached response data to save the resource since that is obsolete by this change
        (-[WebBaseResourceHandleDelegate connection:willStopBufferingData:]): new callback from NSURLConnection, informs us that NSURLConnection has given up buffering
        * WebView.subproj/WebDataSource.m:
        (-[WebDataSource _receivedData:]): removed buffering code since that's done by NSURLConnection and the main client
        (-[WebDataSource _setData:]): removed unnecessary cast since the resourceData ivar is now an NSData instead of NSMutableData
        (-[WebDataSource data]): return resourceData ivar, else return the resourceData from the main client
        * WebView.subproj/WebDataSourcePrivate.h:
        * WebView.subproj/WebMainResourceClient.m:
        (-[WebMainResourceClient releaseResources]): store resourceData on the data source so it can continue to have data after the main client has gone away
        (-[WebMainResourceClient connection:didReceiveData:lengthReceived:]):don't call [dataSource data] just to get the length of data received since [dataSource data] can now cause data to be copied
        (-[WebMainResourceClient connectionDidFinishLoading:]): ditto
        * WebView.subproj/WebResource.m:
        (-[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:]): call following method with YES for copyData
        (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:copyData:]): new initializer, allows caller to choose whether or not the data is copied
        * WebView.subproj/WebResourcePrivate.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bump version number to 173.1.  We're doing a dot submission today for <rdar://problem/3903749>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	Forgot to commit copied header.

        * DOM.subproj/DOMPrivate.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add table test to cover the document.write line layout bug.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
	Use the AppKit's font rendering mode.  This fixes 3905347, but we still need to track down
	and resolve why metrics have changed for Courier.  This may be caused by changes in
	AppKit for 3902394.

        Reviewed by John.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (_AppkitGetCGRenderingMode):
        (getUncachedWidth):
        (_drawGlyphs):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@8147 268f45cc-cd09-0410-ab3c-d52691b4dbfc