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