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