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