Reviewed by Dave.
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-12-09  John Sullivan  <sullivan@apple.com>
2
3         Reviewed by Dave.
4         
5         - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
6
7         * kwq/KWQAccObject.mm:
8         (-[KWQAccObject title]): moved image alt tag code out of here
9         (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
10         (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
11         that ordinary elements return; this means that ordinary elements that aren't images will return
12         a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
13         work here.
14         (-[KWQAccObject accessibilityAttributeValue:]):
15         call accessibilityDescription when asked for AXDescription
16
17 2004-12-09  Ken Kocienda  <kocienda@apple.com>
18
19         Reviewed by Harrison
20
21         Fix for this bug:
22         
23         <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
24
25         * khtml/editing/htmlediting.cpp:
26         (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
27         been deleted. If this is the case, set the destination to the node the delete command provides in
28         its ending selection.
29
30 === Safari-175 ===
31
32 2004-12-09  Ken Kocienda  <kocienda@apple.com>
33
34         Reviewed by John
35         
36         Fix for this bug:
37         
38         <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
39
40         The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
41         callback may not be delivered before the program asks for the dimensions of an image in order to
42         wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
43         layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
44
45         * kwq/KWQRenderTreeDebug.cpp:
46         (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
47         (externalRepresentation): Sets debuggingRenderTree flag to true;
48         * kwq/KWQRenderTreeDebug.h:
49         * kwq/WebCoreImageRendererFactory.m:
50         (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
51         do threaded decoding in any case if the flag is set.
52
53 2004-12-09  Chris Blumenberg  <cblu@apple.com>
54
55         Fix for busting XMLHTTPRequest.
56
57         Reviewed by kocienda.
58
59         * khtml/misc/loader.cpp:
60         (Loader::servePendingRequests): pass true for deliverAllData
61         * kwq/KWQKJob.h:
62         (KIO::get): take deliverAllData param
63         (KIO::http_post): ditto
64         * kwq/KWQKJobClasses.h:
65         * kwq/KWQKJobClasses.mm:
66         (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
67         (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
68
69 2004-12-09  Ken Kocienda  <kocienda@apple.com>
70
71         Reviewed by John
72
73         <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
74
75         * khtml/xml/dom_nodeimpl.cpp:
76         (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
77
78 2004-12-07  Richard Williamson   <rjw@apple.com>
79
80         Support threaded image decoding on machines w/ > 2 CPUs.
81
82         Reviewed by Maciej and Chris.
83
84         * khtml/misc/loader.cpp:
85         (CachedImageCallback::notifyUpdate):
86         (CachedImageCallback::notifyFinished):
87         (CachedImageCallback::notifyDecodingError):
88         (CachedImageCallback::handleError):
89         (CachedImageCallback::clear):
90         (CachedImage::CachedImage):
91         (CachedImage::clear):
92         (CachedImage::data):
93         (CachedImage::checkNotify):
94         (Loader::servePendingRequests):
95         (Loader::slotFinished):
96         (Loader::numRequests):
97         (Loader::cancelRequests):
98         (Loader::removeBackgroundDecodingRequest):
99         * khtml/misc/loader.h:
100         (khtml::CachedImageCallback::CachedImageCallback):
101         (khtml::CachedImageCallback::ref):
102         (khtml::CachedImageCallback::deref):
103         (khtml::CachedImage::decoderCallback):
104         * khtml/rendering/render_object.cpp:
105         (RenderObject::setPixmap):
106         * kwq/KWQPixmap.h:
107         * kwq/KWQPixmap.mm:
108         (-[WebImageCallback initWithCallback:khtml::]):
109         (-[WebImageCallback _commonTermination]):
110         (-[WebImageCallback dealloc]):
111         (-[WebImageCallback finalize]):
112         (-[WebImageCallback notify]):
113         (-[WebImageCallback setImageSourceStatus:]):
114         (-[WebImageCallback status]):
115         (QPixmap::shouldUseThreadedDecoding):
116         (QPixmap::receivedData):
117         * kwq/WebCoreImageRenderer.h:
118         * kwq/WebCoreImageRendererFactory.h:
119         * kwq/WebCoreImageRendererFactory.m:
120         (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
121         (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
122
123 2004-12-07  Ken Kocienda  <kocienda@apple.com>
124
125         Reviewed by John
126
127         * khtml/editing/htmlediting.cpp:
128         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
129         change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
130         after new block has been inserted, otherwise a crash can result. Shuffle down call 
131         to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted), 
132         and all is good.
133
134 2004-12-07  Ken Kocienda  <kocienda@apple.com>
135
136         Reviewed by John
137
138         Fix for this bug:
139         
140         <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
141
142         * khtml/editing/htmlediting.cpp:
143         (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
144         for determining the location for inserting content. Do not allow an insert before or after if the
145         reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
146         * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
147         * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
148
149 2004-12-07  Darin Adler  <darin@apple.com>
150
151         Reviewed by Don.
152
153         - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
154
155         * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
156
157 2004-12-07  Ken Kocienda  <kocienda@apple.com>
158
159         Reviewed by John
160
161         Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
162         I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
163
164         * khtml/editing/html_interchange.h: Name change, as described above.
165         * khtml/editing/htmlediting.cpp:
166         (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
167         * khtml/xml/dom2_rangeimpl.cpp:
168         (DOM::RangeImpl::toHTML): Ditto.
169
170 2004-12-07  Ken Kocienda  <kocienda@apple.com>
171
172         Reviewed by me
173         
174         Added a couple more layout tests.
175
176         * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
177         * layout-tests/editing/deleting/delete-line-013.html: Added.
178         * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
179         * layout-tests/editing/deleting/delete-line-014.html: Added.
180
181 2004-12-06  Maciej Stachowiak  <mjs@apple.com>
182
183         Reviewed by Hyatt.
184
185         - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
186         
187         * kwq/KWQListBox.mm:
188         (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
189         (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
190         (-[KWQListBoxScrollView widget]): See above.
191         (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
192         afterMouseDown, to avoid triggering an assertion failure.
193
194 2004-12-06  David Hyatt  <hyatt@apple.com>
195
196         Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
197         made by me, kocienda and harrison to just remove it.
198         
199         Reviewed by mjs
200
201         * khtml/rendering/bidi.cpp:
202         (khtml::RenderBlock::layoutInlineChildren):
203         * khtml/rendering/render_block.cpp:
204         (khtml:::RenderFlow):
205         * khtml/rendering/render_block.h:
206         * khtml/rendering/render_flow.cpp:
207         (RenderFlow::dirtyLinesFromChangedChild):
208
209 2004-12-06  David Hyatt  <hyatt@apple.com>
210
211         Fix for 3787133, some web pages print with many blank pages.  Make sure to use the real page print rect and
212         not a damage rect that can be changed when intersected with the clip regions of the web page.
213         
214         Reviewed by john
215
216         * khtml/rendering/render_canvas.h:
217         (khtml::RenderCanvas::printRect):
218         (khtml::RenderCanvas::setPrintRect):
219         * khtml/rendering/render_flow.cpp:
220         (RenderFlow::paintLines):
221         * khtml/rendering/render_list.cpp:
222         (RenderListMarker::paint):
223         * kwq/KWQKHTMLPart.mm:
224         (KWQKHTMLPart::adjustPageHeight):
225
226 2004-12-06  David Harrison  <harrison@apple.com>
227
228         Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
229
230                 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
231                 
232                 
233         * khtml/rendering/render_flow.cpp:
234         (RenderFlow::dirtyLinesFromChangedChild):
235                 Dirty the line above because new child can inval the cached line break position of previous line.
236
237 2004-12-06  David Hyatt  <hyatt@apple.com>
238
239         Fix for 3254464, radio buttons do not work for quiz on netscape.com.  Left/top overflow needed to be implemented.
240         This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
241         3126929, handle top/left overflow.
242
243         This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
244
245         Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
246         regions and web pages) has been fixed.
247         
248         Reviewed by mjs
249
250         * khtml/rendering/bidi.cpp:
251         (khtml::RenderBlock::computeHorizontalPositionsForLine):
252         (khtml::RenderBlock::checkLinesForOverflow):
253         * khtml/rendering/render_block.cpp:
254         (khtml:::RenderFlow):
255         (khtml::RenderBlock::overflowHeight):
256         (khtml::RenderBlock::overflowWidth):
257         (khtml::RenderBlock::overflowLeft):
258         (khtml::RenderBlock::overflowTop):
259         (khtml::RenderBlock::overflowRect):
260         (khtml::RenderBlock::layoutBlock):
261         (khtml::RenderBlock::layoutBlockChildren):
262         (khtml::RenderBlock::paint):
263         (khtml::RenderBlock::floatRect):
264         (khtml::RenderBlock::lowestPosition):
265         (khtml::RenderBlock::rightmostPosition):
266         (khtml::RenderBlock::leftmostPosition):
267         (khtml::RenderBlock::nodeAtPoint):
268         * khtml/rendering/render_block.h:
269         * khtml/rendering/render_box.h:
270         (khtml::RenderBox::borderBox):
271         (khtml::RenderBox::borderTopExtra):
272         (khtml::RenderBox::borderBottomExtra):
273         * khtml/rendering/render_layer.cpp:
274         (RenderLayer::paintScrollbars):
275         (mustExamineRenderer):
276         (RenderLayer::intersectsDamageRect):
277         (RenderLayer::containsPoint):
278         * khtml/rendering/render_line.cpp:
279         (khtml::InlineFlowBox::placeBoxesHorizontally):
280         (khtml::InlineFlowBox::verticallyAlignBoxes):
281         * khtml/rendering/render_line.h:
282         (khtml::InlineBox::leftOverflow):
283         (khtml::InlineBox::rightOverflow):
284         (khtml::InlineFlowBox::setVerticalOverflowPositions):
285         (khtml::RootInlineBox::RootInlineBox):
286         (khtml::RootInlineBox::leftOverflow):
287         (khtml::RootInlineBox::rightOverflow):
288         (khtml::RootInlineBox::setVerticalOverflowPositions):
289         (khtml::RootInlineBox::setHorizontalOverflowPositions):
290         * khtml/rendering/render_object.h:
291         (khtml::RenderObject::borderBox):
292         (khtml::RenderObject::overflowLeft):
293         (khtml::RenderObject::overflowTop):
294         (khtml::RenderObject::overflowRect):
295         (khtml::RenderObject::floatRect):
296         * khtml/rendering/render_table.cpp:
297         (RenderTable::layout):
298         (RenderTable::paint):
299         (RenderTable::paintBoxDecorations):
300         (RenderTable::calcMinMaxWidth):
301         * khtml/rendering/render_table.h:
302         (khtml::RenderTableCell::borderTopExtra):
303         (khtml::RenderTableCell::borderBottomExtra):
304         * kwq/KWQRect.h:
305         * kwq/KWQRect.mm:
306         (QRect::inflate):
307
308 2004-12-06  Maciej Stachowiak  <mjs@apple.com>
309
310         Reviewed by John.
311
312         - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
313         
314         I changed all unprotected places that can navigate a different
315         window or frame from script to check for a javascript: URL, and if
316         found, to check for safety using cross-site-script rules. 
317
318         I considered a few other possible exploits and made no change:
319
320         - document.location is already protected because the document
321         object itself is protected
322
323         - frame.src, frame.location, iframe.src and targetted links are
324         all safe because setting the URL of a frame to a javascript: URL
325         executes the script in the context of the parent
326
327         * khtml/ecma/kjs_window.cpp:
328         (WindowFunc::tryCall):
329         (Location::put):
330         (LocationFunc::tryCall):
331
332 2004-12-06  Ken Kocienda  <kocienda@apple.com>
333
334         Reviewed by Maciej
335
336         Fix for this bug:
337         
338         <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
339
340         * khtml/editing/htmlediting.cpp:
341         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
342         check for one of the special cases being checked for in this function. The specific case 
343         intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
344         sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
345         case where a selection ended in a <br> after a block and would not delete any part of the
346         selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
347         selected.
348
349         Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
350         new use of the function exposed this bug:
351         
352         <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
353
354         * khtml/xml/dom_position.cpp:
355         (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does 
356         not have this fatal flaw. It is a much better design as well.
357         
358         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
359         have what I consider to be a better result. Going with it.
360
361 2004-12-06  Chris Blumenberg  <cblu@apple.com>
362
363         Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
364
365         Reviewed by hyatt.
366
367         * kwq/DOM.mm:
368         (-[DOMElement _font]): new SPI for AppKit
369         * kwq/DOMPrivate.h:
370
371 2004-12-06  Darin Adler  <darin@apple.com>
372
373         Reviewed by Maciej.
374
375         - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
376
377         * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
378         to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
379
380 2004-12-06  John Sullivan  <sullivan@apple.com>
381
382         Darin found what appears to be the real leak that we were falsely blaming
383         on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
384         sure nothing barfed.
385
386         * khtml/css/cssparser.cpp:
387         (CSSParser::parseValue):
388         call clearProperties() instead of just setting numParsedProperties to 0
389         (CSSParser::parseDeclaration):
390         ditto
391         (CSSParser::createStyleDeclaration):
392         ditto
393
394 2004-12-06  Ken Kocienda  <kocienda@apple.com>
395
396         Reviewed by me
397         
398         New layout tests.
399
400         * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
401         * layout-tests/editing/inserting/insert-div-001.html: Added.
402         * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
403         * layout-tests/editing/inserting/insert-div-002.html: Added.
404         * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
405         * layout-tests/editing/inserting/insert-div-003.html: Added.
406         * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
407         * layout-tests/editing/inserting/insert-div-004.html: Added.
408         * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
409         * layout-tests/editing/inserting/insert-div-005.html: Added.
410         * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
411         * layout-tests/editing/inserting/insert-div-006.html: Added.
412         * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
413         * layout-tests/editing/inserting/insert-div-007.html: Added.
414         * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
415         * layout-tests/editing/inserting/insert-div-008.html: Added.
416         * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
417         * layout-tests/editing/inserting/insert-div-009.html: Added.
418
419 2004-12-06  Ken Kocienda  <kocienda@apple.com>
420
421         Reviewed by Harrison
422
423         Fix for this bug:
424         
425         <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
426
427         * khtml/editing/htmlediting.cpp:
428         (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
429         being added to this function. This ensures that the added block has a height.
430         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
431
432 2004-12-06  Ken Kocienda  <kocienda@apple.com>
433  
434         Reviewed by John
435         
436         * khtml/dom/dom_string.cpp:
437         (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
438         * khtml/dom/dom_string.h: Ditto.
439         * khtml/editing/htmlediting.cpp:
440         (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
441         RebalanceWhitespaceCommand instance.
442         (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
443         (khtml::InsertLineBreakCommand::doApply): Ditto.
444         (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
445         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
446         (khtml::InsertTextCommand::input): Ditto.
447         (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
448         (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
449         (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
450         (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
451         (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
452         (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
453         * khtml/editing/htmlediting.h: Ditto.
454         (khtml::RebalanceWhitespaceCommand::): Ditto.
455
456 2004-12-05  Darin Adler  <darin@apple.com>
457
458         - fixed small problem in my check-in from yesterday
459
460         * kwq/KWQEvent.mm:
461         (positionForEvent): Get location from event without raising exception if it's the wrong type.
462         (clickCountForEvent): Same, for clickCount.
463         (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
464         the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
465         to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
466
467 2004-12-04  Darin Adler  <darin@apple.com>
468
469         Reviewed by John.
470
471         - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
472
473         * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
474         attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
475         Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
476
477         - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
478
479         * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
480         * khtml/rendering/render_form.cpp:
481         (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
482         (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
483         creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
484
485         * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
486         Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
487         Added a fixState helper method so the constructors can save code.
488         * kwq/KWQEvent.mm:
489         (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
490         and added a third constructor that uses the "current event" from AppKit (used above).
491         (QMouseEvent::fixState): Compute state and click count based on event type.
492
493         - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
494
495         * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
496         the family name is a null string. This prevents the crash, but there are still other problems that may have the same
497         underlying cause in CSS.
498
499         - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
500
501         * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
502         Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
503
504 2004-12-03  Chris Blumenberg  <cblu@apple.com>
505
506         New fixes for:
507         <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
508         <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
509         <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
510         <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
511
512         Reviewed by darin, rjw, kocienda.
513
514         * khtml/misc/loader.cpp:
515         (CachedObject::~CachedObject):
516         (CachedCSSStyleSheet::checkNotify):
517         (Loader::servePendingRequests):
518         (Loader::slotFinished):
519         (Loader::slotReceivedResponse):
520         (Cache::requestImage):
521         (Cache::requestScript):
522         * khtml/misc/loader.h:
523         (khtml::CachedObject::CachedObject):
524         (khtml::CachedObject::response):
525         (khtml::CachedObject::allData):
526         * kwq/KWQKJobClasses.h:
527         * kwq/KWQKJobClasses.mm:
528         (KIO::TransferJobPrivate::TransferJobPrivate):
529         (KIO::TransferJobPrivate::~TransferJobPrivate):
530         (KIO::TransferJob::TransferJob):
531         (KIO::TransferJob::assembleResponseHeaders):
532         (KIO::TransferJob::retrieveCharset):
533         (KIO::TransferJob::emitResult):
534         (KIO::TransferJob::emitReceivedResponse):
535         * kwq/KWQLoader.h:
536         * kwq/KWQLoader.mm:
537         (KWQHeaderStringFromDictionary):
538         (KWQCheckCacheObjectStatus):
539         (KWQIsResponseURLEqualToURL):
540         (KWQResponseURL):
541         (KWQResponseMIMEType):
542         (KWQCacheObjectExpiresTime):
543         (khtml::CachedObject::setResponse):
544         (khtml::CachedObject::setAllData):
545         * kwq/KWQPixmap.h:
546         * kwq/KWQPixmap.mm:
547         (QPixmap::QPixmap):
548         * kwq/KWQResourceLoader.mm:
549         (-[KWQResourceLoader finishJobAndHandle:]):
550         (-[KWQResourceLoader cancel]):
551         (-[KWQResourceLoader reportError]):
552         (-[KWQResourceLoader finishWithData:]):
553         * kwq/KWQSignal.h:
554         * kwq/KWQSignal.mm:
555         (KWQSignal::call):
556         * kwq/KWQSlot.h:
557         * kwq/KWQSlot.mm:
558         (KWQSlot::KWQSlot):
559         (KWQSlot::call):
560         * kwq/WebCoreBridge.h:
561         * kwq/WebCoreResourceLoader.h:
562
563 2004-12-04  Darin Adler  <darin@apple.com>
564
565         Reviewed by John.
566
567         - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
568
569         * khtml/rendering/render_form.cpp:
570         (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
571         modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
572         the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
573         (RenderSlider::slotSliderValueChanged): Ditto.
574
575 2004-12-03  John Sullivan  <sullivan@apple.com>
576
577         Reviewed by Ken.
578         
579         - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in 
580         khtml::BackgroundLayer::cullEmptyLayers
581
582         * khtml/rendering/render_style.cpp:
583         (BackgroundLayer::cullEmptyLayers):
584         added missing nil check
585
586 === Safari-173 ===
587
588 2004-12-03  Ken Kocienda  <kocienda@apple.com>
589
590         Reviewed by me
591
592         Roll out some recent changes by Chris that caused a performance regression.
593         Fix is in hand, but it is a little risky this close to a submission. So,
594         we have decided to roll back the change with the regression and roll in
595         the new code after we submit.
596
597         * khtml/css/cssproperties.c:
598         (hash_prop):
599         (findProp):
600         * khtml/css/cssvalues.c:
601         (hash_val):
602         (findValue):
603         * khtml/misc/htmlattrs.c:
604         (hash_attr):
605         (findAttr):
606         * khtml/misc/htmltags.c:
607         (hash_tag):
608         (findTag):
609         * khtml/misc/loader.cpp:
610         (CachedObject::~CachedObject):
611         (CachedObject::setResponse):
612         (CachedCSSStyleSheet::checkNotify):
613         (Loader::servePendingRequests):
614         (Loader::slotFinished):
615         (Loader::slotReceivedResponse):
616         (Cache::requestImage):
617         (Cache::requestScript):
618         * khtml/misc/loader.h:
619         (khtml::CachedObject::CachedObject):
620         (khtml::CachedObject::response):
621         * kwq/KWQKJobClasses.h:
622         * kwq/KWQKJobClasses.mm:
623         (KIO::TransferJobPrivate::TransferJobPrivate):
624         (KIO::TransferJobPrivate::~TransferJobPrivate):
625         (KIO::TransferJob::TransferJob):
626         (KIO::TransferJob::assembleResponseHeaders):
627         (KIO::TransferJob::retrieveCharset):
628         (KIO::TransferJob::emitResult):
629         (KIO::TransferJob::emitReceivedResponse):
630         * kwq/KWQLoader.h:
631         * kwq/KWQLoader.mm:
632         (KWQHeaderStringFromDictionary):
633         (KWQCheckCacheObjectStatus):
634         (KWQRetainResponse):
635         (KWQReleaseResponse):
636         (KWQIsResponseURLEqualToURL):
637         (KWQResponseURL):
638         (KWQResponseMIMEType):
639         (KWQResponseTextEncodingName):
640         (KWQResponseHeaderString):
641         (KWQCacheObjectExpiresTime):
642         (KWQLoader::KWQLoader):
643         * kwq/KWQPixmap.h:
644         * kwq/KWQPixmap.mm:
645         (QPixmap::QPixmap):
646         * kwq/KWQResourceLoader.mm:
647         (-[KWQResourceLoader finishJobAndHandle]):
648         (-[KWQResourceLoader cancel]):
649         (-[KWQResourceLoader reportError]):
650         (-[KWQResourceLoader finish]):
651         * kwq/KWQSignal.h:
652         * kwq/KWQSignal.mm:
653         (KWQSignal::call):
654         * kwq/KWQSlot.h:
655         * kwq/KWQSlot.mm:
656         (KWQSlot::KWQSlot):
657         (KWQSlot::call):
658         * kwq/WebCoreBridge.h:
659         * kwq/WebCoreResourceLoader.h:
660
661 2004-12-03  John Sullivan  <sullivan@apple.com>
662
663         Reviewed by Chris.
664         
665         - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
666
667         * kwq/KWQKHTMLPart.mm:
668         (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
669         when checking whether we moved the focus to another view, make sure we didn't "move" it to
670         our documentView, because that's no move at all.
671
672 2004-12-03  Darin Adler  <darin@apple.com>
673
674         Reviewed by Vicki.
675
676         - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
677
678         * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
679         Added missing initialization for base class and node pointer.
680
681         - fixed a few places that could leave dangling node pointers
682
683         * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
684         Clear out the node pointer when the node is destroyed.
685         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
686
687 2004-12-03  Chris Blumenberg  <cblu@apple.com>
688
689         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. 
690         Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
691
692         Reviewed by rjw.
693
694         * khtml/misc/loader.cpp:
695         (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
696         (Loader::slotFinished): take data param
697         * khtml/misc/loader.h:
698         * kwq/KWQKJobClasses.h:
699         * kwq/KWQKJobClasses.mm:
700         (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
701         (KIO::TransferJob::emitResult): take data param and pass it
702         * kwq/KWQResourceLoader.mm:
703         (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
704         (-[KWQResourceLoader cancel]): pass nil for data
705         (-[KWQResourceLoader reportError]): ditto
706         (-[KWQResourceLoader finishWithData:]): pass data
707         * kwq/KWQSlot.mm:
708         (KWQSlot::KWQSlot): pass data param to slotFinished
709         (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
710
711 2004-12-03  Ken Kocienda  <kocienda@apple.com>
712
713         Reviewed by John
714
715         Did some clean up in the Position class as a result of trying to write some new layout
716         tests and discovering a bug along the way.
717
718         I removed these three functions from the Position class:
719         
720         1. bool isFirstRenderedPositionOnLine() const;
721         2. bool isLastRenderedPositionOnLine() const;
722         3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
723         4. bool inFirstEditableInRootEditableElement() const;
724
725         The first two have replacements in the VisiblePosition class, and some code has been
726         moved to use these new variants. The third function was a helper used only by these
727         first two function, and can be removed as well. The fourth function was not used by anyone.
728
729         * khtml/editing/htmlediting.cpp:
730         (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
731         * khtml/editing/visible_position.cpp:
732         (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
733         Incorrect results were being returned when asking about positions at the starts of blocks.
734         * khtml/xml/dom_position.cpp:
735         (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
736         (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
737         (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
738         * khtml/xml/dom_position.h: Update header for deletions.
739
740 2004-12-03  Ken Kocienda  <kocienda@apple.com>
741
742         Reviewed by John
743
744         Terminology change in execCommand command identifiers. Specifically, the name of 
745         "InsertNewline" command has been changed to "InsertLineBreak". This matches the 
746         terminology used by AppKit. It is also more accurate, since the insertion of a
747         "br" element is what the command does. The inspiration for this change is so the 
748         -insertNewline AppKit method can be mapped to insert a new "div" element in 
749         a document and avoid ambiguity with what the javascript editing command does.
750         
751         * khtml/editing/jsediting.cpp
752         * layout-tests/editing/deleting/delete-tab-004.html
753         * layout-tests/editing/editing.js
754         * layout-tests/editing/inserting/insert-3654864-fix.html
755         * layout-tests/editing/inserting/insert-3659587-fix.html
756         * layout-tests/editing/inserting/insert-3775316-fix.html
757         * layout-tests/editing/inserting/insert-3800346-fix.html
758         * layout-tests/editing/inserting/insert-br-001.html
759         * layout-tests/editing/inserting/insert-br-002.html
760         * layout-tests/editing/inserting/insert-br-003.html
761         * layout-tests/editing/inserting/insert-br-004.html
762         * layout-tests/editing/inserting/insert-br-005.html
763         * layout-tests/editing/inserting/insert-br-006.html
764         * layout-tests/editing/inserting/insert-br-007.html
765         * layout-tests/editing/inserting/insert-br-008.html
766         * layout-tests/editing/inserting/insert-tab-004.html
767         * layout-tests/editing/inserting/insert-text-with-newlines.html
768         * layout-tests/editing/pasteboard/paste-text-010.html
769
770 2004-12-02  Ken Kocienda  <kocienda@apple.com>
771
772         Reviewed by John
773
774         Fix for this bug:
775         
776         <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
777
778         * khtml/editing/htmlediting.cpp:
779         (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
780         at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
781         (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
782         in a block and the document is in quirks mode, add an additional br to make the one in the 
783         replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
784         * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
785         * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
786
787 2004-12-02  Richard Williamson   <rjw@apple.com>
788
789         Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
790
791         Ensure that the document is cleared when leaving a non-HTML page.  This ensures that
792         the b/f cache won't incorrectly trash the previous state when restoring.
793
794         Reviewed by John.
795
796         * kwq/WebCoreBridge.h:
797         * kwq/WebCoreBridge.mm:
798         (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
799         (-[WebCoreBridge canCachePage]):
800         (-[WebCoreBridge clear]):
801
802 2004-12-02  Ken Kocienda  <kocienda@apple.com>
803
804         Reviewed by Richard
805
806         Fix for this bug:
807         
808         <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
809
810         * khtml/xml/dom2_rangeimpl.cpp:
811         (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
812         was found. This can happen in cases where the DOM was built from malformed markup (as in the case
813         of this bug where there is content after the body tag). Did a little code clean up as well.
814         (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
815
816 2004-12-02  Ken Kocienda  <kocienda@apple.com>
817
818         Reviewed by Chris
819
820         Fix for this bug:
821         
822         <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
823
824         * khtml/khtml_part.cpp:
825         (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
826         to figure out which end of the selection to extend.
827
828 2004-12-02  David Harrison  <harrison@apple.com>
829
830         Reviewed by Ken Kocienda.
831
832                 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
833                 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
834
835         * khtml/editing/visible_text.cpp:
836         (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
837         (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
838         (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
839         (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
840         (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
841         Distinguish BR from whitespace.
842         * khtml/editing/visible_text.h:
843         Distinguish BR from whitespace.
844         * khtml/editing/visible_units.cpp:
845         (khtml::previousWordBoundary):
846         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. 
847
848 2004-12-02  Ken Kocienda  <kocienda@apple.com>
849
850         Reviewed by John
851
852         Fix for this bug:
853         
854         <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
855
856         * khtml/xml/dom_position.cpp:
857         (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
858         of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
859         exception trying to use a Position returned from this function to set the boundary point of a Range (which
860         eventually led to the crash). Since this crash happened, it seems like this function was failing in its
861         contract to return a range-compliant position, hence the need for this fix.
862
863 2004-12-01  Ken Kocienda  <kocienda@apple.com>
864
865         Reviewed by me
866
867         Moving code only.
868
869         * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
870         regard to other editing commands. The class had a name change ages ago, and it was never
871         moved.
872         * khtml/editing/htmlediting.h: Ditto.
873
874 2004-12-01  Ken Kocienda  <kocienda@apple.com>
875
876         Reviewed by Hyatt
877         
878         Some improvements for paste, including some new code to annotate
879         whitespace when writing to the pasteboard to ensure that the meaning
880         of the markup on the pasteboard is unambiguous.
881         
882         There is also new code for reading this annotated markup from the pasteboard,
883         removing the nodes that were added only to prevent ambiguity.
884
885         * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
886         The header should have been added earlier, but I did not do so.
887         * khtml/editing/html_interchange.cpp: Added.
888         (convertHTMLTextToInterchangeFormat):
889         * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
890         * khtml/editing/htmlediting.cpp:
891         (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
892         Also fixed a bug in the code that counts blocks in a fragment.
893         (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
894         (khtml::ReplacementFragment::insertNodeBefore): New helper.
895         (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
896         for the replacement after deleting. This was causing a bug when pasting at the end of a block.
897         * khtml/editing/htmlediting.h: Add some new declarations.
898         * khtml/xml/dom2_rangeimpl.cpp:
899         (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
900         * khtml/xml/dom_nodeimpl.cpp:
901         (NodeImpl::stringValueForRange): New helper.
902         (NodeImpl::renderedText): New helper to return only the rendered text in a node.
903         (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
904         should be added. Called by the paste code.
905         * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
906
907         New test to check the khtml::ReplaceSelectionCommand::doApply fix.
908         * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
909         * layout-tests/editing/pasteboard/paste-text-010.html: Added.
910
911 2004-11-30  Chris Blumenberg  <cblu@apple.com>
912
913         * ChangeLog: removed conflict marker
914
915 2004-11-30  Chris Blumenberg  <cblu@apple.com>
916
917         Fixed:
918         <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
919         <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
920
921         Reviewed by darin.
922
923         * khtml/misc/loader.cpp:
924         (CachedObject::~CachedObject): release m_allData
925         (CachedObject::setAllData): new
926         (Loader::servePendingRequests): connect slotAllData
927         (Loader::slotAllData): new
928         (Cache::requestImage): tweak
929         * khtml/misc/loader.h:
930         (khtml::CachedObject::CachedObject): set allData to 0
931         (khtml::CachedObject::allData): new
932         * kwq/KWQKJobClasses.h:
933         * kwq/KWQKJobClasses.mm:
934         (KIO::TransferJob::TransferJob): set m_allData
935         (KIO::TransferJob::emitAllData): new
936         * kwq/KWQLoader.mm:
937         (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
938         * kwq/KWQResourceLoader.mm:
939         (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
940         * kwq/KWQSlot.mm:
941         (KWQSlot::KWQSlot): support for slotAllData
942         (KWQSlot::call):
943         * kwq/WebCoreBridge.h:
944         * kwq/WebCoreResourceLoader.h:
945
946 2004-11-30  Maciej Stachowiak  <mjs@apple.com>
947
948         Reviewed by John.
949
950 2004-11-30  Maciej Stachowiak  <mjs@apple.com>
951
952         Reviewed by John.
953
954         <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
955
956         * khtml/khtml_part.cpp:
957         (KHTMLPart::begin): call setParsing on document here after opening
958         - from now on we'll only set parsing to true for a document open
959         caused by page loading, not a programmatic one.
960         * khtml/xml/dom_docimpl.cpp:
961         (DocumentImpl::open): don't setParsing to true here any more.
962
963 2004-11-30  Maciej Stachowiak  <mjs@apple.com>
964
965         Reviewed by John.
966
967         - fix recent regression from collection perf fixes.
968         
969         * khtml/html/html_miscimpl.cpp:
970         (HTMLFormCollectionImpl::updateNameCache): Look up the name
971         attribute in the name cache, not the id cache (d'oh!)
972
973 2004-11-30  Darin Adler  <darin@apple.com>
974
975         Reviewed by Ken.
976
977         - rolled in a KDE fix for a problem that may underlie a number of crashes
978
979         * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
980         the KDE guys to fix a subtle problem. Code said "n = n =".
981
982         - rolled in a KDE fix for a containingBlock crash
983
984         * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
985         elements that can not be a containingBlock. They said this fixes a crash, although I did not look
986         into that further.
987
988         - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
989
990         * kwq/KWQButton.mm:
991         (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
992         (-[KWQButton detachQButton]): Added.
993         (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
994         (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
995         (-[KWQButton widget]): Added.
996         (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
997         (-[KWQButton resignFirstResponder]): Ditto.
998         (-[KWQButton canBecomeKeyView]): Ditto.
999         (QButton::QButton): Remove target and action setup; handled in KWQButton now.
1000         (QButton::~QButton): Call detachQButton instead of setTarget:nil.
1001
1002         * kwq/KWQComboBox.mm:
1003         (QComboBox::~QComboBox): Call detachQComboBox.
1004         (-[KWQPopUpButtonCell detachQComboBox]): Added.
1005         (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
1006         (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
1007         (-[KWQPopUpButton action:]): Ditto.
1008         (-[KWQPopUpButton widget]): Tweaked.
1009         (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1010         (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
1011         (-[KWQPopUpButton resignFirstResponder]): Ditto.
1012         (-[KWQPopUpButton canBecomeKeyView]): Ditto.
1013
1014         * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
1015
1016         * kwq/KWQListBox.mm:
1017         (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
1018
1019         * kwq/KWQScrollBar.h: Removed m_scroller field.
1020         * kwq/KWQScrollBar.mm:
1021         (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
1022         (-[KWQScrollBar detachQScrollBar]): Added.
1023         (-[KWQScrollBar widget]): Added.
1024         (-[KWQScrollBar mouseDown:]): Added.  Calls QWidget::beforeMouseDown and afterMouseDown.
1025         (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
1026         (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
1027         (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
1028         (QScrollBar::setKnobProportion): Ditto.
1029         (QScrollBar::scrollbarHit): Ditto.
1030
1031         * kwq/KWQScrollView.mm:
1032         (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
1033         hack where we don't remove right away when doing mouse tracking.
1034         (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
1035         the hack where we don't add right away when doing mouse tracking.
1036
1037         * kwq/KWQSlider.h: Added destructor.
1038         * kwq/KWQSlider.mm:
1039         (-[KWQSlider initWithQSlider:]): Tweaked a little.
1040         (-[KWQSlider detachQSlider]): Added.
1041         (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
1042         (-[KWQSlider widget]): Added.
1043         (QSlider::~QSlider): Added. Calls detachQSlider.
1044
1045         * kwq/KWQTextArea.h: Added detachQTextEdit method.
1046         * kwq/KWQTextArea.mm:
1047         (-[KWQTextArea detachQTextEdit]): Added.
1048         (-[KWQTextArea textDidChange:]): Added check for widget of 0.
1049         (-[KWQTextArea becomeFirstResponder]): Ditto.
1050         (-[KWQTextArea nextKeyView]): Ditto.
1051         (-[KWQTextArea previousKeyView]): Ditto.
1052         (-[KWQTextArea drawRect:]): Ditto.
1053         (-[KWQTextAreaTextView insertTab:]): Ditto.
1054         (-[KWQTextAreaTextView insertBacktab:]): Ditto.
1055         (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
1056         (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
1057         (-[KWQTextAreaTextView mouseDown:]): Ditto.
1058         (-[KWQTextAreaTextView keyDown:]): Ditto.
1059         (-[KWQTextAreaTextView keyUp:]): Ditto.
1060
1061         * kwq/KWQTextEdit.h: Added ~QTextEdit.
1062         * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
1063
1064         * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
1065         * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
1066
1067         * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
1068         Added beforeMouseDown and afterMouseDown for use in widget implementations.
1069         Removed unused hasMouseTracking function.
1070         * kwq/KWQWidget.mm:
1071         (QWidget::QWidget): Initialize two new fields.
1072         (QWidget::~QWidget): Added code to remove view when widget is destroyed.
1073         (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
1074         (QWidget::addToSuperview): Added.
1075         (QWidget::removeFromSuperview): Added.
1076         (QWidget::beforeMouseDown): Added.
1077         (QWidget::afterMouseDown): Added.
1078
1079         * khtml/rendering/render_layer.cpp:
1080         (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
1081         (RenderLayer::setHasVerticalScrollbar): Ditto.
1082
1083 2004-11-30  Ken Kocienda  <kocienda@apple.com>
1084
1085         Reviewed by John
1086
1087         Fix for this bug:
1088         
1089         <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
1090
1091         * khtml/khtml_part.cpp:
1092         (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
1093         with no blink if it is.
1094
1095 2004-11-30  Ken Kocienda  <kocienda@apple.com>
1096
1097         Reviewed by John
1098
1099         Fix for this bug:
1100         
1101         <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
1102
1103         * khtml/khtml_part.cpp:
1104         (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
1105         or <input type=image> was checked for focus since these elements are keyboard-focusable,
1106         but not mouse focusable. Also, this function did not work hard enough to set the focused
1107         node, and was content to clear it if the first element checked failed the test, rather
1108         than looking more at parents. This would have the effect of clearing, then resetting the
1109         focus on a DIV containing a button or image with content on either side of it in the
1110         process of arrowing over such content.
1111
1112 2004-11-30  Ken Kocienda  <kocienda@apple.com>
1113
1114         Reviewed by John
1115
1116         * khtml/editing/htmlediting.cpp:
1117         (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
1118         Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
1119         * khtml/khtml_part.cpp:
1120         (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
1121         ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
1122         * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
1123         * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make 
1124         isCharacterSmartReplaceExempt virtual.
1125
1126 2004-11-30  Ken Kocienda  <kocienda@apple.com>
1127
1128         Reviewed by me
1129
1130         * khtml/editing/htmlediting.cpp:
1131         (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
1132         Seemed simple enough to land without review.
1133
1134 2004-11-29  Ken Kocienda  <kocienda@apple.com>
1135
1136         Reviewed by Chris
1137     
1138         Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
1139         are handled correctly now, including selections that span multiple blocks, and cases
1140         where content on the pasteboard ends in newlines (or what appear to be newlines to a
1141         user, really block ends or BRs). I also made one small, but important change in the 
1142         copy code to annotate the markup written to the pasteboard to support these selections 
1143         ending in newlines.
1144
1145         New header that defines a couple of constants used in copying and pasting.
1146
1147         * ForwardingHeaders/editing/html_interchange.h: Added.
1148         * khtml/editing/html_interchange.h: Added.
1149         
1150         Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
1151         as a new helper class, ReplacementFragment, which encapsulates information and functions
1152         pertaining to a document fragment that is being inserted into a document.
1153         
1154         * khtml/editing/htmlediting.cpp:
1155         (khtml::ReplacementFragment::ReplacementFragment):
1156         (khtml::ReplacementFragment::~ReplacementFragment):
1157         (khtml::ReplacementFragment::firstChild): Simple accessor.
1158         (khtml::ReplacementFragment::lastChild): Ditto.
1159         (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
1160         the starting node to use for merging into the block containing the start of the selection.
1161         (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
1162         (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
1163         (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
1164         special annotation comment added in by the copy code.
1165         (khtml::ReplacementFragment::removeNode): Simple helper.
1166         (khtml::isComment): Simple helper.
1167         (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
1168         I would like to do better than this some day, but this check will hold us until I can do better.
1169         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
1170         (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
1171         (khtml::ReplaceSelectionCommand::doApply):
1172         (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
1173         * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
1174         (khtml::ReplacementFragment::root):
1175         (khtml::ReplacementFragment::type):
1176         (khtml::ReplacementFragment::isEmpty):
1177         (khtml::ReplacementFragment::isSingleTextNode):
1178         (khtml::ReplacementFragment::isTreeFragment):
1179         (khtml::ReplacementFragment::hasMoreThanOneBlock):
1180         (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
1181         
1182         This smaller set of changes markup generation to add the newline annotation described in the
1183         comment at the start of this entry.
1184         
1185         * khtml/xml/dom2_rangeimpl.cpp:
1186         (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
1187         (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
1188         comment annotations are added to the markup generated.
1189         * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
1190         * kwq/WebCoreBridge.mm:
1191         (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to 
1192         DOM::RangeImpl::toHTML uses annotations when generating.
1193         
1194         New tests.        
1195
1196         * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
1197         * layout-tests/editing/pasteboard/paste-text-001.html: Added.
1198         * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
1199         * layout-tests/editing/pasteboard/paste-text-002.html: Added.
1200         * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
1201         * layout-tests/editing/pasteboard/paste-text-003.html: Added.
1202         * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
1203         * layout-tests/editing/pasteboard/paste-text-004.html: Added.
1204         * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
1205         * layout-tests/editing/pasteboard/paste-text-005.html: Added.
1206         * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
1207         * layout-tests/editing/pasteboard/paste-text-006.html: Added.
1208         * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
1209         * layout-tests/editing/pasteboard/paste-text-007.html: Added.
1210         * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
1211         * layout-tests/editing/pasteboard/paste-text-008.html: Added.
1212         * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
1213         * layout-tests/editing/pasteboard/paste-text-009.html: Added.
1214
1215 2004-11-29  Ken Kocienda  <kocienda@apple.com>
1216
1217         Reviewed by Harrison
1218
1219         Made two small changes that make it possible for comments to have DOM nodes made for them
1220         when pasting. This relies on some earlier work I did some days ago.
1221
1222         * khtml/xml/dom_nodeimpl.cpp:
1223         (NodeImpl::startMarkup): Get the string from the comment.
1224         * kwq/WebCoreBridge.mm:
1225         (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
1226         rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
1227         be included in the DOM.
1228
1229 2004-11-29  Ken Kocienda  <kocienda@apple.com>
1230
1231         Reviewed by Harrison
1232
1233         Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
1234         my improved paste code.
1235
1236         * khtml/editing/visible_position.cpp:
1237         (khtml::blockRelationship)
1238         (khtml::visiblePositionsInDifferentBlocks)
1239         (khtml::isFirstVisiblePositionInBlock)
1240         (khtml::isFirstVisiblePositionInNode)
1241         (khtml::isLastVisiblePositionInBlock)
1242         * khtml/editing/visible_position.h
1243
1244 2004-11-29  Ken Kocienda  <kocienda@apple.com>
1245
1246         Reviewed by Harrison
1247
1248         * khtml/xml/dom_position.cpp:
1249         (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
1250         specified from obeying that directive. The old code would stop at an outer block boundary in
1251         the case where that block had a block as its first child. The correct behavior is to drill into
1252         that inner block (and continue on drilling down, if possible), to find the correct position.
1253
1254 2004-11-29  Ken Kocienda  <kocienda@apple.com>
1255
1256         Reviewed by Harrison
1257
1258         Small improvements to the node-display debugging helpers.
1259
1260         * khtml/xml/dom_nodeimpl.cpp:
1261         (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
1262         * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
1263
1264 2004-11-29  Ken Kocienda  <kocienda@apple.com>
1265
1266         Reviewed by Harrison
1267
1268         * khtml/editing/htmlediting.cpp:
1269         (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function 
1270         may need to be adjusted when deleting text off the front part of a text node. This fixes a problem 
1271         I discovered while improving the paste command, where the insertion poitn wound up in the wrong
1272         place after the delete. 
1273
1274 2004-11-29  Ken Kocienda  <kocienda@apple.com>
1275
1276         Reviewed by Harrison
1277
1278         Add a new helper function to insert a paragraph separator. Will be used in my
1279         upcoming paste improvments.
1280
1281         * khtml/editing/htmlediting.cpp: Added function
1282         (khtml::CompositeEditCommand::insertParagraphSeparator)
1283         * khtml/editing/htmlediting.h: Ditto.
1284
1285 2004-11-23  David Harrison  <harrison@apple.com>
1286
1287         Added various comments.
1288
1289         * khtml/editing/htmlediting.cpp:
1290         (khtml::StyleChange::init):
1291         (khtml::ApplyStyleCommand::doApply):
1292         (khtml::ApplyStyleCommand::applyBlockStyle):
1293         (khtml::ApplyStyleCommand::applyInlineStyle):
1294
1295 2004-11-23  David Hyatt  <hyatt@apple.com>
1296
1297         Hit testing in table cells with top/bottom space from vertical alignment didn't work.  I forgot about the
1298         super-secret yPos() lie that table cells do.  Use m_y instead of yPos().
1299
1300         * khtml/rendering/render_block.cpp:
1301         (khtml::RenderBlock::nodeAtPoint):
1302
1303 2004-11-22  David Hyatt  <hyatt@apple.com>
1304
1305         Make sure you can use document.createElement to make a <canvas> element.
1306
1307         * khtml/xml/dom_docimpl.cpp:
1308         (DocumentImpl::createHTMLElement):
1309
1310 2004-11-22  Maciej Stachowiak  <mjs@apple.com>
1311
1312         Reviewed by Dave.
1313
1314         <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
1315         <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
1316         <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
1317         <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
1318         
1319         * khtml/ecma/kjs_html.cpp:
1320         (KJS::HTMLDocument::tryGet):
1321         * khtml/html/html_formimpl.cpp:
1322         (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
1323         (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1324         * khtml/html/html_formimpl.h:
1325         * khtml/html/html_miscimpl.cpp:
1326         (HTMLCollectionImpl::HTMLCollectionImpl):
1327         (HTMLCollectionImpl::~HTMLCollectionImpl):
1328         (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1329         (HTMLCollectionImpl::CollectionInfo::reset):
1330         (HTMLCollectionImpl::resetCollectionInfo):
1331         (HTMLCollectionImpl::checkForNameMatch):
1332         (appendToVector):
1333         (HTMLCollectionImpl::updateNameCache):
1334         (HTMLCollectionImpl::namedItems):
1335         (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
1336         (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1337         (HTMLFormCollectionImpl::item):
1338         (HTMLFormCollectionImpl::updateNameCache):
1339         * khtml/html/html_miscimpl.h:
1340
1341 2004-11-22  David Hyatt  <hyatt@apple.com>
1342
1343         Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
1344         size.
1345         
1346         Reviewed by mjs
1347
1348         * khtml/misc/loader.cpp:
1349         (CachedObject::finish):
1350         (Cache::flush):
1351         (Cache::setSize):
1352         * khtml/misc/loader.h:
1353         (khtml::Cache::maxCacheableObjectSize):
1354
1355 2004-11-22  David Hyatt  <hyatt@apple.com>
1356
1357         Fix for 3673381, huge directory listing so slow it seems like a hang.  Rework painting and hit testing so that
1358         it crawls the line box tree instead of the render tree.  This allows more precise intersection/containment testing
1359         that lets us short circuit earlier when painting and hit testing.
1360         
1361         Reviewed by mjs
1362
1363         * khtml/khtml_part.cpp:
1364         (KHTMLPart::isPointInsideSelection):
1365         * khtml/rendering/render_block.cpp:
1366         (khtml::RenderBlock::paint):
1367         (khtml::RenderBlock::paintChildren):
1368         (khtml::RenderBlock::paintObject):
1369         (khtml::RenderBlock::paintFloats):
1370         (khtml::RenderBlock::nodeAtPoint):
1371         * khtml/rendering/render_block.h:
1372         * khtml/rendering/render_box.cpp:
1373         (RenderBox::nodeAtPoint):
1374         * khtml/rendering/render_box.h:
1375         * khtml/rendering/render_br.h:
1376         * khtml/rendering/render_canvas.cpp:
1377         (RenderCanvas::paint):
1378         * khtml/rendering/render_flow.cpp:
1379         (RenderFlow::paintLines):
1380         (RenderFlow::hitTestLines):
1381         (RenderFlow::caretRect):
1382         (RenderFlow::addFocusRingRects):
1383         (RenderFlow::paintFocusRing):
1384         (RenderFlow::paintOutlines):
1385         (RenderFlow::paintOutlineForLine):
1386         * khtml/rendering/render_flow.h:
1387         * khtml/rendering/render_frames.cpp:
1388         (RenderFrameSet::nodeAtPoint):
1389         * khtml/rendering/render_frames.h:
1390         * khtml/rendering/render_image.cpp:
1391         (RenderImage::nodeAtPoint):
1392         * khtml/rendering/render_image.h:
1393         * khtml/rendering/render_inline.cpp:
1394         (RenderInline::paint):
1395         (RenderInline::nodeAtPoint):
1396         * khtml/rendering/render_inline.h:
1397         * khtml/rendering/render_layer.cpp:
1398         (RenderLayer::paintLayer):
1399         (RenderLayer::hitTest):
1400         (RenderLayer::hitTestLayer):
1401         * khtml/rendering/render_layer.h:
1402         * khtml/rendering/render_line.cpp:
1403         (khtml::InlineBox::paint):
1404         (khtml::InlineBox::nodeAtPoint):
1405         (khtml::InlineFlowBox::flowObject):
1406         (khtml::InlineFlowBox::nodeAtPoint):
1407         (khtml::InlineFlowBox::paint):
1408         (khtml::InlineFlowBox::paintBackgrounds):
1409         (khtml::InlineFlowBox::paintBackground):
1410         (khtml::InlineFlowBox::paintBackgroundAndBorder):
1411         (khtml::InlineFlowBox::paintDecorations):
1412         (khtml::EllipsisBox::paint):
1413         (khtml::EllipsisBox::nodeAtPoint):
1414         (khtml::RootInlineBox::paintEllipsisBox):
1415         (khtml::RootInlineBox::paint):
1416         (khtml::RootInlineBox::nodeAtPoint):
1417         * khtml/rendering/render_line.h:
1418         (khtml::InlineRunBox::paintBackgroundAndBorder):
1419         * khtml/rendering/render_object.cpp:
1420         (RenderObject::hitTest):
1421         (RenderObject::setInnerNode):
1422         (RenderObject::nodeAtPoint):
1423         * khtml/rendering/render_object.h:
1424         (khtml::RenderObject::PaintInfo::PaintInfo):
1425         (khtml::RenderObject::PaintInfo::~PaintInfo):
1426         (khtml::RenderObject::paintingRootForChildren):
1427         (khtml::RenderObject::shouldPaintWithinRoot):
1428         * khtml/rendering/render_table.cpp:
1429         (RenderTable::layout):
1430         (RenderTable::paint):
1431         * khtml/rendering/render_text.cpp:
1432         (simpleDifferenceBetweenColors):
1433         (correctedTextColor):
1434         (InlineTextBox::nodeAtPoint):
1435         (InlineTextBox::paint):
1436         (InlineTextBox::selectionStartEnd):
1437         (InlineTextBox::paintSelection):
1438         (InlineTextBox::paintMarkedTextBackground):
1439         (InlineTextBox::paintDecoration):
1440         (RenderText::posOfChar):
1441         * khtml/rendering/render_text.h:
1442         (khtml::RenderText::paint):
1443         (khtml::RenderText::layout):
1444         (khtml::RenderText::nodeAtPoint):
1445         * khtml/xml/dom2_eventsimpl.cpp:
1446         (MouseEventImpl::computeLayerPos):
1447         * khtml/xml/dom_docimpl.cpp:
1448         (DocumentImpl::prepareMouseEvent):
1449         * kwq/KWQAccObject.mm:
1450         (-[KWQAccObject accessibilityHitTest:]):
1451         * kwq/KWQKHTMLPart.mm:
1452         (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1453         (KWQKHTMLPart::eventMayStartDrag):
1454         (KWQKHTMLPart::khtmlMouseMoveEvent):
1455         * kwq/WebCoreBridge.mm:
1456         (-[WebCoreBridge elementAtPoint:]):
1457         (-[WebCoreBridge _positionForPoint:]):
1458
1459 2004-11-22  Maciej Stachowiak  <mjs@apple.com>
1460
1461         Reviewed by Dave.
1462
1463         <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1464         <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1465
1466         This avoids the O(N^2) penalty for named item traversal for form collections.
1467
1468         It also combines the item traversal logic for all non-form
1469         collection operations into a single traverseNextItem
1470         function. This avoids having 5 copies of the big switch statement
1471         for this.
1472
1473         Also fixed a bug that prevented the last form element from being removed properly.
1474         
1475         * khtml/html/html_formimpl.cpp:
1476         (DOM::removeFromVector):
1477         * khtml/dom/html_misc.cpp:
1478         (HTMLCollection::namedItems):
1479         * khtml/dom/html_misc.h:
1480         * khtml/ecma/kjs_html.cpp:
1481         (KJS::HTMLCollection::getNamedItems):
1482         * khtml/html/html_miscimpl.cpp:
1483         (HTMLCollectionImpl::traverseNextItem):
1484         (HTMLCollectionImpl::calcLength):
1485         (HTMLCollectionImpl::length):
1486         (HTMLCollectionImpl::item):
1487         (HTMLCollectionImpl::nextItem):
1488         (HTMLCollectionImpl::checkForNameMatch):
1489         (HTMLCollectionImpl::namedItem):
1490         (HTMLCollectionImpl::namedItems):
1491         (HTMLCollectionImpl::nextNamedItem):
1492         (HTMLFormCollectionImpl::calcLength):
1493         (HTMLFormCollectionImpl::namedItem):
1494         (HTMLFormCollectionImpl::nextNamedItem):
1495         (HTMLFormCollectionImpl::namedItems):
1496         * khtml/html/html_miscimpl.h:
1497
1498 2004-11-22  Ken Kocienda  <kocienda@apple.com>
1499
1500         Reviewed by Harrison
1501
1502         Change around the way we block the Javascript "Paste" command identifier from
1503         being available. Formerly, this was done with an ifdef we never compiled in.
1504         Now, this is done with a couple of cheap runtime checks. The advantage is that
1505         we can now compile this command into development builds, and still yet switch
1506         on the command in deployment builds through the use of WebCore SPI so we can
1507         write and run layout tests with all of our builds.
1508
1509         * khtml/editing/jsediting.cpp:
1510         (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
1511         command being queried is the paste command. 
1512         (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
1513         * khtml/editing/jsediting.h: Ditto.
1514         * khtml/khtml_part.cpp:
1515         (KHTMLPart::pasteFromPasteboard): Added.
1516         (KHTMLPart::canPaste): Added.
1517         * kwq/KWQKHTMLPart.mm:
1518         (KHTMLPart::canPaste): Added.
1519         * kwq/KWQRenderTreeDebug.cpp:
1520         (externalRepresentation): Turn on paste command.
1521         * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
1522
1523 2004-11-21  Maciej Stachowiak  <mjs@apple.com>
1524
1525         Reviewed by Richard.
1526
1527         <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
1528         
1529         * khtml/html/html_miscimpl.cpp:
1530         (HTMLCollectionImpl::calcLength):
1531         (HTMLCollectionImpl::getItem):
1532         (HTMLCollectionImpl::item):
1533         (HTMLCollectionImpl::nextItem):
1534         (HTMLCollectionImpl::getNamedItem):
1535         (HTMLCollectionImpl::namedItem):
1536         (HTMLCollectionImpl::nextNamedItemInternal):
1537         (HTMLFormCollectionImpl::nextNamedItemInternal):
1538
1539 2004-11-19  Maciej Stachowiak  <mjs@apple.com>
1540
1541         Reviewed by Darin.
1542
1543         <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
1544         <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
1545         <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
1546
1547         Many optimizations to HTMLFormCollection. Iterating it should not
1548         be N^2 any more, though finding items by name could still be.
1549         
1550         * khtml/html/html_formimpl.cpp:
1551         (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1552         (DOM::HTMLFormElementImpl::length):
1553         (DOM::HTMLFormElementImpl::submitClick):
1554         (DOM::HTMLFormElementImpl::formData):
1555         (DOM::HTMLFormElementImpl::submit):
1556         (DOM::HTMLFormElementImpl::reset):
1557         (DOM::HTMLFormElementImpl::radioClicked):
1558         (DOM::appendToVector):
1559         (DOM::removeFromVector):
1560         (DOM::HTMLFormElementImpl::registerFormElement):
1561         (DOM::HTMLFormElementImpl::removeFormElement):
1562         (DOM::HTMLFormElementImpl::makeFormElementDormant):
1563         (DOM::HTMLFormElementImpl::registerImgElement):
1564         (DOM::HTMLFormElementImpl::removeImgElement):
1565         * khtml/html/html_formimpl.h:
1566         * khtml/html/html_miscimpl.cpp:
1567         (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
1568         (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
1569         (HTMLFormCollectionImpl::resetCollectionInfo):
1570         (HTMLFormCollectionImpl::calcLength):
1571         (HTMLFormCollectionImpl::item):
1572         (HTMLFormCollectionImpl::getNamedItem):
1573         (HTMLFormCollectionImpl::getNamedFormItem):
1574         (HTMLFormCollectionImpl::firstItem):
1575         (HTMLFormCollectionImpl::nextItem):
1576         * khtml/html/html_miscimpl.h:
1577         (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1578         * khtml/xml/dom_elementimpl.cpp:
1579         (ElementImpl::setAttribute):
1580         (ElementImpl::setAttributeMap):
1581         * kwq/KWQPtrVector.h:
1582         (QPtrVector::findRef):
1583         * kwq/KWQVectorImpl.h:
1584         * kwq/KWQVectorImpl.mm:
1585         (KWQVectorImpl::findRef):
1586         * kwq/WebCoreBridge.mm:
1587         (-[WebCoreBridge elementWithName:inForm:]):
1588         (-[WebCoreBridge controlsInForm:]):
1589
1590 2004-11-19  David Harrison  <harrison@apple.com>
1591
1592         Reviewed by Ken and Darin.
1593
1594         <rdar://problem/3856215> Cannot remove bold from the beginning of a message
1595
1596         Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
1597         for the existing style, but in this case (hitting cmd-B with caret at top of
1598         file) there is nothing upstream.  Changed this to use the VisiblePosition
1599         deepEquivalent instead.
1600         
1601         * khtml/khtml_part.cpp:
1602         (KHTMLPart::computeAndSetTypingStyle):
1603
1604 === Safari-172 ===
1605
1606 2004-11-19  Maciej Stachowiak  <mjs@apple.com>
1607
1608         Reviewed by Darin.
1609
1610         <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
1611         
1612         * khtml/xml/dom_docimpl.cpp:
1613         (DocumentImpl::close): Don't fire the onload handler if there is a
1614         redirect pending. This is a very long-standing bug that was masked
1615         by our previously incorrect redirect logic. It used to be that an
1616         older redirect would always win. Recently we changed things so
1617         that a newer redirect would win, but a script that causes a
1618         redirect would stop parsing once complete (so if there are two
1619         redirects in the same script, the latter wins). However, we should
1620         have also prevented onload in this case. Testing with other
1621         browsers shows that onload handlers do not run at all when there
1622         is a pending redirect.
1623
1624 2004-11-19  Ken Kocienda  <kocienda@apple.com>
1625
1626         Reviewed by Harrison
1627
1628         Fix some object lifetime issues in these two commands. This fixes some crashes
1629         I am seeing in some new code I am working on, but have not yet reproduced otherwise.
1630
1631         * khtml/editing/htmlediting.cpp:
1632         (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
1633         in the ancestor list. They are not ref'ed when put on list. D'uh.
1634         (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
1635         before putting them on the cloned nodes list. This are still deref'ed in the destructor.
1636         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
1637         destructor comment.
1638         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
1639
1640 2004-11-19  Ken Kocienda  <kocienda@apple.com>
1641
1642         Reviewed by Harrison
1643
1644         Fix for this bug:
1645         
1646         <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
1647
1648         * khtml/khtml_part.cpp:
1649         (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
1650         declaration given the current selection, and then sets the minimum necessary style as the typing
1651         style on the part.
1652         (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
1653         to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
1654         as well.
1655         * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
1656         * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
1657         * kwq/WebCoreBridge.mm: 
1658         (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
1659         (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
1660
1661 2004-11-18  David Harrison  <harrison@apple.com>
1662
1663         Reviewed by Darin.
1664         
1665         Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
1666         by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
1667
1668         * kwq/DOM-CSS.mm:
1669         (-[DOMCSSStyleDeclaration setProperty:::]):
1670
1671 2004-11-18  Chris Blumenberg  <cblu@apple.com>
1672
1673         Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
1674
1675         Reviewed by john.
1676
1677         * kwq/KWQKHTMLPart.mm:
1678         (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
1679
1680 2004-11-18  Maciej Stachowiak  <mjs@apple.com>
1681
1682         Reviewed by Chris.
1683
1684         - fix recursive item traversal, use traverseNextNode() instead of
1685         the buggy hand-rolled traversal.
1686
1687         * khtml/xml/dom_nodeimpl.cpp:
1688         (NodeListImpl::recursiveItem):
1689
1690 2004-11-17  Darin Adler  <darin@apple.com>
1691
1692         Reviewed by Ken.
1693
1694         - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
1695
1696         * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
1697         Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
1698
1699         - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
1700         - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
1701         - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
1702         - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
1703           an entire category of leaks we have been fixing one by one recently
1704         - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
1705           stale RenderObject pointer, although I never saw it do that in practice
1706         - implemented the length and item methods for computed styles
1707         - implemented querying additional properties in computed styles (29 more)
1708
1709         * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1710         now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
1711         take a mutable style.
1712         * khtml/khtml_part.cpp:
1713         (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
1714         (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
1715         a computed style; also change some types to mutable style.
1716         (updateState): Update iteration of CSSProperty objects in a style declaration to use
1717         the new valuesIterator interface.
1718         (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
1719         (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
1720         (editingStyle): Change type to mutable style, and simplify the style-creation calls,
1721         including accomodating the exception code that setCssText has now.
1722         (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
1723         (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
1724         the style attributes really was a change, although it's not an important optimization it's
1725         good to do it right.
1726
1727         * khtml/css/css_base.h: Remove unneeded setParsedValue method.
1728         * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
1729         calling it were already removing the old property explicitly, so the code in here to remove
1730         the property again was redundant.
1731
1732         * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
1733         Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
1734         * khtml/css/css_computedstyle.cpp:
1735         (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
1736         the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
1737         Before we had no guarantee the object would outlast us.
1738         (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
1739         exception to NO_MODIFICATION_ALLOWED_ERR.
1740         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
1741         than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
1742         box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
1743         list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
1744         marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
1745         page-break-inside, position, unicode-bidi, widows, z-index.
1746         (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
1747         exception to NO_MODIFICATION_ALLOWED_ERR.
1748         (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
1749         (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
1750         (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
1751         (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
1752         CSSMutableStyleDeclarationImpl.
1753         (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
1754         (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
1755
1756         * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1757         now a separate class rather than a typedef.
1758         * khtml/css/cssparser.h: Ditto.
1759
1760         * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
1761         CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
1762         Removed a bunch of redundant stuff from other classes in this file too.
1763         (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
1764         (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
1765         (DOM::CSSProperty::operator=): Added.
1766         (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
1767
1768         * khtml/css/css_valueimpl.cpp:
1769         (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
1770         (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
1771         (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
1772         (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
1773         (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
1774         (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
1775         (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
1776         (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
1777         (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
1778         (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
1779         (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
1780         (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
1781         (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
1782         (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
1783         (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
1784         (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
1785         (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
1786         (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
1787         (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
1788         (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
1789         (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
1790         no styles in the list. Update to use QValueList.
1791         (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
1792         parameter and set it.
1793         (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
1794         (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
1795         (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
1796         (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
1797         (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
1798         (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
1799
1800         * khtml/css/cssparser.cpp:
1801         (CSSParser::parseValue): Changed to use addParsedProperties.
1802         (CSSParser::parseDeclaration): Ditto.
1803         (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
1804
1805         * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
1806         * khtml/css/cssproperties.c: Regenerated.
1807         * khtml/css/cssproperties.h: Regenerated.
1808
1809         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
1810         Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
1811
1812         * khtml/dom/css_value.cpp:
1813         (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
1814         (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
1815         (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
1816         first doing getPropertyCSSValue and then doing cssText.
1817         (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
1818         (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling. 
1819         (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
1820         (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
1821         (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
1822         (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
1823         (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
1824
1825         * khtml/dom/dom_node.h: Made isNull and handle functions inline.
1826         * khtml/dom/dom_node.cpp: Ditto.
1827
1828         * khtml/editing/htmlediting.h: Change some types to mutable style.
1829         * khtml/editing/htmlediting.cpp:
1830         (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
1831         (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
1832         (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
1833         (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
1834         (khtml::EditCommand::setTypingStyle): Ditto.
1835         (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
1836         (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
1837         (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
1838         (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1839         (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
1840         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
1841         (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
1842         (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
1843         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1844         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1845         (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
1846         (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1847         (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
1848
1849         * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
1850         * khtml/html/html_baseimpl.h: Change type to mutable style.
1851         * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
1852
1853         * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
1854         class as a base class, and change types to mutable style as needed.
1855         * khtml/html/html_elementimpl.cpp:
1856         (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
1857         (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
1858         (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
1859         (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
1860         (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
1861         (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
1862         to appendChild.
1863         (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
1864         to replaceChild.
1865
1866         * khtml/html/html_tableimpl.h: Change types to mutable style.
1867         * khtml/html/html_tableimpl.cpp:
1868         (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1869         (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
1870         (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1871
1872         * khtml/html/htmlparser.cpp:
1873         (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
1874         than using an explicit delete to make the node go away, and is required for compatibility with the
1875         changes to the NodeImpl functions.
1876         (KHTMLParser::insertNode): Ditto.
1877         (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
1878         the NodeImpl functions.
1879
1880         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
1881         now that there's no need to make the property list explictly.
1882
1883         * kwq/DOM-CSS.mm:
1884         (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
1885         (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
1886         (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
1887
1888         * khtml/xml/dom_nodeimpl.cpp:
1889         (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
1890         function succeeded or not for ownership purposes.
1891         (NodeImpl::replaceChild): Ditto.
1892         (NodeImpl::appendChild): Ditto.
1893         (NodeBaseImpl::insertBefore): Ditto.
1894         (NodeBaseImpl::replaceChild): Ditto.
1895         (NodeBaseImpl::appendChild): Ditto.
1896         (NodeBaseImpl::addChild): Ditto.
1897
1898         * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
1899         * WebCore-combined.exp: Regenerated.
1900
1901 2004-11-18  Maciej Stachowiak  <mjs@apple.com>
1902
1903         still even more build fixing
1904
1905         * khtml/html/html_miscimpl.cpp:
1906         (HTMLCollectionImpl::resetCollectionInfo):
1907
1908 2004-11-18  Maciej Stachowiak  <mjs@apple.com>
1909
1910         more build fixing
1911
1912         * khtml/html/html_miscimpl.cpp:
1913         (HTMLCollectionImpl::resetCollectionInfo):
1914
1915 2004-11-18  Maciej Stachowiak  <mjs@apple.com>
1916
1917         Fixed build problem.
1918
1919         * khtml/html/html_miscimpl.h:
1920         (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
1921
1922 2004-11-18  Maciej Stachowiak  <mjs@apple.com>
1923
1924         Reviewed by Ken.
1925
1926         - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
1927
1928         <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
1929         <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
1930
1931         This is also a start on fixing 5 other bugs, but those need additional work to make
1932         HTMLFormCollection fast.
1933
1934         * khtml/html/html_documentimpl.h:
1935         (DOM::HTMLDocumentImpl::collectionInfo):
1936         * khtml/html/html_formimpl.cpp:
1937         (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1938         (DOM::HTMLFormElementImpl::isURLAttribute):
1939         (DOM::HTMLFormElementImpl::registerImgElement):
1940         (DOM::HTMLFormElementImpl::removeImgElement):
1941         * khtml/html/html_formimpl.h:
1942         * khtml/html/html_imageimpl.cpp:
1943         (HTMLImageElementImpl::HTMLImageElementImpl):
1944         (HTMLImageElementImpl::~HTMLImageElementImpl):
1945         * khtml/html/html_imageimpl.h:
1946         * khtml/html/html_miscimpl.cpp:
1947         (HTMLCollectionImpl::HTMLCollectionImpl):
1948         (HTMLCollectionImpl::~HTMLCollectionImpl):
1949         (HTMLCollectionImpl::updateCollectionInfo):
1950         (HTMLCollectionImpl::length):
1951         (HTMLCollectionImpl::item):
1952         (HTMLCollectionImpl::firstItem):
1953         (HTMLCollectionImpl::nextItem):
1954         (HTMLCollectionImpl::namedItem):
1955         (HTMLCollectionImpl::nextNamedItemInternal):
1956         (HTMLFormCollectionImpl::getNamedFormItem):
1957         * khtml/html/html_miscimpl.h:
1958         (DOM::HTMLCollectionImpl::):
1959         (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1960         * khtml/html/htmlparser.cpp:
1961         (KHTMLParser::getElement):
1962         * khtml/xml/dom_docimpl.cpp:
1963         (DocumentImpl::DocumentImpl):
1964         * khtml/xml/dom_docimpl.h:
1965         (DOM::DocumentImpl::incDOMTreeVersion):
1966         (DOM::DocumentImpl::domTreeVersion):
1967         * khtml/xml/dom_nodeimpl.cpp:
1968         (NodeImpl::attach):
1969         (NodeImpl::detach):
1970
1971 2004-11-18  Kevin Decker  <kdecker@apple.com>
1972
1973         Reviewed by Chris.
1974
1975         fixed: <rdar://problem/3841842> getPropertyID expensive
1976
1977         * kwq/DOM-CSS.mm:
1978         (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
1979
1980 2004-11-17  David Hyatt  <hyatt@apple.com>
1981
1982         Improve responsiveness by being willing to break out of the tokenizer.  (This patch was landed already
1983         and subsequently backed out).
1984         
1985         Reviewed by kocienda
1986
1987         * khtml/html/html_baseimpl.cpp:
1988         (HTMLBodyElementImpl::insertedIntoDocument):
1989         * khtml/html/htmltokenizer.cpp:
1990         (khtml::HTMLTokenizer::reset):
1991         (khtml::HTMLTokenizer::scriptHandler):
1992         (khtml::HTMLTokenizer::scriptExecution):
1993         (khtml::HTMLTokenizer::write):
1994         (khtml::HTMLTokenizer::continueProcessing):
1995         (khtml::HTMLTokenizer::timerEvent):
1996         (khtml::HTMLTokenizer::notifyFinished):
1997         * khtml/html/htmltokenizer.h:
1998         * khtml/khtmlview.cpp:
1999         (KHTMLViewPrivate::KHTMLViewPrivate):
2000         (KHTMLViewPrivate::reset):
2001         (KHTMLView::clear):
2002         (KHTMLView::layout):
2003         (KHTMLView::timerEvent):
2004         (KHTMLView::scheduleRelayout):
2005         (KHTMLView::layoutPending):
2006         (KHTMLView::haveDelayedLayoutScheduled):
2007         (KHTMLView::unscheduleRelayout):
2008         * khtml/khtmlview.h:
2009         * khtml/xml/dom_docimpl.cpp:
2010         (DocumentImpl::DocumentImpl):
2011         (DocumentImpl::close):
2012         (DocumentImpl::setParsing):
2013         (DocumentImpl::shouldScheduleLayout):
2014         (DocumentImpl::minimumLayoutDelay):
2015         (DocumentImpl::write):
2016         (DocumentImpl::finishParsing):
2017         (DocumentImpl::stylesheetLoaded):
2018         (DocumentImpl::updateStyleSelector):
2019         * khtml/xml/dom_docimpl.h:
2020         (DOM::DocumentImpl::parsing):
2021         * kwq/KWQDateTime.mm:
2022         (KWQUIEventTime::uiEventPending):
2023
2024 2004-11-17  David Harrison  <harrison@apple.com>
2025
2026         Reviewed by Ken Kocienda.
2027         
2028         Make sure previousLineStart is non-null before calling compareBoundaryPoints.
2029         Treat null case as meaning no post-move merge is needed.
2030
2031         * khtml/editing/htmlediting.cpp:
2032         (khtml::DeleteSelectionCommand::initializePositionData):
2033
2034 2004-11-17  David Harrison  <harrison@apple.com>
2035         
2036         Added displayNode and displayTree methods for debugging.  Fixed comment typo in dispatchChildRemovalEvents.
2037         * khtml/xml/dom_nodeimpl.cpp:
2038         (NodeImpl::displayNode):
2039         (NodeImpl::displayTree):
2040         (NodeBaseImpl::dispatchChildRemovalEvents):
2041         * khtml/xml/dom_nodeimpl.h:
2042
2043 2004-11-16  John Sullivan  <sullivan@apple.com>
2044
2045         Reviewed by Richard.
2046         
2047         - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
2048
2049         * khtml/khtml_part.cpp:
2050         (editingStyle):
2051         delete the list we created when we're done with it
2052
2053 2004-11-16  Ken Kocienda  <kocienda@apple.com>
2054
2055         Reviewed by John
2056         
2057         It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
2058         Instead, I replaced this with a helper function that derefs DOM nodes stored in a 
2059         QPtrList when the list goes out of scope.
2060
2061         * khtml/editing/htmlediting.cpp:
2062         (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
2063         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
2064         (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
2065         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):  
2066         No longer set lists to autodelete.
2067         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
2068          Call new derefNodesInList helper.
2069         * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
2070         of one before, but now it does.
2071
2072 2004-11-15  David Harrison  <harrison@apple.com>
2073
2074         Reviewed by Chris and Darin.
2075         
2076         <rdar://problem/3880304> Non-linear performance hit for style changes
2077
2078         * khtml/xml/dom_nodeimpl.cpp:
2079         (NodeImpl::traverseNextNode):
2080         (NodeImpl::traverseNextSibling):
2081         (NodeImpl::traversePreviousNodePostOrder):
2082         Return 0 rather than traversing beyond stayWithin when this == stayWithin.
2083         Add asserts that stayWithin is an ancestor of the returned node.
2084
2085 2004-11-15  Darin Adler  <darin@apple.com>
2086
2087         Reviewed by Ken.
2088
2089         - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
2090
2091         * khtml/css/css_computedstyle.cpp:
2092         (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
2093         since there's no guarantee it's already ref'd.
2094         * khtml/css/css_valueimpl.cpp:
2095         (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
2096         (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
2097         (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
2098         (CSSStyleDeclarationImpl::merge): Ditto.
2099         (CSSStyleDeclarationImpl::diff): Ditto.
2100         * khtml/editing/htmlediting.cpp:
2101         (khtml::StyleChange::currentlyHasStyle): Ditto.
2102         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2103         * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
2104         * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
2105
2106 2004-11-15  Darin Adler  <darin@apple.com>
2107
2108         Reviewed by Ken.
2109
2110         Use separate mutable style and computed style types as appropriate.
2111         For now this should have no effect, but it prepares us for refactoring later.
2112         Also remove some unnecessary "DOM::" prefixes and in one case factor out
2113         some shared code.
2114
2115         * khtml/khtml_part.cpp:
2116         (KHTMLPart::typingStyle):
2117         (KHTMLPart::setTypingStyle):
2118         (updateState):
2119         (KHTMLPart::selectionHasStyle):
2120         (KHTMLPart::selectionStartHasStyle):
2121         (KHTMLPart::selectionComputedStyle):
2122         * khtml/khtml_part.h:
2123         * khtml/khtmlpart_p.h:
2124
2125         * khtml/css/css_base.h:
2126         * khtml/css/css_ruleimpl.cpp:
2127         (CSSStyleRuleImpl::setDeclaration):
2128         * khtml/css/css_ruleimpl.h:
2129         (DOM::CSSFontFaceRuleImpl::style):
2130         (DOM::CSSPageRuleImpl::style):
2131         (DOM::CSSStyleRuleImpl::style):
2132         (DOM::CSSStyleRuleImpl::declaration):
2133         * khtml/css/css_valueimpl.h:
2134         (DOM::CSSPrimitiveValueImpl::):
2135         * khtml/css/cssparser.cpp:
2136         (CSSParser::parseValue):
2137         (CSSParser::parseColor):
2138         (CSSParser::parseDeclaration):
2139         (CSSParser::createStyleDeclaration):
2140         * khtml/css/cssparser.h:
2141         * khtml/css/cssstyleselector.cpp:
2142         (khtml::CSSStyleSelector::addMatchedDeclaration):
2143         (khtml::CSSStyleSelector::matchRulesForList):
2144         (khtml::CSSStyleSelector::styleForElement):
2145         (khtml::CSSStyleSelector::applyDeclarations):
2146         * khtml/css/cssstyleselector.h:
2147         * khtml/css/parser.cpp:
2148         * khtml/css/parser.y:
2149         * khtml/dom/css_rule.h:
2150         * khtml/dom/css_stylesheet.h:
2151         * khtml/dom/css_value.h:
2152         * khtml/dom/dom2_views.cpp:
2153         * khtml/xml/dom2_viewsimpl.cpp:
2154         (DOM::AbstractViewImpl::getComputedStyle):
2155         * khtml/xml/dom_docimpl.cpp:
2156         (DocumentImpl::importNode):
2157         (DocumentImpl::setStyleSheet):
2158         * khtml/xml/dom_docimpl.h:
2159         * khtml/xml/dom_xmlimpl.cpp:
2160         (DOM::ProcessingInstructionImpl::setStyleSheet):
2161         * khtml/xml/dom_xmlimpl.h:
2162
2163         * khtml/dom/css_value.cpp:
2164         (DOM::throwException): Added.
2165         (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
2166         The real thing is coming with the next change to refactor.
2167         (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
2168         (DOM::CSSPrimitiveValue::setStringValue): Ditto.
2169
2170 2004-11-15  Darin Adler  <darin@apple.com>
2171
2172         Reviewed by Ken.
2173
2174         - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
2175
2176         * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
2177         dispatchSubtreeModifiedEvent, so it can be called in cases where only the
2178         node's attributes changed without sending a misleading childrenChanged call,
2179         but the childrenChanged call can happen at the exact right moment.
2180         * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
2181         (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
2182         the boolean true is passed in.
2183
2184         * khtml/xml/dom_elementimpl.cpp:
2185         (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
2186         (NamedAttrMapImpl::removeAttribute): Ditto.
2187
2188 2004-11-15  John Sullivan  <sullivan@apple.com>
2189
2190         Reviewed by Ken.
2191         
2192         - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet, 
2193         seen often in Mail and Blot
2194
2195         * khtml/css/css_valueimpl.cpp:
2196         (CSSStyleDeclarationImpl::copyPropertiesInSet):
2197         delete temporary list after we're done using it
2198
2199 2004-11-15  Richard Williamson   <rjw@apple.com>
2200
2201         Fixed leak (3879883) that John found.  Early return leaked
2202         allocated instance.
2203
2204         Reviewed by John.
2205
2206         * khtml/css/css_computedstyle.cpp:
2207         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2208
2209 2004-11-15  Ken Kocienda  <kocienda@apple.com>
2210
2211         Reviewed by John
2212
2213         Fix for this bug:
2214         
2215         <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
2216
2217         Fixed a couple of object lifetime issues. The EditCommand class used to hold an
2218         EditCommandPtr to its parent, but this caused a a reference cycle in composite 
2219         commands as the children held a ref to their parent. Now, the parent variable
2220         is a non-retained reference to an EditCommand *. It would be nice to have a 
2221         weak reference to the parent or even override deref in composite commands (but I
2222         can't since deref() is not virtual). However, this should be OK since any
2223         dangling parent pointer is a sign of a bigger object lifetime problem that
2224         would need to be addressed anyway.
2225
2226         * khtml/css/css_valueimpl.cpp:
2227         (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a 
2228         QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
2229         just assigning the list variable passed in to the local list variable, or the list will be 
2230         double-deleted.
2231         * khtml/editing/htmlediting.cpp:
2232         (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
2233         (khtml::EditCommand::setEndingSelection): Ditto.
2234         (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
2235         Unrelated to the change, but saves some ref's and deref's.
2236         (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
2237         * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
2238         EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
2239         (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
2240
2241 2004-11-15  Maciej Stachowiak  <mjs@apple.com>
2242
2243         Reviewed by Kevin.
2244
2245         <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
2246         
2247         * khtml/xml/dom_nodeimpl.cpp:
2248         (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
2249         isLengthCacheValid.
2250         (NodeListImpl::recursiveLength): Adjusted for rename.
2251         (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
2252         If the same offset is looked up again, just return it, otherwise, if looking up
2253         a later offset, start at the last item and proceed from there.
2254         (NodeListImpl::itemById): Apply the special document optimization to all
2255         nodes that are either a document or in a document - just walk up to make
2256         sure the node found by ID has the root node as an ancestor.
2257         (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
2258         * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
2259
2260 2004-11-15  John Sullivan  <sullivan@apple.com>
2261
2262         Reviewed by Ken.
2263         
2264         - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
2265
2266         * kwq/KWQKHTMLPart.mm:
2267         (KWQKHTMLPart::documentFragmentWithText):
2268         release mutable copy of string after we're done using it
2269
2270 2004-11-14  Kevin Decker  <kdecker@apple.com>
2271
2272         Reviewed by mjs.
2273
2274         fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
2275
2276         * khtml/html/html_elementimpl.cpp:
2277         (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
2278         (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
2279
2280 2004-11-13  Maciej Stachowiak  <mjs@apple.com>
2281
2282         Reviewed by Kevin.
2283
2284         <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
2285
2286         * khtml/dom/dom_node.cpp:
2287         (NodeList::itemById): New method, just forward to impl.
2288         * khtml/dom/dom_node.h: Prototype it.
2289         * khtml/ecma/kjs_dom.cpp:
2290         (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
2291         let the NodeList do it. The NodeList might be able to do it more efficiently.
2292         * khtml/xml/dom_nodeimpl.cpp:
2293         (NodeListImpl::itemById): Optimize for the case where the NodeList
2294         covers the whole document. In this case, just use getElementById,
2295         then check that the element satisfies the list criteria.
2296         (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
2297         (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
2298         * khtml/xml/dom_nodeimpl.h:
2299
2300 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
2301
2302         Reviewed by Gramps.
2303
2304         - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
2305         sometimes using a huge bogus length value.
2306         
2307         * khtml/xml/dom_nodeimpl.cpp:
2308         (NodeListImpl::NodeListImpl): Initialize isCacheValid.
2309
2310 2004-11-12  Darin Adler  <darin@apple.com>
2311
2312         Reviewed by Maciej.
2313
2314         - fixed an infinite loop in that last check-in
2315
2316         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
2317         Added a ++i to the loop so it won't get stuck on the first element in the list.
2318
2319 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
2320
2321         Reviewed by Kevin.
2322
2323         - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
2324         
2325         I fixed this by changing NodeLists to cache their length, but
2326         invalidate it whenever there is a change in the DOM subtree at
2327         which they are rooted. This makes NodeListImpl::recursiveLength()
2328         drop completely off the profile, since we were repeatedly getting
2329         a length for the same NodeList over and over.
2330         
2331         * khtml/xml/dom_nodeimpl.cpp:
2332         (NodeImpl::NodeImpl):
2333         (NodeImpl::~NodeImpl):
2334         (NodeImpl::registerNodeList):
2335         (NodeImpl::unregisterNodeList):
2336         (NodeImpl::notifyLocalNodeListsSubtreeModified):
2337         (NodeImpl::notifyNodeListsSubtreeModified):
2338         (NodeImpl::dispatchSubtreeModifiedEvent):
2339         (NodeListImpl::NodeListImpl):
2340         (NodeListImpl::~NodeListImpl):
2341         (NodeListImpl::recursiveLength):
2342         (NodeListImpl::recursiveItem):
2343         (NodeListImpl::rootNodeSubtreeModified):
2344         (ChildNodeListImpl::ChildNodeListImpl):
2345         (ChildNodeListImpl::length):
2346         (ChildNodeListImpl::item):
2347         (TagNodeListImpl::TagNodeListImpl):
2348         (TagNodeListImpl::length):
2349         (TagNodeListImpl::item):
2350         (NameNodeListImpl::NameNodeListImpl):
2351         (NameNodeListImpl::length):
2352         (NameNodeListImpl::item):
2353         * khtml/xml/dom_nodeimpl.h:
2354
2355 2004-11-12  Darin Adler  <darin@apple.com>
2356
2357         Reviewed by Maciej.
2358
2359         - various small cleanups
2360
2361         * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
2362         * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
2363
2364         * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
2365         * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
2366         * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
2367         * khtml/html/htmltokenizer.cpp:
2368         (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
2369         (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
2370
2371         * khtml/khtml_part.h: Removed docImpl function.
2372         * khtml/khtml_part.cpp: Ditto.
2373
2374         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
2375         the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
2376
2377         * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
2378         * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
2379         part of the change last time, which is why the build broke).
2380         (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
2381         (KWQKHTMLPart::setPolicyBaseURL): Ditto.
2382         (KWQKHTMLPart::keyEvent): Ditto.
2383         (KWQKHTMLPart::dispatchCPPEvent): Ditto.
2384         (KWQKHTMLPart::bodyBackgroundColor): Ditto.
2385
2386 2004-11-12  Chris Blumenberg  <cblu@apple.com>
2387
2388         <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
2389
2390         Reviewed by rjw.
2391
2392         * kwq/KWQKHTMLPart.mm:
2393         (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
2394
2395 === Safari-171 ===
2396
2397 2004-11-12  Darin Adler  <darin@apple.com>
2398
2399         Reviewed by Kevin.
2400
2401         - fixed a couple places that would not work for XML documents
2402
2403         * khtml/ecma/kjs_window.cpp:
2404         (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
2405         is present on the base class.
2406         (WindowFunc::tryCall): More of the same.
2407
2408 2004-11-12  Darin Adler  <darin@apple.com>
2409
2410         - land versions of these files generated by the newer gperf
2411
2412         People building on Panther will continue to see these files modified.
2413         A workaround would be to install the newer gperf on our Tiger build machines.
2414
2415         * khtml/css/cssproperties.c: Regenerated.
2416         * khtml/css/cssvalues.c: Regenerated.
2417         * khtml/html/doctypes.cpp: Regenerated.
2418         * khtml/html/kentities.c: Regenerated.
2419         * khtml/misc/htmlattrs.c: Regenerated.
2420         * khtml/misc/htmltags.c: Regenerated.
2421         * kwq/KWQColorData.c: Regenerated.
2422
2423 2004-11-11  Richard Williamson   <rjw@apple.com>
2424         
2425         Fix build horkage from previous checkin.
2426                 
2427         * kwq/KWQKHTMLPart.h:
2428
2429 2004-11-11  Darin Adler  <darin@apple.com>
2430
2431         Reviewed by John.
2432
2433         - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2434
2435         * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2436
2437         * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2438         * kwq/KWQKHTMLPart.mm:
2439         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2440         method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2441         we started with the NSTextField as first responder, and then took focus away and gave it back, which
2442         makes dragging text work again.
2443         (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2444
2445 2004-11-11  David Hyatt  <hyatt@apple.com>
2446
2447         Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2448         
2449         Reviewed by vicki
2450
2451         * khtml/html/htmltokenizer.cpp:
2452         (khtml::HTMLTokenizer::continueProcessing):
2453
2454 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2455
2456         Reviewed by Maciej
2457
2458         * khtml/editing/htmlediting.cpp:
2459         (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2460         of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2461         with the prevailing style for the VisiblePosition class.
2462         * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files. 
2463         * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2464         (khtml::visiblePositionsInDifferentBlocks): New helper method.
2465         (khtml::isLastVisiblePositionInBlock): Ditto.
2466         (khtml::isLastVisiblePositionInNode): Ditto.
2467         * khtml/editing/visible_position.h: Add declarations for new functions.
2468
2469 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2470
2471         Reviewed by Hyatt
2472
2473         * khtml/editing/htmlediting.cpp:
2474         (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2475         (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2476         (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2477         (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2478         (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2479         * khtml/xml/dom2_rangeimpl.cpp:
2480         (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2481         * khtml/xml/dom2_rangeimpl.h: Ditto.
2482
2483 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2484
2485         Reviewed by Harrison
2486
2487         Some improvements to deleting when complete lines are selected.
2488
2489         * khtml/editing/htmlediting.cpp:
2490         (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2491         the end of a selection is fully selected. Turn off block merging in this case.
2492         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2493         whether a BR immediately followed a block. The old code could erroneously skip nodes.
2494         (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2495         start block is selected. This new code will now delete this block in one call, rather
2496         than iterating over each child.
2497         * khtml/editing/visible_position.cpp:
2498         (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
2499         to do the work mentioned above in the comment for that function.
2500         (khtml::isFirstVisiblePositionOnLine): Ditto.
2501         (khtml::isLastVisiblePositionOnLine): Ditto.
2502         * khtml/editing/visible_position.h: Add new functions.
2503         * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
2504         * layout-tests/editing/deleting/delete-line-001.html: Added.
2505         * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
2506         * layout-tests/editing/deleting/delete-line-002.html: Added.
2507         * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
2508         * layout-tests/editing/deleting/delete-line-003.html: Added.
2509         * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
2510         * layout-tests/editing/deleting/delete-line-004.html: Added.
2511         * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
2512         * layout-tests/editing/deleting/delete-line-005.html: Added.
2513         * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
2514         * layout-tests/editing/deleting/delete-line-006.html: Added.
2515         * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
2516         * layout-tests/editing/deleting/delete-line-007.html: Added.
2517         * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
2518         * layout-tests/editing/deleting/delete-line-008.html: Added.
2519         * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
2520         * layout-tests/editing/deleting/delete-line-009.html: Added.
2521         * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
2522         * layout-tests/editing/deleting/delete-line-010.html: Added.
2523         * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
2524         * layout-tests/editing/deleting/delete-line-011.html: Added.
2525         * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
2526         * layout-tests/editing/deleting/delete-line-012.html: Added.
2527
2528 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2529
2530         Reviewed by Adele
2531
2532         * khtml/editing/htmlediting.cpp:
2533         (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
2534
2535 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2536
2537         Reviewed by John
2538
2539         Fix for these bugs:
2540
2541         <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
2542         <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
2543
2544         * khtml/editing/selection.cpp:
2545         (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
2546         the next line position when necessary.
2547         * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
2548         * layout-tests/editing/selection/move-3875618-fix.html: Added.
2549         * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
2550         * layout-tests/editing/selection/move-3875641-fix.html: Added.
2551
2552 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2553
2554         Reviewed by John
2555
2556         Improved some function names, at John's urging. No changes to the
2557         functions themselves.
2558         
2559         canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
2560         canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
2561         performGeneralDelete() --> handleGeneralDelete()
2562
2563         * khtml/editing/htmlediting.cpp:
2564         (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
2565         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
2566         (khtml::DeleteSelectionCommand::handleGeneralDelete)
2567         (khtml::DeleteSelectionCommand::doApply)
2568         * khtml/editing/htmlediting.h
2569
2570 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2571
2572         Reviewed by John
2573         
2574         Updated some layout test results that changed as a result of my last checking.
2575         Added a new test that has been in my tree for a few days.
2576
2577         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2578         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
2579         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
2580         * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
2581
2582 2004-11-11  Ken Kocienda  <kocienda@apple.com>
2583
2584         Reviewed by John
2585
2586         * khtml/editing/htmlediting.cpp:
2587         (khtml::debugNode): New debugging helper.
2588         (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
2589         startPositionForDelete() and endPositionForDelete() functions. Just use the 
2590         m_selectionToDelete object to determine start and end positions for the delete.
2591         (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
2592         function that creates a special case for deleting all the content in a root
2593         editable element.
2594         (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
2595         function before BR special case and the general case delete functions.
2596         * khtml/editing/htmlediting.h: Updated for changed functions.
2597
2598 2004-11-10  Kevin Decker  <kdecker@apple.com>
2599
2600         Reviewed by mjs.
2601         
2602         Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.  
2603
2604         * khtml/ecma/kjs_dom.cpp:
2605         (DOMNodeList::tryGet): Got rid of an unnecessary node traversal. 
2606
2607 2004-11-10  Ken Kocienda  <kocienda@apple.com>
2608
2609         Reviewed by Chris
2610
2611         * khtml/editing/htmlediting.cpp:
2612         (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
2613         smart delete from the two functions below to here. There was an unnecessary double 
2614         calculation of the leading and trailing whitespace positions. Also refined the trailing
2615         case so it only acts when the leading position is null (which seems to match TextEdit in
2616         my tests). Also removed some unnecessary copying of Position objects.
2617         (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
2618         from here.
2619         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
2620
2621 2004-11-10  Ken Kocienda  <kocienda@apple.com>
2622
2623         Reviewed by Harrison
2624
2625         (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
2626         make things more clear.
2627         * khtml/editing/selection.cpp:
2628         (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the 
2629         resulting positions do not cross block boundaries. This was a bug and caused some
2630         delete problems when whole blocks were selected. I will be addressing that issue
2631         more fully in upcoming changes.
2632
2633 2004-11-10  Ken Kocienda  <kocienda@apple.com>
2634
2635         Reviewed by Harrison
2636
2637         Some cleanups and fixes in upstream and downstream functions. 
2638         
2639         Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement(). 
2640         Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the 
2641         block's enclosing block will be returned. 
2642         
2643         Remove code from upstream that confined the serach to block boundaries outside of
2644         the code which runs in the StayInBlock case. This code was redundant, and caused
2645         incorrect results to be returned in the DoNotStayInBlock case.
2646         
2647         In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
2648         node, not the the this pointer's node.
2649
2650         * khtml/xml/dom_position.cpp:
2651         (DOM::Position::upstream)
2652         (DOM::Position::downstream)
2653
2654 2004-11-09  David Hyatt  <hyatt@apple.com>
2655
2656         Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
2657         loading large local files.
2658         
2659         Reviewed by mjs
2660
2661         * khtml/html/htmltokenizer.cpp:
2662         (khtml::HTMLTokenizer::HTMLTokenizer):
2663         (khtml::HTMLTokenizer::reset):
2664         (khtml::HTMLTokenizer::write):
2665         (khtml::HTMLTokenizer::stopped):
2666         (khtml::HTMLTokenizer::processingData):
2667         (khtml::HTMLTokenizer::continueProcessing):
2668         (khtml::HTMLTokenizer::timerEvent):
2669         (khtml::HTMLTokenizer::allDataProcessed):
2670         (khtml::HTMLTokenizer::end):
2671         (khtml::HTMLTokenizer::finish):
2672         (khtml::HTMLTokenizer::notifyFinished):
2673         * khtml/html/htmltokenizer.h:
2674         * khtml/khtml_part.cpp:
2675         (KHTMLPart::slotFinished):
2676         (KHTMLPart::end):
2677         (KHTMLPart::stop):
2678         * khtml/khtml_part.h:
2679         (KHTMLPart::tokenizerProcessedData):
2680         * khtml/khtmlview.cpp:
2681         * khtml/xml/dom_docimpl.cpp:
2682         * khtml/xml/xml_tokenizer.h:
2683         (khtml::Tokenizer::stopped):
2684         (khtml::Tokenizer::processingData):
2685         * kwq/KWQDateTime.h:
2686         * kwq/KWQDateTime.mm:
2687         (QDateTime::secsTo):
2688         (KWQUIEventTime::uiEventPending):
2689         * kwq/KWQKHTMLPart.h:
2690         * kwq/KWQKHTMLPart.mm:
2691         (KWQKHTMLPart::tokenizerProcessedData):
2692         * kwq/WebCoreBridge.h:
2693         * kwq/WebCoreBridge.mm:
2694         (-[WebCoreBridge stop]):
2695         (-[WebCoreBridge numPendingOrLoadingRequests]):
2696         (-[WebCoreBridge doneProcessingData]):
2697
2698 2004-11-09  David Harrison  <harrison@apple.com>
2699
2700         Reviewed by Ken Kocienda.
2701
2702                 <rdar://problem/3865837> Wrong text style after delete to start of document
2703                 
2704         * khtml/editing/htmlediting.cpp:
2705         (khtml::DeleteSelectionCommand::saveTypingStyleState):
2706         Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
2707
2708 2004-11-09  Richard Williamson   <rjw@apple.com>
2709
2710         Fixed <rdar://problem/3872440> NSTimer prematurely released.
2711
2712         Reviewed by Darin.
2713
2714         * kwq/KWQTimer.mm:
2715         (QTimer::fire):
2716         * kwq/KWQWidget.mm:
2717         (QWidget::paint):
2718
2719 2004-11-09  Chris Blumenberg  <cblu@apple.com>
2720
2721         Reviewed by vicki.
2722
2723         * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
2724
2725 2004-11-08  David Harrison  <harrison@apple.com>
2726
2727         Reviewed by Ken Kocienda.
2728
2729                 <rdar://problem/3865854> Deleting first line deletes all lines
2730                 
2731         * khtml/editing/htmlediting.cpp:
2732         (khtml::DeleteSelectionCommand::performGeneralDelete):
2733         Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
2734         of its ancestors, failed to end the loop that deletes all fully selected nodes.  Also,
2735         fixed this code to clear m_trailingWhitespaceValid.  Also removed dead m_endingPosition
2736         update because it is handled in calculateEndingPosition now.
2737         * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
2738         * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
2739
2740 2004-11-08  Ken Kocienda  <kocienda@apple.com>
2741
2742         Reviewed by Hyatt
2743
2744         * khtml/html/html_elementimpl.cpp:
2745         (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
2746         are added to the DOM.
2747         * khtml/html/html_elementimpl.h: Ditto.
2748         * khtml/html/htmlparser.cpp:
2749         (KHTMLParser::KHTMLParser): Ditto.
2750         (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
2751         * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
2752         * khtml/html/htmltokenizer.cpp:
2753         (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
2754         (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
2755         There were a couple of indexing errors that resulted in the comment text containing part of the 
2756         comment markers.
2757         (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
2758         * khtml/html/htmltokenizer.h:  Add flag to constructor so callers can request comment nodes.
2759
2760 2004-11-08  Chris Blumenberg  <cblu@apple.com>
2761
2762         Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
2763
2764         Reviewed by darin.
2765
2766         * WebCore.pbproj/project.pbxproj: stop unnecessary linking
2767         * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
2768         * kwq/KWQKHTMLPart.h: ditto
2769
2770 2004-11-08  Darin Adler  <darin@apple.com>
2771
2772         Reviewed by John.
2773
2774         - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
2775
2776         * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
2777         that possibly deletes the QTimer.
2778
2779 2004-11-08  Chris Blumenberg  <cblu@apple.com>
2780
2781         Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
2782
2783         Reviewed by john.
2784
2785         * kwq/KWQTextField.mm:
2786         (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
2787         * kwq/WebCoreBridge.h:
2788
2789 2004-11-08  David Harrison  <harrison@apple.com>
2790
2791         Reviewed by Darin.
2792         
2793         Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
2794
2795         * khtml/editing/htmlediting.cpp:
2796         (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2797         * khtml/xml/dom_nodeimpl.cpp:
2798         (NodeImpl::enclosingInlineElement):
2799         * khtml/xml/dom_nodeimpl.h:
2800
2801 2004-11-05  Chris Blumenberg  <cblu@apple.com>
2802
2803         Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
2804
2805         Reviewed by rjw.
2806
2807         * khtml/editing/htmlediting.cpp:
2808         (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
2809         * khtml/editing/visible_position.cpp:
2810         (khtml::VisiblePosition::character): new, returns the character for the position
2811         * khtml/editing/visible_position.h:
2812         * kwq/KWQKHTMLPart.h:
2813         * kwq/KWQKHTMLPart.mm:
2814         (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
2815         * kwq/WebCoreBridge.h:
2816
2817 === Safari-170 ===
2818
2819 2004-11-05  Adele Amchan  <adele@apple.com>
2820
2821         Reviewed by Darin
2822
2823         Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
2824         and a workaround for displaying transparent backgrounds for textareas.
2825
2826         * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
2827         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
2828         * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class, 
2829           on the contentView, and on the textView.
2830
2831 2004-11-04  David Hyatt  <hyatt@apple.com>
2832
2833         Fix for relpositioned inlines.  This was reviewed a long time ago, but I can't recall who reviewed it (either
2834         darin or ken).
2835         
2836         Reviewed by darin or ken
2837
2838         * khtml/rendering/bidi.cpp:
2839         (khtml::appendRunsForObject):
2840         (khtml::RenderBlock::skipWhitespace):
2841         (khtml::RenderBlock::findNextLineBreak):
2842         * khtml/rendering/render_block.cpp:
2843         (khtml::RenderBlock::lowestPosition):
2844         (khtml::RenderBlock::rightmostPosition):
2845         (khtml::RenderBlock::leftmostPosition):
2846         * khtml/rendering/render_box.cpp:
2847         (RenderBox::position):
2848         * khtml/rendering/render_box.h:
2849         (khtml::RenderBox::staticX):
2850         (khtml::RenderBox::staticY):
2851         * khtml/rendering/render_layer.cpp:
2852         (RenderLayer::updateLayerPosition):
2853         (RenderLayer::convertToLayerCoords):
2854         * khtml/rendering/render_line.cpp:
2855         (khtml::InlineFlowBox::placeBoxesHorizontally):
2856         * khtml/rendering/render_object.h:
2857         (khtml::RenderObject::staticX):
2858         (khtml::RenderObject::staticY):
2859
2860         Finish turning on XSLT.  Make sure child stylesheets can load.
2861         
2862         * khtml/xsl/xslt_processorimpl.cpp:
2863         (DOM::stylesheetLoadFunc):
2864         (DOM::XSLTProcessorImpl::transformDocument):
2865
2866 2004-11-04  David Hyatt  <hyatt@apple.com>
2867
2868         Implement CSS3 support for multiple backgrounds.  Also fix a bug with background propagation so that it only
2869         happens (from the <body> to the root) for HTML documents.  Fixed background-position to handle a mixture of
2870         keyword and length values.
2871
2872         Reviewed by darin
2873
2874         * khtml/css/cssparser.cpp:
2875         (CSSParser::parseValue):
2876         (CSSParser::addBackgroundValue):
2877         (CSSParser::parseBackgroundShorthand):
2878         (CSSParser::parseBackgroundColor):
2879         (CSSParser::parseBackgroundImage):
2880         (CSSParser::parseBackgroundPositionXY):
2881         (CSSParser::parseBackgroundPosition):
2882         (CSSParser::parseBackgroundProperty):
2883         (CSSParser::parseColorFromValue):
2884         * khtml/css/cssparser.h:
2885         * khtml/css/cssstyleselector.cpp:
2886         (khtml::CSSStyleSelector::adjustRenderStyle):
2887         (khtml::CSSStyleSelector::applyProperty):
2888         (khtml::CSSStyleSelector::mapBackgroundAttachment):
2889         (khtml::CSSStyleSelector::mapBackgroundImage):
2890         (khtml::CSSStyleSelector::mapBackgroundRepeat):
2891         (khtml::CSSStyleSelector::mapBackgroundXPosition):
2892         (khtml::CSSStyleSelector::mapBackgroundYPosition):
2893         * khtml/css/cssstyleselector.h:
2894         * khtml/rendering/render_box.cpp:
2895         (RenderBox::paintRootBoxDecorations):
2896         (RenderBox::paintBoxDecorations):
2897         (RenderBox::paintBackgrounds):
2898         (RenderBox::paintBackground):
2899         (RenderBox::paintBackgroundExtended):
2900         * khtml/rendering/render_box.h:
2901         * khtml/rendering/render_form.cpp:
2902         (RenderFieldset::paintBoxDecorations):
2903         * khtml/rendering/render_line.cpp:
2904         (khtml::InlineFlowBox::paintBackgrounds):
2905         (khtml::InlineFlowBox::paintBackground):
2906         (khtml::InlineFlowBox::paintBackgroundAndBorder):
2907         * khtml/rendering/render_line.h:
2908         * khtml/rendering/render_object.cpp:
2909         (RenderObject::setStyle):
2910         (RenderObject::updateBackgroundImages):
2911         (RenderObject::getVerticalPosition):
2912         * khtml/rendering/render_object.h:
2913         (khtml::RenderObject::paintBackgroundExtended):
2914         * khtml/rendering/render_style.cpp:
2915         (m_next):
2916         (BackgroundLayer::BackgroundLayer):
2917         (BackgroundLayer::~BackgroundLayer):
2918         (BackgroundLayer::operator=):
2919         (BackgroundLayer::operator==):
2920         (BackgroundLayer::fillUnsetProperties):
2921         (BackgroundLayer::cullEmptyLayers):
2922         (StyleBackgroundData::StyleBackgroundData):
2923         (StyleBackgroundData::operator==):
2924         (RenderStyle::diff):
2925         (RenderStyle::adjustBackgroundLayers):
2926         * khtml/rendering/render_style.h:
2927         (khtml::OutlineValue::operator==):
2928         (khtml::OutlineValue::operator!=):
2929         (khtml::BackgroundLayer::backgroundImage):
2930         (khtml::BackgroundLayer::backgroundXPosition):
2931         (khtml::BackgroundLayer::backgroundYPosition):
2932         (khtml::BackgroundLayer::backgroundAttachment):
2933         (khtml::BackgroundLayer::backgroundRepeat):
2934         (khtml::BackgroundLayer::next):
2935         (khtml::BackgroundLayer::isBackgroundImageSet):
2936         (khtml::BackgroundLayer::isBackgroundXPositionSet):
2937         (khtml::BackgroundLayer::isBackgroundYPositionSet):
2938         (khtml::BackgroundLayer::isBackgroundAttachmentSet):
2939         (khtml::BackgroundLayer::isBackgroundRepeatSet):
2940         (khtml::BackgroundLayer::setBackgroundImage):
2941         (khtml::BackgroundLayer::setBackgroundXPosition):
2942         (khtml::BackgroundLayer::setBackgroundYPosition):
2943         (khtml::BackgroundLayer::setBackgroundAttachment):
2944         (khtml::BackgroundLayer::setBackgroundRepeat):
2945         (khtml::BackgroundLayer::clearBackgroundImage):
2946         (khtml::BackgroundLayer::clearBackgroundXPosition):
2947         (khtml::BackgroundLayer::clearBackgroundYPosition):
2948         (khtml::BackgroundLayer::clearBackgroundAttachment):
2949         (khtml::BackgroundLayer::clearBackgroundRepeat):
2950         (khtml::BackgroundLayer::setNext):
2951         (khtml::BackgroundLayer::operator!=):
2952         (khtml::BackgroundLayer::containsImage):
2953         (khtml::BackgroundLayer::hasImage):
2954         (khtml::BackgroundLayer::hasFixedImage):
2955         (khtml::RenderStyle::setBitDefaults):
2956         (khtml::RenderStyle::hasBackground):
2957         (khtml::RenderStyle::hasFixedBackgroundImage):
2958         (khtml::RenderStyle::outlineWidth):
2959         (khtml::RenderStyle::outlineStyle):
2960         (khtml::RenderStyle::outlineStyleIsAuto):
2961         (khtml::RenderStyle::outlineColor):
2962         (khtml::RenderStyle::backgroundColor):
2963         (khtml::RenderStyle::backgroundImage):
2964         (khtml::RenderStyle::backgroundRepeat):
2965         (khtml::RenderStyle::backgroundAttachment):
2966         (khtml::RenderStyle::backgroundXPosition):
2967         (khtml::RenderStyle::backgroundYPosition):
2968         (khtml::RenderStyle::accessBackgroundLayers):
2969         (khtml::RenderStyle::backgroundLayers):
2970         (khtml::RenderStyle::outlineOffset):
2971         (khtml::RenderStyle::resetOutline):
2972         (khtml::RenderStyle::setBackgroundColor):
2973         (khtml::RenderStyle::setOutlineWidth):
2974         (khtml::RenderStyle::setOutlineStyle):
2975         (khtml::RenderStyle::setOutlineColor):
2976         (khtml::RenderStyle::clearBackgroundLayers):
2977         (khtml::RenderStyle::inheritBackgroundLayers):
2978         (khtml::RenderStyle::setOutlineOffset):
2979         * khtml/rendering/render_table.cpp:
2980         (RenderTable::paintBoxDecorations):
2981         (RenderTableCell::paintBoxDecorations):
2982
2983 2004-11-04  David Hyatt  <hyatt@apple.com>
2984
2985         Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
2986         Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
2987
2988         Reviewed by darin
2989
2990         * kwq/KWQTextCodec.mm:
2991         (KWQTextDecoder::convertLatin1):
2992         (KWQTextDecoder::convertUTF16):
2993         (KWQTextDecoder::convertUsingTEC):
2994         (KWQTextDecoder::toUnicode):
2995
2996 2004-11-04  David Hyatt  <hyatt@apple.com>
2997
2998         Make sure line-height returns the correct value for normal.
2999         
3000         Reviewed by darin
3001
3002         * khtml/css/css_computedstyle.cpp:
3003         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3004
3005 2004-11-04  David Harrison  <harrison@apple.com>
3006
3007         Reviewed by Ken Kocienda.
3008
3009                 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
3010                 
3011         * khtml/editing/htmlediting.cpp:
3012         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
3013         to, but not including, the enclosingBlockFlowElement) rather than just the source element.
3014         Fixed to insert after the destination subtree, rather than the destination element.  Handles
3015         edge case of deleting back to the top of the tree, where there is nothing left to insert after.
3016         * khtml/xml/dom_nodeimpl.cpp:
3017         (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
3018         * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
3019         * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
3020         * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
3021
3022 2004-11-03  Ken Kocienda  <kocienda@apple.com>
3023
3024         Reviewed by me
3025         
3026         More layout tests.
3027
3028         * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
3029         * layout-tests/editing/deleting/delete-br-008.html: Added.
3030         * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
3031         * layout-tests/editing/deleting/delete-br-009.html: Added.
3032         * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
3033         * layout-tests/editing/deleting/delete-br-010.html: Added.
3034
3035 2004-11-03  Maciej Stachowiak  <mjs@apple.com>
3036
3037         Fix by Yasuo Kida, reviewed by me.
3038
3039         <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
3040         
3041         * kwq/KWQKHTMLPart.mm:
3042         (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
3043         same as a nil range - setting an empty marked range should clear
3044         the marked range entirely.
3045
3046 2004-11-02  Maciej Stachowiak  <mjs@apple.com>
3047
3048         Reviewed by Dave Hyatt (when I originally coded it).
3049
3050         WebCore part of fix for:
3051
3052         <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
3053         
3054         * kwq/WebCoreBridge.h:
3055         * kwq/WebCoreBridge.mm:
3056         (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
3057         DOMRange, or if the range is split into multiple lines, the rect for the part on
3058         the first line only.
3059         
3060         * khtml/rendering/render_object.cpp:
3061         (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
3062         for the overrides below.
3063         * khtml/rendering/render_object.h:
3064         * khtml/rendering/render_box.cpp:
3065         (RenderBox::caretRect):
3066         * khtml/rendering/render_box.h:
3067         * khtml/rendering/render_br.cpp:
3068         (RenderBR::caretRect):
3069         * khtml/rendering/render_br.h:
3070         * khtml/rendering/render_flow.cpp:
3071         (RenderFlow::caretRect):
3072         * khtml/rendering/render_flow.h:
3073         * khtml/rendering/render_text.cpp:
3074         (RenderText::caretRect):
3075
3076 2004-11-02  Ken Kocienda  <kocienda@apple.com>
3077
3078         Reviewed by Hyatt
3079
3080         Implemented command to insert a block in response to typing a return key (even though
3081         I am not turning that on by default with this patch....that will come later). 
3082         
3083         This new command is called InsertParagraphSeparatorCommand.
3084         
3085         Reworked the command and function names associated with inserting content into a 
3086         document. Before this patch, there were inputXXX and insertXXX variants, with the
3087         former used for more high-level actions and the latter used for lower-level stuff.
3088         However, this was confusing as the AppKit uses insertXXX for everything. This resulted
3089         in an insertXXX command going through an inputXXX WebCore step and then finally to an
3090         insertXXX WebCore step. To make this less confusing, I have changes all the names to
3091         be insertXXX, and modified the lower-level operations so that it is clear what they do.
3092         
3093         * khtml/editing/htmlediting.cpp:
3094         (khtml::EditCommandPtr::isInsertTextCommand): Name change.
3095         (khtml::EditCommand::isInsertTextCommand): Ditto.
3096         (khtml::CompositeEditCommand::inputText): Ditto.
3097         (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
3098         (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
3099         (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
3100         (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
3101         (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
3102         (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
3103         (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
3104         (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
3105         (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
3106         (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
3107         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3108         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3109         (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
3110         (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
3111         (khtml::InsertIntoTextNode::doApply): Ditto.
3112         (khtml::InsertIntoTextNode::doUnapply): Ditto.
3113         (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
3114         (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
3115         (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
3116         (khtml::InsertLineBreakCommand::doApply):
3117         (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
3118         (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
3119         (khtml::InsertNodeBeforeCommand::doApply): Ditto.
3120         (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
3121         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
3122         (khtml::InsertParagraphSeparatorCommand::doApply):
3123         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
3124         Class name change, was InsertNewlineCommandInQuotedContentCommand.
3125         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
3126         (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
3127         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
3128         (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
3129         (khtml::InsertTextCommand::doApply): Ditto.
3130         (khtml::InsertTextCommand::deleteCharacter): Ditto.
3131         (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
3132         (khtml::InsertTextCommand::input): Ditto.
3133         (khtml::InsertTextCommand::insertSpace): Ditto.
3134         (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
3135         (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
3136         (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
3137         (khtml::TypingCommand::insertParagraphSeparator): New function.
3138         (khtml::TypingCommand::doApply): Name changes, as above.
3139         (khtml::TypingCommand::insertText): Ditto.
3140         (khtml::TypingCommand::deleteKeyPressed): Ditto.
3141         (khtml::TypingCommand::preservesTypingStyle): Ditto.
3142         * khtml/editing/htmlediting.h:
3143         (khtml::DeleteFromTextNodeCommand::node): Name change.
3144         (khtml::DeleteFromTextNodeCommand::offset): Ditto.
3145         (khtml::DeleteFromTextNodeCommand::count): Ditto.
3146         (khtml::InsertIntoTextNode::text): Ditto.
3147         (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
3148         (khtml::InsertNodeBeforeCommand::refChild): Ditto.
3149         (khtml::TypingCommand::): Ditto.
3150         * khtml/editing/jsediting.cpp: Name changes, as above.
3151         * kwq/WebCoreBridge.h:
3152         * kwq/WebCoreBridge.mm:
3153         (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
3154         (-[WebCoreBridge insertParagraphSeparator]): New function.
3155         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
3156
3157 2004-11-01  Kevin Decker  <kdecker@apple.com>
3158
3159         Reviewed by rjw.
3160
3161         fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
3162         once and for all. 
3163
3164         * khtml/ecma/kjs_window.cpp:
3165         (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
3166
3167 2004-11-01  Darin Adler  <darin@apple.com>
3168
3169         Reviewed by Hyatt.
3170
3171         - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
3172
3173         * khtml/css/html4.css: Use color: initial for textarea and related ones.
3174
3175 2004-11-01  Ken Kocienda  <kocienda@apple.com>
3176
3177         Reviewed by John
3178
3179         Fix for this bug:
3180         
3181         <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
3182
3183         * khtml/css/css_computedstyle.cpp:
3184         (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the 
3185         implementation here into new copyPropertiesInSet helper. This now calls the
3186         generalized copyPropertiesInSet function with the arguments needed to make copying
3187         inheritable work.
3188         * khtml/css/css_computedstyle.h:
3189         * khtml/css/css_valueimpl.cpp:
3190         (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
3191         In order to do apply block properties, "regular" style declarations need to do style
3192         diffs as well.
3193         (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
3194         except that it uses a different set of properties that apply only to blocks.
3195         (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
3196         and copies out those properties listed in a pre-defined set.
3197         * khtml/css/css_valueimpl.h:
3198         * khtml/editing/htmlediting.cpp:
3199         (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
3200         block, factoring out some of the special case code that should now only run in the inline case.
3201         (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
3202         (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
3203         special handling for "legacy" HTML styles like <B> and <I>.
3204         (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
3205         style changes into different kinds. CSS specifies certain properties only apply to certain
3206         element types. This set of changes now recognizes two such separate cases: styles that apply
3207         to blocks, and styles that apply to inlines.
3208         (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
3209         (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
3210         (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
3211         with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
3212         done so that the function can be passed a portion of the styles being applied so that block styles
3213         and inline styles can be handled separately.
3214         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
3215         (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
3216         (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
3217         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
3218         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
3219         * khtml/editing/htmlediting.h:
3220         (khtml::StyleChange::): Changed as described above.
3221         (khtml::StyleChange::usesLegacyStyles):
3222         (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
3223         it needs to layout, even though it has not changed position in the DOM. For instance, this is needed 
3224         when text align changes.
3225         * khtml/khtml_part.cpp:
3226         (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
3227         the passed-in argument.
3228         (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
3229         is a caret. Formerly, this just set typing style and made no visible changes to the document.
3230
3231         New tests.
3232
3233         * layout-tests/editing/editing.js: Added some glue to change text align.
3234         * layout-tests/editing/style/block-style-001-expected.txt: Added.
3235         * layout-tests/editing/style/block-style-001.html: Added.
3236         * layout-tests/editing/style/block-style-002-expected.txt: Added.
3237         * layout-tests/editing/style/block-style-002.html: Added.
3238         * layout-tests/editing/style/block-style-003-expected.txt: Added.
3239         * layout-tests/editing/style/block-style-003.html: Added.
3240
3241 === Safari-169 ===
3242
3243 2004-10-29  Darin Adler  <darin@apple.com>
3244
3245         Reviewed by Kevin.
3246
3247         - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
3248
3249         * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
3250         before advancing one character; before it did it backwards.
3251
3252 2004-10-29  Chris Blumenberg  <cblu@apple.com>
3253
3254         Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
3255
3256         Reviewed by kocienda, adele.
3257
3258         * khtml/rendering/render_frames.cpp:
3259         (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
3260
3261 2004-10-29  Darin Adler  <darin@apple.com>
3262
3263         Reviewed by Chris.
3264
3265         - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
3266
3267         * khtml/khtmlview.cpp:
3268         (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
3269         deleted before this function finishes running.
3270         (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
3271         (KHTMLView::viewportMouseReleaseEvent): Ditto.
3272         (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
3273         is guaranteed to do ref/deref as needed.
3274
3275         * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
3276
3277 2004-10-28  Chris Blumenberg  <cblu@apple.com>
3278
3279         Enabled XSLT on Panther. See intrigue mail for compiling instructions.
3280
3281         Reviewed by darin.
3282
3283         * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
3284         * WebCorePrefix.h: always use XSLT
3285
3286 2004-10-28  Ken Kocienda  <kocienda@apple.com>
3287
3288         Reviewed by Chris
3289
3290         Fix for these bugs:
3291         
3292         <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
3293         <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
3294         
3295         * khtml/editing/htmlediting.cpp:
3296         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members 
3297         to initialization list, zeroing them out.
3298         (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
3299         handle a delete of content in special cases where the only thing selected is a BR. This
3300         code path is much simpler than the newly-named performGeneralDelete, and detects when no
3301         content merging should be done between blocks. This aspect of the change fixes 3854848.
3302         One of the special cases added fixes 3803832.
3303         (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
3304         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
3305         like the other helpers in this class.
3306         (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
3307         (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
3308         * khtml/editing/htmlediting.h: Added new helper and changed an old one.
3309
3310 2004-10-28  Chris Blumenberg  <cblu@apple.com>
3311
3312         Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
3313
3314         Reviewed by darin.
3315
3316         * kwq/KWQKHTMLPart.mm:
3317         (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it