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