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