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