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