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