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