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