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