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