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