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