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