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