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