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