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