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