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